Class PathOptions
java.lang.Object
org.vaadin.addons.componentfactory.leaflet.layer.vectors.PathOptions
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionCreates a new set of path options initialized with the Leaflet default values.PathOptions(String color) Creates a new set of path options using the given color for both the stroke and the fill.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. -
Method Summary
Modifier and TypeMethodDescriptionGets the custom class name set on the element.getColor()Gets the stroke color.Gets the stroke dash pattern.Gets the distance into the dash pattern to start the dash.Gets the fill color.doubleGets the fill opacity.Gets how the inside of a shape is determined.Gets the shape to be used at the end of the stroke.Gets the shape to be used at the corners of the stroke.doubleGets the stroke opacity.doubleGets the stroke width in pixels.booleanisFill()Whether to fill the path with color.booleanisStroke()Whether to draw stroke along the path.voidsetClassName(String className) Custom class name set on an element.voidStroke colorvoidsetDashArray(String dashArray) A string that defines the stroke dash pattern.voidsetDashOffset(String dashOffset) A string that defines the distance into the dash pattern to start the dash.voidsetFill(boolean fill) Whether to fill the path with color.voidsetFillColor(String fillColor) Fill color.voidsetFillOpacity(double fillOpacity) Fill opacity.voidsetFillRule(String fillRule) A string that defines how the inside of a shape is determined.voidsetLineCap(String lineCap) A string that defines shape to be used at the end of the stroke.voidsetLineJoin(String lineJoin) A string that defines shape to be used at the corners of the stroke.voidsetOpacity(double opacity) Stroke opacityvoidsetStroke(boolean stroke) Whether to draw stroke along the path.voidsetWeight(double weight) Stroke width in pixels
-
Constructor Details
-
PathOptions
public PathOptions()Creates a new set of path options initialized with the Leaflet default values. -
PathOptions
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
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 colorweight- the stroke width in pixels
-
-
Method Details
-
isStroke
public boolean isStroke()Whether to draw stroke along the path.- Returns:
trueif 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
Gets the stroke color.- Returns:
- the color of the stroke
-
setColor
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
Gets the shape to be used at the end of the stroke.- Returns:
- the shape used at the end of the stroke
-
setLineCap
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
Gets the shape to be used at the corners of the stroke.- Returns:
- the shape used at the corners of the stroke
-
setLineJoin
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
Gets the stroke dash pattern.- Returns:
- the string that defines the stroke dash pattern
-
setDashArray
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
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
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:
trueif 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
Gets the fill color.- Returns:
- the fill color of the path
-
setFillColor
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
Gets how the inside of a shape is determined.- Returns:
- the string that defines how the inside of a shape is determined
-
setFillRule
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
Gets the custom class name set on the element.- Returns:
- the class name set on an element
-
setClassName
Custom class name set on an element. Only for SVG renderer.- Parameters:
className- the class name set on an element
-