Package jltk.shape
Class Line
- java.lang.Object
-
- jltk.Component
-
- jltk.shape.Shape
-
- jltk.shape.Line
-
public class Line extends Shape
Beschreiben Sie hier die Klasse Line.- Version:
- 1.0
- Author:
- ms
-
-
Field Summary
Fields Modifier and Type Field Description protected javafx.scene.shape.Line
fxLine
-
Fields inherited from class jltk.shape.Shape
fillColor, fxShape, lineColor, rotate, scale, transparancy, x, xOffset, y, yOffset
-
Fields inherited from class jltk.Component
fxNode, hasFocus, myWindow, onFocusGained, onFocusLost
-
-
Constructor Summary
Constructors Constructor Description Line(double pStartX, double pStartY, double pEndX, double pEndY)
Creates a new line from (pStartX|pStartY) to (pEndX|pEndY).Line(double pStartX, double pStartY, double pEndX, double pEndY, Window pWindow)
Creates a new rectangle width the specified width and height.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getEndX()
Return the x coordinate of the end point.double
getEndY()
Return the y coordinate of the end point.double
getHeight()
Return the height of this linedouble
getStartX()
Return the x coordinate of the starting point.double
getStartY()
Return the y coordinate of the starting point.double
getWidth()
Return the width of this linevoid
setEndX(double pValue)
Set the new x coordinate for the end pointvoid
setEndY(double pValue)
Set the new y coordinate for the end pointvoid
setPosition(double pX, double pY)
Methode setPositionvoid
setStartX(double pValue)
Set the new x coordinate for the start pointvoid
setStartY(double pValue)
Set the new y coordinate for the start pointvoid
turn(double pAngle)
Turn this shape by the specified angle (in degrees).-
Methods inherited from class jltk.shape.Shape
contains, contains, contains, delay, flipHorizontal, flipVertical, getLineWidth, getRotation, getTransparancy, getX, getY, init, intersects, intersects, move, move, scale, scaleTo, setCenterPosition, setFillColor, setFillColor, setFillColor, setLineColor, setLineColor, setLineColor, setLineWidth, setRotation, setTransparancy, turn
-
Methods inherited from class jltk.Component
activate, deactivate, focus, hasFocus, hide, init, istActive, isVisible, runMethodByName, setOnFocusGained, setOnFocusLost, show, toBack, toFront
-
-
-
-
Constructor Detail
-
Line
public Line(double pStartX, double pStartY, double pEndX, double pEndY)
Creates a new line from (pStartX|pStartY) to (pEndX|pEndY). The specified position describes the left upper corner of this rectangle.- Parameters:
pStartX
- The x-coordinate of the starting pointpStartY
- The y-coordinate of the starting pointpEndX
- The x-coordinate of the endpointpEndY
- The y-coordinate of the endpoint
-
Line
public Line(double pStartX, double pStartY, double pEndX, double pEndY, Window pWindow)
Creates a new rectangle width the specified width and height. It is placed on the specified window The specified position describes the left upper corner of this rectangle.- Parameters:
pX
- The x-coordinate of the left upper cornerpY
- The y-coordinate of the left upper cornerpWidth
- The width of this rectanglepHeight
- The height of tis rectanglepWindow
- The windows, the rectangle should place
-
-
Method Detail
-
setStartX
public void setStartX(double pValue)
Set the new x coordinate for the start point- Parameters:
pWidth
- The x coordinate for the start point
-
setStartY
public void setStartY(double pValue)
Set the new y coordinate for the start point- Parameters:
pWidth
- The y coordinate for the start point
-
setEndX
public void setEndX(double pValue)
Set the new x coordinate for the end point- Parameters:
pWidth
- The x coordinate for the end point
-
setEndY
public void setEndY(double pValue)
Set the new y coordinate for the end point- Parameters:
pWidth
- The y coordinate for the end point
-
setPosition
public void setPosition(double pX, double pY)
Methode setPosition- Overrides:
setPosition
in classShape
- Parameters:
pX
- Ein ParameterpY
- Ein Parameter- See Also:
Shape.setCenterPosition(double,double)
,Shape.getX()
,Shape.getY()
-
getStartX
public double getStartX()
Return the x coordinate of the starting point.- Returns:
- The x coordinate of the starting point
-
getStartY
public double getStartY()
Return the y coordinate of the starting point.- Returns:
- The y coordinate of the starting point
-
getEndX
public double getEndX()
Return the x coordinate of the end point.- Returns:
- The x coordinate of the end point
-
getEndY
public double getEndY()
Return the y coordinate of the end point.- Returns:
- The y coordinate of the end point
-
getWidth
public double getWidth()
Return the width of this line
-
getHeight
public double getHeight()
Return the height of this line
-
turn
public void turn(double pAngle)
Description copied from class:Shape
Turn this shape by the specified angle (in degrees). Zero degrees is to the east (right-hand side of the window), and the angle increases clockwise.
-
-