Class RMSvgShape
java.lang.Object
com.inductiveautomation.rm.base.RMListenerList
com.inductiveautomation.rm.base.RMObject
com.inductiveautomation.rm.shape.RMShape
com.inductiveautomation.rm.shape.RMParentShape
com.inductiveautomation.rm.shape.rm2dshapes.AbstractRM2DShape
com.inductiveautomation.rm.shape.rm2dshapes.RMSvgShape
- All Implemented Interfaces:
Archivable, DeepChangeListener, RMPropertyChanger, RMTypes, Unexpandable, PropertyChangeListener, Cloneable, EventListener
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface RMTypes
RMTypes.Align, RMTypes.AlignX, RMTypes.AlignY -
Field Summary
FieldsFields inherited from class AbstractRM2DShape
DEFAULT_COLORS, logger, USE_RASTER_ATTRIB, USE_RASTER_PROPERTY_STRINGFields inherited from class RMShape
BINDING_PROP_NAME, STROKE_BORDER, STROKE_DOUBLE, STROKE_HIDDEN, STROKE_SHAPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromXML(RXArchiver archiver, RXElement element) XML unarchival generic - break fromXML into fromXMLShape and fromXMLShapeChildren.booleanbooleanbooleanloadSvg(byte[] bytes) Replaces the SVG content from raw bytes.booleanReplaces the SVG content by reading from a file path.protected voidrender(Graphics2D g2d, 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.protected RMShaperpgShape(ReportOwner owner, RMShape parent) Generate report with report owner.static voidshowLoadError(JComponent parent, @Nullable String fileName) toXML(RXArchiver archiver) XML Archival generic - break toXML into toXMLShape and toXMLShapeChildren.Methods inherited from class AbstractRM2DShape
clone, disposeVectorShapes, generateVectorShapes, getDefaultColorCodes, getDefaultColors, getDisplayedFill, getRenderContext, getUseRaster, getUserRasterInternal, isRpg, setDirty, setIsRpg, setRenderContext, setUseRaster, useImageForVectorMethods inherited from class RMParentShape
addChild, addChild, addChild, addChild, addLayoutChild, bringShapesToFront, cloneDeep, computePrefHeight, computePrefWidth, divideShapeFromTop, fromXMLChildren, fromXMLShape, getBoundsOfChildren, getChild, getChildArray, getChildContaining, getChildCount, getChildLast, getChildren, getChildrenIntersecting, getChildrenWithClass, getChildrenWithClass, getChildWithClass, getChildWithName, getLayout, getNeedsLayout, getSourceURL, indexOfChild, isHittable, isShowing, isSourceURLSet, layout, layoutChildren, relayout, removeChild, removeChild, removeChildren, removeLayoutChild, rpgAll, rpgChildren, sendShapesToBack, setHeight, setLayout, setNeedsLayout, setSourceURL, setWidth, toXMLChildren, toXMLShapeMethods inherited from class RMShape
acceptsChildren, acceptsMouse, addBinding, addBinding, addDeepChangeListener, addMouseListener, animUpdate, bounds, childrenSuperSelectImmediately, contains, convertedPointFromShape, convertedPointToShape, convertedRectFromShape, convertedRectToShape, convertedVectorFromShape, convertedVectorToShape, convertFromShape, convertPathFromShape, convertPathToShape, convertPointFromShape, convertPointToShape, convertRectFromShape, convertRectToShape, convertToShape, convertVectorFromShape, convertVectorToShape, copyShape, createDivideShapeRemainder, deepChange, divideShapeFromEdge, get, get, getAlignment, getAlignmentX, getAlignmentY, getAncestor, getAncestorCount, getAncestorInCommon, getAnimator, getAnimator, getAutosizing, getAutosizingDefault, getBestHeight, getBestHeight, getBestWidth, getBestWidth, getBinding, getBinding, getBindingCount, getBindings, getBounds, getBoundsInside, getBoundsMarked, getBoundsMarkedDeep, getChildAnimator, getChildAnimator, getChildClipShape, getClipShape, getColor, getDashArrayString, getDashPhase, getDatasetEntity, getDatasetKey, getDisplayedStroke, getDocument, getEffect, getEventAdapter, getFill, getFont, getFormat, getFrame, getFrameHeight, getFrameMaxX, getFrameMaxY, getFrameWidth, getFrameX, getFrameXY, getFrameY, getHeight, getHover, getLayoutInfo, getMaskPath, getMaxX, getMaxY, getMinHeight, getMinHeight, getMinWidth, getMinWidth, getName, getOpacity, getOpacityDeep, getOutline, getPageBreak, getPageBreakMax, getPageBreakPage, getPageBreakPageMax, getPageShape, getParent, getParent, getPath, getPathInBounds, getPrefHeight, getPrefHeight, getPrefWidth, getPrefWidth, getPropertyNameMapped, getPropertyNames, getPropertyNames, getRoll, getRootShape, getRSS, getScaleX, getScaleY, getShapesToAncestor, getShapesToDescendant, getShapesToShape, getSize, getSkewX, getSkewY, getStroke, getStrokeColor, getStrokeOnTop, getStrokeStyle, getStrokeWidth, getTextColor, getTimeline, getTimeline, getTransform, getTransformFromShape, getTransformInverse, getTransformToShape, getUndoer, getURL, getVisbileBounds, getVisibleBounds, getVisibleBounds, getVisibleBounds, getWidth, getX, getXY, getXYP, getY, height, indexOf, intersects, isAncestor, isAnimProperty, isDeletable, isDescendant, isEditing, isEnabled, isFontSet, isHittable, isLocked, isMinHeightSet, isMinWidthSet, isPrefHeightSet, isPrefWidthSet, isRoot, isRSS, isShowing, isUnderlined, isUseFill, isUseStroke, isViewing, isVisible, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, offsetXY, page, pageMax, paint, paintShape, paintShapeAll, paintShapeChildren, paintShapeOver, processBinding, propertyChange, put, removeBinding, removeBinding, removeDeepChangeListener, removeFromParent, removeMouseListener, repaint, repaint, resolvePageReferences, rpgBindings, setAlignment, setAlignmentX, setAlignmentY, setAutosizing, setBestHeight, setBestSize, setBounds, setBounds, setColor, setDashArrayString, setDashPhase, setEffect, setEnabled, setFill, setFont, setFormat, setFrame, setFrame, setFrameSize, setFrameX, setFrameXY, setFrameXY, setFrameY, setHover, setLayoutInfo, setLocked, setMinHeight, setMinSize, setMinWidth, setName, setOpacity, setOutline, setParent, setPrefHeight, setPrefWidth, setRoll, setScaleX, setScaleXY, setScaleY, setShowing, setSize, setSize, setSkewX, setSkewXY, setSkewY, setStroke, setStrokeColor, setStrokeStyle, setStrokeWidth, setTextColor, setTime, setTimeline, setUnderlined, setURL, setUseFill, setUseStroke, setVisible, setX, setXY, setXY, setXYP, setY, shapeHidden, shapeShown, superSelectable, toString, undoerDisable, undoerEnable, undoerSetUndoTitle, width, x, yMethods inherited from class RMObject
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChangeMethods inherited from class RMListenerList
addListener, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
Field Details
-
ARCHIVE_NAME
- See Also:
-
-
Constructor Details
-
RMSvgShape
public RMSvgShape() -
RMSvgShape
-
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:
trueif the SVG loaded successfully,falseif parsing failed
-
loadSvg
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:
trueif the file was read and the SVG loaded successfully,falseotherwise
-
render
Description copied from class:AbstractRM2DShapeThis is where implementations of AbstractRM2DShape actual paint themselves to a graphics context, to produce either a vector or raster graphic.- Specified by:
renderin classAbstractRM2DShape
-
isLoadError
public boolean isLoadError() -
isAcceptingDrop
public boolean isAcceptingDrop() -
rpgShape
-
toXML
Description copied from class:RMParentShapeXML Archival generic - break toXML into toXMLShape and toXMLShapeChildren.- Specified by:
toXMLin interfaceArchivable- Overrides:
toXMLin classAbstractRM2DShape
-
fromXML
Description copied from class:RMParentShapeXML unarchival generic - break fromXML into fromXMLShape and fromXMLShapeChildren.- Specified by:
fromXMLin interfaceArchivable- Overrides:
fromXMLin classAbstractRM2DShape
-
showLoadError
-