Style Intelligence v12.0

inetsoft.graph.element
Class GraphElement

java.lang.Object
  extended by inetsoft.graph.Graphable
      extended by inetsoft.graph.element.GraphElement
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
SchemaElement, StackableElement

public abstract class GraphElement
extends Graphable

A graph element is an object that can be added to a graph to create a visual perception of data. For example, a PointElement can be added to a graph to draw points for data tuples.

A graph element can plot a graph for each variable. An element shares a a set of dimensions, and plot a graph for each var(iable).


Field Summary
static int DODGE_SYMMETRIC
          Dodge and center objects.
static String HINT_ALPHA
          Transparency value for color, a double value from 0 to 1.
static String HINT_CLIP
          Hint to clip the plot area for drawing this element, a string of true or false.
static String HINT_EXPLODED
          Hint to explode a slice of a pie, string of true or false.
static String HINT_MAX_COUNT
          Hint for the geometry max count limit, an integer value.
static String HINT_MAX_HEIGHT
          The maximum plot (single sub-graph) height, a number.
static String HINT_MAX_WIDTH
          The maximum plot (single sub-graph) width, a number.
static String HINT_SHINE
          Hint to add a shining effect to paint, string of true or false.
static int MOVE_CENTER
          Center the objects at tick position.
static int MOVE_DODGE
          Move objects side ways to avoid overlapping.
static int MOVE_JITTER
          Randomly shift points to reduce overlapping.
static int MOVE_NONE
          No collision resolution.
static int MOVE_STACK
          Stack objects.
static int STACK_SYMMETRIC
          Stack, dodge, and center objects.
 
Constructor Summary
protected GraphElement()
          Create an empty graph element.
protected GraphElement(String field)
          Create a graph element for a single column (1d).
protected GraphElement(String field1, String field2)
          Create a graph element for two columns (2d).
protected GraphElement(String field1, String field2, String field3)
          Create a graph element for three columns (3d).
 
Method Summary
 void addDim(String col)
          Add a dimension to be plotted using this element.
 void addVar(String col)
          Add a variable to be plotted using this element.
 void clearDims()
          Remove all dimensions.
 void clearVars()
          Remove all variables.
 Object clone()
          Clone this object.
protected  VisualModel createVisualModel(DataSet data)
          Create a visual model for the graph element.
 boolean equalsContent(Object obj)
          Check if equals another objects in structure.
 int getCollisionModifier()
          Get the collision handling option.
 ColorFrame getColorFrame()
          Get the color frame for getting the color aesthetic for each element.
 Comparator getComparator()
          Get the comparator.
 String getDim(int idx)
          Get the dimension at the specified index.
 int getDimCount()
          Get the number of dimensions specified for this element.
 String[] getDims()
          Get all the dimensions.
 int getEndRow()
          Get the ending row of the dataset to use for this element.
 int getLabelPlacement()
          Get the text placement.
 LineFrame getLineFrame()
          Get the line frame for getting the line aesthetic for each element.
protected  int getRootColIndex(DataSet data, String column)
          Get the col index on the root dataset.
protected  int getRootRowIndex(DataSet data, int row)
          Get the row index on the root dataset.
protected  int[] getRootRowIndexes(DataSet data, int[] rows)
          Get the row indexes on the root dataset.
 ShapeFrame getShapeFrame()
          Get the shape frame for getting the shape aesthetic for each element.
 SizeFrame getSizeFrame()
          Get the size frame for getting the size aesthetic for each element.
 int getStartRow()
          Get the starting row of the dataset to use for this element.
 TextFrame getTextFrame()
          Get the text frame for getting the label aesthetic for each element.
 TextSpec getTextSpec()
          Get the text label attributes.
 TextureFrame getTextureFrame()
          Get the texture frame for getting the texture aesthetic for each element.
 String getVar(int idx)
          Get the variable at the specified index.
 int getVarCount()
          Get the number of variables specified for this element.
 String[] getVars()
          Get all the variables.
 DataSet getVisualDataSet()
          Get the data set for the visual frame if it needs to be different.
 VisualFrame[] getVisualFrames()
          Get all the legend frames.
 boolean isInPlot()
          Check if the element should be kept inside the plot area.
 void removeDim(int idx)
          Remove the dimension at the specified index.
 void removeVar(int idx)
          Remove the variable at the specified index.
 void setCollisionModifier(int option)
          Set the option to handle collisions.
 void setColorFrame(ColorFrame colors)
          Set the color frame for getting the color aesthetic for each element.
 void setComparator(Comparator comp)
          Set a comparator to control the drawing order of the visual objects generated for this element.
 void setEndRow(int end)
          Set the ending row of the dataset to use for this element.
 void setInPlot(boolean inside)
          Set whether this element should be kept inside the plot area.
 void setLabelPlacement(int pos)
          Set the text placement.
 void setLineFrame(LineFrame lines)
          Set the line frame for getting the line aesthetic for each element.
 void setShapeFrame(ShapeFrame shapes)
          Set the shape frame for getting the shape aesthetic for each element.
 void setSizeFrame(SizeFrame sizes)
          Set the size frame for getting the size aesthetic for each element.
 void setStartRow(int start)
          Set the starting row of the dataset to use for this element.
 void setTextFrame(TextFrame labels)
          Set the text frame for getting the label aesthetic for each element.
 void setTextSpec(TextSpec textSpec)
          Set the text label attributes.
 void setTextureFrame(TextureFrame textures)
          Set the texture frame for getting the texture aesthetic for each element.
 void setVisualDataSet(DataSet data)
          Set the data set for the visual frame if it needs to be different.
 SortedDataSet sortData(DataSet data, GGraph graph)
          Sort dataset to prepare for generating visual objects.
 boolean supportsFrame(VisualFrame frame)
          Check if the aesthetic frame is supported.
 String toString()
          Get the string representation.
 
