Class RMFill

All Implemented Interfaces:
Archivable, RMPropertyChanger, Cloneable
Direct Known Subclasses:
RMContourFill, RMGradientFill, RMImageFill, RMStroke

public class RMFill extends RMObject implements Archivable
This class represents a simple shape fill, drawing a given color in a provided path. Subclasses support things like gradients, textures, etc.
  • Constructor Details

    • RMFill

      public RMFill()
      Creates a plain, black fill.
    • RMFill

      public RMFill(RMColor aColor)
      Creates a plain fill with the given color.
  • Method Details

    • getName

      public String getName()
      Returns the name of the fill.
    • getColor

      @Nonnull public RMColor getColor()
      Returns the color associated with this fill.
    • setColor

      public void setColor(@Nonnull RMColor aColor)
      Sets the color associated with this fill.
    • getBounds

      public RMRect getBounds(RMShape aShape)
      Returns the bounds required to render this fill for this shape.
    • paint

      public void paint(RMShapePainter aPntr, RMShape aShape)
      Render this fill in a Java2D Graphics2D.
    • hasAlpha

      public boolean hasAlpha()
      Returns whether fill has transparency.
    • equals

      public boolean equals(Object anObj)
      Standard equals implementation.
      Overrides:
      equals in class Object
    • clone

      public RMFill clone()
      Standard clone implementation.
      Overrides:
      clone in class RMListenerList
    • deriveFill

      public RMFill deriveFill(RMFill aFill)
      Derives an instance of this class from another fill.
    • toXML

      public RXElement toXML(RXArchiver anArchiver)
      XML archival.
      Specified by:
      toXML in interface Archivable
    • fromXML

      public Object fromXML(RXArchiver anArchiver, RXElement anElement)
      XML unarchival.
      Specified by:
      fromXML in interface Archivable
    • readAttributes

      protected void readAttributes(RXElement anElement)
    • toString

      public String toString()
      Returns a string representation.
      Overrides:
      toString in class RMObject