/** Process a change event from the user-supplied tree model. * Order of operations: * <ol><li>Refire the same tree event with the OutlineModel we're * proxying as the source</li> * <li>Create one or more table model events (more than one if the * incoming event affects discontiguous rows) reflecting the effect * of the tree change</li> * <li>Call the method with the same signature as this one on the * layout cache, so it will update its state appropriately</li> * <li>Fire the generated TableModelEvent(s)</li></ol> */ public void treeNodesChanged(TreeModelEvent e) { assert SwingUtilities.isEventDispatchThread(); fireTreeChange (translateEvent(e), NODES_CHANGED); TableModelEvent[] events = translateEvent(e, NODES_CHANGED); getLayout().treeNodesChanged(e); fireTableChange(events); }
/** Process a node removal event from the user-supplied tree model * Order of operations: * <ol><li>Refire the same tree event with the OutlineModel we're * proxying as the source</li> * <li>Create one or more table model events (more than one if the * incoming event affects discontiguous rows) reflecting the effect * of the tree change</li> * <li>Call the method with the same signature as this one on the * layout cache, so it will update its state appropriately</li> * <li>Fire the generated TableModelEvent(s)</li></ol> */ public void treeNodesRemoved(TreeModelEvent e) { assert SwingUtilities.isEventDispatchThread(); fireTreeChange (translateEvent(e), NODES_REMOVED); TableModelEvent[] events = translateEvent(e, NODES_REMOVED); getLayout().treeNodesRemoved(e); fireTableChange(events); }
/** Process a node insertion event from the user-supplied tree model * Order of operations: * <ol><li>Refire the same tree event with the OutlineModel we're * proxying as the source</li> * <li>Create one or more table model events (more than one if the * incoming event affects discontiguous rows) reflecting the effect * of the tree change</li> * <li>Call the method with the same signature as this one on the * layout cache, so it will update its state appropriately</li> * <li>Fire the generated TableModelEvent(s)</li></ol> */ public void treeNodesInserted(TreeModelEvent e) { assert SwingUtilities.isEventDispatchThread(); fireTreeChange (translateEvent(e), NODES_INSERTED); TableModelEvent[] events = translateEvent(e, NODES_INSERTED); getLayout().treeNodesInserted(e); fireTableChange(events); }
/** Process a structural change event from the user-supplied tree model. * This will result in a generic "something changed" * TableModelEvent being fired. */ public void treeStructureChanged(TreeModelEvent e) { assert SwingUtilities.isEventDispatchThread(); getLayout().treeStructureChanged(e); fireTreeChange (translateEvent(e), STRUCTURE_CHANGED); //If it's a structural change, we need to dump all our info about the //existing tree structure - it can be bogus now. Similar to JTree, //this will have the effect of collapsing all expanded paths. The //TreePathSupport takes care of dumping the layout cache's copy of //such data getTreePathSupport().clear(); //We will just fire a "Something happened. Go figure out what." event. fireTableChange (new TableModelEvent (getModel())); }