Class Polyline

  • All Implemented Interfaces:
    Styleable, EventTarget


    public class Polyline
    extends Shape
    Creates a polyline, defined by the array of the segment points. The Polyline class is similar to the Polygon class, except that it is not automatically closed.
    import javafx.scene.shape.*;
    
    Polyline polyline = new Polyline();
    polyline.getPoints().addAll(new Double[]{
        0.0, 0.0,
        20.0, 10.0,
        10.0, 20.0 });
    
    Since:
    JavaFX 2.0
    • Constructor Detail

      • Polyline

        public Polyline​()
        Creates an empty instance of Polyline.
      • Polyline

        public Polyline​(double... points)
        Creates a new instance of Polyline.
        Parameters:
        points - the coordinates of the polyline segments
    • Method Detail

      • getPoints

        public final ObservableList<Double> getPoints​()
        Gets the coordinates of the PolyLine segments.
        Returns:
        An observable list of points constituting segments of this PolyLine
      • toString

        public String toString​()
        Returns a string representation of this Polyline object.
        Overrides:
        toString in class Node
        Returns:
        a string representation of this Polyline object.