Example usage for javax.swing.event TreeModelListener treeNodesRemoved

List of usage examples for javax.swing.event TreeModelListener treeNodesRemoved

Introduction

In this page you can find the example usage for javax.swing.event TreeModelListener treeNodesRemoved.

Prototype

void treeNodesRemoved(TreeModelEvent e);

Source Link

Document

Invoked after nodes have been removed from the tree.

Usage

From source file:CreatingTreeModel.java

public void fireTreeNodesRemoved(TreeModelEvent e) {
    Enumeration listenerCount = listeners.elements();
    while (listenerCount.hasMoreElements()) {
        TreeModelListener listener = (TreeModelListener) listenerCount.nextElement();
        listener.treeNodesRemoved(e);
    }/* ww  w.ja  v a  2  s .c  o  m*/

}

From source file:gov.nij.er.ui.RawDataFilteredTreeModel.java

RawDataFilteredTreeModel(RecordTreeModel rawDataTreeModel) {
    this.rawDataTreeModel = rawDataTreeModel;
    rawDataTreeModel.addTreeModelListener(new TreeModelListener() {

        public void treeNodesChanged(TreeModelEvent e) {
            if (!isFiltered) {
                for (TreeModelListener l : listeners) {
                    l.treeNodesChanged(e);
                }//w  ww  .  j  a  v a2  s  .c  o  m
            }
        }

        public void treeNodesInserted(TreeModelEvent e) {
            if (!isFiltered) {
                for (TreeModelListener l : listeners) {
                    l.treeNodesInserted(e);
                }
            }
        }

        public void treeNodesRemoved(TreeModelEvent e) {
            if (!isFiltered) {
                for (TreeModelListener l : listeners) {
                    l.treeNodesRemoved(e);
                }
            }
        }

        public void treeStructureChanged(TreeModelEvent e) {
            if (!isFiltered) {
                for (TreeModelListener l : listeners) {
                    l.treeStructureChanged(e);
                }
            }
        }
    });
    root = new DefaultMutableTreeNode(ROOT_NODE_LABEL);

}

From source file:org.drugis.mtc.gui.AnalysesModel.java

private void fireTreeNodesRemoved(ArrayList<ModelType> nodes) {
    int idx[] = new int[nodes.size()];
    for (int i = 0; i < idx.length; ++i) {
        idx[i] = i;/*from  w  w w  .jav  a2 s. co  m*/
    }
    TreeModelEvent event = new TreeModelEvent(this, new Object[] { d_root }, idx, nodes.toArray());
    for (TreeModelListener l : new ArrayList<TreeModelListener>(d_listeners)) {
        l.treeNodesRemoved(event);
    }
}