Class AbstractRM2DShape
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
- All Implemented Interfaces:
Archivable
,DeepChangeListener
,RMPropertyChanger
,RMTypes
,Unexpandable
,PropertyChangeListener
,Cloneable
,EventListener
- Direct Known Subclasses:
RMBarcode
,RMScriptableChart
To create RM vector images, we add
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.
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 LoggerEx
static final String
protected static final String
Fields 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 TypeMethodDescription@NotNull RMParentShape
clone()
Standard implementation of Object clone.fromXML
(RXArchiver archiver, RXElement element) XML unarchival generic - break fromXML into fromXMLShape and fromXMLShapeChildren.static String[]
static Color[]
boolean
protected boolean
This is the accessor for the useRaster variable.protected boolean
isRpg()
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.protected void
setDirty()
void
setIsRpg
(boolean isRpg) void
setRenderContext
(RenderContext renderContext) void
setUseRaster
(boolean useRaster) toXML
(RXArchiver archiver) XML Archival generic - break toXML into toXMLShape and toXMLShapeChildren.protected boolean
void
writeEnd()
Method works in conjunction withwriteStart()
to produce PDF/Vector output.void
Method works in conjunction withwriteEnd()
to produce PDF/Vector output.Methods 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, toXMLShape
Methods 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, y
Methods inherited from class com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange
Methods 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:
getDisplayedFill
in classRMShape
-
writeStart
public void writeStart()Method works in conjunction withwriteEnd()
to produce PDF/Vector output. When theRenderContext
hasRenderContext.RenderOption
set toRenderContext.RenderOption.VECTOR_IF_ENABLED
, and theRenderContext.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, andwriteEnd()
marks the end of the process. -
writeEnd
public void writeEnd()Method works in conjunction withwriteStart()
to produce PDF/Vector output. When theRenderContext
hasRenderContext.RenderOption
set toRenderContext.RenderOption.VECTOR_IF_ENABLED
, and theRenderContext.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
Description copied from class:RMParentShape
Standard implementation of Object clone. Null's out shape's parent and children.- Overrides:
clone
in classRMParentShape
-
toXML
Description copied from class:RMParentShape
XML Archival generic - break toXML into toXMLShape and toXMLShapeChildren.- Specified by:
toXML
in interfaceArchivable
- Overrides:
toXML
in classRMParentShape
-
fromXML
Description copied from class:RMParentShape
XML unarchival generic - break fromXML into fromXMLShape and fromXMLShapeChildren.- Specified by:
fromXML
in interfaceArchivable
- Overrides:
fromXML
in classRMParentShape
-