public class IlvSubTreeSetModel extends IlvFilterTreeSetModel
IlvTreeSetModel
.
It is specified through a node of the given model called the "focus";
this node becomes the root of this model. If the focus node is not
contained in the original model, this model is empty.BEFORE_COLUMN_REMOVED_MASK, BEFORE_DATA_CHANGE_MASK, BEFORE_OBJECTS_REMOVED_MASK, DURING_OBJECTS_REMOVED_MASK
Constructor and Description |
---|
IlvSubTreeSetModel(IlvTreeSetModel model,
Object focus)
Creates a subtree model.
|
IlvSubTreeSetModel(IlvTreeSetModel model,
Object focus,
int eventsMaskHint)
Creates a subtree model.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Returns a copy of this object.
|
void |
disconnect()
Drops references to objects to help garbage collection.
|
void |
dispose()
Cleans up this model and drops references to objects to
help garbage collection.
|
Object |
getFocus()
Returns the focus.
|
TreePath |
getPath(Object object)
Returns the path from the root to the given object.
|
Object |
getRoot()
This method is implemented through a call to the underlying model.
|
int |
getSupportedEventsMask()
Returns a bit mask denoting the optional kinds of events that are guaranteed
to be sent by this model to the registered listeners.
|
void |
noteBeforeColumnRemoved(int column,
IlvDataColumnInfo columnInfo)
Reacts on a
BEFORE_COLUMN_REMOVED event from the underlying model. |
void |
noteBeforeDataChange(Object object,
TreePath objectPath,
boolean recursive,
int column)
Reacts on a
BEFORE_DATA_CHANGED event from the underlying model. |
void |
noteBeforeObjectsRemoved(Object parent,
TreePath parentPath,
Object[] objects)
Reacts on a
BEFORE_OBJECTS_REMOVED event from the underlying model. |
void |
noteDataChanged(Object object,
TreePath objectPath,
boolean recursive,
int column)
Reacts on a
DATA_CHANGED event from the underlying model. |
void |
noteDuringObjectsRemoved(Object parent,
TreePath parentPath,
Object[] objects)
Reacts on a
DURING_OBJECTS_REMOVED event from the underlying model. |
void |
noteObjectsAdded(Object parent,
TreePath parentPath,
Object[] objects)
Reacts on an
OBJECTS_ADDED event from the underlying model. |
void |
noteObjectsRemoved(Object parent,
TreePath parentPath,
Object[] objects)
Reacts on an
OBJECTS_REMOVED event from the underlying model. |
fireBeforeColumnRemoved, fireBeforeDataChange, fireBeforeObjectsRemoved, fireColumnAdded, fireColumnPropertyChanged, fireColumnRemoved, fireDataChanged, fireDuringObjectsRemoved, fireObjectsAdded, fireObjectsRemoved, getChildren, getColumn, getColumnCount, getDoubleAt, getFilteredModel, getValueAt, noteColumnAdded, noteColumnPropertyChanged, noteColumnRemoved, setDoubleAt, setFilteredModel, setValueAt
addTreeSetModelListener, convertToDouble, endBatch, fireModelEvent, postOrderIterator, preOrderIterator, removeTreeSetModelListener, startBatch
public IlvSubTreeSetModel(IlvTreeSetModel model, Object focus)
model
- The original model.focus
- The root of the subtree.public IlvSubTreeSetModel(IlvTreeSetModel model, Object focus, int eventsMaskHint)
model
- The original model.focus
- The root of the subtree.eventsMaskHint
- Desired events mask. This is just a hint; there is
no guarantee that the event types designated by the
mask are supported by this model.public Object getRoot()
getRoot
in interface IlvTreeSetModel
getRoot
in class IlvFilterTreeSetModel
public TreePath getPath(Object object)
getPath
in interface IlvTreeSetModel
getPath
in class IlvFilterTreeSetModel
object
- An object in the model.TreePath
whose first component is
getRoot()
and whose last component is the given
object.public int getSupportedEventsMask()
This implementation returns the event mask of the underlying model,
intersected with the eventsMaskHint constructor argument and
with
BEFORE_DATA_CHANGE_MASK | BEFORE_OBJECTS_REMOVED_MASK | DURING_OBJECTS_REMOVED_MASK | BEFORE_COLUMN_REMOVED_MASK
.
It may need to be overridden in subclasses.
getSupportedEventsMask
in interface IlvTreeSetModel
getSupportedEventsMask
in class IlvFilterTreeSetModel
IlvTreeSetModel.BEFORE_DATA_CHANGE_MASK
,
IlvTreeSetModel.BEFORE_OBJECTS_REMOVED_MASK
,
IlvTreeSetModel.BEFORE_COLUMN_REMOVED_MASK
public void noteDataChanged(Object object, TreePath objectPath, boolean recursive, int column)
DATA_CHANGED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireDataChanged
.
noteDataChanged
in class IlvFilterTreeSetModel
object
- The object whose attributes have changedobjectPath
- The path from the root to the objectrecursive
- true
if the attributes of the entire subtree have
changed, false
for a change affecting only the single
object.column
- Column that changed, or -1 for all columns.public void noteBeforeDataChange(Object object, TreePath objectPath, boolean recursive, int column)
BEFORE_DATA_CHANGED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireBeforeDataChange
.
noteBeforeDataChange
in class IlvFilterTreeSetModel
object
- The object whose attributes will changeobjectPath
- The path from the root to the objectrecursive
- true
if the attributes of the entire subtree will
change, false
for a change affecting only the single
object.column
- Column that will change, or -1 for all columns.public void noteObjectsAdded(Object parent, TreePath parentPath, Object[] objects)
OBJECTS_ADDED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireObjectsAdded
.
noteObjectsAdded
in class IlvFilterTreeSetModel
parent
- The parent object of the set of objects that were
added, or null
for a root change.parentPath
- The path from the root to the parent object, or
null
for a root change.objects
- The set of objects that was added
(together with their entire subtrees).public void noteObjectsRemoved(Object parent, TreePath parentPath, Object[] objects)
OBJECTS_REMOVED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireObjectsRemoved
.
noteObjectsRemoved
in class IlvFilterTreeSetModel
parent
- The parent object of the set of objects that were
removed, or null
for a root change.parentPath
- The path from the root to the parent object, or
null
for a root change.objects
- The set of objects that was removed
(together with their entire subtrees).public void noteBeforeObjectsRemoved(Object parent, TreePath parentPath, Object[] objects)
BEFORE_OBJECTS_REMOVED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireBeforeObjectsRemoved
.
noteBeforeObjectsRemoved
in class IlvFilterTreeSetModel
parent
- The parent object of the set of objects that will be
removed, or null
for a root change.parentPath
- The path from the root to the parent object, or
null
for a root change.objects
- The set of objects that will be removed
(together with their entire subtrees).public void noteDuringObjectsRemoved(Object parent, TreePath parentPath, Object[] objects)
DURING_OBJECTS_REMOVED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireDuringObjectsRemoved
.
noteDuringObjectsRemoved
in class IlvFilterTreeSetModel
parent
- The parent object of the set of objects that will be
removed, or null
for a root change.parentPath
- The path from the root to the parent object, or
null
for a root change.objects
- The set of objects that will be removed
(together with their entire subtrees).public void noteBeforeColumnRemoved(int column, IlvDataColumnInfo columnInfo)
BEFORE_COLUMN_REMOVED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireBeforeColumnRemoved
.
noteBeforeColumnRemoved
in class IlvFilterTreeSetModel
column
- The column that will be removed (index before removing).columnInfo
- The IlvDataColumnInfo
of the column that
will be removed.public Object getFocus()
public void dispose()
Note: After calling this function, this model is no longer functional.
dispose
in class IlvFilterTreeSetModel
public void disconnect()
Note: After calling this function, and after some changes occurred in the underlying model, this model is no longer functional.
disconnect
in class IlvFilterTreeSetModel
public Object clone()
clone
in class IlvFilterTreeSetModel
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.