Class RMFill
- java.lang.Object
-
- com.inductiveautomation.rm.base.RMListenerList
-
- com.inductiveautomation.rm.base.RMObject
-
- com.inductiveautomation.rm.graphics.RMFill
-
- All Implemented Interfaces:
Archivable,RMPropertyChanger,java.lang.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.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RMFillclone()Standard clone implementation.RMFillderiveFill(RMFill aFill)Derives an instance of this class from another fill.booleanequals(java.lang.Object anObj)Standard equals implementation.java.lang.ObjectfromXML(RXArchiver anArchiver, RXElement anElement)XML unarchival.RMRectgetBounds(RMShape aShape)Returns the bounds required to render this fill for this shape.RMColorgetColor()Returns the color associated with this fill.java.lang.StringgetName()Returns the name of the fill.booleanhasAlpha()Returns whether fill has transparency.voidpaint(RMShapePainter aPntr, RMShape aShape)Render this fill in a Java2D Graphics2D.protected voidreadAttributes(RXElement anElement)voidsetColor(RMColor aColor)Sets the color associated with this fill.java.lang.StringtoString()Returns a string representation.RXElementtoXML(RXArchiver anArchiver)XML archival.-
Methods inherited from class com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange
-
Methods inherited from class com.inductiveautomation.rm.base.RMListenerList
addListener, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
-
-
-
Constructor Detail
-
RMFill
public RMFill()
Creates a plain, black fill.
-
RMFill
public RMFill(RMColor aColor)
Creates a plain fill with the given color.
-
-
Method Detail
-
getName
public java.lang.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(java.lang.Object anObj)
Standard equals implementation.- Overrides:
equalsin classjava.lang.Object
-
clone
public RMFill clone()
Standard clone implementation.- Overrides:
clonein classRMListenerList
-
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:
toXMLin interfaceArchivable
-
fromXML
public java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.- Specified by:
fromXMLin interfaceArchivable
-
readAttributes
protected void readAttributes(RXElement anElement)
-
-