com.vividsolutions.jump.workbench.ui.renderer.style
Class ColorThemingStyle

java.lang.Object
  extended by com.vividsolutions.jump.workbench.ui.renderer.style.ColorThemingStyle
All Implemented Interfaces:
Style, java.lang.Cloneable

public class ColorThemingStyle
extends java.lang.Object
implements Style


Constructor Summary
ColorThemingStyle()
           
ColorThemingStyle(java.lang.String attributeName, java.util.Map attributeValueToBasicStyleMap, BasicStyle defaultStyle)
           
ColorThemingStyle(java.lang.String attributeName, java.util.Map attributeValueToBasicStyleMap, java.util.Map attributeValueToLabelMap, BasicStyle defaultStyle)
           
 
Method Summary
 java.lang.Object clone()
           
static ColorThemingStyle get(Layer layer)
           
 java.lang.String getAttributeName()
           
 java.util.Map getAttributeValueToBasicStyleMap()
           
 java.util.Map getAttributeValueToLabelMap()
           
 BasicStyle getDefaultStyle()
           
 void initialize(Layer layer)
          Called before #paint is applied to each Feature.
 boolean isEnabled()
           
 void paint(Feature f, java.awt.Graphics2D g, Viewport viewport)
           
 void setAlpha(int alpha)
          Call this method after calling #setAttributeValueToBasicStyleMap rather than before.
 void setAttributeName(java.lang.String attributeName)
           
 void setAttributeValueToBasicStyleMap(java.util.Map attributeValueToBasicStyleMap)
          You can set the keys to Ranges if the Map is a Range.RangeTreeMap.
 void setAttributeValueToLabelMap(java.util.Map attributeValueToLabelMap)
          You can set the keys to Ranges if the Map is a Range.RangeTreeMap.
 void setDefaultStyle(BasicStyle defaultStyle)
           
 void setEnabled(boolean enabled)
           
 void setLineWidth(int lineWidth)
          Call this method after calling #setAttributeValueToBasicStyleMap rather than before.
static java.lang.Object trimIfString(java.lang.Object object)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorThemingStyle

public ColorThemingStyle()

ColorThemingStyle

public ColorThemingStyle(java.lang.String attributeName,
                         java.util.Map attributeValueToBasicStyleMap,
                         BasicStyle defaultStyle)
Parameters:
defaultStyle - null to prevent drawing features with a null attribute value

ColorThemingStyle

public ColorThemingStyle(java.lang.String attributeName,
                         java.util.Map attributeValueToBasicStyleMap,
                         java.util.Map attributeValueToLabelMap,
                         BasicStyle defaultStyle)
Method Detail

setAlpha

public void setAlpha(int alpha)
Call this method after calling #setAttributeValueToBasicStyleMap rather than before.


setLineWidth

public void setLineWidth(int lineWidth)
Call this method after calling #setAttributeValueToBasicStyleMap rather than before.


paint

public void paint(Feature f,
                  java.awt.Graphics2D g,
                  Viewport viewport)
           throws java.lang.Exception
Specified by:
paint in interface Style
Throws:
java.lang.Exception

trimIfString

public static java.lang.Object trimIfString(java.lang.Object object)

clone

public java.lang.Object clone()
Specified by:
clone in interface Style
Overrides:
clone in class java.lang.Object

getAttributeName

public java.lang.String getAttributeName()
Returns:
null if the layer has no non-spatial attributes

setAttributeValueToBasicStyleMap

public void setAttributeValueToBasicStyleMap(java.util.Map attributeValueToBasicStyleMap)
You can set the keys to Ranges if the Map is a Range.RangeTreeMap. But don't mix Ranges and non-Ranges -- the UI expects homogeneity in this regard (i.e. to test whether or not there are ranges, only the first attribute value is tested).


setAttributeValueToLabelMap

public void setAttributeValueToLabelMap(java.util.Map attributeValueToLabelMap)
You can set the keys to Ranges if the Map is a Range.RangeTreeMap. But don't mix Ranges and non-Ranges -- the UI expects homogeneity in this regard (i.e. to test whether or not there are ranges, only the first attribute value is tested).


setAttributeName

public void setAttributeName(java.lang.String attributeName)

getAttributeValueToBasicStyleMap

public java.util.Map getAttributeValueToBasicStyleMap()

getAttributeValueToLabelMap

public java.util.Map getAttributeValueToLabelMap()

initialize

public void initialize(Layer layer)
Description copied from interface: Style
Called before #paint is applied to each Feature.

Specified by:
initialize in interface Style

setEnabled

public void setEnabled(boolean enabled)
Specified by:
setEnabled in interface Style

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface Style

get

public static ColorThemingStyle get(Layer layer)

getDefaultStyle

public BasicStyle getDefaultStyle()

setDefaultStyle

public void setDefaultStyle(BasicStyle defaultStyle)