Package com.treemap.treeplot
Class DefaultTreePlotModel<N,Row,Column,Color,Font>
java.lang.Object
com.treemap.treeplot.DefaultTreePlotModel<N,Row,Column,Color,Font>
- All Implemented Interfaces:
TreePlotModel<N,Row, Column, Color, Font>
- Direct Known Subclasses:
SwingTreePlotModel
public class DefaultTreePlotModel<N,Row,Column,Color,Font>
extends Object
implements TreePlotModel<N,Row,Column,Color,Font>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final MutableSingleSelection<TreeMapField<N, Column>> protected final MutableSingleSelection<TreeMapField<N, Column>> -
Constructor Summary
ConstructorsConstructorDescriptionDefaultTreePlotModel(TreeMapModel<N, Row, Column, Color, Font> tmm, com.macrofocus.igraphics.CPColorFactory<Color> colorFactory, com.macrofocus.igraphics.CPFontFactory<Font> fontFactory, com.macrofocus.crossplatform.CPHelper helper) -
Method Summary
Modifier and TypeMethodDescriptiondepthFirstIterator(N parent) Creates and returns an iterable that traverses the subhierarchy rooted at the give node in depth-first order.getAggregateValue(N node, TreeMapField field) Returns the aggregated value of a variable for a given node.com.macrofocus.geom.GeneralPathgetCH(N node, TreeMapField xVariable, TreeMapField yVariable) getChildren(N parent) Returns an iterator of the children of the given node.com.macrofocus.igraphics.CPColor<Color> Gets the color of the given node.Class<?> getColumnClass(Column columnIndex) Returns the most specific superclass for all the cell values in the column.intReturns the number of columns in the model.getColumnName(Column columnIndex) Returns the name of the column atcolumnIndex.Gets the currently selected root node from which the treemap should be displayed.Obtains the model used for filtering nodes in the treemap.Obtains the model used to highlight nodes in the treemap.doubleCorresponds to area in map.doublegetMaximumSize(N parent) Corresponds to area in map.com.macrofocus.geom.Ellipse2DgetMEC(N node, TreeMapField xVariable, TreeMapField yVariable) getNumericMax(TreeMapField<N, Column> columnIndex) Gets the maximum value contained in the specified column.getNumericMax(TreeMapField columnIndex, N parent) Gets the maximum value contained in the specified column.getNumericMin(TreeMapField<N, Column> columnIndex) Gets the minimum value contained in the specified column.getNumericMin(TreeMapField columnIndex, N parent) Gets the minimum value contained in the specified column.Gets the parent node of the given node.Obtains the model used for probing (aka mouse over).getRoot()Returns the root node of the treemap.Obtains the model used to carry out search in the treemap.Obtains the model used for selecting nodes in the treemap.Gets the settings currently selected.doubleCorresponds to area in map.getStringValue(N node, TreeMapField field, TreeMapFieldSettings<Color, Font> settings) Returns the string value for the cell atcolumnIndexand ofnode.getTreeMapField(int columnIndex) Gets the field corresponding to the specified column index.getTreeMapField(String columnName) Gets the field corresponding to the specified column name.protected Iterable<TreeMapField<N, Column>> getTreeMapFields(boolean includeNone) getValueAt(N node, Column columnIndex) Returns the value for the cell atcolumnIndexand ofnode.booleanhasNoChildren(N node) Tells whether the given node is a leaf node or not.booleanbooleanisNumericType(TreeMapField<N, Column> field) booleanTells 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.
-
Field Details
-
xVariable
-
yVariable
-
-
Constructor Details
-
DefaultTreePlotModel
-
-
Method Details
-
isNumericType
- Specified by:
isNumericTypein interfaceTreePlotModel<N,Row, Column, Color, Font>
-
isTemporalType
- Specified by:
isTemporalTypein interfaceTreePlotModel<N,Row, Column, Color, Font>
-
isVisualType
- Specified by:
isVisualTypein interfaceTreePlotModel<N,Row, Column, Color, Font>
-
getSize
Corresponds to area in map. -
getMaximumSize
public double getMaximumSize()Corresponds to area in map.- Specified by:
getMaximumSizein interfaceTreePlotModel<N,Row, Column, Color, Font> - Returns:
- the maximum area
-
getMaximumSize
Corresponds to area in map.- Specified by:
getMaximumSizein interfaceTreePlotModel<N,Row, Column, Color, Font> - Returns:
- the maximum area
-
getTreeMapModel
- Specified by:
getTreeMapModelin interfaceTreePlotModel<N,Row, Column, Color, Font>
-
getXVariable
- Specified by:
getXVariablein interfaceTreePlotModel<N,Row, Column, Color, Font>
-
getXTreeMapFields
- Specified by:
getXTreeMapFieldsin interfaceTreePlotModel<N,Row, Column, Color, Font>
-
getYVariable
- Specified by:
getYVariablein interfaceTreePlotModel<N,Row, Column, Color, Font>
-
getYTreeMapFields
- Specified by:
getYTreeMapFieldsin interfaceTreePlotModel<N,Row, Column, Color, Font>
-
getTreeMapFields
-
getRoot
Returns the root node of the treemap. -
getCurrentRoot
Gets the currently selected root node from which the treemap should be displayed.- Specified by:
getCurrentRootin interfaceTreePlotModel<N,Row, Column, Color, Font> - Returns:
- the currently selected root node.
-
setCurrentRoot
Sets the currently selected root node from which the treemap should be displayed.- Specified by:
setCurrentRootin interfaceTreePlotModel<N,Row, Column, Color, Font> - Parameters:
currentRoot- the root node to use for display.
-
getProbing
Obtains the model used for probing (aka mouse over).- Specified by:
getProbingin interfaceTreePlotModel<N,Row, Column, Color, Font> - Returns:
- the model used for probing.
-
getHighlighting
Obtains the model used to highlight nodes in the treemap.- Specified by:
getHighlightingin interfaceTreePlotModel<N,Row, Column, Color, Font> - Returns:
- the model used for highlighting.
-
getSelection
Obtains the model used for selecting nodes in the treemap.- Specified by:
getSelectionin interfaceTreePlotModel<N,Row, Column, Color, Font> - Returns:
- the model used for selection.
-
getFilter
Obtains the model used for filtering nodes in the treemap. -
getSearch
Obtains the model used to carry out search in the treemap. -
getSettings
Gets the settings currently selected.- Specified by:
getSettingsin interfaceTreePlotModel<N,Row, Column, Color, Font> - Returns:
- the settings.
-
getNumericMax
Gets the maximum value contained in the specified column.- Specified by:
getNumericMaxin interfaceTreePlotModel<N,Row, Column, Color, Font> - Parameters:
columnIndex- the index of the column.- Returns:
- the maximum value.
-
getNumericMin
Gets the minimum value contained in the specified column.- Specified by:
getNumericMinin interfaceTreePlotModel<N,Row, Column, Color, Font> - Parameters:
columnIndex- the index of the column.- Returns:
- the minimum value.
-
getNumericMax
Description copied from interface:TreePlotModelGets the maximum value contained in the specified column.- Specified by:
getNumericMaxin interfaceTreePlotModel<N,Row, Column, Color, Font> - Parameters:
columnIndex- the index of the column.- Returns:
- the maximum value.
-
getNumericMin
Description copied from interface:TreePlotModelGets the minimum value contained in the specified column.- Specified by:
getNumericMinin interfaceTreePlotModel<N,Row, Column, Color, Font> - Parameters:
columnIndex- the index of the column.- Returns:
- the minimum value.
-
depthFirstIterator
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.- Specified by:
depthFirstIteratorin interfaceTreePlotModel<N,Row, Column, Color, Font> - 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
Gets the field corresponding to the specified column index.- Specified by:
getTreeMapFieldin interfaceTreePlotModel<N,Row, Column, Color, Font> - Parameters:
columnIndex- the index of the column.- Returns:
- the field.
-
getTreeMapField
Gets the field corresponding to the specified column name.- Specified by:
getTreeMapFieldin interfaceTreePlotModel<N,Row, Column, Color, Font> - Parameters:
columnName- the name of the column.- Returns:
- the field.
-
hasNoChildren
Description copied from interface:TreePlotModelTells whether the given node is a leaf node or not.- Specified by:
hasNoChildrenin interfaceTreePlotModel<N,Row, Column, Color, Font> - Parameters:
node- the node- Returns:
- true if it is a leaf node, false otherwise.
-
isLeaf
-
getParent
Gets the parent node of the given node. -
getColumnName
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.- Specified by:
getColumnNamein interfaceTreePlotModel<N,Row, Column, Color, Font> - Parameters:
columnIndex- the index of the column- Returns:
- the name of the column
-
getValueAt
Returns the value for the cell atcolumnIndexand ofnode.- Specified by:
getValueAtin interfaceTreePlotModel<N,Row, Column, Color, Font> - 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
Returns the aggregated value of a variable for a given node.- Specified by:
getAggregateValuein interfaceTreePlotModel<N,Row, Column, Color, Font> - 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
Returns an iterator of the children of the given node.- Specified by:
getChildrenin interfaceTreePlotModel<N,Row, Column, Color, Font> - Parameters:
parent- the parent node- Returns:
- the children
-
getColor
Gets the color of the given node. -
getStringValue
Returns the string value for the cell atcolumnIndexand ofnode.- Specified by:
getStringValuein interfaceTreePlotModel<N,Row, Column, Color, Font> - 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
Tells whether the given node is the root node or not. -
getColumnCount
public int getColumnCount()Returns the number of columns in the model.- Specified by:
getColumnCountin interfaceTreePlotModel<N,Row, Column, Color, Font> - Returns:
- the number of columns in the model
-
getColumnClass
Returns the most specific superclass for all the cell values in the column.- Specified by:
getColumnClassin interfaceTreePlotModel<N,Row, Column, Color, Font> - Parameters:
columnIndex- the index of the column- Returns:
- the common ancestor class of the object values in the model.
-
getMEC
-
getCH
public com.macrofocus.geom.GeneralPath getCH(N node, TreeMapField xVariable, TreeMapField yVariable)
-