Package app.media

Class GenericShape

java.lang.Object
app.media.Media
app.media.GenericShape
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EllipseShape, PolygonShape, RectangleShape

public abstract class GenericShape extends Media
A sub-class of Media representing an arbitrary shape
See Also:
  • 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 type
      p1 - The first point the shape is defined by
      p2 - The second point the shape is defined by
      colour - 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

      public String 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

      public void setColour(String colour)
      Sets the colour of the shape
      Parameters:
      colour - The desired color to set the shape to