public class TLcdDTEDColorModelFactory extends Object implements ILcdColorModelFactory
ILcdColorModelFactory
creates IndexColorModel
instances for use with DTED data. An array of height levels and an array of
corresponding colors can be specified.
If the number of levels is one less than the number of colors, the color model will be piece-wise constant.
If the number of levels is equal to the number of colors, the colors model will be piece-wise linear, i.e. the colors inbetween the specified levels will be interpolated.
Transparency of input colors is ignored; the index corresponding to the DTED
unknown elevation is always made transparent. If more general transparency is
required, please consider the class
.TLcdJetIndexColorModelFactory
Constructor and Description |
---|
TLcdDTEDColorModelFactory() |
Modifier and Type | Method and Description |
---|---|
ColorModel |
createColorModel()
Creates a new
ColorModel . |
Color |
getColor(int aIndex) |
Color[] |
getColors() |
static Color[] |
getDefaultColors()
Returns the default colors for the DTED color model.
|
static double[] |
getDefaultLevels()
Returns the default levels for the DTED color model.
|
double |
getLevel(int aIndex) |
int |
getLevelCount() |
double[] |
getLevels() |
static TLcdDTEDColorModelFactory |
getSharedInstance() |
void |
loadProperties(Properties aProperties,
String aPrefix,
String aSuffix)
Loads the relevant properties for this
ILcdColorModelFactory . |
void |
setColors(Color[] aColors) |
void |
setLevels(double[] aLevels) |
static void |
setSharedInstance(TLcdDTEDColorModelFactory aSharedInstance) |
public static void setSharedInstance(TLcdDTEDColorModelFactory aSharedInstance)
public static TLcdDTEDColorModelFactory getSharedInstance()
public int getLevelCount()
public void setLevels(double[] aLevels)
public double[] getLevels()
public double getLevel(int aIndex)
public void setColors(Color[] aColors)
public Color[] getColors()
public Color getColor(int aIndex)
public ColorModel createColorModel()
ILcdColorModelFactory
ColorModel
.createColorModel
in interface ILcdColorModelFactory
ColorModel
.public void loadProperties(Properties aProperties, String aPrefix, String aSuffix) throws IllegalArgumentException
ILcdColorModelFactory
.
The property names should be preceded by the prefix
"TLcdDTEDColorModelFactory.".
Note that colors can be specified using the common Java formats for integers, as [A]RGB.
For example, for setting up a factory that produces an
IndexColorModel
based on 7 levels with specified colors, in
between which other colors will be interpolated:
TLcdDTEDColorModelFactory.levelCount = 7 TLcdDTEDColorModelFactory.level.0 = 0 TLcdDTEDColorModelFactory.level.1 = 100 TLcdDTEDColorModelFactory.level.2 = 200 TLcdDTEDColorModelFactory.level.3 = 300 TLcdDTEDColorModelFactory.level.4 = 400 TLcdDTEDColorModelFactory.level.5 = 500 TLcdDTEDColorModelFactory.level.6 = 600 TLcdDTEDColorModelFactory.color.0 = #0000ff TLcdDTEDColorModelFactory.color.1 = #ffff00 TLcdDTEDColorModelFactory.color.2 = #80c000 TLcdDTEDColorModelFactory.color.3 = #c08000 TLcdDTEDColorModelFactory.color.4 = #808080 TLcdDTEDColorModelFactory.color.5 = #ffffff TLcdDTEDColorModelFactory.color.6 = #00ffff
loadProperties
in interface ILcdColorModelFactory
aProperties
- the properties.aPrefix
- an optional additional prefix for each of the property
names, before the common prefix.aSuffix
- an optional suffix prefix for each of the property
names.IllegalArgumentException
- in case of parsing problems.public static double[] getDefaultLevels()
Returns the default levels for the DTED color model.
Note: modifying the returned array will not affect any of the TLcdDTEDColorModelFactory
instances.
getDefaultColors()
public static Color[] getDefaultColors()
Returns the default colors for the DTED color model.
Note: modifying the returned array will not affect any of the TLcdDTEDColorModelFactory
instances.
getDefaultLevels()