Package com.reportmill.shape
Class RMGraph
- java.lang.Object
- 
- com.reportmill.base.RMObject
- 
- com.reportmill.shape.RMShape
- 
- com.reportmill.shape.RMGraph
 
 
 
- 
- All Implemented Interfaces:
- RMArchiver.Archiving,- java.lang.Cloneable
 
 public class RMGraph extends RMShape 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);
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classRMGraph.BarLabelAn inner class for bar labels.static classRMGraph.LegendAn inner class for Legend.
 - 
Field SummaryFields Modifier and Type Field Description static java.lang.StringEXTRUDE_ALLstatic java.lang.StringEXTRUDE_CUSTOMstatic java.lang.StringEXTRUDE_FIRSTstatic java.lang.StringEXTRUDE_LASTstatic java.lang.StringEXTRUDE_NONEstatic java.lang.String[]EXTRUSIONSstatic java.lang.StringTYPE_BARstatic java.lang.StringTYPE_BAR_HORIZONTALstatic java.lang.StringTYPE_PIEstatic java.lang.String[]TYPES- 
Fields inherited from class com.reportmill.shape.RMShapeWRAP_TYPE_BOTH, WRAP_TYPE_NONE
 
- 
 - 
Constructor SummaryConstructors Constructor Description RMGraph()Creates a plain graph shape.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptsChildren()Editor method indicates that graph can accept new children.booleanacceptsFormat()RMEditor method (indicates that graphs have settable format).booleancanBeUngrouped()Editor method indicates that graph cannot be ungrouped.voidcopy(java.lang.Object anObj)Copies the attributes from the given object into receiver (for undo).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.RMGraph.BarLabelgetBarLabel()Returns the child of the graph that represents bar labels (if present).floatgetBarSpacing()Returns the width of the space between bars as a ratio of the bar width (0.0 - 1.0).RMShapegetBarWedgePrototype()Returns the shape used to represent the basic attributes of bars & wedges.floatgetBarWidth()Returns the width of the area used to draw bars as a ratio of the over-all area (0.0 - 1.0).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).RMGraphContentgetContent()Returns the shape that represents the conent of the graph.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.booleangetDrawAxisLabels()Returns whether the graph draws axis labels.booleangetDrawGroupSeparator()Returns whether the graph draws a line between groups (if multiple keys).booleangetDrawMajorAxis()Returns whether the graph draws the major axis.booleangetDrawMinorAxis()Returns whether the graph draws the minor axis.booleangetDrawWedgeLabelLines()Returns whether a pie graph draws lines from the wedges to wedge labels.java.lang.StringgetExtrusionKey()Returns the key used to determine which pie wedges get extruded.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.ListgetKeys()Returns a list of the individual keys in the (potentially) 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.RMGraph.LegendgetLegend()Returns the child of the graph that represents the legend (if present).java.lang.StringgetListKey()Returns the list key associated with the graph.static RMShapegetSampleGraphContent(RMGraphContent aGraphContent)Returns a filled graph content for a given graph content.booleangetShowBarLabels()Returns whether the graph shows bar labels.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.booleangetStacked()Returns whether multiple keys are stacked or separated.booleangetSwapSeries()Returns whether the graph groups bars by keys (normal) or by objects (swapped).intgetTopNCount()Returns the top-n count for this graph's top-n sort.booleangetTopNIncludeOthers()Returns whether the top-n sort for this graph includes remainders.RMSortgetTopNSort()Returns the top-n sort for this graph.java.lang.StringgetType()Returns the graph type (TYPE_BAR, TYPE_PIE, etc.).java.lang.ObjectinitWithArchiver(RMArchiver anArchiver)Legacy unarchival.RMShaperpgClone(ReportMill anRM)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.voidsetBarSpacing(float aValue)Sets the width of the space between bars as a ratio of the bar width (0.0 - 1.0).voidsetBarWedgePrototype(RMShape aShape)Sets the shape used to represent the basic attributes of bars & wedges.voidsetBarWidth(float aValue)Sets the width of the area used to draw bars as a ratio of the over-all area (0.0 - 1.0).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.voidsetDrawAxisLabels(boolean aFlag)Sets whether the graph draws axis labels.voidsetDrawGroupSeparator(boolean aFlag)Sets whether the graph draws a line between groups (if multiple keys).voidsetDrawMajorAxis(boolean aFlag)Sets whether the graph draws the major axis.voidsetDrawMinorAxis(boolean aFlag)Sets whether the graph draws the minor axis.voidsetDrawWedgeLabelLines(boolean aFlag)Sets whether a pie graph draws lines from the wedges to wedge labels.voidsetExtrusionKey(java.lang.String aKey)Sets the key used to determine which pie wedges get extruded.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.voidsetShowBarLabels(boolean aFlag)Sets whether the graph shows bar labels.voidsetShowLegend(boolean aFlag)Sets whether the graph shows a legend.voidsetStacked(boolean aFlag)Sets whether multiple keys are stacked or separated.voidsetSwapSeries(boolean aFlag)Sets whether the graph groups bars by keys (normal) or by objects (swapped).voidsetTopNCount(int aCount)Sets the top-n count for this graph's top-n sort.voidsetTopNIncludeOthers(boolean aFlag)Sets whether the top-n sort for this graph includes remainders.voidsetTopNSort(RMSort aSO)Sets the top-n sort for this graph.voidsetType(java.lang.String aType)Sets the graph type (TYPE_BAR, TYPE_PIE, etc.).booleansuperSelectable()Editor method indicates that graph can be super selected.RXElementtoXML(RXArchiver anArchiver)XML archival.- 
Methods inherited from class com.reportmill.shape.RMShapeacceptsDragKeys, acceptsMouse, addChild, addChild, addChildBelowLastChild, bounds, boundsChanged, boundsChanged, bringShapesToFront, 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, getToolClassName, getTransform, getTransformFromShape, getTransformInverse, getTransformToShape, getUndoer, getUrl, getWidth, getWidthToFit, getX, getXY, getXYP, getY, groupShapes, hasPageBreaks, height, indexOf, indexOf, 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, 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_BARpublic static final java.lang.String TYPE_BAR - See Also:
- Constant Field Values
 
 - 
