Package com.macrofocus.treemap
Interface TreeMapModel<N,Row,Column,Color,Font>
-
- Type Parameters:
N
- the type of nodes
- All Known Implementing Classes:
AbstractTreeMapModel
,DefaultTreeMapModel
,SwingTreeMapModel
@JsType public interface TreeMapModel<N,Row,Column,Color,Font>
Main interface for the model part of TreeMap.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_CURRENT_ROOT
static java.lang.String
PROPERTY_PROGRESS
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addListener(TreeMapListener treeMapListener)
Add a listener for receiving interesting events about changes in the model.java.lang.Iterable<N>
breadthFirstIterator(N parent)
Creates and returns an iterable that traverses the subhierarchy rooted at the give node in breadth-first order.java.lang.Iterable<Column>
columns()
com.macrofocus.colormap.MutableColorMap
createDefaultColorMap(TreeMapField<N,Column> field)
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.Object
getAggregateValue(N node, TreeMapField<N,Column> field)
Returns the aggregated value of a variable for a given node.java.awt.geom.Rectangle2D
getBounds(N node)
Gets the bounding rectangle of the item in the map.com.macrofocus.colormap.MutableColorMap<Color>
getCategoricalColorMap(Column columnIndex)
int
getChildCount(N node)
Returns the number of children of a given node.java.lang.Iterable<N>
getChildren(N parent)
Returns an iterator of the children of the given node.TreeMapField<N,Column>
getChildrenGroupByField(N node)
Gets the depth in hierarchy.java.lang.Iterable<N>
getChildrenOfTypeParent(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.com.macrofocus.igraphics.CPColorFactory<Color>
getColorFactory()
com.macrofocus.colormap.MutableColorMap<Color>
getColorMap(TreeMapField<N,Column> field)
com.macrofocus.igraphics.ColorProvider<N,Color>
getColorProvider()
java.lang.Iterable<TreeMapField<N,Column>>
getColorTreeMapFields()
java.lang.Class<?>
getColumnClass(Column columnIndex)
Returns the most specific superclass for all the cell values in the column.int
getColumnCount()
Returns the number of columns in the model.java.lang.String
getColumnName(Column columnIndex)
Returns the name of the column atcolumnIndex
.N
getCurrentRoot()
Gets the currently selected root node from which the treemap should be displayed.com.macrofocus.igraphics.CPColor<Color>
getCushionColor(N node)
Returns the color of the cushion.com.macrofocus.igraphics.CPImage
getCushionImage(N node)
Returns the image used for painting the cushion.com.macrofocus.colormap.MutableColorMap<Color>
getCustomColorMap(Column columnIndex)
com.macrofocus.molap.dataframe.DataFrame<Row,Column,?>
getDataFrame()
MutableFilter<N>
getFilter()
Obtains the model used for filtering nodes in the treemap.java.lang.String
getFormatPattern(int columnIndex)
TreeMapField<N,Column>
getGroupByField(N node)
Gets the depth in hierarchy.java.lang.Iterable<TreeMapField<N,Column>>
getGroupByTreeMapFields()
java.lang.Iterable<TreeMapField<N,Column>>
getHeightTreeMapFields()
MutableSelection<N>
getHighlighting()
Obtains the model used to highlight nodes in the treemap.com.macrofocus.igraphics.CPImageFactory
getImageFactory()
java.lang.String
getLabelName(N node)
Gets the label of the given node.java.lang.Iterable<TreeMapField<N,Column>>
getLabelsTreeMapFields()
int
getLevel(N node)
Gets the depth in hierarchy.double
getMaximumSize()
Corresponds to area in map.java.awt.Shape
getNestedShape(N node)
Gets the shape after nesting of the item in the map.N
getNode(java.awt.Point position)
/** Gets the node at the specified positionN
getNode(Row row)
double
getNormalizedLightSourceX()
Gets the the position of the light source along the X axis.double
getNormalizedLightSourceY()
Gets the the position of the light source along the Y axis.double
getNormalizedLightSourceZ()
Gets the the position of the light source along the Z axis.java.lang.Double
getNumericMax(TreeMapField<N,Column> columnIndex)
Gets the maximum value contained in the specified column.java.lang.Double
getNumericMin(TreeMapField<N,Column> columnIndex)
Gets the minimum value contained in the specified column.N
getParent(N node)
Gets the parent node of the given node.com.macrofocus.colormap.MutableColorMap<Color>
getPredefinedColorMap(Column columnIndex)
MutableSingleSelection<N>
getProbing()
Obtains the model used for probing (aka mouse over).MutableProperties<java.lang.String>
getProperties()
N
getRoot()
Returns the root node of the treemap.int
getRowCount()
Returns the number of columns in the model.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.TreeMapSettings<N,Column,Color,Font>
getSettings()
Gets the settings currently selected.java.awt.Shape
getShape(N node)
Gets the shape of the item in the map.double
getSize(N node)
Corresponds to area in map.java.lang.Iterable<TreeMapField<N,Column>>
getSizeTreeMapFields()
java.lang.String
getStringValue(N node, TreeMapField<N,Column> field)
Returns the string value for the cell atcolumnIndex
and ofnode
.double
getSumSize(N node)
java.lang.Iterable<TreeMapField<N,Column>>
getTooltipTreeMapFields()
TreeMapField<N,Column>
getTreeMapField(int columnIndex)
Gets the field corresponding to the specified column index.TreeMapField
getTreeMapField(Column columnIndex)
Gets the field corresponding to the specified column index.TreeMapField<N,Column>
getTreeMapFieldByName(java.lang.String columnName)
Gets the field corresponding to the specified column name.java.lang.Object
getValueAt(N node, Column columnIndex)
Returns the value for the cell atcolumnIndex
and ofnode
.TreeMapWorker
getWorker()
Gets the worker task updating the layout.java.util.concurrent.Future<java.lang.Void>
getWorkerFuture()
Gets the worker task updating the layout.boolean
hasNoChildren(N node)
Tells whether the given node is a leaf node or not.boolean
isDirty()
Tells whether the current layout need to be reprocessed.boolean
isEveryValueUnique(TreeMapField<N,Column> field)
Indicates whether all the values in the given field are unique.boolean
isLeaf(N node)
boolean
isNumericType(TreeMapField<N,Column> field)
boolean
isRoot(N node)
Tells whether the given node is the root node or not.boolean
isTemporalType(TreeMapField<N,Column> field)
boolean
isVisualType(TreeMapField<N,Column> field)
java.lang.Iterable<N>
parentPreorderEnumeration(N parent)
Creates and returns an iterable that traverses the subhierarchy rooted at the give node in preorder.java.lang.Iterable<N>
preorderEnumeration(N parent)
Creates and returns an iterable that traverses the subhierarchy rooted at the give node in preorder.MutableProperty<java.lang.Integer>
progressProperty()
void
removeListener(TreeMapListener treeMapListener)
Remove a listener from the list of listeners that should be notified about changes in the model.void
setColor(N node, com.macrofocus.igraphics.CPColor<Color> color)
Sets the color of the given node.void
setColorProvider(com.macrofocus.igraphics.ColorProvider<N,Color> colorProvider)
void
setCurrentRoot(N currentRoot)
Sets the currently selected root node from which the treemap should be displayed.void
setFormatPattern(int columnIndex, java.lang.String pattern)
void
setNestedShape(N node, java.awt.Shape shape)
Sets the shape after nesting of the item in the map.void
setNumericMax(TreeMapField columnIndex, double max)
Sets the maximum value contained in the specified column.void
setNumericMin(TreeMapField columnIndex, double min)
Sets the minimum value contained in the specified column.void
setShape(N node, java.awt.Shape shape)
Sets the shape of the item in the map.void
waitUntilReady()
Wait until all processing are completed.
-
-
-
Field Detail
-
PROPERTY_PROGRESS
static final java.lang.String PROPERTY_PROGRESS
- See Also:
- Constant Field Values
-
PROPERTY_CURRENT_ROOT
static final java.lang.String PROPERTY_CURRENT_ROOT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getProperties
MutableProperties<java.lang.String> getProperties()
-
getGroupByTreeMapFields
java.lang.Iterable<TreeMapField<N,Column>> getGroupByTreeMapFields()
-
getSizeTreeMapFields
java.lang.Iterable<TreeMapField<N,Column>> getSizeTreeMapFields()
-
getColorTreeMapFields
java.lang.Iterable<TreeMapField<N,Column>> getColorTreeMapFields()
-
getHeightTreeMapFields
java.lang.Iterable<TreeMapField<N,Column>> getHeightTreeMapFields()
-
getLabelsTreeMapFields
java.lang.Iterable<TreeMapField<N,Column>> getLabelsTreeMapFields()
-
getTooltipTreeMapFields
java.lang.Iterable<TreeMapField<N,Column>> getTooltipTreeMapFields()
-
isNumericType
boolean isNumericType(TreeMapField<N,Column> field)
-
isTemporalType
boolean isTemporalType(TreeMapField<N,Column> field)
-
isVisualType
boolean isVisualType(TreeMapField<N,Column> field)
-
getColorMap
com.macrofocus.colormap.MutableColorMap<Color> getColorMap(TreeMapField<N,Column> field)
-
getCategoricalColorMap
com.macrofocus.colormap.MutableColorMap<Color> getCategoricalColorMap(Column columnIndex)
-
getPredefinedColorMap
com.macrofocus.colormap.MutableColorMap<Color> getPredefinedColorMap(Column columnIndex)
-
getCustomColorMap
com.macrofocus.colormap.MutableColorMap<Color> getCustomColorMap(Column columnIndex)
-
createDefaultColorMap
com.macrofocus.colormap.MutableColorMap createDefaultColorMap(TreeMapField<N,Column> field)
-
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
-
setShape
@JsIgnore void setShape(N node, java.awt.Shape shape)
Sets the shape of the item in the map.- Parameters:
node
- the node.shape
- the shape of the item in the map.
-
getShape
@JsIgnore java.awt.Shape getShape(N node)
Gets the shape of the item in the map.- Parameters:
node
- the node.- Returns:
- the shape of the item in the map.
-
setNestedShape
@JsIgnore void setNestedShape(N node, java.awt.Shape shape)
Sets the shape after nesting of the item in the map.- Parameters:
node
- the node.shape
- the shape of the item in the map.
-
getNestedShape
@JsIgnore java.awt.Shape getNestedShape(N node)
Gets the shape after nesting of the item in the map.- Parameters:
node
- the node.- Returns:
- the shape of the item in the map.
-
getBounds
@JsIgnore java.awt.geom.Rectangle2D getBounds(N node)
Gets the bounding rectangle of the item in the map.- Parameters:
node
- the node.- Returns:
- the bounding rectangle of the item in the map.
-
getLevel
int getLevel(N node)
Gets the depth in hierarchy.- Parameters:
node
- the node.- Returns:
- the depth in hierarchy.
-
getGroupByField
TreeMapField<N,Column> getGroupByField(N node)
Gets the depth in hierarchy.- Parameters:
node
- the node.- Returns:
- the depth in hierarchy.
-
getChildrenGroupByField
TreeMapField<N,Column> getChildrenGroupByField(N node)
Gets the depth in hierarchy.- Parameters:
node
- the node.- Returns:
- the depth in hierarchy.
-
getLabelName
java.lang.String getLabelName(N node)
Gets the label of the given node.- Parameters:
node
- the node.- Returns:
- its label.
-
setColorProvider
void setColorProvider(com.macrofocus.igraphics.ColorProvider<N,Color> colorProvider)
-
setColor
void setColor(N node, com.macrofocus.igraphics.CPColor<Color> color)
Sets the color of the given node.- Parameters:
node
- the node.color
- its color.
-
getColor
com.macrofocus.igraphics.CPColor<Color> getColor(N node)
Gets the color of the given node.- Parameters:
node
- the node.- Returns:
- its color.
-
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
-
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.
-
getChildren
@JsIgnore 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
-
getChildrenOfTypeParent
@JsIgnore java.lang.Iterable<N> getChildrenOfTypeParent(N parent)
Returns an iterator of the children of the given node.- Parameters:
parent
- the parent node- Returns:
- the children
-
getChildCount
int getChildCount(N node)
Returns the number of children of a given node.- Parameters:
node
- the parent node.- Returns:
- the number of children
-
getCushionImage
@JsIgnore com.macrofocus.igraphics.CPImage getCushionImage(N node)
Returns the image used for painting the cushion.- Parameters:
node
- the node- Returns:
- the cushion image
-
getCushionColor
com.macrofocus.igraphics.CPColor<Color> getCushionColor(N node)
Returns the color of the cushion.- Parameters:
node
- the node- Returns:
- the cushion color
-
parentPreorderEnumeration
@JsIgnore java.lang.Iterable<N> parentPreorderEnumeration(N parent)
Creates and returns an iterable that traverses the subhierarchy rooted at the give node in preorder. Only non-leaf nodes are included. The first node returned by the iterator's next() method is the given node.- Parameters:
parent
- the root of the hierarchy to traverse- Returns:
- an iterable that traverses the subtree rooted at this node in preorder.
-
preorderEnumeration
@JsIgnore java.lang.Iterable<N> preorderEnumeration(N parent)
Creates and returns an iterable that traverses the subhierarchy rooted at the give node in preorder. The first node returned by the iterator's next() method is the given node.- Parameters:
parent
- the root of the hierarchy to traverse- Returns:
- an iterable that traverses the subtree rooted at this node in preorder.
-
breadthFirstIterator
@JsIgnore java.lang.Iterable<N> breadthFirstIterator(N parent)
Creates and returns an iterable that traverses the subhierarchy rooted at the give node in breadth-first order. The first node returned by the iterator's next() method is the given node.- Parameters:
parent
- the root of the hierarchy to traverse- Returns:
- an iterable that traverses the subtree rooted at this node in breadth-first order.
-
depthFirstIterator
@JsIgnore 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<N,Column> getTreeMapField(int columnIndex)
Gets the field corresponding to the specified column index.- Parameters:
columnIndex
- the index of the column.- Returns:
- the field.
-
getTreeMapField
@JsIgnore TreeMapField getTreeMapField(Column columnIndex)
Gets the field corresponding to the specified column index.- Parameters:
columnIndex
- the index of the column.- Returns:
- the field.
-
getTreeMapFieldByName
TreeMapField<N,Column> getTreeMapFieldByName(java.lang.String columnName)
Gets the field corresponding to the specified column name.- Parameters:
columnName
- the name of the column.- Returns:
- the field.
-
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.
-
setNumericMax
void setNumericMax(TreeMapField columnIndex, double max)
Sets the maximum value contained in the specified column.- Parameters:
columnIndex
- the index of the column.max
- the maximum value.
-
setNumericMin
void setNumericMin(TreeMapField columnIndex, double min)
Sets the minimum value contained in the specified column.- Parameters:
columnIndex
- the index of the column.min
- the minimum value.
-
getNormalizedLightSourceX
double getNormalizedLightSourceX()
Gets the the position of the light source along the X axis.- Returns:
- the position along the X axis.
-
getNormalizedLightSourceY
double getNormalizedLightSourceY()
Gets the the position of the light source along the Y axis.- Returns:
- the position along the Y axis.
-
getNormalizedLightSourceZ
double getNormalizedLightSourceZ()
Gets the the position of the light source along the Z axis.- Returns:
- the position along the Z axis.
-
getRowCount
int getRowCount()
Returns the number of columns in the model.- Returns:
- the number of columns in the model
-
getColumnCount
int getColumnCount()
Returns the number of columns in the model.- Returns:
- the number of columns in the model
-
columns
@JsIgnore java.lang.Iterable<Column> columns()
-
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
-
getColumnClass
@JsIgnore 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.
-
getValueAt
java.lang.Object getValueAt(N node, Column columnIndex)
Returns the value for the cell atcolumnIndex
and 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
-
isEveryValueUnique
boolean isEveryValueUnique(TreeMapField<N,Column> field)
Indicates whether all the values in the given field are unique.- Parameters:
field
- the field whose whose values are to be queried- Returns:
- true if every value is unique, false otherwise
-
getAggregateValue
java.lang.Object getAggregateValue(N node, TreeMapField<N,Column> 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
-
getStringValue
java.lang.String getStringValue(N node, TreeMapField<N,Column> field)
Returns the string value for the cell atcolumnIndex
and 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
-
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
MutableSelection<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
TreeMapSettings<N,Column,Color,Font> getSettings()
Gets the settings currently selected.- Returns:
- the settings.
-
getWorker
@JsIgnore TreeMapWorker getWorker()
Gets the worker task updating the layout.- Returns:
- the worker task
-
getWorkerFuture
@JsIgnore java.util.concurrent.Future<java.lang.Void> getWorkerFuture()
Gets the worker task updating the layout.- Returns:
- the worker task
-
addListener
@JsIgnore void addListener(TreeMapListener treeMapListener)
Add a listener for receiving interesting events about changes in the model.- Parameters:
treeMapListener
- the listener to add.
-
removeListener
@JsIgnore void removeListener(TreeMapListener treeMapListener)
Remove a listener from the list of listeners that should be notified about changes in the model.- Parameters:
treeMapListener
- the listener to remove.
-
getNode
@JsIgnore N getNode(java.awt.Point position)
/** Gets the node at the specified position- Parameters:
position
- the position- Returns:
- the node at that position
-
isDirty
boolean isDirty()
Tells whether the current layout need to be reprocessed.- Returns:
- true if the current layout is dirty, false otherwise
-
waitUntilReady
void waitUntilReady()
Wait until all processing are completed.
-
getSumSize
double getSumSize(N node)
-
progressProperty
MutableProperty<java.lang.Integer> progressProperty()
-
getFormatPattern
java.lang.String getFormatPattern(int columnIndex)
-
setFormatPattern
void setFormatPattern(int columnIndex, java.lang.String pattern)
-
getColorFactory
com.macrofocus.igraphics.CPColorFactory<Color> getColorFactory()
-
getImageFactory
com.macrofocus.igraphics.CPImageFactory getImageFactory()
-
-