ReportMill 10 API

com.reportmill.shape.graph
Class RMGraph

java.lang.Object
  extended by com.reportmill.base.RMObject
      extended by com.reportmill.shape.RMShape
          extended by com.reportmill.shape.graph.RMGraph
All Implemented Interfaces:
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);
  


Field Summary
static java.lang.String TYPE_AREA
           
static java.lang.String TYPE_BAR
           
static java.lang.String TYPE_BARH
           
static java.lang.String TYPE_LINE
           
static java.lang.String TYPE_PIE
           
static java.lang.String TYPE_SCATTER
           
static java.lang.String[] TYPES
           
 
Fields inherited from class com.reportmill.shape.RMShape
WRAP_TYPE_BOTH, WRAP_TYPE_NONE
 
Constructor Summary
RMGraph()
          Creates a plain graph shape.
 
Method Summary
 boolean acceptsChildren()
          Editor method indicates that graph can accept new children.
 void addKey(java.lang.String aKey)
          Adds a key.
 boolean canBeUngrouped()
          Editor method indicates that graph cannot be ungrouped.
 void clearKeys()
          Removes all keys.
 java.lang.Object clone()
          Standard clone implementation.
 void copy(java.lang.Object anObj)
          Copies the attributes from the given object into receiver (for undo).
 boolean equals(java.lang.Object anObj)
          Standard equals implementation.
 java.lang.Object fromXML(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement)
          XML unarchival.
 RMShape getBarWedgePrototype()
          Returns the shape used to represent the basic attributes of bars & wedges.
 RMColor getColor(int anIndex)
          Returns the specific color at the given index.
 int getColorCount()
          Returns the number of colors set for this graph.
 java.util.List getColors()
          Returns the list of colors to be used by this graph (or the default graph colors, if null).
static java.util.List getDefaultColors()
          Returns the default list of colors to be used by any graph without an explicit list of colors.
 boolean getDraw3D()
          Returns whether the graph draws in 3D.
 java.lang.String getFilterKey()
          Returns the optional key chain (expression) used to limit the table list derived from list key.
 RMGraphArea getGraphArea()
          Returns the shape that represents the conent of the graph.
 java.lang.String getGraphTypeString()
          Returns the graph type as a simple string: bar, pie or hbar.
 RMGrouping getGrouping()
          Returns the graph grouping.
 java.lang.String getKey(int anIndex)
          Returns the specific key at the given index.
 int getKeyCount()
          Returns the number of keys for this graph.
 RMGraphLegend getLegend()
          Returns the child of the graph that represents the legend (if present).
 java.lang.String getListKey()
          Returns the list key associated with the graph.
 boolean getShowLegend()
          Returns whether the graph shows a legend.
 java.lang.String getType()
          Returns the graph type (TYPE_BAR, TYPE_PIE, etc.).
 void rebuild()
          Rebuild graph.
 void removeKey(int anIndex)
          Removes a key.
 RMShape rpgClone(com.reportmill.base.ReportMill aReportMill)
          Returns a clone of this shape with report generation.
 void setBarWedgePrototype(RMShape aShape)
          Sets the shape used to represent the basic attributes of bars & wedges.
 void setColors(java.util.List aColorList)
          Sets the list of colors to be used by this graph.
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.
 void setDraw3D(boolean aFlag)
          Sets whether the graph draws in 3D.
 void setFilterKey(java.lang.String aKeyExpr)
          Sets the optional key chain (expression) used to limit the table list derived from list key.
 void setGraphTypeString(java.lang.String aString)
          Sets the graph type as a simple string: bar, pie or hbar.
 void setGrouping(RMGrouping aGrouping)
          Sets the graph grouping.
 void setListKey(java.lang.String aKeyPath)
          Sets the list key associated with the graph.
 void setShowLegend(boolean aFlag)
          Sets whether the graph shows a legend.
 void setType(java.lang.String aType)
          Sets the graph type (TYPE_BAR, TYPE_PIE, etc.).
 boolean superSelectable()
          Editor method indicates that graph can be super selected.
 com.reportmill.archiver.RXElement toXML(com.reportmill.archiver.RXArchiver anArchiver)
          XML archival.
 
