Class Line

All Implemented Interfaces:
Styleable, EventTarget

public non-sealed class Line extends Shape
This Line represents a line segment in (x,y) coordinate space. Example:
import javafx.scene.shape.*;

Line line = new Line();
line.setStartX(0.0f);
line.setStartY(0.0f);
line.setEndX(100.0f);
line.setEndY(100.0f);
}
Since:
JavaFX 2.0
  • Property Details

  • Constructor Details

    • Line

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

      public Line(double startX, double startY, double endX, double endY)
      Creates a new instance of Line.
      Parameters:
      startX - the horizontal coordinate of the start point of the line segment
      startY - the vertical coordinate of the start point of the line segment
      endX - the horizontal coordinate of the end point of the line segment
      endY - the vertical coordinate of the end point of the line segment
  • Method Details

    • setStartX

      public final void setStartX(double value)
      Sets the value of the startX property.
      Property description:
      The X coordinate of the start point of the line segment.
      Default value:
      0.0
      Parameters:
      value - the value for the startX property
      See Also:
    • getStartX

      public final double getStartX()
      Gets the value of the startX property.
      Property description:
      The X coordinate of the start point of the line segment.
      Default value:
      0.0
      Returns:
      the value of the startX property
      See Also:
    • startXProperty

      public final DoubleProperty startXProperty()
      The X coordinate of the start point of the line segment.
      Default value:
      0.0
      Returns:
      the startX property
      See Also:
    • setStartY

      public final void setStartY(double value)
      Sets the value of the startY property.
      Property description:
      The Y coordinate of the start point of the line segment.
      Default value:
      0.0
      Parameters:
      value - the value for the startY property
      See Also:
    • getStartY

      public final double getStartY()
      Gets the value of the startY property.
      Property description:
      The Y coordinate of the start point of the line segment.
      Default value:
      0.0
      Returns:
      the value of the startY property
      See Also:
    • startYProperty

      public final DoubleProperty startYProperty()
      The Y coordinate of the start point of the line segment.
      Default value:
      0.0
      Returns:
      the startY property
      See Also:
    • setEndX

      public final void setEndX(double value)
      Sets the value of the endX property.
      Property description:
      The X coordinate of the end point of the line segment.
      Default value:
      0.0
      Parameters:
      value - the value for the endX property
      See Also:
    • getEndX

      public final double getEndX()
      Gets the value of the endX property.
      Property description:
      The X coordinate of the end point of the line segment.
      Default value:
      0.0
      Returns:
      the value of the endX property
      See Also:
    • endXProperty

      public final DoubleProperty endXProperty()
      The X coordinate of the end point of the line segment.
      Default value:
      0.0
      Returns:
      the endX property
      See Also:
    • setEndY

      public final void setEndY(double value)
      Sets the value of the endY property.
      Property description:
      The Y coordinate of the end point of the line segment.
      Default value:
      0.0
      Parameters:
      value - the value for the endY property
      See Also:
    • getEndY

      public final double getEndY()
      Gets the value of the endY property.
      Property description:
      The Y coordinate of the end point of the line segment.
      Default value:
      0.0
      Returns:
      the value of the endY property
      See Also:
    • endYProperty

      public final DoubleProperty endYProperty()
      The Y coordinate of the end point of the line segment.
      Default value:
      0.0
      Returns:
      the endY property
      See Also:
    • toString

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