Package javax.swing.event

Examples of javax.swing.event.TreeModelListener


    pluginRegistry.addPluginListener(model);
    receiversTree.setModel(model);

    receiversTree.setExpandsSelectedPaths(true);
    model.addTreeModelListener(
      new TreeModelListener() {
        public void treeNodesChanged(TreeModelEvent e) {
          expandRoot();
        }

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


    ToolTipManager.sharedInstance().registerComponent(logTree);
    logTree.setCellRenderer(cellRenderer);

    //  ============================================
    logTreeModel.addTreeModelListener(new TreeModelListener()
      {
        private boolean latched = false;

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

        assertEquals("root", ((DefaultMutableTreeNode) model.getRoot()).getUserObject());
        assertEquals(0, model.getChildCount(model.getRoot()));
    }

    public void testCreateTreeModelListener() {
        TreeModelListener listener1 = tree.createTreeModelListener();
        TreeModelListener listener2 = tree.createTreeModelListener();
        assertTrue(listener1 instanceof JTree.TreeModelHandler);
        assertNotSame(listener1, listener2);
    }
View Full Code Here

        treeTableModel = new FeatureTreeTableModel(root);
        treeTable = new JXTreeTable(treeTableModel);
        treeTable.setTreeCellRenderer(new FeatureTreeCellRender());
        treeTable.setRootVisible(true);
        treeTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        treeTableModel.addTreeModelListener(new TreeModelListener() {

           
            public void treeNodesChanged(TreeModelEvent e) {
                treeTable.packAll();
            }
View Full Code Here

    public void valueForPathChanged(TreePath path, Object newValue) {
        Iterator listeners = _listenerList.iterator();
        TreeModelEvent event = new TreeModelEvent(this, path);

        while (listeners.hasNext()) {
            TreeModelListener listener = (TreeModelListener) listeners.next();
            listener.treeStructureChanged(event);
        }
    }
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() {
            @Override
            public void treeNodesChanged(TreeModelEvent e) {
                delayedFireTableDataChanged();
            }
View Full Code Here

    /*
     * Test method for 'javax.swing.tree.DefaultTreeModel.getListeners(EventListener)'
     */
    public void testGetListeners() {
        TreeModelListener listener1 = new ConcreteTreeModelListener();
        TreeModelListener listener2 = new ConcreteTreeModelListener();
        EventListener[] listenersArray = null;
        listenersArray = model.getListeners(TreeModelListener.class);
        assertEquals(0, listenersArray.length);
        model.addTreeModelListener(listener1);
        model.addTreeModelListener(listener2);
View Full Code Here

  {
    final TreeModelListener[] treeModelListeners = getListeners();
    final TreeModelEvent treeEvent = new TreeModelEvent(this, treePath);
    for (int i = treeModelListeners.length - 1; i >= 0; i -= 1)
    {
      final TreeModelListener listener = treeModelListeners[i];
      listener.treeStructureChanged(treeEvent);
    }
  }
View Full Code Here

  {
    final TreeModelListener[] treeModelListeners = eventListenerList.getListeners(TreeModelListener.class);
    final TreeModelEvent treeEvent = new TreeModelEvent(this, TreeSelectionHelper.getPathForNode(this, source));
    for (int i = treeModelListeners.length - 1; i >= 0; i -= 1)
    {
      final TreeModelListener listener = treeModelListeners[i];
      listener.treeStructureChanged(treeEvent);
    }
  }
View Full Code Here

    final TreeModelListener[] treeModelListeners = getListeners();
    final TreeModelEvent treeEvent = new TreeModelEvent(this, new TreePath(getRoot()));
//    for (int i = treeModelListeners.length - 1; i >= 0; i -= 1)
    for (int i = 0; i < treeModelListeners.length; i++)
    {
      final TreeModelListener listener = treeModelListeners[i];
      listener.treeStructureChanged(treeEvent);
    }
  }
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.