Package com.kheops.jmap.client.layers
Class StyleManager
java.lang.Object
com.kheops.jmap.client.layers.StyleManager
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
JMapServerStyleManager
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(LayerEventListener listener) voidclone()protected voidclone(StyleManager styleManager) protected static double[]copyArray(double[] s, double[] d, int index, boolean adding) protected static Object[]static StylecreateEditionStyle(Style style) Creates a new edition style using the specified style.createSelectionStyle(Style style, int elementType) Creates a selection style using the specified style.createSelectionStyle(Style style, int elementType, Color selectColor) Creates a selection style using the specified style.voiddestroy()Frees all listeners registered in this style manager.protected booleanexists(double scale) voidintgetCount()Returns the number of styles configured in this style manager.getEditionStyle(double scale) intReturns the label style.doublegetMaximumScale(Style style) double[]Returns the custom selection style, if any.getSelectionStyle(double scale) Returns the selection style.getStyle(double scale) Returns theStyleobject to be used at the specified scale.Style[]intindexOf(double scale) Returns the index of the style configured for the specified scale.booleanvoidmoveStyle(double oldScale, double newScale) Moves aStyleobject from a specified scale to another.voidoverrideSelectionStyle(Style style) Overrides the layer selection style with the specified style object.voidremoveListener(LayerEventListener listener) removeStyle(double scale) Removes theStyleobject that corresponds to the specified scale.protected StyleremoveStyle(double scale, boolean validateSize) replaceStyle(double scale, Style newStyle) voidsetDefaultSelectionColor(Color defaultSelectionColor) voidsetElementType(int elementType) voidsetLabelStyle(Style labelStyle) Sets the label style.voidsetMaximumScales(double[] minScales) void
-
Field Details
-
defaultSelectionColor
-
labelStyle
-
selectionStyle
-
styles
-
maximumScales
protected double[] maximumScales -
elementType
protected int elementType
-
-
Constructor Details
-
StyleManager
public StyleManager()Default constructor for java bean compliance -
StyleManager
public StyleManager(int elementType)
-
-
Method Details
-
getElementType
public int getElementType() -
setElementType
public void setElementType(int elementType) -
getStyles
-
setStyles
-
setMaximumScales
public void setMaximumScales(double[] minScales) -
replaceStyle
-
addStyle
-
fireStyleChangedEvent
public void fireStyleChangedEvent() -
addListener
-
removeListener
-
copyArray
-
copyArray
protected static double[] copyArray(double[] s, double[] d, int index, boolean adding) -
removeStyle
-
removeStyle
Removes theStyleobject that corresponds to the specified scale.- Parameters:
scale- a scale.
-
getStyle
Returns theStyleobject to be used at the specified scale.- Parameters:
scale- a scale.
-
moveStyle
public void moveStyle(double oldScale, double newScale) Moves aStyleobject from a specified scale to another.- Parameters:
oldScale- the old scale.newScale- the scale to move theStyleat.
-
getMaximumScale
-
getMaximumScales
public double[] getMaximumScales() -
exists
protected boolean exists(double scale) -
indexOf
public int indexOf(double scale) Returns the index of the style configured for the specified scale.- Parameters:
scale- the scale of the style to return.- Returns:
- the index of the style.
- See Also:
-
getDefaultSelectionColor
-
setDefaultSelectionColor
-
destroy
public void destroy()Frees all listeners registered in this style manager. -
clone
-
clone
-
getCount
public int getCount()Returns the number of styles configured in this style manager.- Returns:
- the number of styles configured.
-
getLabelStyle
Returns the label style.- Returns:
- the label style.
-
setLabelStyle
Sets the label style.- Parameters:
labelStyle- the Style used to draw labels.
-
getSelectionStyle
Returns the custom selection style, if any.- Returns:
- the selection style.
-
getSelectionStyle
Returns the selection style. If a custom selection style was configured, then it will be returned. Otherwise, the default selection style for the specified scale will be returned.- Parameters:
scale- the current scale.- Returns:
- the selection style.
-
getEditionStyle
-
isSelectionStyleOverridden
public boolean isSelectionStyleOverridden() -
createSelectionStyle
Creates a selection style using the specified style. -
createEditionStyle
Creates a new edition style using the specified style.- Parameters:
style- the base style to use.- Returns:
- the edition style that was created.
-
createSelectionStyle
Creates a selection style using the specified style. -
overrideSelectionStyle
Overrides the layer selection style with the specified style object. When this method is called, the new selection style will always remain the same.- Parameters:
style- the style to be used for selections
-