Class LineTo


  • public class LineTo
    extends PathElement
    Creates a line path element by drawing a straight line from the current coordinate to the new coordinates.

    For more information on path elements see the Path and PathElement classes.

    Example:

    import javafx.scene.shape.*;
    
    Path path = new Path();
    path.getElements().add(new MoveTo(0.0f, 50.0f));
    path.getElements().add(new LineTo(100.0f, 100.0f));
    
    Since:
    JavaFX 2.0
    • Constructor Detail

      • LineTo

        public LineTo()
        Creates an empty instance of LineTo.
      • LineTo

        public LineTo​(double x,
                      double y)
        Creates a new isntance of LineTo.
        Parameters:
        x - the horizontal coordinate of the line end point
        y - the vertical coordinate of the line end point
    • Method Detail

      • setX

        public final void setX​(double value)
        Sets the value of the property x.
        Property description:
        Defines the X coordinate.
        Default value:
        0.0
      • getX

        public final double getX()
        Gets the value of the property x.
        Property description:
        Defines the X coordinate.
        Default value:
        0.0
      • setY

        public final void setY​(double value)
        Sets the value of the property y.
        Property description:
        Defines the Y coordinate.
        Default value:
        0.0
      • getY

        public final double getY()
        Gets the value of the property y.
        Property description:
        Defines the Y coordinate.
        Default value:
        0.0
      • toString

        public String toString()
        Returns a string representation of this LineTo object.
        Overrides:
        toString in class Object
        Returns:
        a string representation of this LineTo object.