Package app.media
Class GenericShape
java.lang.Object
app.media.Media
app.media.GenericShape
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
EllipseShape
,PolygonShape
,RectangleShape
A sub-class of Media representing an arbitrary shape
- See Also:
-
Property Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionGenericShape
(String type, javafx.geometry.Point2D p1, javafx.geometry.Point2D p2, String colour) Initializes a Generic Shape with the given parameters -
Method Summary
Modifier and TypeMethodDescriptionReturns the color of the shapejavafx.geometry.Point2D
getP1()
Gets the first point defining the shapejavafx.geometry.Point2D
getP2()
Gets the second point defining the shapevoid
Sets the colour of the shapevoid
setP1
(javafx.geometry.Point2D p1) Sets the first point defining the shapevoid
setP2
(javafx.geometry.Point2D p2) Sets the second point defining the shapeMethods inherited from class app.media.Media
angleProperty, getAngle, getHeight, getID, getName, getTags, getWidth, getX, getY, getZindex, heightProperty, isWithin, nameProperty, setAngle, setHeight, setID, setName, setTags, setWidth, setX, setY, setZindex, toString, widthProperty, xProperty, yProperty, zIndexProperty
-
Constructor Details
-
GenericShape
public GenericShape(String type, javafx.geometry.Point2D p1, javafx.geometry.Point2D p2, String colour) Initializes a Generic Shape with the given parameters- Parameters:
type
- The shape's typep1
- The first point the shape is defined byp2
- The second point the shape is defined bycolour
- The shape's color
-
-
Method Details
-
getP1
public javafx.geometry.Point2D getP1()Gets the first point defining the shape- Returns:
- the first point defining the shape
-
getP2
public javafx.geometry.Point2D getP2()Gets the second point defining the shape- Returns:
- the second point defining the shape
-
getColour
Returns the color of the shape- Returns:
- the color of the shape
-
setP1
public void setP1(javafx.geometry.Point2D p1) Sets the first point defining the shape- Parameters:
p1
- the first point defining the shape
-
setP2
public void setP2(javafx.geometry.Point2D p2) Sets the second point defining the shape- Parameters:
p2
- the second point defining the shape
-
setColour
Sets the colour of the shape- Parameters:
colour
- The desired color to set the shape to
-