Class AbstractRM2DShape
- All Implemented Interfaces:
Archivable,DeepChangeListener,RMPropertyChanger,RMTypes,Unexpandable,PropertyChangeListener,Cloneable,EventListener
- Direct Known Subclasses:
RMBarcode,RMScriptableChart
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.inductiveautomation.rm.base.RMTypes
RMTypes.Align, RMTypes.AlignX, RMTypes.AlignY -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String[]protected final LoggerExstatic final Stringprotected static final StringFields inherited from class com.inductiveautomation.rm.shape.RMShape
BINDING_PROP_NAME, STROKE_BORDER, STROKE_DOUBLE, STROKE_HIDDEN, STROKE_SHAPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Standard implementation of Object clone.voidThis method is only active whenRenderContext.useImageForVector()is set to true.fromXML(RXArchiver archiver, RXElement element) XML unarchival generic - break fromXML into fromXMLShape and fromXMLShapeChildren.voidThis method is only active whenRenderContext.useImageForVector()is set to true.static String[]static Color[]booleanprotected booleanThis is the accessor for the useRaster variable.protected booleanisRpg()protected abstract voidrender(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.protected voidsetDirty()voidsetIsRpg(boolean isRpg) voidsetRenderContext(RenderContext renderContext) voidsetUseRaster(boolean useRaster) toXML(RXArchiver archiver) XML Archival generic - break toXML into toXMLShape and toXMLShapeChildren.protected booleanMethods inherited from class com.inductiveautomation.rm.shape.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 com.inductiveautomation.rm.shape.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, propertyChange, put, removeBinding, removeBinding, removeDeepChangeListener, removeFromParent, removeMouseListener, repaint, repaint, resolvePageReferences, rpgBindings, rpgShape, 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 com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChangeMethods inherited from class com.inductiveautomation.rm.base.RMListenerList
addListener, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
Field Details
-
USE_RASTER_ATTRIB
- See Also:
-
DEFAULT_COLORS
-
USE_RASTER_PROPERTY_STRING
- See Also:
-
logger
-
-
Constructor Details
-
AbstractRM2DShape
public AbstractRM2DShape()
-
-
Method Details
-
render
This is where implementations of AbstractRM2DShape actual paint themselves to a graphics context, to produce either a vector or raster graphic. -
getDefaultColorCodes
-
getDefaultColors
-
setIsRpg
public void setIsRpg(boolean isRpg) -
isRpg
protected boolean isRpg() -
setRenderContext
-
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
- Overrides:
getDisplayedFillin classRMShape
-
generateVectorShapes
public void generateVectorShapes()This method is only active whenRenderContext.useImageForVector()is set to true. When called will addRMShapes to the root node.In the current use case, it's paired with
disposeVectorShapes(). The main purpose of these methods is to minimize memory usage when generating vector output. This method creates theRMShapes needed to generate the vector output, anddisposeVectorShapes()removes theseRMShapes when they are no longer needed.An example to further clarify: let's say we have a Report containing a Table followed by a Barcode and then a XYChart. As we write the report to vector (PDF or printing), we write the Table first, then when we hit the Barcode, we call this method to create the
RMShapes used to render the Barcode. Once we finish writing theseRMShapes to vector, we calldisposeVectorShapes()to remove theseRMShapes from the root node. We then move on to the XYChart, and repeat the above process. So at any given time, we only have theRMShapes needed to render the current element being written to vector. -
disposeVectorShapes
public void disposeVectorShapes()This method is only active whenRenderContext.useImageForVector()is set to true. When called will clear the root node of its childRMShapes. -
clone
Description copied from class:RMParentShapeStandard implementation of Object clone. Null's out shape's parent and children.- Overrides:
clonein classRMParentShape
-
toXML
Description copied from class:RMParentShapeXML Archival generic - break toXML into toXMLShape and toXMLShapeChildren.- Specified by:
toXMLin interfaceArchivable- Overrides:
toXMLin classRMParentShape
-
fromXML
Description copied from class:RMParentShapeXML unarchival generic - break fromXML into fromXMLShape and fromXMLShapeChildren.- Specified by:
fromXMLin interfaceArchivable- Overrides:
fromXMLin classRMParentShape
-