Methods inherited from class inetsoft.graph.Graphable
getHint, getHints, setHint, setHints
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MOVE_NONE

public static final int MOVE_NONE
No collision resolution.

See Also:
Constant Field Values

MOVE_CENTER

public static final int MOVE_CENTER
Center the objects at tick position.

See Also:
Constant Field Values

MOVE_DODGE

public static final int MOVE_DODGE
Move objects side ways to avoid overlapping.

See Also:
Constant Field Values

MOVE_STACK

public static final int MOVE_STACK
Stack objects.

See Also:
Constant Field Values

MOVE_JITTER

public static final int MOVE_JITTER
Randomly shift points to reduce overlapping.

See Also:
Constant Field Values

DODGE_SYMMETRIC

public static final int DODGE_SYMMETRIC
Dodge and center objects.

See Also:
Constant Field Values

STACK_SYMMETRIC

public static final int STACK_SYMMETRIC
Stack, dodge, and center objects.

See Also:
Constant Field Values

HINT_EXPLODED

public static final String HINT_EXPLODED
Hint to explode a slice of a pie, string of true or false.

See Also:
Constant Field Values

HINT_SHINE

public static final String HINT_SHINE
Hint to add a shining effect to paint, string of true or false.

See Also:
Constant Field Values

HINT_ALPHA

public static final String HINT_ALPHA
Transparency value for color, a double value from 0 to 1.

See Also:
Constant Field Values

HINT_MAX_COUNT

public static final String HINT_MAX_COUNT
Hint for the geometry max count limit, an integer value.

See Also:
Constant Field Values

HINT_CLIP

public static final String HINT_CLIP
Hint to clip the plot area for drawing this element, a string of true or false.

See Also:
Constant Field Values

HINT_MAX_WIDTH

public static final String HINT_MAX_WIDTH
The maximum plot (single sub-graph) width, a number.

See Also:
Constant Field Values

HINT_MAX_HEIGHT

public static final String HINT_MAX_HEIGHT
The maximum plot (single sub-graph) height, a number.

See Also:
Constant Field Values
Constructor Detail

GraphElement

protected GraphElement()
Create an empty graph element. Column binding must be defined using addDim.


GraphElement

protected GraphElement(String field)
Create a graph element for a single column (1d).


GraphElement

protected GraphElement(String field1,
                       String field2)
Create a graph element for two columns (2d).


GraphElement

protected GraphElement(String field1,
                       String field2,
                       String field3)
Create a graph element for three columns (3d).

Method Detail

createVisualModel

protected VisualModel createVisualModel(DataSet data)
Create a visual model for the graph element.


addDim

public void addDim(String col)
Add a dimension to be plotted using this element.

Parameters:
col - the dimension identifier.

getDim

public String getDim(int idx)
Get the dimension at the specified index.

Parameters:
idx - the dim index.

getDimCount

public int getDimCount()
Get the number of dimensions specified for this element.


removeDim

public void removeDim(int idx)
Remove the dimension at the specified index.

Parameters:
idx - the dim index.

clearDims

public void clearDims()
Remove all dimensions.


getDims

public String[] getDims()
Get all the dimensions.


addVar

public void addVar(String col)
Add a variable to be plotted using this element.

Parameters:
col - the variable identifier.

getVar

public String getVar(int idx)
Get the variable at the specified index.

Parameters:
idx - the var index.

getVarCount

public int getVarCount()
Get the number of variables specified for this element.


removeVar

public void removeVar(int idx)
Remove the variable at the specified index.

Parameters:
idx - the var index.

clearVars

public void clearVars()
Remove all variables.


getVars

public String[] getVars()
Get all the variables.


setCollisionModifier

