Class 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 Detail

      • DEFAULT_COLOR

        public static final javafx.scene.paint.Color DEFAULT_COLOR
        default color: dodgerblue slightly transparent
    • 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 class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • 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 class MapElement
        Parameters:
        visible - visibilty
        Returns:
        this object
      • setWidth

        public CoordinateLine setWidth​(int width)
        sets the width
        Parameters:
        width - the new width
        Returns:
        this object