Class ColorThemingStyle
java.lang.Object
com.vividsolutions.jump.workbench.ui.renderer.style.ColorThemingStyle
- All Implemented Interfaces:
AlphaSetting, Style, Cloneable
A Style mapping different basic styles for different attribute values.
-
Constructor Summary
ConstructorsConstructorDescriptionColorThemingStyle(String attributeName, Map<Object, BasicStyle> attributeValueToBasicStyleMap, BasicStyle defaultStyle) ColorThemingStyle(String attributeName, Map<Object, BasicStyle> attributeValueToBasicStyleMap, Map<Object, String> attributeValueToLabelMap, BasicStyle defaultStyle) -
Method Summary
Modifier and TypeMethodDescriptionclone()static ColorThemingStyleCreates a default ColorThemingStyle for this layer if none is already set.intgetAlpha()voidinitialize(Layer layer) Called before #paint is applied to each Feature.booleanbooleanbooleanbooleanvoidpaint(Feature f, Graphics2D g, Viewport viewport) voidsetAlpha(int alpha) Call this method after calling #setAttributeValueToBasicStyleMap rather than before.voidsetAttributeName(String attributeName) voidsetAttributeValueToBasicStyleMap(Map<Object, BasicStyle> attributeValueToBasicStyleMap) You can set the keys to Ranges if the Map is a Range.RangeTreeMap.voidsetAttributeValueToLabelMap(Map<Object, String> attributeValueToLabelMap) You can set the keys to Ranges if the Map is a Range.RangeTreeMap.voidsetDefaultStyle(BasicStyle defaultStyle) voidsetEnabled(boolean enabled) voidsetGlobalLineWidthEnabled(boolean globalLineWidthEnabled) voidsetGlobalTransparencyEnabled(boolean globalTransparencyEnabled) voidsetLineWidth(int lineWidth) Call this method after calling #setAttributeValueToBasicStyleMap rather than before.voidsetVertexStyleEnabled(boolean vertexStyleEnabled) static ObjecttrimIfString(Object object)
-
Constructor Details
-
ColorThemingStyle
public ColorThemingStyle() -
ColorThemingStyle
public ColorThemingStyle(String attributeName, Map<Object, BasicStyle> attributeValueToBasicStyleMap, BasicStyle defaultStyle) - Parameters:
attributeName- name of the attribute used to choose the feature StyleattributeValueToBasicStyleMap- map attribute values (or range) to stylesdefaultStyle- style used for features with a null attribute value.nullto prevent drawing features with a null attribute value.
-
ColorThemingStyle
public ColorThemingStyle(String attributeName, Map<Object, BasicStyle> attributeValueToBasicStyleMap, Map<Object, String> attributeValueToLabelMap, BasicStyle defaultStyle) - Parameters:
attributeName- name of the attribute used to choose the feature StyleattributeValueToBasicStyleMap- map attribute values (or range) to stylesattributeValueToLabelMap- map attribute values (or range) to labelsdefaultStyle- style used for features with a null attribute value.nullto prevent drawing features with a null attribute value.
-
-
Method Details
-
setAlpha
public void setAlpha(int alpha) Call this method after calling #setAttributeValueToBasicStyleMap rather than before.- Specified by:
setAlphain interfaceAlphaSetting
-
setLineWidth
public void setLineWidth(int lineWidth) Call this method after calling #setAttributeValueToBasicStyleMap rather than before. -
paint
-
trimIfString
-
clone
-
getAttributeName
- Returns:
- null if the layer has no non-spatial attributes
-
setAttributeValueToBasicStyleMap
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
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
-
getAttributeValueToBasicStyleMap
-
getAttributeValueToLabelMap
-
initialize
Description copied from interface:StyleCalled before #paint is applied to each Feature.- Specified by:
initializein interfaceStyle- Parameters:
layer- the layer on which to apply this style
-
setEnabled
public void setEnabled(boolean enabled) - Specified by:
setEnabledin interfaceStyle
-
isEnabled
-
get
Creates a default ColorThemingStyle for this layer if none is already set. -
getDefaultStyle
-
setDefaultStyle
-
isGlobalTransparencyEnabled
public boolean isGlobalTransparencyEnabled() -
setGlobalTransparencyEnabled
public void setGlobalTransparencyEnabled(boolean globalTransparencyEnabled) -
isGlobalLineWidthEnabled
public boolean isGlobalLineWidthEnabled() -
setGlobalLineWidthEnabled
public void setGlobalLineWidthEnabled(boolean globalLineWidthEnabled) -
isVertexStyleEnabled
public boolean isVertexStyleEnabled() -
setVertexStyleEnabled
public void setVertexStyleEnabled(boolean vertexStyleEnabled) -
getAlpha
public int getAlpha()- Specified by:
getAlphain interfaceAlphaSetting
-