Class AbstractRM2DShape

All Implemented Interfaces:
Archivable, DeepChangeListener, RMPropertyChanger, RMTypes, Unexpandable, PropertyChangeListener, Cloneable, EventListener
Direct Known Subclasses:
RMBarcode, RMScriptableChart

public abstract class AbstractRM2DShape extends RMParentShape implements Unexpandable
To create RM vector images, we add RMShape nodes to a root node. This class serves as that root node for extending classes. Inorder to be able to add children, the class needed to extend from RMParentShape. The existing AbstractJ2DShape extends from RMShape and does not support having children nodes. This class therefore contains a near copy of AbstractJ2DShape but extending from RMParentShape instead of RMShape.

The "copy" is then extended with methods and properties to enable the creation of RM vector images; and the switching between raster and vector output.
  • Field Details

  • Constructor Details

    • AbstractRM2DShape

      public AbstractRM2DShape()
  • Method Details

    • render

      protected abstract void render(Graphics2D g, int width, int height)
      This is where implementations of AbstractRM2DShape actual paint themselves to a graphics context, to produce either a vector or raster graphic.
    • getDefaultColorCodes

      public static String[] getDefaultColorCodes()
    • getDefaultColors

      public static Color[] getDefaultColors()
    • setIsRpg

      public void setIsRpg(boolean isRpg)
    • isRpg

      protected boolean isRpg()
    • setRenderContext

      public void setRenderContext(RenderContext renderContext)
    • getRenderContext

      public RenderContext getRenderContext()
    • useImageForVector

      protected boolean useImageForVector()
    • setUseRaster

      public void setUseRaster(boolean useRaster)
    • getUseRaster

      public boolean getUseRaster()
    • getUserRasterInternal

      protected boolean getUserRasterInternal()
      This is the accessor for the useRaster variable. This might diverge from the getUserRaster() public property if that's overridden.
    • setDirty

      protected void setDirty()
    • getDisplayedFill

      public RMFill getDisplayedFill()
      Overrides:
      getDisplayedFill in class RMShape
    • writeStart

      public void writeStart()
      Method works in conjunction with writeEnd() to produce PDF/Vector output. When the RenderContext has RenderContext.RenderOption set to RenderContext.RenderOption.VECTOR_IF_ENABLED, and the RenderContext.useImageForVector() is set to true, an image will be produced, except when writing to PDFs. When the PDF write action takes place, this method marks the start of the process, and writeEnd() marks the end of the process.
    • writeEnd

      public void writeEnd()
      Method works in conjunction with writeStart() to produce PDF/Vector output. When the RenderContext has RenderContext.RenderOption set to RenderContext.RenderOption.VECTOR_IF_ENABLED, and the RenderContext.useImageForVector() is set to true, an image will be produced, except when writing to PDFs. When the PDF write action takes place, writeStart() marks the start of the process, and this method marks the end of the process.
    • clone

      @NotNull public @NotNull RMParentShape clone()
      Description copied from class: RMParentShape
      Standard implementation of Object clone. Null's out shape's parent and children.
      Overrides:
      clone in class RMParentShape
    • toXML

      public RXElement toXML(RXArchiver archiver)
      Description copied from class: RMParentShape
      XML Archival generic - break toXML into toXMLShape and toXMLShapeChildren.
      Specified by:
      toXML in interface Archivable
      Overrides:
      toXML in class RMParentShape
    • fromXML

      public RMShape fromXML(RXArchiver archiver, RXElement element)
      Description copied from class: RMParentShape
      XML unarchival generic - break fromXML into fromXMLShape and fromXMLShapeChildren.
      Specified by:
      fromXML in interface Archivable
      Overrides:
      fromXML in class RMParentShape