Class TLcdDTEDColorModelFactory

java.lang.Object
com.luciad.format.raster.TLcdDTEDColorModelFactory
All Implemented Interfaces:
ILcdColorModelFactory

public class TLcdDTEDColorModelFactory extends Object implements ILcdColorModelFactory
This 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 Details

    • TLcdDTEDColorModelFactory

      public TLcdDTEDColorModelFactory()
  • Method Details

    • setSharedInstance

      public static void setSharedInstance(TLcdDTEDColorModelFactory aSharedInstance)
    • getSharedInstance

      public static TLcdDTEDColorModelFactory getSharedInstance()
    • getLevelCount

      public int getLevelCount()
    • setLevels

      public void setLevels(double[] aLevels)
    • getLevels

      public double[] getLevels()
    • getLevel

      public double getLevel(int aIndex)
    • setColors

      public void setColors(Color[] aColors)
    • getColors

      public Color[] getColors()
    • getColor

      public Color getColor(int aIndex)
    • createColorModel

      public ColorModel createColorModel()
      Description copied from interface: ILcdColorModelFactory
      Creates a new ColorModel.
      Specified by:
      createColorModel in interface ILcdColorModelFactory
      Returns:
      the ColorModel.
    • loadProperties

      public void loadProperties(Properties aProperties, String aPrefix, String aSuffix) throws IllegalArgumentException
      Loads the relevant properties for this 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
       
      Specified by:
      loadProperties in interface ILcdColorModelFactory
      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

      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.

      Returns:
      array containing the default colors for the DTED color model
      See Also: