Top Description Fields Constructors Methods
javafx.scene.shape

public non-sealed Class Line

extends Shape
Class Inheritance
Imports
com.sun.javafx.geom.BaseBounds, .Line2D, com.sun.javafx.geom.transform.BaseTransform, com.sun.javafx.scene.DirtyBits, .NodeHelper, com.sun.javafx.scene.shape.LineHelper, com.sun.javafx.sg.prism.NGLine, .NGNode, .NGShape, javafx.beans.property.DoubleProperty, .DoublePropertyBase, javafx.css.StyleableProperty, javafx.scene.Node, javafx.scene.paint.Color, .Paint

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

Field Summary

Modifier and TypeField and Description
private final DoubleProperty
endX

The X coordinate of the end point of the line segment.

private final DoubleProperty
endY

The Y coordinate of the end point of the line segment.

private final Line2D
private final DoubleProperty
startX

The X coordinate of the start point of the line segment.

private final DoubleProperty
startY

The Y coordinate of the start point of the line segment.

Inherited from javafx.scene.shape.Shape:
old_fillold_stroke

Constructor Summary

AccessConstructor and Description
public
Line()

Creates an empty instance of Line.

public
Line(double
the horizontal coordinate of the start point of the line segment
startX
,
double
the vertical coordinate of the start point of the line segment
startY
,
double
the horizontal coordinate of the end point of the line segment
endX
,
double
the vertical coordinate of the end point of the line segment
endY
)

Creates a new instance of Line.

Method Summary

Modifier and TypeMethod and Description
private BaseBounds
private Line2D
private NGNode
private Paint
private Paint
doCssGetStrokeInitialValue()

Hides javafx.scene.shape.Shape.doCssGetStrokeInitialValue.

Some sub-class of Shape, such as Line, override the default value for the Shape#stroke property.

private void
public final DoubleProperty
public final DoubleProperty
public final double
public final double
public final double
public final double
public final void
setEndX(double value)

public final void
setEndY(double value)

public final void
setStartX(double value)

public final void
setStartY(double value)

public final DoubleProperty
public final DoubleProperty
public String

Returns:

a string representation of this Line object.
toString
()

Overrides javafx.scene.Node.toString.

Returns a string representation of this Line object.

Inherited from javafx.scene.shape.Shape:
computeBoundscomputeShapeBoundscomputeShapeContainsconvertLineJoinfillPropertygetClassCssMetaDatagetCssMetaDatagetFillgetModegetStrokegetStrokeDashArraygetStrokeDashOffsetgetStrokeLineCapgetStrokeLineJoingetStrokeMiterLimitgetStrokeTypegetStrokeWidthintersectisSmoothsetFillsetShapeChangeListenersetSmoothsetStrokesetStrokeDashOffsetsetStrokeLineCapsetStrokeLineJoinsetStrokeMiterLimitsetStrokeTypesetStrokeWidthsmoothPropertystrokeDashOffsetPropertystrokeLineCapPropertystrokeLineJoinPropertystrokeMiterLimitPropertystrokePropertystrokeTypePropertystrokeWidthPropertysubtractunion

Field Detail

endXback to summary
private final DoubleProperty endX

The X coordinate of the end point of the line segment.

Default Value
0.0
endYback to summary
private final DoubleProperty endY

The Y coordinate of the end point of the line segment.

Default Value
0.0
shapeback to summary
private final Line2D shape
startXback to summary
private final DoubleProperty startX

The X coordinate of the start point of the line segment.

Default Value
0.0
startYback to summary
private final DoubleProperty startY

The Y coordinate of the start point of the line segment.

Default Value
0.0

Constructor Detail

Lineback to summary
public Line()

Creates an empty instance of Line.

Lineback to summary
public Line(double startX, double startY, double endX, double endY)

Creates a new instance of Line.

Parameters
startX:double

the horizontal coordinate of the start point of the line segment

startY:double

the vertical coordinate of the start point of the line segment

endX:double

the horizontal coordinate of the end point of the line segment

endY:double

the vertical coordinate of the end point of the line segment

Method Detail

doComputeGeomBoundsback to summary
private BaseBounds doComputeGeomBounds(BaseBounds bounds, BaseTransform tx)

Hides javafx.scene.shape.Shape.doComputeGeomBounds.

doConfigShapeback to summary
private Line2D doConfigShape()
doCreatePeerback to summary
private NGNode doCreatePeer()
doCssGetFillInitialValueback to summary
private Paint doCssGetFillInitialValue()

Hides javafx.scene.shape.Shape.doCssGetFillInitialValue.

doCssGetStrokeInitialValueback to summary
private Paint doCssGetStrokeInitialValue()

Hides javafx.scene.shape.Shape.doCssGetStrokeInitialValue.

Some sub-class of Shape, such as Line, override the default value for the Shape#stroke property. This allows CSS to get the correct initial value.

Note

This method MUST only be called via its accessor method.

doUpdatePeerback to summary
private void doUpdatePeer()

Hides javafx.scene.shape.Shape.doUpdatePeer.

endXPropertyback to summary
public final DoubleProperty endXProperty()
endYPropertyback to summary
public final DoubleProperty endYProperty()
getEndXback to summary
public final double getEndX()
getEndYback to summary
public final double getEndY()
getStartXback to summary
public final double getStartX()
getStartYback to summary
public final double getStartY()
setEndXback to summary
public final void setEndX(double value)
setEndYback to summary
public final void setEndY(double value)
setStartXback to summary
public final void setStartX(double value)
setStartYback to summary
public final void setStartY(double value)
startXPropertyback to summary
public final DoubleProperty startXProperty()
startYPropertyback to summary
public final DoubleProperty startYProperty()
toStringback to summary
public String toString()

Overrides javafx.scene.Node.toString.

Returns a string representation of this Line object.

Returns:String

a string representation of this Line object.

Annotations
@Override