Package com.sothawo.mapjfx
Class CoordinateLine
- java.lang.Object
-
- com.sothawo.mapjfx.MapElement
-
- com.sothawo.mapjfx.CoordinateLine
-
public class CoordinateLine extends MapElement
A sequence of Coordinate objects which is drawn on the map as a line connecting the coordinates. It has a visible property that enables to switch the visibility on the map off without removing the CoordinateLine frmthe map. Invisible CoordinateLines can easily be switched to visiblae again.- Author:
- P.J.Meisch ([email protected])
-
-
Field Summary
Fields Modifier and Type Field Description static javafx.scene.paint.Color
DEFAULT_COLOR
default color: dodgerblue slightly transparentstatic int
DEFAULT_WIDTH
default width 3-
Fields inherited from class com.sothawo.mapjfx.MapElement
visible
-
-
Constructor Summary
Constructors Constructor Description CoordinateLine(Coordinate... coordinates)
Creates a CoordinateLine for the given coordinates.CoordinateLine(java.util.List<? extends Coordinate> coordinates)
Creates a CoordinateLine for the given coordinates.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
javafx.scene.paint.Color
getColor()
java.util.stream.Stream<Coordinate>
getCoordinateStream()
java.lang.String
getId()
int
getWidth()
int
hashCode()
CoordinateLine
setColor(javafx.scene.paint.Color color)
sets the new color.CoordinateLine
setVisible(boolean visible)
sets the visibilty of the markerCoordinateLine
setWidth(int width)
sets the widthjava.lang.String
toString()
-
Methods inherited from class com.sothawo.mapjfx.MapElement
getVisible, visibleProperty
-
-
-
-
Field Detail
-
DEFAULT_COLOR
public static final javafx.scene.paint.Color DEFAULT_COLOR
default color: dodgerblue slightly transparent
-
DEFAULT_WIDTH
public static final int DEFAULT_WIDTH
default width 3- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CoordinateLine
public CoordinateLine(java.util.List<? extends Coordinate> coordinates)
Creates a CoordinateLine for the given coordinates.- Parameters:
coordinates
- the coordinate objects are copied into an internal ist, so that modifying the passed argument list will not modify this object.- Throws:
java.lang.NullPointerException
- if coordinates is null
-
CoordinateLine
public CoordinateLine(Coordinate... coordinates)
Creates a CoordinateLine for the given coordinates.- Parameters:
coordinates
- the coordinate objects are copied into an internal ist, so that modifying the passed argument list will not modify this object.- Throws:
java.lang.NullPointerException
- if coordinates is null
-
-
Method Detail
-
getColor
public javafx.scene.paint.Color getColor()
-
getId
public java.lang.String getId()
-
getWidth
public int getWidth()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classMapElement
-
getCoordinateStream
public java.util.stream.Stream<Coordinate> getCoordinateStream()
- Returns:
- the coordinates as stream. The coordinates are only available as stream, this prevents modification of the internal list.
-
setColor
public CoordinateLine setColor(javafx.scene.paint.Color color)
sets the new color. when changing color, the CoordinateLine must be removed and re-added to the map in order to make the change visible.- Parameters:
color
- the new color- Returns:
- this object
- Throws:
java.lang.NullPointerException
- when color is null
-
setVisible
public CoordinateLine setVisible(boolean visible)
Description copied from class:MapElement
sets the visibilty of the marker- Overrides:
setVisible
in classMapElement
- Parameters:
visible
- visibilty- Returns:
- this object
-
setWidth
public CoordinateLine setWidth(int width)
sets the width- Parameters:
width
- the new width- Returns:
- this object
-
-