Methods inherited from class com.reportmill.shape.RMShape
acceptsMouse, addChild, addChild, bounds, boundsChanged, boundsChanged, bringShapesToFront, childrenSuperSelectImmediately, cloneDeep, contains, convertedPointFromShape, convertedPointToShape, convertedRectFromShape, convertedRectToShape, convertedSizeFromShape, convertedSizeToShape, convertedVectorFromShape, convertedVectorToShape, convertFromShape, convertPathFromShape, convertPathToShape, convertPointFromShape, convertPointToShape, convertRectFromShape, convertRectToShape, convertSizeFromShape, convertSizeToShape, convertToShape, convertVectorFromShape, convertVectorToShape, copyShape, createLayout, delete, didChange, divideShapeFromEdge, divideShapeFromTop, doLayout, fromXMLDeep, get, getActionScript, getAnim, getAnim, getAnimator, getAnimator, getAutosizeHeight, getAutosizing, getBounds, getBoundsInside, getBoundsMarked, getBoundsOfChildren, getBoundsOfChildren, getBoundsSuperSelected, getCausesWrap, getCausesWrapType, getChild, getChildAnimator, getChildAnimator, getChildContaining, getChildCount, getChildCountHitable, getChildCountLayout, getChildCountVisible, getChildHitable, getChildLast, getChildLayout, getChildren, getChildrenIntersecting, getChildrenWhoCauseWrap, getChildrenWithClass, getChildrenWithClass, getChildVisible, getChildWithClass, getChildWithName, getColor, getCommonAncestor, getDatasetKey, getDatasetKeyDeep, getDatasetKeyShape, getDocument, getFill, getFill, getFill, getFillCount, getFills, getFont, getFormat, getFrame, getFrame, getFrameMaxX, getFrameMaxY, getFrameX, getFrameXY, getFrameY, getGroupShape, getHeight, getHeightToFit, getImageFill, getLayout, getLineWidth, getMaxX, getMaxY, getName, getOpacity, getOpacityDeep, getOutline, getPageBreak, getPageBreakMax, getPageBreakPage, getPageBreakPageMax, 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, height, indexOf, indexOf, intersects, invalidate, isAncestor, isDescendant, isLocked, isRoot, isUnderlined, isValid, layoutReset, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, notRSS, offsetChildrenXY, offsetXY, page, pageMax, put, putPropertyKey, reclaimChildren, removeChild, removeChild, removeChildren, removeChildren, removeFromParent, resolvePageReferences, revalidate, rpgCloneBase, rpgCloneChildren, rpgCloneNotification, rpgClonePreprocess, rpgCloneUrl, sendShapesToBack, setActionScript, setAnim, setAutosizeHeight, setAutosizing, setBounds, setBounds, setCausesWrapType, setChildren, setColor, setFill, setFont, setFormat, setFrame, setFrame, setFrameSize, setFrameX, setFrameXY, setFrameXY, setFrameY, setHeight, setHeightDeep, setHeightToFit, setLayout, setLayoutEnabled, 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, setWidthToFit, setX, setXY, setXY, setXYP, setY, sizesToFitChildren, toString, toXMLDeep, undoClone, undoCopy, undoEquals, undoerAddDirtyObject, undoerDisable, undoerEnable, undoerSetUndoTitle, validate, width, willChange, willChange, x, y
 
Methods inherited from class com.reportmill.base.RMObject
didUndo, getAnimAttribute, getClassNameShort
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_BAR

public static final java.lang.String TYPE_BAR
See Also:
Constant Field Values

TYPE_BARH

public static final java.lang.String TYPE_BARH
See Also:
Constant Field Values

TYPE_AREA

public static final java.lang.String TYPE_AREA
See Also:
Constant Field Values

TYPE_LINE

public static final java.lang.String TYPE_LINE
See Also:
Constant Field Values

TYPE_SCATTER

public static final java.lang.String TYPE_SCATTER
See Also:
Constant Field Values

TYPE_PIE

public static final java.lang.String TYPE_PIE
See Also:
Constant Field Values

TYPES

public static final java.lang.String[] TYPES
Constructor Detail

RMGraph

public RMGraph()
Creates a plain graph shape.

Method Detail

getListKey

public java.lang.String getListKey()
Returns the list key associated with the graph.

Overrides:
getListKey in class RMShape

setListKey

