Class RMStroke
- java.lang.Object
-
- com.inductiveautomation.rm.base.RMListenerList
-
- com.inductiveautomation.rm.base.RMObject
-
- com.inductiveautomation.rm.graphics.RMFill
-
- com.inductiveautomation.rm.graphics.RMStroke
-
- All Implemented Interfaces:
Archivable
,RMPropertyChanger
,java.lang.Cloneable
- Direct Known Subclasses:
RMBorderStroke
,RMDoubleStroke
public class RMStroke extends RMFill
An RMFill subclass specifically designed to describe strokes.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RMStroke
clone()
Standard clone implementation.boolean
equals(java.lang.Object anObj)
Standard equals implementation.java.lang.Object
fromXML(RXArchiver anArchiver, RXElement e)
XML unarchival.RMRect
getBounds(RMShape aShape)
Returns the bounds required to render this fill for this shape.float[]
getDashArray()
Returns the dash array for this stroke.static float[]
getDashArray(java.lang.String aString, java.lang.String aDelimeter)
Returns a dash array for given dash array string and delimeter.java.lang.String
getDashArrayString()
Returns the dash array for this stroke as a string.static java.lang.String
getDashArrayString(float[] dashArray, java.lang.String aDelimiter)
Returns the dash array for this stroke as a string.float
getDashPhase()
Returns the dash phase.java.lang.String
getName()
Returns the name of the fill.protected java.awt.Stroke
getStroke()
Returns the java2d stroke to be used.java.awt.Shape
getStrokePath(RMShape aShape)
Returns the path to be stroked, transformed from the input path.float
getWidth()
Returns the line width of this stroke.void
paint(RMShapePainter aPntr, RMShape aShape)
Render this fill in a shape painter.protected void
readAttributes(RXElement e)
void
setColor(RMColor aColor)
Overrides fill version to clear java 2d stroke.void
setDashArray(float[] anArray)
Sets the dash array for this stroke.void
setDashArrayString(java.lang.String aString)
Sets the dash array for this stroke from a string.void
setDashPhase(float aValue)
Sets the dash phase.void
setWidth(float aValue)
Sets the line width of this stroke.RXElement
toXML(RXArchiver anArchiver)
XML archival.-
Methods inherited from class com.inductiveautomation.rm.graphics.RMFill
deriveFill, getColor, hasAlpha, toString
-
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
-
RMStroke
public RMStroke()
Creates a plain, black stroke.
-
RMStroke
public RMStroke(RMColor aColor, float aStrokeWidth)
Creates a stroke with the given color and line width.
-
-
Method Detail
-
getWidth
public float getWidth()
Returns the line width of this stroke.
-
setWidth
public void setWidth(float aValue)
Sets the line width of this stroke.
-
getDashArray
public float[] getDashArray()
Returns the dash array for this stroke.
-
setDashArray
public void setDashArray(float[] anArray)
Sets the dash array for this stroke.
-
getDashArrayString
public java.lang.String getDashArrayString()
Returns the dash array for this stroke as a string.
-
setDashArrayString
public void setDashArrayString(java.lang.String aString)
Sets the dash array for this stroke from a string.
-
getDashArray
public static float[] getDashArray(java.lang.String aString, java.lang.String aDelimeter)
Returns a dash array for given dash array string and delimeter.
-
getDashArrayString
public static java.lang.String getDashArrayString(float[] dashArray, java.lang.String aDelimiter)
Returns the dash array for this stroke as a string.
-
getDashPhase
public float getDashPhase()
Returns the dash phase.
-
setDashPhase
public void setDashPhase(float aValue)
Sets the dash phase.
-
setColor
public void setColor(RMColor aColor)
Overrides fill version to clear java 2d stroke.
-
getStroke
protected java.awt.Stroke getStroke()
Returns the java2d stroke to be used.
-
getStrokePath
public java.awt.Shape getStrokePath(RMShape aShape)
Returns the path to be stroked, transformed from the input path.
-
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 shape painter.
-
getName
public java.lang.String getName()
Returns the name of the fill.
-
equals
public boolean equals(java.lang.Object anObj)
Standard equals implementation.
-
toXML
public RXElement toXML(RXArchiver anArchiver)
XML archival.- Specified by:
toXML
in interfaceArchivable
- Overrides:
toXML
in classRMFill
-
fromXML
public java.lang.Object fromXML(RXArchiver anArchiver, RXElement e)
XML unarchival.- Specified by:
fromXML
in interfaceArchivable
- Overrides:
fromXML
in classRMFill
-
readAttributes
protected void readAttributes(RXElement e)
- Overrides:
readAttributes
in classRMFill
-
-