TYPE_BAR_HORIZONTALpublic static final java.lang.String TYPE_BAR_HORIZONTAL - See Also:
- Constant Field Values
 
 - 
TYPE_PIEpublic static final java.lang.String TYPE_PIE - See Also:
- Constant Field Values
 
 - 
TYPESpublic static final java.lang.String[] TYPES 
 - 
EXTRUDE_NONEpublic static final java.lang.String EXTRUDE_NONE - See Also:
- Constant Field Values
 
 - 
EXTRUDE_FIRSTpublic static final java.lang.String EXTRUDE_FIRST - See Also:
- Constant Field Values
 
 - 
EXTRUDE_LASTpublic static final java.lang.String EXTRUDE_LAST - See Also:
- Constant Field Values
 
 - 
EXTRUDE_ALLpublic static final java.lang.String EXTRUDE_ALL - See Also:
- Constant Field Values
 
 - 
EXTRUDE_CUSTOMpublic static final java.lang.String EXTRUDE_CUSTOM - See Also:
- Constant Field Values
 
 - 
EXTRUSIONSpublic static final java.lang.String[] EXTRUSIONS 
 
- 
 - 
Method Detail- 
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 (potentially) comma separated keys string.
 - 
getTypepublic java.lang.String getType() Returns the graph type (TYPE_BAR, TYPE_PIE, etc.).
 - 
setTypepublic void setType(java.lang.String aType) Sets the graph type (TYPE_BAR, TYPE_PIE, 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.
 - 
getTopNSortpublic RMSort getTopNSort() Returns the top-n sort for this graph.
 - 
setTopNSortpublic void setTopNSort(RMSort aSO) Sets the top-n sort for this graph.
 - 
getTopNCountpublic int getTopNCount() Returns the top-n count for this graph's top-n sort.
 - 
setTopNCountpublic void setTopNCount(int aCount) Sets the top-n count for this graph's top-n sort.
 - 
getTopNIncludeOtherspublic boolean getTopNIncludeOthers() Returns whether the top-n sort for this graph includes remainders.
 - 
setTopNIncludeOtherspublic void setTopNIncludeOthers(boolean aFlag) Sets whether the top-n sort for this graph includes remainders.
 - 
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).
 - 
getStackedpublic boolean getStacked() Returns whether multiple keys are stacked or separated.
 - 
setStackedpublic void setStacked(boolean aFlag) Sets whether multiple keys are stacked or separated.
 - 
