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 RMFill
clone()
Standard clone implementation.RMFill
deriveFill(RMFill aFill)
Derives an instance of this class from another fill.boolean
equals(java.lang.Object anObj)
Standard equals implementation.java.lang.Object
fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.RMRect
getBounds(RMShape aShape)
Returns the bounds required to render this fill for this shape.RMColor
getColor()
Returns the color associated with this fill.java.lang.String
getName()
Returns the name of the fill.boolean
hasAlpha()
Returns whether fill has transparency.void
paint(RMShapePainter aPntr, RMShape aShape)
Render this fill in a Java2D Graphics2D.protected void
readAttributes(RXElement anElement)
void
setColor(RMColor aColor)
Sets the color associated with this fill.java.lang.String
toString()
Returns a string representation.RXElement
toXML(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:
equals
in classjava.lang.Object
-
clone
public RMFill clone()
Standard clone implementation.- Overrides:
clone
in 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:
toXML
in interfaceArchivable
-
fromXML
public java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.- Specified by:
fromXML
in interfaceArchivable
-
readAttributes
protected void readAttributes(RXElement anElement)
-
-