public class Line extends Shape
(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); }
Type | Property and Description |
---|---|
DoubleProperty |
endX
The X coordinate of the end point of the line segment.
|
DoubleProperty |
endY
The Y coordinate of the end point of the line segment.
|
DoubleProperty |
startX
The X coordinate of the start point of the line segment.
|
DoubleProperty |
startY
The Y coordinate of the start point of the line segment.
|
fillProperty, smoothProperty, strokeDashOffsetProperty, strokeLineCapProperty, strokeLineJoinProperty, strokeMiterLimitProperty, strokeProperty, strokeTypeProperty, strokeWidthProperty
Modifier and Type | Field and Description |
---|---|
private DoubleProperty |
endX
The X coordinate of the end point of the line segment.
|
private DoubleProperty |
endY
The Y coordinate of the end point of the line segment.
|
private Line2D |
shape |
private DoubleProperty |
startX
The X coordinate of the start point of the line segment.
|
private DoubleProperty |
startY
The Y coordinate of the start point of the line segment.
|
old_fill, old_stroke
Constructor and Description |
---|
Line()
Creates an empty instance of Line.
|
Line(double startX,
double startY,
double endX,
double endY)
Creates a new instance of Line.
|
Modifier and Type | Method and Description |
---|---|
private BaseBounds |
doComputeGeomBounds(BaseBounds bounds,
BaseTransform tx) |
private Line2D |
doConfigShape() |
private NGNode |
doCreatePeer() |
private Paint |
doCssGetFillInitialValue()
*
Stylesheet Handling *
*
|
private Paint |
doCssGetStrokeInitialValue()
Some sub-class of Shape, such as
Line , override the
default value for the Shape.stroke property. |
private void |
doUpdatePeer() |
DoubleProperty |
endXProperty()
The X coordinate of the end point of the line segment.
|
DoubleProperty |
endYProperty()
The Y coordinate of the end point of the line segment.
|
double |
getEndX()
Gets the value of the property endX.
|
double |
getEndY()
Gets the value of the property endY.
|
double |
getStartX()
Gets the value of the property startX.
|
double |
getStartY()
Gets the value of the property startY.
|
void |
setEndX(double value)
Sets the value of the property endX.
|
void |
setEndY(double value)
Sets the value of the property endY.
|
void |
setStartX(double value)
Sets the value of the property startX.
|
void |
setStartY(double value)
Sets the value of the property startY.
|
DoubleProperty |
startXProperty()
The X coordinate of the start point of the line segment.
|
DoubleProperty |
startYProperty()
The Y coordinate of the start point of the line segment.
|
java.lang.String |
toString()
Returns a string representation of this
Line object. |
computeBounds, computeShapeBounds, computeShapeContains, convertLineJoin, fillProperty, getClassCssMetaData, getCssMetaData, getFill, getMode, getStroke, getStrokeDashArray, getStrokeDashOffset, getStrokeLineCap, getStrokeLineJoin, getStrokeMiterLimit, getStrokeType, getStrokeWidth, intersect, isSmooth, setFill, setMode, setShapeChangeListener, setSmooth, setStroke, setStrokeDashOffset, setStrokeLineCap, setStrokeLineJoin, setStrokeMiterLimit, setStrokeType, setStrokeWidth, smoothProperty, strokeDashOffsetProperty, strokeLineCapProperty, strokeLineJoinProperty, strokeMiterLimitProperty, strokeProperty, strokeTypeProperty, strokeWidthProperty, subtract, union
public final DoubleProperty startXProperty
getStartX()
,
setStartX(double)
public final DoubleProperty startYProperty
getStartY()
,
setStartY(double)
public final DoubleProperty endXProperty
getEndX()
,
setEndX(double)
public final DoubleProperty endYProperty
getEndY()
,
setEndY(double)
private final Line2D shape
private final DoubleProperty startX
private final DoubleProperty startY
private final DoubleProperty endX
private final DoubleProperty endY
public Line()
public Line(double startX, double startY, double endX, double endY)
startX
- the horizontal coordinate of the start point of the line segmentstartY
- the vertical coordinate of the start point of the line segmentendX
- the horizontal coordinate of the end point of the line segmentendY
- the vertical coordinate of the end point of the line segmentpublic final void setStartX(double value)
public final double getStartX()
public final DoubleProperty startXProperty()
getStartX()
,
setStartX(double)
public final void setStartY(double value)
public final double getStartY()
public final DoubleProperty startYProperty()
getStartY()
,
setStartY(double)
public final void setEndX(double value)
public final double getEndX()
public final DoubleProperty endXProperty()
getEndX()
,
setEndX(double)
public final void setEndY(double value)
public final double getEndY()
public final DoubleProperty endYProperty()
getEndY()
,
setEndY(double)
private NGNode doCreatePeer()
private BaseBounds doComputeGeomBounds(BaseBounds bounds, BaseTransform tx)
private Line2D doConfigShape()
private void doUpdatePeer()
private Paint doCssGetFillInitialValue()
private Paint doCssGetStrokeInitialValue()
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.public java.lang.String toString()
Line
object.Line
object.