java.lang.Object
org.vaadin.addons.componentfactory.leaflet.layer.vectors.PathOptions
All Implemented Interfaces:
Serializable

public class PathOptions extends Object implements Serializable
Contains options shared between vector overlays (Polygon, Polyline, Circle).
Since:
2020-03-22
Version:
1.0
Author:
Gabor Kokeny Email: kokeny19@gmail.com
See Also:
  • Constructor Details

    • PathOptions

      public PathOptions()
      Creates a new set of path options initialized with the Leaflet default values.
    • PathOptions

      public PathOptions(String color)
      Creates a new set of path options using the given color for both the stroke and the fill.
      Parameters:
      color - the stroke and fill color
    • PathOptions

      public PathOptions(String color, double weight)
      Creates a new set of path options using the given color for both the stroke and the fill, and the given stroke width.
      Parameters:
      color - the stroke and fill color
      weight - the stroke width in pixels
  • Method Details

    • isStroke

      public boolean isStroke()
      Whether to draw stroke along the path.
      Returns:
      true if the stroke is drawn along the path
    • setStroke

      public void setStroke(boolean stroke)
      Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
      Parameters:
      stroke - Set it to false to disable borders on polygons or circles.
    • getColor

      public String getColor()
      Gets the stroke color.
      Returns:
      the color of the stroke
    • setColor

      public void setColor(String color)
      Stroke color
      Parameters:
      color - the color of the stroke
    • getWeight

      public double getWeight()
      Gets the stroke width in pixels.
      Returns:
      the weight of the path
    • setWeight

      public void setWeight(double weight)
      Stroke width in pixels
      Parameters:
      weight - the weight of the path
    • getOpacity

      public double getOpacity()
      Gets the stroke opacity.
      Returns:
      the opacity of the path
    • setOpacity

      public void setOpacity(double opacity)
      Stroke opacity
      Parameters:
      opacity - the opacity of the path
    • getLineCap

      public String getLineCap()
      Gets the shape to be used at the end of the stroke.
      Returns:
      the shape used at the end of the stroke
    • setLineCap

      public void setLineCap(String lineCap)
      A string that defines shape to be used at the end of the stroke.
      Parameters:
      lineCap - shape to be used at the end of the stroke
    • getLineJoin

      public String getLineJoin()
      Gets the shape to be used at the corners of the stroke.
      Returns:
      the shape used at the corners of the stroke
    • setLineJoin

      public void setLineJoin(String lineJoin)
      A string that defines shape to be used at the corners of the stroke.
      Parameters:
      lineJoin - shape to be used at the corners of the stroke
    • getDashArray

      public String getDashArray()
      Gets the stroke dash pattern.
      Returns:
      the string that defines the stroke dash pattern
    • setDashArray

      public void setDashArray(String dashArray)
      A string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers.
      Parameters:
      dashArray - efines the stroke dash pattern
    • getDashOffset

      public String getDashOffset()
      Gets the distance into the dash pattern to start the dash.
      Returns:
      the string that defines the distance into the dash pattern to start the dash
    • setDashOffset

      public void setDashOffset(String dashOffset)
      A string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers.
      Parameters:
      dashOffset - defines the distance into the dash pattern to start the dash
    • isFill

      public boolean isFill()
      Whether to fill the path with color.
      Returns:
      true if the path is filled with color
    • setFill

      public void setFill(boolean fill)
      Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
      Parameters:
      fill - Set it to false to disable filling on polygons or circles
    • getFillColor

      public String getFillColor()
      Gets the fill color.
      Returns:
      the fill color of the path
    • setFillColor

      public void setFillColor(String fillColor)
      Fill color. Defaults to the value of the color option
      Parameters:
      fillColor - the fill color of the path
    • getFillOpacity

      public double getFillOpacity()
      Gets the fill opacity.
      Returns:
      the fill opacity (0 between 1)
    • setFillOpacity

      public void setFillOpacity(double fillOpacity)
      Fill opacity.
      Parameters:
      fillOpacity - the fill opacity (0 between 1)
    • getFillRule

      public String getFillRule()
      Gets how the inside of a shape is determined.
      Returns:
      the string that defines how the inside of a shape is determined
    • setFillRule

      public void setFillRule(String fillRule)
      A string that defines how the inside of a shape is determined.
      Parameters:
      fillRule - the string that defines how the inside of a shape is determined
    • getClassName

      public String getClassName()
      Gets the custom class name set on the element.
      Returns:
      the class name set on an element
    • setClassName

      public void setClassName(String className)
      Custom class name set on an element. Only for SVG renderer.
      Parameters:
      className - the class name set on an element