Class LayerStyle

java.lang.Object
com.jbstrap.jbmap.layers.LayerStyle

public class LayerStyle extends Object
This class represents the style of layers (shapes: line, circle, rectangle, area).
Since:
4.0
  • Constructor Details

    • LayerStyle

      public LayerStyle(String name)
      Creates a LayerStyle.
      Parameters:
      name - LayerStyle unique ID
  • Method Details

    • setLayer

      protected void setLayer(BaseLayer<?> layer)
    • getName

      public String 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

      public LayerStyle setBorderLineVisible(boolean borderLineVisible)
      Sets the border line (delimiting the shape) visibility.
      Parameters:
      borderLineVisible - If the specified value is true, the border line is visible, otherwise not
      Returns:
      LayerStyle instance
    • getBorderLineColor

      public String getBorderLineColor()
      Gets the shape's border color.
      Returns:
      Border color
    • setBorderLineColor

      public LayerStyle setBorderLineColor(String borderLineColor)
      Sets the shape's border color.
      Parameters:
      borderLineColor - Border line color (in CSS3 format)
      Returns:
      LayerStyle instance
    • getBorderLineWidth

      public Integer getBorderLineWidth()
      Gets the border line width.
      Returns:
      Border line width
    • setBorderLineWidth

      public LayerStyle setBorderLineWidth(int borderLineWidth)
      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

      public LayerStyle setLineDashArray(int... dashArray)
      Sets the line dash pattern.
      Parameters:
      dashArray - Line dash pattern (sets the line segment lengths in pixels)
      Returns:
      LayerStyle instance
    • getLineDashOffset

      public Integer getLineDashOffset()
      Gets the line dash offset.
      Returns:
      Line dash offset
    • setLineDashOffset

      public LayerStyle setLineDashOffset(int lineDashOffset)
      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

      public LayerStyle setFillColorVisible(boolean fillColorVisible)
      Sets the shape fill visibility.
      Parameters:
      fillColorVisible - If the set value is true, the shape fill is visible, otherwise not
      Returns:
      LayerStyle instance
    • getFillColor

      public String getFillColor()
      Gets the shape fill color.
      Returns:
      Shape fill color
    • setFillColor

      public LayerStyle setFillColor(String fillColor)
      Sets the shape fill color.
      Parameters:
      fillColor - Shape fill color (CSS3 format)
      Returns:
      LayerStyle instance
    • getFillOpacity

      public Double getFillOpacity()
      Gets the fill opacity.
      Returns:
      Fill opacity
    • setFillOpacity

      public LayerStyle setFillOpacity(double fillOpacity)
      Sets the fill opacity.
      Parameters:
      fillOpacity - Fill opacity (between 0 and 1)
      Returns:
      LayerStyle instance
    • getBorderOpacity

      public Double getBorderOpacity()
      Gets the border opacity.
      Returns:
      Shape border opacity (if specified), otherwise null
    • setBorderOpacity

      public LayerStyle setBorderOpacity(double opacity)
      Sets the border line opacity.
      Parameters:
      opacity - Border line opacity between 0 and 1
      Returns:
      LayerStyle instance
    • getClassName

      public String getClassName()
      Gets a CSS class name assigned to the shape.
      Returns:
      CSS class name
    • setClassName

      public LayerStyle setClassName(String className)
      Adds a custom CSS class name to the shape.
      Parameters:
      className - Custom CSS class name
      Returns:
      LayerStyle instance
    • runJS

      protected void runJS(String script)
      Parameters:
      script - JavaScript