|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.treemap.AbstractTreeMapModel<N>
N
- the type of nodespublic abstract class AbstractTreeMapModel<N extends MutableTreeMapNode>
This class provides a skeletal implementation of the TreeMapModel interface to minimize the effort required to implement this interface.
Nested Class Summary | |
---|---|
class |
AbstractTreeMapModel.Worker
|
Field Summary | |
---|---|
protected TreeMapSettings |
_settings
|
static String |
PROPERTY_HIGHLIGHTING
|
static String |
PROPERTY_PROBING
|
static String |
PROPERTY_SELECTION
|
Fields inherited from interface com.jidesoft.treemap.TreeMapModel |
---|
PROPERTY_PROGRESS |
Constructor Summary | |
---|---|
AbstractTreeMapModel()
|
Method Summary | |
---|---|
void |
addListener(TreeMapListener treeMapListener)
Add a listener for receiving interesting events about changes in the model. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list. |
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list for a specific property. |
Iterable<N> |
breadthFirstIterator(N parent)
Creates and returns an iterable that traverses the subhierarchy rooted at the give node in breadth-first order. |
protected void |
computeSize(N node,
TreeMapWorker worker)
|
protected abstract N |
createRootNode(TreeMapField<N> groupByField)
|
protected TreeMapSettings |
createSettings()
|
Iterable<N> |
depthFirstIterator(N parent)
Creates and returns an iterable that traverses the subhierarchy rooted at the give node in depth-first order. |
protected boolean |
doColors(N parent,
TreeMapWorker worker)
|
protected abstract boolean |
doGroupBy(N parent,
TreeMapWorker worker)
|
protected boolean |
doLayout(N parent,
TreeMapWorker worker)
|
protected boolean |
doLayoutChildren(N parent,
TreeMapWorker worker)
|
protected void |
firePropertyChange(String propertyName,
boolean oldValue,
boolean newValue)
Support for reporting bound property changes for boolean properties. |
protected void |
firePropertyChange(String propertyName,
int oldValue,
int newValue)
Support for reporting bound property changes for integer properties. |
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Support for reporting bound property changes for Object properties. |
ComboBoxModel |
getBackgroundModel()
|
Rectangle2D |
getBounds(N node)
Gets the bounding rectangle of the item in the map. |
TreeMapField<N> |
getChildrenGroupByField(N node)
Gets the depth in hierarchy. |
ComboBoxModel |
getColorModel()
|
N |
getCurrentRoot()
Gets the currently selected root node from which the treemap should be displayed. |
MutableValueFilter<N> |
getFilter()
Obtains the model used for filtering nodes in the treemap. |
TreeMapField<N> |
getGroupByField(N node)
Gets the depth in hierarchy. |
ComboBoxModel |
getGroupByModel()
|
ComboBoxModel |
getHeightModel()
|
List<N> |
getHighlighting()
Obtains the model used to highlight nodes in the treemap. |
ComboBoxModel |
getLabelModel()
|
int |
getLevel(N node)
Gets the depth in hierarchy. |
N |
getNode(Point p)
|
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. |
N |
getProbing()
Obtains the model used for probing (aka mouse over). |
PropertyChangeListener[] |
getPropertyChangeListeners()
Returns an array of all the property change listeners registered on this component. |
PropertyChangeListener[] |
getPropertyChangeListeners(String propertyName)
Returns an array of all the listeners which have been associated with the named property. |
N |
getRoot()
Returns the root node of the treemap. |
MutableValueFilter<N> |
getSearch()
Obtains the model used to carry out search in the treemap. |
List<N> |
getSelection()
Obtains the model used for selecting nodes in the treemap. |
TreeMapSettings |
getSettings()
Gets the settings currently selected. |
Shape |
getShape(N node)
Gets the shape of the item in the map. |
double |
getSize(N node)
Corresponds to area in map. |
ComboBoxModel |
getSizeModel()
|
String |
getStringValue(N node,
TreeMapField field)
Returns the string value for the cell at columnIndex and of
node . |
protected double |
getSumSize(N node)
|
protected TreeMapField[] |
getTreeMapFields(int... columns)
|
protected TreeMapField[] |
getTreeMapFields(String... columnNames)
|
protected Rectangle |
getViewport()
|
TreeMapWorker |
getWorker()
Gets the worker task updating the layout. |
Future<Void> |
getWorkerFuture()
Gets the worker task updating the layout. |
protected void |
initDefaults()
|
boolean |
isLeaf(N node)
Tells whether the given node is a leaf node or not. |
Iterable<N> |
preorderEnumeration(N parent)
Creates and returns an iterable that traverses the subhierarchy rooted at the give node in preorder. |
void |
removeListener(TreeMapListener treeMapListener)
Remove a listener from the list of listeners that should be notified about changes in the model. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. |
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list for a specific property. |
protected void |
scheduleUpdateColors()
|
protected void |
scheduleUpdateGroupBy()
|
protected void |
scheduleUpdateLayout()
|
void |
setColor(AbstractTreeMapNode node,
Color color)
|
void |
setCurrentRoot(N currentRoot)
Sets the currently selected root node from which the treemap should be displayed. |
void |
setHighlighting(List<N> highlighting)
|
void |
setProbing(N probing)
|
void |
setSelection(List<N> selection)
|
void |
setShape(N node,
Shape shape)
Sets the shape of the item in the map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.jidesoft.treemap.TreeMapModel |
---|
createDefaultColorMap, getChildCount, getChildren, getColor, getColumnClass, getColumnCount, getColumnName, getCushionColor, getCushionImage, getLabelName, getNumericMax, getNumericMin, getParent, getTreeMapField, getTreeMapField, getValueAt, isEveryValueUnique, isRoot, setColor, setNumericMax, setNumericMin |
Field Detail |
---|
public static final String PROPERTY_PROBING
public static final String PROPERTY_HIGHLIGHTING
public static final String PROPERTY_SELECTION
protected final TreeMapSettings _settings
Constructor Detail |
---|
public AbstractTreeMapModel()
Method Detail |
---|
protected void initDefaults()
public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
in interface TreeMapModel<N extends MutableTreeMapNode>
listener
- the PropertyChangeListener to be addedremovePropertyChangeListener(java.beans.PropertyChangeListener)
,
getPropertyChangeListeners()
,
addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
in interface TreeMapModel<N extends MutableTreeMapNode>
listener
- the PropertyChangeListener to be removedaddPropertyChangeListener(java.beans.PropertyChangeListener)
,
getPropertyChangeListeners()
,
removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
public PropertyChangeListener[] getPropertyChangeListeners()
PropertyChangeListener
s
or an empty array if no property change
listeners are currently registeredaddPropertyChangeListener(java.beans.PropertyChangeListener)
,
removePropertyChangeListener(java.beans.PropertyChangeListener)
,
getPropertyChangeListeners(java.lang.String)
,
PropertyChangeSupport.getPropertyChangeListeners()
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
addPropertyChangeListener
in interface TreeMapModel<N extends MutableTreeMapNode>
propertyName
- one of the property names listed abovelistener
- the PropertyChangeListener to be addedremovePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
,
getPropertyChangeListeners(java.lang.String)
,
addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
removePropertyChangeListener
in interface TreeMapModel<N extends MutableTreeMapNode>
propertyName
- a valid property namelistener
- the PropertyChangeListener to be removedaddPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
,
getPropertyChangeListeners(java.lang.String)
,
removePropertyChangeListener(java.beans.PropertyChangeListener)
public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
propertyName
- the property name
PropertyChangeListeners
associated with
the named property or an empty array if no listeners have
been addedaddPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
,
removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
,
getPropertyChangeListeners()
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
propertyName
- the property whose value has changedoldValue
- the property's previous valuenewValue
- the property's new valueprotected void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
propertyName
- the property whose value has changedoldValue
- the property's previous valuenewValue
- the property's new valueprotected void firePropertyChange(String propertyName, int oldValue, int newValue)
propertyName
- the property whose value has changedoldValue
- the property's previous valuenewValue
- the property's new valueprotected TreeMapSettings createSettings()
public N getProbing()
TreeMapModel
getProbing
in interface TreeMapModel<N extends MutableTreeMapNode>
public void setProbing(N probing)
setProbing
in interface TreeMapModel<N extends MutableTreeMapNode>
public List<N> getHighlighting()
TreeMapModel
getHighlighting
in interface TreeMapModel<N extends MutableTreeMapNode>
public void setHighlighting(List<N> highlighting)
setHighlighting
in interface TreeMapModel<N extends MutableTreeMapNode>
public MutableValueFilter<N> getFilter()
TreeMapModel
getFilter
in interface TreeMapModel<N extends MutableTreeMapNode>
public List<N> getSelection()
TreeMapModel
getSelection
in interface TreeMapModel<N extends MutableTreeMapNode>
public void setSelection(List<N> selection)
setSelection
in interface TreeMapModel<N extends MutableTreeMapNode>
public MutableValueFilter<N> getSearch()
TreeMapModel
getSearch
in interface TreeMapModel<N extends MutableTreeMapNode>
public TreeMapSettings getSettings()
TreeMapModel
getSettings
in interface TreeMapModel<N extends MutableTreeMapNode>
public String getStringValue(N node, TreeMapField field)
TreeMapModel
columnIndex
and of
node
.
getStringValue
in interface TreeMapModel<N extends MutableTreeMapNode>
node
- the node whose value is to be queriedfield
- the field whose value is to be queried
public void setCurrentRoot(N currentRoot)
TreeMapModel
setCurrentRoot
in interface TreeMapModel<N extends MutableTreeMapNode>
currentRoot
- the root node to use for display.public N getCurrentRoot()
TreeMapModel
getCurrentRoot
in interface TreeMapModel<N extends MutableTreeMapNode>
public N getRoot()
TreeMapModel
getRoot
in interface TreeMapModel<N extends MutableTreeMapNode>
protected abstract N createRootNode(TreeMapField<N> groupByField)
protected void scheduleUpdateGroupBy()
protected void scheduleUpdateLayout()
protected void scheduleUpdateColors()
public double getNormalizedLightSourceX()
TreeMapModel
getNormalizedLightSourceX
in interface TreeMapModel<N extends MutableTreeMapNode>
public double getNormalizedLightSourceY()
TreeMapModel
getNormalizedLightSourceY
in interface TreeMapModel<N extends MutableTreeMapNode>
public double getNormalizedLightSourceZ()
TreeMapModel
getNormalizedLightSourceZ
in interface TreeMapModel<N extends MutableTreeMapNode>
public Iterable<N> preorderEnumeration(N parent)
TreeMapModel
preorderEnumeration
in interface TreeMapModel<N extends MutableTreeMapNode>
parent
- the root of the hierarchy to traverse
public Iterable<N> breadthFirstIterator(N parent)
TreeMapModel
breadthFirstIterator
in interface TreeMapModel<N extends MutableTreeMapNode>
parent
- the root of the hierarchy to traverse
public Iterable<N> depthFirstIterator(N parent)
TreeMapModel
depthFirstIterator
in interface TreeMapModel<N extends MutableTreeMapNode>
parent
- the root of the hierarchy to traverse
public void addListener(TreeMapListener treeMapListener)
TreeMapModel
addListener
in interface TreeMapModel<N extends MutableTreeMapNode>
treeMapListener
- the listener to add.public void removeListener(TreeMapListener treeMapListener)
TreeMapModel
removeListener
in interface TreeMapModel<N extends MutableTreeMapNode>
treeMapListener
- the listener to remove.protected TreeMapField[] getTreeMapFields(int... columns)
protected TreeMapField[] getTreeMapFields(String... columnNames)
protected abstract boolean doGroupBy(N parent, TreeMapWorker worker)
protected boolean doLayout(N parent, TreeMapWorker worker)
protected Rectangle getViewport()
protected void computeSize(N node, TreeMapWorker worker)
protected boolean doLayoutChildren(N parent, TreeMapWorker worker)
protected double getSumSize(N node)
protected boolean doColors(N parent, TreeMapWorker worker)
public double getSize(N node)
getSize
in interface TreeMapModel<N extends MutableTreeMapNode>
node
- the node.
public void setShape(N node, Shape shape)
setShape
in interface TreeMapModel<N extends MutableTreeMapNode>
node
- the node.shape
- the shape of the item in the map.public Shape getShape(N node)
getShape
in interface TreeMapModel<N extends MutableTreeMapNode>
node
- the node.
public Rectangle2D getBounds(N node)
getBounds
in interface TreeMapModel<N extends MutableTreeMapNode>
node
- the node.
public int getLevel(N node)
getLevel
in interface TreeMapModel<N extends MutableTreeMapNode>
node
- the node.
public TreeMapField<N> getGroupByField(N node)
TreeMapModel
getGroupByField
in interface TreeMapModel<N extends MutableTreeMapNode>
node
- the node.
public TreeMapField<N> getChildrenGroupByField(N node)
TreeMapModel
getChildrenGroupByField
in interface TreeMapModel<N extends MutableTreeMapNode>
node
- the node.
public boolean isLeaf(N node)
isLeaf
in interface TreeMapModel<N extends MutableTreeMapNode>
node
- the node
public void setColor(AbstractTreeMapNode node, Color color)
public TreeMapWorker getWorker()
TreeMapModel
getWorker
in interface TreeMapModel<N extends MutableTreeMapNode>
public Future<Void> getWorkerFuture()
TreeMapModel
getWorkerFuture
in interface TreeMapModel<N extends MutableTreeMapNode>
public ComboBoxModel getGroupByModel()
getGroupByModel
in interface TreeMapModel<N extends MutableTreeMapNode>
public ComboBoxModel getLabelModel()
getLabelModel
in interface TreeMapModel<N extends MutableTreeMapNode>
public ComboBoxModel getBackgroundModel()
getBackgroundModel
in interface TreeMapModel<N extends MutableTreeMapNode>
public ComboBoxModel getSizeModel()
getSizeModel
in interface TreeMapModel<N extends MutableTreeMapNode>
public ComboBoxModel getHeightModel()
getHeightModel
in interface TreeMapModel<N extends MutableTreeMapNode>
public ComboBoxModel getColorModel()
getColorModel
in interface TreeMapModel<N extends MutableTreeMapNode>
public N getNode(Point p)
getNode
in interface TreeMapModel<N extends MutableTreeMapNode>
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |