Class RMStroke

All Implemented Interfaces:
Archivable, RMPropertyChanger, Cloneable
Direct Known Subclasses:
RMBorderStroke, RMDoubleStroke

public class RMStroke extends RMFill
An RMFill subclass specifically designed to describe strokes.
  • Constructor Details

    • 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 Details

    • 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 String getDashArrayString()
      Returns the dash array for this stroke as a string.
    • setDashArrayString

      public void setDashArrayString(String aString)
      Sets the dash array for this stroke from a string.
    • getDashArray

      public static float[] getDashArray(String aString, String aDelimeter)
      Returns a dash array for given dash array string and delimeter.
    • getDashArrayString

      public static String getDashArrayString(float[] dashArray, 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.
      Overrides:
      setColor in class RMFill
    • getStroke

      protected Stroke getStroke()
      Returns the java2d stroke to be used.
    • getStrokePath

      public 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.
      Overrides:
      getBounds in class RMFill
    • paint

      public void paint(RMShapePainter aPntr, RMShape aShape)
      Render this fill in a shape painter.
      Overrides:
      paint in class RMFill
    • getName

      public String getName()
      Returns the name of the fill.
      Overrides:
      getName in class RMFill
    • equals

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

      public RMStroke clone()
      Standard clone implementation.
      Overrides:
      clone in class RMFill
    • toXML

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

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

      protected void readAttributes(RXElement e)
      Overrides:
      readAttributes in class RMFill