public void setCollisionModifier(int option)
Set the option to handle collisions. The collision modifiers may not be supported by all elements.

Parameters:
option - an option defined in this class, e.g. DODGE_SYMMETRIC.

getCollisionModifier

public int getCollisionModifier()
Get the collision handling option.

Returns:
an int represent collision handling option, an option defined in this class, e.g. DODGE_SYMMETRIC.

setInPlot

public void setInPlot(boolean inside)
Set whether this element should be kept inside the plot area. If set to true and the element extends outside of the plot, the plot area is scaled to push the object inside. The default is true.

Specified by:
setInPlot in class Graphable

isInPlot

public boolean isInPlot()
Check if the element should be kept inside the plot area.

Specified by:
isInPlot in class Graphable

setColorFrame

public void setColorFrame(ColorFrame colors)
Set the color frame for getting the color aesthetic for each element.


getColorFrame

public ColorFrame getColorFrame()
Get the color frame for getting the color aesthetic for each element.


setSizeFrame

public void setSizeFrame(SizeFrame sizes)
Set the size frame for getting the size aesthetic for each element.


getSizeFrame

public SizeFrame getSizeFrame()
Get the size frame for getting the size aesthetic for each element.


setShapeFrame

public void setShapeFrame(ShapeFrame shapes)
Set the shape frame for getting the shape aesthetic for each element.


getShapeFrame

public ShapeFrame getShapeFrame()
Get the shape frame for getting the shape aesthetic for each element.


setTextureFrame

public void setTextureFrame(TextureFrame textures)
Set the texture frame for getting the texture aesthetic for each element.


getTextureFrame

public TextureFrame getTextureFrame()
Get the texture frame for getting the texture aesthetic for each element.


setTextFrame

public void setTextFrame(TextFrame labels)
Set the text frame for getting the label aesthetic for each element.


getTextFrame

public TextFrame getTextFrame()
Get the text frame for getting the label aesthetic for each element.


setLineFrame

public void setLineFrame(LineFrame lines)
Set the line frame for getting the line aesthetic for each element.


getLineFrame

public LineFrame getLineFrame()
Get the line frame for getting the line aesthetic for each element.


supportsFrame

public boolean supportsFrame(VisualFrame frame)
Check if the aesthetic frame is supported.


getTextSpec

public TextSpec getTextSpec()
Get the text label attributes.


setTextSpec

public void setTextSpec(TextSpec textSpec)
Set the text label attributes.


getLabelPlacement

public int getLabelPlacement()
Get the text placement.


setLabelPlacement

public void setLabelPlacement(int pos)
Set the text placement.

Parameters:
pos - one of GraphConstants.TOP, LEFT, BOTTOM, RIGHT, CENTER, AUTO.

setComparator

public void setComparator(Comparator comp)
Set a comparator to control the drawing order of the visual objects generated for this element.


getComparator

public Comparator getComparator()
Get the comparator.


getRootColIndex

protected int getRootColIndex(DataSet data,
                              String column)
Get the col index on the root dataset.

Parameters:
data - the chartLens to plot using this element.
column - the specified column name.

getRootRowIndex

protected int getRootRowIndex(DataSet data,
                              int row)
Get the row index on the root dataset.

Parameters:
data - the chartLens to plot using this element.
row - the row index for the dataset.

getRootRowIndexes

protected int[] getRootRowIndexes(DataSet data,
                                  int[] rows)
Get the row indexes on the root dataset.

Parameters:
data - the chartLens to plot using this element.
rows - the row indexes for the dataset.

getVisualFrames

public VisualFrame[] getVisualFrames()
Get all the legend frames.

Returns:
all the legend frames applied on this graph element.

sortData

public SortedDataSet sortData(DataSet data,
                              GGraph graph)
Sort dataset to prepare for generating visual objects.

Returns:
sorted dataset or null if no sorting is necessary.

setStartRow

public void setStartRow(int start)
Set the starting row of the dataset to use for this element. The default is 0.


getStartRow

public int getStartRow()
Get the starting row of the dataset to use for this element.


setEndRow

public void setEndRow(int end)
Set the ending row of the dataset to use for this element.

Parameters:
end - the ending row (non-inclusive). Use -1 to use all rows.

getEndRow

public int getEndRow()
Get the ending row of the dataset to use for this element.


setVisualDataSet

public void setVisualDataSet(DataSet data)
Set the data set for the visual frame if it needs to be different.


getVisualDataSet

public DataSet getVisualDataSet()
Get the data set for the visual frame if it needs to be different.


toString

public String toString()
Get the string representation.

Overrides:
toString in class Graphable

equalsContent

public boolean equalsContent(Object obj)
Check if equals another objects in structure.


clone

public Object clone()
Clone this object.

Overrides:
clone in class Object
Returns:
the cloned object.

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.