public void setListKey(java.lang.String aKeyPath)
Sets the list key associated with the graph.


getFilterKey

public java.lang.String getFilterKey()
Returns the optional key chain (expression) used to limit the table list derived from list key.


setFilterKey

public void setFilterKey(java.lang.String aKeyExpr)
Sets the optional key chain (expression) used to limit the table list derived from list key.


getKeyCount

public int getKeyCount()
Returns the number of keys for this graph.


getKey

public java.lang.String getKey(int anIndex)
Returns the specific key at the given index.


addKey

public void addKey(java.lang.String aKey)
Adds a key.


removeKey

public void removeKey(int anIndex)
Removes a key.


clearKeys

public void clearKeys()
Removes all keys.


getType

public java.lang.String getType()
Returns the graph type (TYPE_BAR, TYPE_PIE, etc.).


setType

public void setType(java.lang.String aType)
Sets the graph type (TYPE_BAR, TYPE_PIE, etc.).


getGraphTypeString

public java.lang.String getGraphTypeString()
Returns the graph type as a simple string: bar, pie or hbar.


setGraphTypeString

public void setGraphTypeString(java.lang.String aString)
Sets the graph type as a simple string: bar, pie or hbar.


getGrouping

public RMGrouping getGrouping()
Returns the graph grouping.


setGrouping

public void setGrouping(RMGrouping aGrouping)
Sets the graph grouping.


getDraw3D

public boolean getDraw3D()
Returns whether the graph draws in 3D.


setDraw3D

public void setDraw3D(boolean aFlag)
Sets whether the graph draws in 3D.


getLegend

public RMGraphLegend getLegend()
Returns the child of the graph that represents the legend (if present).


getShowLegend

public boolean getShowLegend()
Returns whether the graph shows a legend.


setShowLegend

public void setShowLegend(boolean aFlag)
Sets whether the graph shows a legend.


getColorCount

public int getColorCount()
Returns the number of colors set for this graph.


getColor

public RMColor getColor(int anIndex)
Returns the specific color at the given index. Automatically wraps if index exceeds color count.


getColors

public java.util.List getColors()
Returns the list of colors to be used by this graph (or the default graph colors, if null).


setColors

public void setColors(java.util.List aColorList)
Sets the list of colors to be used by this graph.


getDefaultColors

public static java.util.List getDefaultColors()
Returns the default list of colors to be used by any graph without an explicit list of colors.


setDefaultColors

public 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.


getBarWedgePrototype

public RMShape getBarWedgePrototype()
Returns the shape used to represent the basic attributes of bars & wedges.


setBarWedgePrototype

public void setBarWedgePrototype(RMShape aShape)
Sets the shape used to represent the basic attributes of bars & wedges.


getGraphArea

public RMGraphArea getGraphArea()
Returns the shape that represents the conent of the graph.


rebuild

public void rebuild()
Rebuild graph.


equals

public boolean equals(java.lang.Object anObj)
Standard equals implementation.

Overrides:
equals in class RMShape

clone

public java.lang.Object clone()
Standard clone implementation.

Overrides:
clone in class RMShape

copy

public void copy(java.lang.Object anObj)
Copies the attributes from the given object into receiver (for undo).

Overrides:
copy in class RMShape

rpgClone

public RMShape rpgClone(com.reportmill.base.ReportMill aReportMill)
Returns a clone of this shape with report generation.

Overrides:
rpgClone in class RMShape

superSelectable

public boolean superSelectable()
Editor method indicates that graph can be super selected.

Overrides:
superSelectable in class RMShape

canBeUngrouped

public boolean canBeUngrouped()
Editor method indicates that graph cannot be ungrouped.

Overrides:
canBeUngrouped in class RMShape

acceptsChildren

public boolean acceptsChildren()
Editor method indicates that graph can accept new children.

Overrides:
acceptsChildren in class RMShape

toXML

public com.reportmill.archiver.RXElement toXML(com.reportmill.archiver.RXArchiver anArchiver)
XML archival.

Overrides:
toXML in class RMShape

fromXML

public java.lang.Object fromXML(com.reportmill.archiver.RXArchiver anArchiver,
                                com.reportmill.archiver.RXElement anElement)
XML unarchival.

Overrides:
fromXML in class RMShape

ReportMill 10 API