| |
|
| java.lang.Object org.netbeans.swing.outline.EventBroadcaster
EventBroadcaster | final class EventBroadcaster implements TableModelListener,TreeModelListener,ExtTreeWillExpandListener,TreeExpansionListener(Code) | | Responsible for handling tree model events from the user-supplied treemodel
portion of a DefaultOutlineModel, translating them into appropriate
TableModelEvents and refiring these events to listeners on the table model.
This class could be (and originally was) incorporated directly into
DefaultOutlineModel, but is separated for better readability and separation
of concerns.
author: Tim Boudreau |
Field Summary | |
static boolean | log |
Constructor Summary | |
public | EventBroadcaster(DefaultOutlineModel model) Creates a new instance of EventBroadcaster which will
produce events for the passed DefaultOutlineModel model. |
log | static boolean log(Code) | | Debugging constant for whether logging should be enabled
|
EventBroadcaster | public EventBroadcaster(DefaultOutlineModel model)(Code) | | Creates a new instance of EventBroadcaster which will
produce events for the passed DefaultOutlineModel model.
|
addTableModelListener | public synchronized void addTableModelListener(TableModelListener l)(Code) | | Add a table model listener. All events fired by this EventBroadcaster
will have the OutlineModel as the event source
|
addTreeModelListener | public synchronized void addTreeModelListener(TreeModelListener l)(Code) | | Add a tree model listener. All events fired by this EventBroadcaster
will have the OutlineModel as the event source
|
areMoreEventsPending | public boolean areMoreEventsPending()(Code) | | Flag which is set to true while multiple TableModelEvents generated
from a single TreeModelEvent are being fired, so clients can avoid
any model queries until all pending changes have been fired. The
main thing to avoid is any mid-process repaints, which can only happen
if the response to an event will be to call paintImmediately().
This value is guaranteed to be true for the first of a group of
related events, and false if tested in response to the final event.
|
removeTableModelListener | public synchronized void removeTableModelListener(TableModelListener l)(Code) | | Remove a table model listener.
|
removeTreeModelListener | public synchronized void removeTreeModelListener(TreeModelListener l)(Code) | | Remove a tree model listener.
|
tableChanged | public void tableChanged(TableModelEvent e)(Code) | | Process a change event from the user-supplied tree model. This
method will throw an assertion failure if it receives any event type
other than TableModelEvent.UPDATE - the ProxyTableModel should never,
ever fire structural changes - only the tree model is allowed to do
that.
|
treeExpanded | public void treeExpanded(TreeExpansionEvent event)(Code) | | Updates the layout to mark the descendants of the events path as also
expanded if they were the last it was expanded, then fires a table change.
|
treeExpansionVetoed | public void treeExpansionVetoed(TreeExpansionEvent event, ExpandVetoException exception)(Code) | | Messaged if the tree expansion event (for which we will have already
constructed a TableModelEvent) was vetoed; disposes of the constructed
TableModelEvent in that circumstance.
|
treeNodesChanged | public void treeNodesChanged(TreeModelEvent e)(Code) | | Process a change event from the user-supplied tree model.
Order of operations:
- Refire the same tree event with the OutlineModel we're
proxying as the source
- Create one or more table model events (more than one if the
incoming event affects discontiguous rows) reflecting the effect
of the tree change
- Call the method with the same signature as this one on the
layout cache, so it will update its state appropriately
- Fire the generated TableModelEvent(s)
|
treeNodesInserted | public void treeNodesInserted(TreeModelEvent e)(Code) | | Process a node insertion event from the user-supplied tree model
Order of operations:
- Refire the same tree event with the OutlineModel we're
proxying as the source
- Create one or more table model events (more than one if the
incoming event affects discontiguous rows) reflecting the effect
of the tree change
- Call the method with the same signature as this one on the
layout cache, so it will update its state appropriately
- Fire the generated TableModelEvent(s)
|
treeNodesRemoved | public void treeNodesRemoved(TreeModelEvent e)(Code) | | Process a node removal event from the user-supplied tree model
Order of operations:
- Refire the same tree event with the OutlineModel we're
proxying as the source
- Create one or more table model events (more than one if the
incoming event affects discontiguous rows) reflecting the effect
of the tree change
- Call the method with the same signature as this one on the
layout cache, so it will update its state appropriately
- Fire the generated TableModelEvent(s)
|
treeStructureChanged | public void treeStructureChanged(TreeModelEvent e)(Code) | | Process a structural change event from the user-supplied tree model.
This will result in a generic "something changed"
TableModelEvent being fired.
|
treeWillCollapse | public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException(Code) | | Receives a TreeWillCollapse event and constructs a TableModelEvent
based on the pending changes while the model still reflects the unchanged
state
|
treeWillExpand | public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException(Code) | | Receives a TreeWillExpand event and constructs a TableModelEvent
based on the pending changes while the model still reflects the unchanged
state
|
|
|
|