Class GFillableE

java.lang.Object
com.dkt.graphics.elements.GraphicE
com.dkt.graphics.elements.GFillableE
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
GArc, GCircle, GMultiPoint, GOval, GRectangle

public abstract class GFillableE extends GraphicE
This represents an abstract fillable element
Author:
Federico Vera <[email protected]>
  • Constructor Details

    • GFillableE

      protected GFillableE(GFillableE e)
      Copy constructor
      Parameters:
      e - GFillableE to copy
      Throws:
      IllegalArgumentException - if e is null
    • GFillableE

      protected GFillableE()
  • Method Details

    • getFillPaint

      public Paint getFillPaint()
      Retrieves the Paint used to render this component
      Returns:
      the Paint
    • setFillPaint

      public void setFillPaint(Paint paint)
      Sets the Paint that's used to fill this component
      Parameters:
      paint - The new Paint used to render this component
      Throws:
      IllegalArgumentException - if paint is null
    • fill

      public boolean fill()
      Tells if the component must be filled
      Returns:
      true if the component must be filled and false otherwise
    • setFill

      public void setFill(boolean fill)
      Tells if the component needs to be filled
      Parameters:
      fill - true if the component must be filled and false otherwise
    • getShape

      public abstract Area getShape()
      This method should return a Area that represents the GFillableE. Since this is not always possible, and the implementation of Area isn't always easy, it should return null otherwise.
      In jDrawingLibs implementation we use the default shapes for this. Note that this method is only called to create clips for Graphic objects
      Returns:
      Shape
    • clone

      public abstract GFillableE clone()
      Specified by:
      clone in class GraphicE
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class GraphicE
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class GraphicE