Package com.jbstrap.jbmap.layers
Class LayerStyle
java.lang.Object
com.jbstrap.jbmap.layers.LayerStyle
This class represents the style of layers (shapes: line, circle, rectangle, area).
- Since:
- 4.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the shape's border color.Gets the border line width.Gets the border opacity.Gets a CSS class name assigned to the shape.Gets the shape fill color.Gets the fill opacity.int[]
Sets the line dash pattern.Gets the line dash offset.getName()
Gets the LayerStyle unique ID.com.jbstrap.core.Parameters
Gets the LayerStyle instance's parameters.boolean
Gets the border line (delimiting the shape) visibility.boolean
Gets the shape fill visibility.protected void
setBorderLineColor
(String borderLineColor) Sets the shape's border color.setBorderLineVisible
(boolean borderLineVisible) Sets the border line (delimiting the shape) visibility.setBorderLineWidth
(int borderLineWidth) Sets the border line width.setBorderOpacity
(double opacity) Sets the border line opacity.setClassName
(String className) Adds a custom CSS class name to the shape.setFillColor
(String fillColor) Sets the shape fill color.setFillColorVisible
(boolean fillColorVisible) Sets the shape fill visibility.setFillOpacity
(double fillOpacity) Sets the fill opacity.protected void
setLineDashArray
(int... dashArray) Sets the line dash pattern.setLineDashOffset
(int lineDashOffset) Gets the line dash offset.
-
Constructor Details
-
LayerStyle
Creates a LayerStyle.- Parameters:
name
- LayerStyle unique ID
-
-
Method Details
-
setLayer
-
getName
Gets the LayerStyle unique ID.- Returns:
- LayerStyle unique ID
-
getParams
public com.jbstrap.core.Parameters getParams()Gets the LayerStyle instance's parameters.- Returns:
- LayerStyle instance parameters
-
isBorderLineVisible
public boolean isBorderLineVisible()Gets the border line (delimiting the shape) visibility.- Returns:
- If
true
, the border line is visible, otherwise not
-
setBorderLineVisible
Sets the border line (delimiting the shape) visibility.- Parameters:
borderLineVisible
- If the specified value istrue
, the border line is visible, otherwise not- Returns:
- LayerStyle instance
-
getBorderLineColor
Gets the shape's border color.- Returns:
- Border color
-
setBorderLineColor
Sets the shape's border color.- Parameters:
borderLineColor
- Border line color (in CSS3 format)- Returns:
- LayerStyle instance
-
getBorderLineWidth
Gets the border line width.- Returns:
- Border line width
-
setBorderLineWidth
Sets the border line width.- Parameters:
borderLineWidth
- Shape border width- Returns:
- LayerStyle instance
-
getLineDashArray
public int[] getLineDashArray()Sets the line dash pattern.- Returns:
- Line dash pattern
-
setLineDashArray
Sets the line dash pattern.- Parameters:
dashArray
- Line dash pattern (sets the line segment lengths in pixels)- Returns:
- LayerStyle instance
-
getLineDashOffset
Gets the line dash offset.- Returns:
- Line dash offset
-
setLineDashOffset
Gets the line dash offset.- Parameters:
lineDashOffset
- Offset value- Returns:
- LayerStyle instance
-
isFillColorVisible
public boolean isFillColorVisible()Gets the shape fill visibility.- Returns:
- If
true
, the shape fill is visible, otherwise not
-
setFillColorVisible
Sets the shape fill visibility.- Parameters:
fillColorVisible
- If the set value istrue
, the shape fill is visible, otherwise not- Returns:
- LayerStyle instance
-
getFillColor
Gets the shape fill color.- Returns:
- Shape fill color
-
setFillColor
Sets the shape fill color.- Parameters:
fillColor
- Shape fill color (CSS3 format)- Returns:
- LayerStyle instance
-
getFillOpacity
Gets the fill opacity.- Returns:
- Fill opacity
-
setFillOpacity
Sets the fill opacity.- Parameters:
fillOpacity
- Fill opacity (between 0 and 1)- Returns:
- LayerStyle instance
-
getBorderOpacity
Gets the border opacity.- Returns:
- Shape border opacity (if specified), otherwise
null
-
setBorderOpacity
Sets the border line opacity.- Parameters:
opacity
- Border line opacity between 0 and 1- Returns:
- LayerStyle instance
-
getClassName
Gets a CSS class name assigned to the shape.- Returns:
- CSS class name
-
setClassName
Adds a custom CSS class name to the shape.- Parameters:
className
- Custom CSS class name- Returns:
- LayerStyle instance
-
runJS
- Parameters:
script
- JavaScript
-