Class RMSvgShape

All Implemented Interfaces:
Archivable, DeepChangeListener, RMPropertyChanger, RMTypes, Unexpandable, PropertyChangeListener, Cloneable, EventListener

@NullMarked public class RMSvgShape extends AbstractRM2DShape
  • Field Details

  • Constructor Details

    • RMSvgShape

      public RMSvgShape()
    • RMSvgShape

      public RMSvgShape(String filePath)
    • RMSvgShape

      public RMSvgShape(byte[] svgContent)
  • Method Details

    • loadSvg

      public boolean loadSvg(byte[] bytes)
      Replaces the SVG content from raw bytes. The shape's size is preserved — only the content changes. Triggered when the user drags an SVG from the ImageBrowser onto an existing empty SVG placeholder in the designer.
      Returns:
      true if the SVG loaded successfully, false if parsing failed
    • loadSvg

      public boolean loadSvg(String filePath)
      Replaces the SVG content by reading from a file path. The shape's size is preserved — only the content changes. Triggered when the user drags an SVG file from the OS filesystem onto an existing empty SVG placeholder in the designer.
      Returns:
      true if the file was read and the SVG loaded successfully, false otherwise
    • render

      protected void render(Graphics2D g2d, int width, int height)
      Description copied from class: AbstractRM2DShape
      This is where implementations of AbstractRM2DShape actual paint themselves to a graphics context, to produce either a vector or raster graphic.
      Specified by:
      render in class AbstractRM2DShape
    • isLoadError

      public boolean isLoadError()
    • isAcceptingDrop

      public boolean isAcceptingDrop()
    • rpgShape

      protected RMShape rpgShape(ReportOwner owner, RMShape parent)
      Description copied from class: RMShape
      Generate report with report owner.
      Overrides:
      rpgShape in class RMShape
    • 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 AbstractRM2DShape
    • 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 AbstractRM2DShape
    • showLoadError

      public static void showLoadError(JComponent parent, @Nullable String fileName)