Class ColorThemingStyle
- java.lang.Object
-
- org.locationtech.jts.jump.workbench.ui.renderer.style.ColorThemingStyle
-
-
Constructor Summary
Constructors Constructor Description ColorThemingStyle()ColorThemingStyle(String attributeName, Map attributeValueToBasicStyleMap, BasicStyle defaultStyle)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()static ColorThemingStyleget(Layer layer)StringgetAttributeName()MapgetAttributeValueToBasicStyleMap()BasicStylegetDefaultStyle()voidinitialize(Layer layer)Called before #paint is applied to each Feature.booleanisEnabled()voidpaint(Feature f, Graphics2D g, Viewport viewport)voidsetAlpha(int alpha)Call this method after calling #setAttributeValueToBasicStyleMap rather than before.voidsetAttributeName(String attributeName)voidsetAttributeValueToBasicStyleMap(Map attributeValueToStyleMap)You can set the keys to Ranges if the Map is a Range.RangeTreeMap.voidsetDefaultStyle(BasicStyle defaultStyle)voidsetEnabled(boolean enabled)voidsetLineWidth(int lineWidth)Call this method after calling #setAttributeValueToBasicStyleMap rather than before.static ObjecttrimIfString(Object object)
-
-
-
Constructor Detail
-
ColorThemingStyle
public ColorThemingStyle()
-
ColorThemingStyle
public ColorThemingStyle(String attributeName, Map attributeValueToBasicStyleMap, BasicStyle defaultStyle)
- Parameters:
defaultStyle-nullto prevent drawing features with a null attribute value
-
-
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, Graphics2D g, Viewport viewport) throws Exception
-
getAttributeName
public String getAttributeName()
- Returns:
- null if the layer has no non-spatial attributes
-
setAttributeValueToBasicStyleMap
public void setAttributeValueToBasicStyleMap(Map attributeValueToStyleMap)
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(String attributeName)
-
getAttributeValueToBasicStyleMap
public Map getAttributeValueToBasicStyleMap()
-
initialize
public void initialize(Layer layer)
Description copied from interface:StyleCalled before #paint is applied to each Feature.- Specified by:
initializein interfaceStyle
-
setEnabled
public void setEnabled(boolean enabled)
- Specified by:
setEnabledin interfaceStyle
-
get
public static ColorThemingStyle get(Layer layer)
-
getDefaultStyle
public BasicStyle getDefaultStyle()
-
setDefaultStyle
public void setDefaultStyle(BasicStyle defaultStyle)
-
-