getDrawAxisLabelspublic boolean getDrawAxisLabels() Returns whether the graph draws axis labels.
 - 
setDrawAxisLabelspublic void setDrawAxisLabels(boolean aFlag) Sets whether the graph draws axis labels.
 - 
getDrawMajorAxispublic boolean getDrawMajorAxis() Returns whether the graph draws the major axis.
 - 
setDrawMajorAxispublic void setDrawMajorAxis(boolean aFlag) Sets whether the graph draws the major axis.
 - 
getDrawMinorAxispublic boolean getDrawMinorAxis() Returns whether the graph draws the minor axis.
 - 
setDrawMinorAxispublic void setDrawMinorAxis(boolean aFlag) Sets whether the graph draws the minor axis.
 - 
getDrawGroupSeparatorpublic boolean getDrawGroupSeparator() Returns whether the graph draws a line between groups (if multiple keys).
 - 
setDrawGroupSeparatorpublic void setDrawGroupSeparator(boolean aFlag) Sets whether the graph draws a line between groups (if multiple keys).
 - 
getBarWidthpublic float getBarWidth() Returns the width of the area used to draw bars as a ratio of the over-all area (0.0 - 1.0).
 - 
setBarWidthpublic void setBarWidth(float aValue) Sets the width of the area used to draw bars as a ratio of the over-all area (0.0 - 1.0).
 - 
getBarSpacingpublic float getBarSpacing() Returns the width of the space between bars as a ratio of the bar width (0.0 - 1.0).
 - 
setBarSpacingpublic void setBarSpacing(float aValue) Sets the width of the space between bars as a ratio of the bar width (0.0 - 1.0).
 - 
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.
 - 
getDrawWedgeLabelLinespublic boolean getDrawWedgeLabelLines() Returns whether a pie graph draws lines from the wedges to wedge labels.
 - 
setDrawWedgeLabelLinespublic void setDrawWedgeLabelLines(boolean aFlag) Sets whether a pie graph draws lines from the wedges to wedge labels.
 - 
getExtrusionKeypublic java.lang.String getExtrusionKey() Returns the key used to determine which pie wedges get extruded.
 - 
setExtrusionKeypublic void setExtrusionKey(java.lang.String aKey) Sets the key used to determine which pie wedges get extruded.
 - 
getBarLabelpublic RMGraph.BarLabel getBarLabel() Returns the child of the graph that represents bar labels (if present).
 - 
getShowBarLabelspublic boolean getShowBarLabels() Returns whether the graph shows bar labels.
 - 
setShowBarLabelspublic void setShowBarLabels(boolean aFlag) Sets whether the graph shows bar labels.
 - 
getLegendpublic RMGraph.Legend getLegend() Returns the child of the graph that represents the legend (if present).
 - 
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
 
 - 
getBarWedgePrototypepublic RMShape getBarWedgePrototype() Returns the shape used to represent the basic attributes of bars & wedges.
 - 
setBarWedgePrototypepublic void setBarWedgePrototype(RMShape aShape) Sets the shape used to represent the basic attributes of bars & wedges.
 - 
getContentpublic RMGraphContent getContent() Returns the shape that represents the conent of the graph.
 - 
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).
 - 
initWithArchiverpublic java.lang.Object initWithArchiver(RMArchiver anArchiver) Legacy unarchival.- Specified by:
- initWithArchiverin interface- RMArchiver.Archiving
- Overrides:
- initWithArchiverin class- RMShape
 
 - 
toXMLpublic RXElement toXML(RXArchiver anArchiver) XML archival.
 - 
fromXMLpublic java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement) XML unarchival.
 - 
superSelectablepublic boolean superSelectable() Editor method indicates that graph can be super selected.- Overrides:
- superSelectablein class- RMShape
 
 - 
canBeUngroupedpublic boolean canBeUngrouped() Editor method indicates that graph cannot be ungrouped.- Overrides:
- canBeUngroupedin class- RMShape
 
 - 
acceptsChildrenpublic boolean acceptsChildren() Editor method indicates that graph can accept new children.- Overrides:
- acceptsChildrenin class- RMShape
 
 - 
rpgClonepublic RMShape rpgClone(ReportMill anRM) Returns a clone of this shape with report generation.
 - 
getSampleGraphContentpublic static RMShape getSampleGraphContent(RMGraphContent aGraphContent) Returns a filled graph content for a given graph content.
 
- 
 
-