Package javax.swing.event

Examples of javax.swing.event.TreeModelListener


        int[] indices = { index };
        Object[] changedChildren = { getChild(path.getLastPathComponent(), index) };
        TreeModelEvent event = new TreeModelEvent(this, path, indices, changedChildren);
        Enumeration<TreeModelListener> e = modelListeners.elements();
        while (e.hasMoreElements()) {
            TreeModelListener l = e.nextElement();
            l.treeNodesChanged(event);
        }
    }
View Full Code Here


        final DefaultTreeModel treeModel = ((DefaultTreeModel) dirTree.getModel());
        treeModel.setRoot(rootNode);
            // Add a listener to detect when the items are first added to the tree.
            treeModel.addTreeModelListener(new TreeModelListener() {

                @Override
                public void treeNodesChanged(TreeModelEvent e) {
                    // do nothing.
View Full Code Here

        // Install a TreeModelListener that can update the table when
        // mTree changes. We use delayedFireTableDataChanged as we can
        // not be guaranteed the mTree will have finished processing
        // the event before us.
        aTreeTableModel.addTreeModelListener(new TreeModelListener()
        {
            public void treeNodesChanged(TreeModelEvent e)
            {
                delayedFireTableDataChanged();
            }
View Full Code Here

        // Ensure that inserted nodes are expanded.
        // Note that we add the listener before any other listener can be added. 
        //  This is because the JTree adds its own listeners to update itself on model change, but any added nodes will be
        //  collapsed by default.  The model listeners are notified in *reverse* order from the order in which they are added,
        //  meaning that if we add this listener first, it will be notified last, after any new nodes have appeared.
        argumentTreeModel.addTreeModelListener(new TreeModelListener() {

            public void treeNodesChanged(TreeModelEvent e) {
                expandAll(e.getTreePath(), true);
            }

View Full Code Here

        // Install a TreeModelListener that can update the table when
        // tree changes. We use delayedFireTableDataChanged as we can
        // not be guaranteed the tree will have finished processing
        // the event before us.
        treeTableModel.addTreeModelListener(new TreeModelListener() {
            public void treeNodesChanged(TreeModelEvent e) {
                delayedFireTableDataChanged();
            }

            public void treeNodesInserted(TreeModelEvent e) {
View Full Code Here

        TreeSelectionModel selModel = treeComp.getTreeSelectionModel();
        selModel.setSelectionMode(TreeSelectionModel.CONTIGUOUS_TREE_SELECTION);

        selModel.addSelectionPath(new TreePath(parentNode.getPath())); // Actors

        TreeModelListener dataListener = new TreeModelListener()
        {
            public void treeNodesChanged(TreeModelEvent e)
            {
                treeChangedLog(e);
            }
View Full Code Here

  public void fireTreeNodesChanged( TreeModelEvent e )
  {
    Enumeration listeners = m_listenerList.elements();
    while ( listeners.hasMoreElements() )
    {
      TreeModelListener listener =
      (TreeModelListener) listeners.nextElement();
      listener.treeNodesChanged( e );
    }
  }
View Full Code Here

  public void fireTreeNodesInserted( TreeModelEvent e )
  {
    Enumeration listeners = m_listenerList.elements();
    while ( listeners.hasMoreElements() )
    {
      TreeModelListener listener =
      (TreeModelListener) listeners.nextElement();
      listener.treeNodesInserted( e );
    }
  }  
View Full Code Here

  public void fireTreeNodesRemoved( TreeModelEvent e )
  {
    Enumeration listeners = m_listenerList.elements();
    while ( listeners.hasMoreElements() )
    {
      TreeModelListener listener =
      (TreeModelListener) listeners.nextElement();
      listener.treeNodesRemoved( e );
    }
  }  
View Full Code Here

  public void fireTreeStructureChanged( TreeModelEvent e )
  {
    Enumeration listeners = m_listenerList.elements();
    while ( listeners.hasMoreElements() )
    {
      TreeModelListener listener =
      (TreeModelListener) listeners.nextElement();
      listener.treeStructureChanged( e );
    }
  }
View Full Code Here

TOP

Related Classes of javax.swing.event.TreeModelListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.