Class TLcdDTEDColorModelFactory
- All Implemented Interfaces:
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreates a newColorModel
.getColor
(int aIndex) Color[]
static Color[]
Returns the default colors for the DTED color model.static double[]
Returns the default levels for the DTED color model.double
getLevel
(int aIndex) int
double[]
static TLcdDTEDColorModelFactory
void
loadProperties
(Properties aProperties, String aPrefix, String aSuffix) Loads the relevant properties for thisILcdColorModelFactory
.void
void
setLevels
(double[] aLevels) static void
setSharedInstance
(TLcdDTEDColorModelFactory aSharedInstance)
-
Constructor Details
-
TLcdDTEDColorModelFactory
public TLcdDTEDColorModelFactory()
-
-
Method Details
-
getLevelCount
public int getLevelCount() -
setLevels
public void setLevels(double[] aLevels) -
getLevels
public double[] getLevels() -
getLevel
public double getLevel(int aIndex) -
setColors
-
getColors
-
getColor
-
createColorModel
Description copied from interface:ILcdColorModelFactory
Creates a newColorModel
.- Specified by:
createColorModel
in interfaceILcdColorModelFactory
- Returns:
- the
ColorModel
.
-
loadProperties
public void loadProperties(Properties aProperties, String aPrefix, String aSuffix) throws IllegalArgumentException Loads the relevant properties for thisILcdColorModelFactory
. 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
- Specified by:
loadProperties
in interfaceILcdColorModelFactory
- Parameters:
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.- Throws:
IllegalArgumentException
- in case of parsing problems.
-
getDefaultLevels
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.- Returns:
- array containing the default levels for the DTED color model
- See Also:
-
getDefaultColors
Returns the default colors for the DTED color model.
Note: modifying the returned array will not affect any of the
TLcdDTEDColorModelFactory
instances.- Returns:
- array containing the default colors for the DTED color model
- See Also: