Class LineGraph
- java.lang.Object
- 
- com.reportmill.base.RMObject
- 
- com.reportmill.shape.RMShape
- 
- com.inductiveautomation.factorypmi.plugins.reporting.shapes.LineGraph
 
 
 
- 
- All Implemented Interfaces:
- RMArchiver.Archiving,- Java2DShapePainter,- RMShapePainter.Paint,- java.lang.Cloneable
 
 public class LineGraph extends RMShape implements RMShapePainter.Paint, Java2DShapePainter The RMGraph class provides a template and the machinery for generating graphs. It primarily encapsulates a list key for defining the set of objects to graph and a keys string for defining the attributes of those objects to graph. For instance, the list key might be "Movies" and the keys string might be "revenue". You can programatically create a graph like this:RMGraph graph = new RMGraph(); graph.setBounds(0, 0, 640, 480); graph.setListKey("Movies"); graph.setKeysString("revenue"); graph.setType(RMGraph.TYPE_PIE);
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringTYPE_AREAstatic java.lang.StringTYPE_LINEstatic java.lang.StringTYPE_SCATTERstatic java.lang.String[]TYPES- 
Fields inherited from class com.reportmill.shape.RMShapeWRAP_TYPE_BOTH, WRAP_TYPE_NONE
 
- 
 - 
Constructor SummaryConstructors Constructor Description LineGraph()Creates a plain graph shape.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptsFormat()RMEditor method (indicates that graphs have settable format).voidbasePaint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D rect)voidbuildChart()voidcopy(java.lang.Object anObj)Copies the attributes from the given object into receiver (for undo).java.util.DatedateValueForKeyChain(java.lang.Object anObj, java.lang.Object aKey)Returns a date value for the given object and key (automatically handles "swapped" case).doubledoubleValueForKeyChain(java.lang.Object anObj, java.lang.Object aKey)Returns a double value for the given object and key (automatically handles "swapped" case).booleanequals(java.lang.Object anObj)Standard equals implementation.java.lang.ObjectfromXML(RXArchiver anArchiver, RXElement anElement)XML unarchival.java.lang.StringgetAxisMinMaxCount()Returns the value axis' min, max and number of increments as a single string.RMColorgetColor(int anIndex)Returns the specific color at the given index.intgetColorCount()Returns the number of colors set for this graph.java.util.ListgetColors()Returns the list of colors to be used by this graph (or the default graph colors, if null).static java.util.ListgetDefaultColors()Returns the default list of colors to be used by any graph without an explicit list of colors.booleangetDraw3D()Returns whether the graph draws in 3D.java.lang.StringgetFilterKey()Returns the optional key chain (expression) used to limit the table list derived from list key.RMFontgetFont()Returns the font associated with the graph.RMFormatgetFormat()Returns the format associated with the value axis of the graph.java.lang.StringgetGraphTypeString()Returns the graph type as a simple string: bar, pie or hbar.java.util.ListgetGroups()Returns the keys to be graphed (unless swapped, in which case it returns the objects).java.util.ListgetKeys()Returns a list of the individual keys in the (potentialy) comma separated keys string.java.lang.StringgetKeysString()Returns keys string - a comma separated list of keys evaluated on list key objects to represent in graph.java.lang.StringgetListKey()Returns the list key associated with the graph.java.util.ListgetSeries()Returns the objects to be graphed (unless swapped, in which case it returns the keys).booleangetShowLegend()Returns whether the graph shows a legend.RMSortgetSort(int anIdex)Returns the individual RMSort at the given index.intgetSortCount()Returns the number of sorts associated with this graph.java.util.ListgetSorts()Returns the list of sorts associated with the graph.booleangetSwapSeries()Returns whether the graph groups bars by keys (normal) or by objects (swapped).java.lang.StringgetToolClassName()Editor method - returns the tool class name for this shape.java.lang.StringgetType()Returns the graph type (TYPE_LINE, TYPE_AREA, etc.).java.lang.StringgetXAxisLabel()java.lang.StringgetYAxisLabel()booleanisShowXAxis()booleanisShowYAxis()booleanisTimeseries()voidpaintShape(RMShapePainter aPainter, java.awt.Graphics2D g)RMShaperpgClone(ReportMill aReportMill)Returns a clone of this shape with report generation.voidsetAxisMinMaxCount(java.lang.String aValue)Sets the value axis' min, max and number of increments as a single string.voidsetColors(java.util.List aList)Sets the list of colors to be used by this graph.static voidsetDefaultColors(java.util.List aList)Sets the default list of colors to be used by any graph without an explicit list of colors.voidsetDraw3D(boolean aFlag)Sets whether the graph draws in 3D.voidsetFilterKey(java.lang.String aKeyExpr)Returns the optional key chain (expression) used to limit the table list derived from list key.voidsetFont(RMFont aFont)Sets the font associated with the graph.voidsetFormat(RMFormat f)Sets the format associated with the value axis of the graph.voidsetGraphTypeString(java.lang.String aString)Sets the graph type as a simple string: bar, pie or hbar.voidsetKeysString(java.lang.String aString)Sets keys string - a comma separated list of keys evaluated on list key objects to represent in graph.voidsetListKey(java.lang.String aKeyPath)Sets the list key associated with the graph.voidsetShowLegend(boolean aFlag)Sets whether the graph shows a legend.voidsetShowXAxis(boolean axis)voidsetShowYAxis(boolean axis)voidsetSwapSeries(boolean aFlag)Sets whether the graph groups bars by keys (normal) or by objects (swapped).voidsetTimeseries(boolean timeseries)voidsetType(java.lang.String aType)Sets the graph type (TYPE_LINE, TYPE_AREA, etc.).voidsetXAxisLabel(java.lang.String axisLabel)voidsetYAxisLabel(java.lang.String axisLabel)RXElementtoXML(RXArchiver anArchiver)XML archival.- 
Methods inherited from class com.reportmill.shape.RMShapeacceptsChildren, acceptsDragKeys, acceptsMouse, addChild, addChild, addChildBelowLastChild, bounds, boundsChanged, boundsChanged, bringShapesToFront, canBeUngrouped, childrenSuperSelectImmediately, clone, cloneDeep, contains, convertedPointFromShape, convertedPointToShape, convertedRectFromShape, convertedRectToShape, convertedSizeFromShape, convertedSizeToShape, convertedVectorFromShape, convertedVectorToShape, convertFromShape, convertPathFromShape, convertPathToShape, convertPointFromShape, convertPointToShape, convertRectFromShape, convertRectToShape, convertSizeFromShape, convertSizeToShape, convertToShape, convertVectorFromShape, convertVectorToShape, copyShape, delete, didChange, divideShapeFromEdge, divideShapeFromTop, dragExit, dragKeyAtPoint, dropKeyAtPoint, fromXMLDeep, get, getActionScript, getAnim, getAnim, getAnimator, getAnimator, getAutosizeHeight, getAutosizing, getBounds, getBoundsInside, getBoundsMarked, getBoundsOfChildren, getBoundsOfChildren, getBoundsSuperSelected, getCausesWrap, getCausesWrapType, getChild, getChildAnimator, getChildAnimator, getChildContaining, getChildCount, getChildLast, getChildren, getChildrenIntersecting, getChildrenWhoCauseWrap, getChildrenWhoDraw, getChildrenWhoHitTest, getChildSortedByX, getChildWithClass, getChildWithName, getColor, getCommonAncestor, getDocument, getFill, getFill, getFill, getFillCount, getFills, getFrame, getFrame, getFrameMaxX, getFrameMaxY, getFrameX, getFrameXY, getFrameY, getGroupShape, getHeight, getHeightToFit, getImageFill, getLineWidth, getListKeyDeep, getListKeyShape, getMaxX, getMaxY, getName, getOpacity, getOpacityDeep, getOutline, getPageCount, getPageShape, getParent, getParentCount, getParents, getPath, getPathInBounds, getPropertyKey, getPropertyKeyCount, getPropertyKeyName, getRoll, getRootShape, getScaleX, getScaleY, getShapesToAncestor, getShapesToDescendant, getShapesToShape, getSize, getSizeP, getSkewX, getSkewY, getStroke, getStrokeColor, getTextColor, getTransform, getTransformFromShape, getTransformInverse, getTransformToShape, getUndoer, getUrl, getWidth, getWidthToFit, getX, getXY, getXYP, getY, groupShapes, hasPageBreaks, height, indexOf, indexOf, initWithArchiver, intersects, isAncestor, isDescendant, isLocked, isRoot, isUnderlined, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, notRSS, offsetChildrenXY, offsetXY, page, pageBreakMax, pageBreakPageMax, pageMax, put, putPropertyKey, reclaimChildren, removeChild, removeChild, removeChildren, removeChildren, removeFromParent, resolvePageReferences, rpgCloneBase, rpgCloneChildren, rpgCloneConclude, rpgCloneNotification, rpgClonePrepare, rpgClonePreprocess, rpgCloneUrl, sendShapesToBack, setActionScript, setAnim, setAutosizeHeight, setAutosizing, setBounds, setBounds, setCausesWrapType, setChildren, setColor, setFill, setFrame, setFrame, setFrameSize, setFrameX, setFrameXY, setFrameXY, setFrameY, setHeight, setHeightDeep, setHeightDeep, setHeightToFit, setLineWidth, setLocked, setName, setNeedsRepaint, setNeedsRepaint, setOpacity, setOutline, setParent, setRoll, setScaleX, setScaleXY, setScaleY, setSize, setSize, setSizeDeep, setSizeP, setSizeToFit, setSizeToFit, setSkewX, setSkewXY, setSkewY, setStroke, setStrokeColor, setTextColor, setTime, setUnderlined, setUrl, setWidth, setWidthDeep, setWidthDeep, setWidthToFit, setX, setXY, setXY, setXYP, setY, sizesToFitChildren, superSelectable, toString, undoClone, undoCopy, undoEquals, undoerAddDirtyObject, undoerDisable, undoerEnable, undoerSetUndoTitle, width, willChange, willChange, x, y
 - 
Methods inherited from class com.reportmill.base.RMObjectdidUndo, getAnimAttribute, getClassNameShort
 
- 
 
- 
- 
- 
Field Detail- 
TYPE_LINEpublic static final java.lang.String TYPE_LINE - See Also:
- Constant Field Values
 
 - 
TYPE_AREApublic static final java.lang.String TYPE_AREA - See Also:
- Constant Field Values
 
 - 
TYPE_SCATTERpublic static final java.lang.String TYPE_SCATTER - See Also:
- Constant Field Values
 
 - 
TYPESpublic static final java.lang.String[] TYPES 
 
- 
 - 
Method Detail- 
buildChartpublic void buildChart() 
 - 
getListKeypublic java.lang.String getListKey() Returns the list key associated with the graph.- Overrides:
- getListKeyin class- RMShape
 
 - 
setListKeypublic void setListKey(java.lang.String aKeyPath) Sets the list key associated with the graph.- Overrides:
- setListKeyin class- RMShape
 
 - 
getFilterKeypublic java.lang.String getFilterKey() Returns the optional key chain (expression) used to limit the table list derived from list key.
 - 
setFilterKeypublic void setFilterKey(java.lang.String aKeyExpr) Returns the optional key chain (expression) used to limit the table list derived from list key.
 - 
getKeysStringpublic java.lang.String getKeysString() Returns keys string - a comma separated list of keys evaluated on list key objects to represent in graph.
 - 
setKeysStringpublic void setKeysString(java.lang.String aString) Sets keys string - a comma separated list of keys evaluated on list key objects to represent in graph.
 - 
getKeyspublic java.util.List getKeys() Returns a list of the individual keys in the (potentialy) comma separated keys string.
 - 
getTypepublic java.lang.String getType() Returns the graph type (TYPE_LINE, TYPE_AREA, etc.).
 - 
setTypepublic void setType(java.lang.String aType) Sets the graph type (TYPE_LINE, TYPE_AREA, etc.).
 - 
getGraphTypeStringpublic java.lang.String getGraphTypeString() Returns the graph type as a simple string: bar, pie or hbar.
 - 
setGraphTypeStringpublic void setGraphTypeString(java.lang.String aString) Sets the graph type as a simple string: bar, pie or hbar.
 - 
getSortCountpublic int getSortCount() Returns the number of sorts associated with this graph.
 - 
getSortpublic RMSort getSort(int anIdex) Returns the individual RMSort at the given index.
 - 
getSortspublic java.util.List getSorts() Returns the list of sorts associated with the graph.
 - 
getDraw3Dpublic boolean getDraw3D() Returns whether the graph draws in 3D.
 - 
setDraw3Dpublic void setDraw3D(boolean aFlag) Sets whether the graph draws in 3D.
 - 
getSwapSeriespublic boolean getSwapSeries() Returns whether the graph groups bars by keys (normal) or by objects (swapped).
 - 
setSwapSeriespublic void setSwapSeries(boolean aFlag) Sets whether the graph groups bars by keys (normal) or by objects (swapped).
 - 
getAxisMinMaxCountpublic java.lang.String getAxisMinMaxCount() Returns the value axis' min, max and number of increments as a single string.
 - 
setAxisMinMaxCountpublic void setAxisMinMaxCount(java.lang.String aValue) Sets the value axis' min, max and number of increments as a single string.
 - 
getShowLegendpublic boolean getShowLegend() Returns whether the graph shows a legend.
 - 
setShowLegendpublic void setShowLegend(boolean aFlag) Sets whether the graph shows a legend.
 - 
getColorCountpublic int getColorCount() Returns the number of colors set for this graph.
 - 
getColorpublic RMColor getColor(int anIndex) Returns the specific color at the given index.
 - 
getColorspublic java.util.List getColors() Returns the list of colors to be used by this graph (or the default graph colors, if null).
 - 
setColorspublic void setColors(java.util.List aList) Sets the list of colors to be used by this graph.
 - 
getDefaultColorspublic static java.util.List getDefaultColors() Returns the default list of colors to be used by any graph without an explicit list of colors.
 - 
setDefaultColorspublic static void setDefaultColors(java.util.List aList) Sets the default list of colors to be used by any graph without an explicit list of colors.
 - 
getFontpublic RMFont getFont() Returns the font associated with the graph.
 - 
setFontpublic void setFont(RMFont aFont) Sets the font associated with the graph.
 - 
getFormatpublic RMFormat getFormat() Returns the format associated with the value axis of the graph.
 - 
setFormatpublic void setFormat(RMFormat f) Sets the format associated with the value axis of the graph.
 - 
acceptsFormatpublic boolean acceptsFormat() RMEditor method (indicates that graphs have settable format).- Overrides:
- acceptsFormatin class- RMShape
 
 - 
equalspublic boolean equals(java.lang.Object anObj) Standard equals implementation.
 - 
copypublic void copy(java.lang.Object anObj) Copies the attributes from the given object into receiver (for undo).
 - 
toXMLpublic RXElement toXML(RXArchiver anArchiver) XML archival.
 - 
fromXMLpublic java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement) XML unarchival.
 - 
paintShapepublic void paintShape(RMShapePainter aPainter, java.awt.Graphics2D g) - Specified by:
- paintShapein interface- RMShapePainter.Paint
 
 - 
basePaintpublic void basePaint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D rect)- Specified by:
- basePaintin interface- Java2DShapePainter
 
 - 
rpgClonepublic RMShape rpgClone(ReportMill aReportMill) Returns a clone of this shape with report generation.
 - 
getGroupspublic java.util.List getGroups() Returns the keys to be graphed (unless swapped, in which case it returns the objects).
 - 
getSeriespublic java.util.List getSeries() Returns the objects to be graphed (unless swapped, in which case it returns the keys).
 - 
doubleValueForKeyChainpublic double doubleValueForKeyChain(java.lang.Object anObj, java.lang.Object aKey)Returns a double value for the given object and key (automatically handles "swapped" case).
 - 
dateValueForKeyChainpublic java.util.Date dateValueForKeyChain(java.lang.Object anObj, java.lang.Object aKey)Returns a date value for the given object and key (automatically handles "swapped" case).
 - 
getToolClassNamepublic java.lang.String getToolClassName() Description copied from class:RMShapeEditor method - returns the tool class name for this shape.- Overrides:
- getToolClassNamein class- RMShape
 
 - 
isShowXAxispublic boolean isShowXAxis() 
 - 
setShowXAxispublic void setShowXAxis(boolean axis) 
 - 
isShowYAxispublic boolean isShowYAxis() 
 - 
setShowYAxispublic void setShowYAxis(boolean axis) 
 - 
isTimeseriespublic boolean isTimeseries() 
 - 
setTimeseriespublic void setTimeseries(boolean timeseries) 
 - 
getXAxisLabelpublic java.lang.String getXAxisLabel() 
 - 
setXAxisLabelpublic void setXAxisLabel(java.lang.String axisLabel) 
 - 
getYAxisLabelpublic java.lang.String getYAxisLabel() 
 - 
setYAxisLabelpublic void setYAxisLabel(java.lang.String axisLabel) 
 
- 
 
-