Package com.macrofocus.treeplot
Interface TreePlotModel<N,Row,Column,Color,Font>
-
- Type Parameters:
N- the type of nodes
- All Known Implementing Classes:
DefaultTreePlotModel,SwingTreePlotModel
public interface TreePlotModel<N,Row,Column,Color,Font>Main interface for the model part of TreePlot.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Iterable<N>depthFirstIterator(N parent)Creates and returns an iterable that traverses the subhierarchy rooted at the give node in depth-first order.java.lang.ObjectgetAggregateValue(N node, TreeMapField field)Returns the aggregated value of a variable for a given node.java.awt.geom.GeneralPathgetCH(N node, TreeMapField xVariable, TreeMapField yVariable)java.lang.Iterable<N>getChildren(N parent)Returns an iterator of the children of the given node.com.macrofocus.igraphics.CPColor<Color>getColor(N node)Gets the color of the given node.java.lang.Class<?>getColumnClass(Column columnIndex)Returns the most specific superclass for all the cell values in the column.intgetColumnCount()Returns the number of columns in the model.java.lang.StringgetColumnName(Column columnIndex)Returns the name of the column atcolumnIndex.NgetCurrentRoot()Gets the currently selected root node from which the treemap should be displayed.MutableFilter<N>getFilter()Obtains the model used for filtering nodes in the treemap.Selection<N>getHighlighting()Obtains the model used to highlight nodes in the treemap.doublegetMaximumSize()Corresponds to area in map.doublegetMaximumSize(N parent)Corresponds to area in map.java.awt.geom.Ellipse2DgetMEC(N node, TreeMapField xVariable, TreeMapField yVariable)java.lang.DoublegetNumericMax(TreeMapField<N,Column> columnIndex)Gets the maximum value contained in the specified column.java.lang.DoublegetNumericMax(TreeMapField columnIndex, N root)Gets the maximum value contained in the specified column.java.lang.DoublegetNumericMin(TreeMapField<N,Column> columnIndex)Gets the minimum value contained in the specified column.java.lang.DoublegetNumericMin(TreeMapField columnIndex, N root)Gets the minimum value contained in the specified column.NgetParent(N node)Gets the parent node of the given node.MutableSingleSelection<N>getProbing()Obtains the model used for probing (aka mouse over).NgetRoot()Returns the root node of the treemap.MutableFilter<N>getSearch()Obtains the model used to carry out search in the treemap.MutableSelection<N>getSelection()Obtains the model used for selecting nodes in the treemap.TreePlotSettings<Color,Font>getSettings()Gets the settings currently selected.doublegetSize(N node)Corresponds to area in map.java.lang.StringgetStringValue(N node, TreeMapField field)Returns the string value for the cell atcolumnIndexand ofnode.TreeMapFieldgetTreeMapField(int columnIndex)Gets the field corresponding to the specified column index.TreeMapFieldgetTreeMapField(java.lang.String columnName)Gets the field corresponding to the specified column name.TreeMapModel<N,Row,Column,Color,Font>getTreeMapModel()java.lang.ObjectgetValueAt(N node, Column columnIndex)Returns the value for the cell atcolumnIndexand ofnode.java.lang.Iterable<TreeMapField<N,Column>>getXTreeMapFields()MutableSingleSelection<TreeMapField<N,Column>>getXVariable()java.lang.Iterable<TreeMapField<N,Column>>getYTreeMapFields()MutableSingleSelection<TreeMapField<N,Column>>getYVariable()booleanhasNoChildren(N node)Tells whether the given node is a leaf node or not.booleanisLeaf(N node)booleanisNumericType(TreeMapField<N,Column> field)booleanisRoot(N node)Tells whether the given node is the root node or not.booleanisTemporalType(TreeMapField<N,Column> field)booleanisVisualType(TreeMapField<N,Column> field)voidsetCurrentRoot(N currentRoot)Sets the currently selected root node from which the treemap should be displayed.
-
-
-
Method Detail
-
isNumericType
boolean isNumericType(TreeMapField<N,Column> field)
-
isTemporalType
boolean isTemporalType(TreeMapField<N,Column> field)
-
isVisualType
boolean isVisualType(TreeMapField<N,Column> field)
-
getXVariable
MutableSingleSelection<TreeMapField<N,Column>> getXVariable()
-
getXTreeMapFields
java.lang.Iterable<TreeMapField<N,Column>> getXTreeMapFields()
-
getYVariable
MutableSingleSelection<TreeMapField<N,Column>> getYVariable()
-
getYTreeMapFields
java.lang.Iterable<TreeMapField<N,Column>> getYTreeMapFields()
-
getSize
double getSize(N node)
Corresponds to area in map.- Parameters:
node- the node.- Returns:
- the area
-
getMaximumSize
double getMaximumSize()
Corresponds to area in map.- Returns:
- the maximum area
-
getMaximumSize
double getMaximumSize(N parent)
Corresponds to area in map.- Returns:
- the maximum area
-
getRoot
N getRoot()
Returns the root node of the treemap.- Returns:
- the root node.
-
getCurrentRoot
N getCurrentRoot()
Gets the currently selected root node from which the treemap should be displayed.- Returns:
- the currently selected root node.
-
setCurrentRoot
void setCurrentRoot(N currentRoot)
Sets the currently selected root node from which the treemap should be displayed.- Parameters:
currentRoot- the root node to use for display.
-
getProbing
MutableSingleSelection<N> getProbing()
Obtains the model used for probing (aka mouse over).- Returns:
- the model used for probing.
-
getHighlighting
Selection<N> getHighlighting()
Obtains the model used to highlight nodes in the treemap.- Returns:
- the model used for highlighting.
-
getSelection
MutableSelection<N> getSelection()
Obtains the model used for selecting nodes in the treemap.- Returns:
- the model used for selection.
-
getFilter
MutableFilter<N> getFilter()
Obtains the model used for filtering nodes in the treemap.- Returns:
- the model used for filtering.
-
getSearch
MutableFilter<N> getSearch()
Obtains the model used to carry out search in the treemap.- Returns:
- the model used for searching.
-
getSettings
TreePlotSettings<Color,Font> getSettings()
Gets the settings currently selected.- Returns:
- the settings.
-
getNumericMax
java.lang.Double getNumericMax(TreeMapField<N,Column> columnIndex)
Gets the maximum value contained in the specified column.- Parameters:
columnIndex- the index of the column.- Returns:
- the maximum value.
-
getNumericMin
java.lang.Double getNumericMin(TreeMapField<N,Column> columnIndex)
Gets the minimum value contained in the specified column.- Parameters:
columnIndex- the index of the column.- Returns:
- the minimum value.
-
getNumericMax
java.lang.Double getNumericMax(TreeMapField columnIndex, N root)
Gets the maximum value contained in the specified column.- Parameters:
columnIndex- the index of the column.- Returns:
- the maximum value.
-
getNumericMin
java.lang.Double getNumericMin(TreeMapField columnIndex, N root)
Gets the minimum value contained in the specified column.- Parameters:
columnIndex- the index of the column.- Returns:
- the minimum value.
-
depthFirstIterator
java.lang.Iterable<N> depthFirstIterator(N parent)
Creates and returns an iterable that traverses the subhierarchy rooted at the give node in depth-first order. The first node returned by the iterator's next() method is the leftmost leaf.- Parameters:
parent- the root of the hierarchy to traverse- Returns:
- an iterable that traverses the subtree rooted at this node in depth-first order.
-
getTreeMapField
TreeMapField getTreeMapField(int columnIndex)
Gets the field corresponding to the specified column index.- Parameters:
columnIndex- the index of the column.- Returns:
- the field.
-
getTreeMapField
TreeMapField getTreeMapField(java.lang.String columnName)
Gets the field corresponding to the specified column name.- Parameters:
columnName- the name of the column.- Returns:
- the field.
-
hasNoChildren
boolean hasNoChildren(N node)
Tells whether the given node is a leaf node or not.- Parameters:
node- the node- Returns:
- true if it is a leaf node, false otherwise.
-
isLeaf
boolean isLeaf(N node)
-
getParent
N getParent(N node)
Gets the parent node of the given node.- Parameters:
node- the node- Returns:
- its parent
-
getColumnName
java.lang.String getColumnName(Column columnIndex)
Returns the name of the column atcolumnIndex. Note: this name does not need to be unique; two columns in a table can have the same name.- Parameters:
columnIndex- the index of the column- Returns:
- the name of the column
-
getValueAt
java.lang.Object getValueAt(N node, Column columnIndex)
Returns the value for the cell atcolumnIndexand ofnode.- Parameters:
node- the node whose value is to be queriedcolumnIndex- the column whose value is to be queried- Returns:
- the value Object at the specified cell
-
getAggregateValue
java.lang.Object getAggregateValue(N node, TreeMapField field)
Returns the aggregated value of a variable for a given node.- Parameters:
node- the node whose value is to be queriedfield- the field whose value is to be queried- Returns:
- the value Object at the specified cell
-
getChildren
java.lang.Iterable<N> getChildren(N parent)
Returns an iterator of the children of the given node.- Parameters:
parent- the parent node- Returns:
- the children
-
getColor
com.macrofocus.igraphics.CPColor<Color> getColor(N node)
Gets the color of the given node.- Parameters:
node- the node.- Returns:
- its color.
-
getStringValue
java.lang.String getStringValue(N node, TreeMapField field)
Returns the string value for the cell atcolumnIndexand ofnode.- Parameters:
node- the node whose value is to be queriedfield- the field whose value is to be queried- Returns:
- the value Object at the specified cell
-
isRoot
boolean isRoot(N node)
Tells whether the given node is the root node or not.- Parameters:
node- the node- Returns:
- true if it is the root node, false otherwise.
-
getColumnCount
int getColumnCount()
Returns the number of columns in the model.- Returns:
- the number of columns in the model
-
getColumnClass
java.lang.Class<?> getColumnClass(Column columnIndex)
Returns the most specific superclass for all the cell values in the column.- Parameters:
columnIndex- the index of the column- Returns:
- the common ancestor class of the object values in the model.
-
getMEC
java.awt.geom.Ellipse2D getMEC(N node, TreeMapField xVariable, TreeMapField yVariable)
-
getCH
java.awt.geom.GeneralPath getCH(N node, TreeMapField xVariable, TreeMapField yVariable)
-
-