Example usage for javax.swing.tree DefaultMutableTreeNode DefaultMutableTreeNode

List of usage examples for javax.swing.tree DefaultMutableTreeNode DefaultMutableTreeNode

Introduction

In this page you can find the example usage for javax.swing.tree DefaultMutableTreeNode DefaultMutableTreeNode.

Prototype

public DefaultMutableTreeNode(Object userObject) 

Source Link

Document

Creates a tree node with no parent, no children, but which allows children, and initializes it with the specified user object.

Usage

From source file:edu.harvard.i2b2.patientSet.ui.PatientSetJPanel.java

public DefaultMutableTreeNode addNode(QueryInstanceData node, DefaultMutableTreeNode parent) {
    QueryMasterData logicdata = (QueryMasterData) parent.getUserObject();
    logicdata.runs.add(node);//  w ww  .jav a2s.co m

    DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(node);

    QueryInstanceData tmpData = new QueryInstanceData();
    tmpData.name("working ......");
    tmpData.tooltip("A tmp node");
    tmpData.visualAttribute("LAO");
    DefaultMutableTreeNode tmpNode = new DefaultMutableTreeNode(tmpData);

    treeModel.insertNodeInto(childNode, parent, parent.getChildCount());
    if (!(node.visualAttribute().startsWith("L") || node.visualAttribute().equalsIgnoreCase("MA"))) {
        treeModel.insertNodeInto(tmpNode, childNode, childNode.getChildCount());
    }
    // Make sure the user can see the lovely new node.

    DefaultMutableTreeNode tmpnode = (DefaultMutableTreeNode) parent.getChildAt(0);
    QueryData tmpdata = (QueryData) tmpnode.getUserObject();
    if (tmpdata.name().equalsIgnoreCase("working ......")) {
        treeModel.removeNodeFromParent(tmpnode);
    }

    return childNode;
}

From source file:com.clough.android.adbv.view.MainFrame.java

private void refreshDatabase() {
    inputQuery = "";
    invalidateInputOutput();// w w w. ja v  a2s  . com
    new SwingWorker<Void, Void>() {

        @Override
        protected Void doInBackground() throws Exception {
            try {
                Thread.sleep(100);
            } catch (InterruptedException ex) {
            }
            try {
                String tableNames = MainFrame.this.ioManager.getTableNames();
                tableNameJSONArray = new JSONArray(tableNames);
            } catch (IOManagerException ex) {
                showDeviceDisconnectedDialog();
            }
            return null;
        }

        @Override
        protected void done() {
            closeProgressDialog();
        }

    }.execute();
    showProgressDialog(true, 0, "Waiting for table list");

    tableInfoTree.removeAll();
    tableInfoTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    final DefaultMutableTreeNode databaseDMTN = new DefaultMutableTreeNode(databaseName);
    tableInfoTree.setModel(new DefaultTreeModel(databaseDMTN));
    new SwingWorker<Void, Void>() {
        @Override
        protected Void doInBackground() throws Exception {
            try {
                Thread.sleep(100);
            } catch (InterruptedException ex) {
            }
            try {
                tables = new String[tableNameJSONArray.length()];
                queries = new String[tableNameJSONArray.length()];
                columns = new String[tableNameJSONArray.length()][];
                columnInfos = new String[tableNameJSONArray.length()][][];
                for (int i = 0; i < tableNameJSONArray.length(); i++) {
                    tables[i] = tableNameJSONArray.getJSONObject(i).getString("name");
                    DefaultMutableTreeNode tableDMTN = new DefaultMutableTreeNode(tables[i]);
                    databaseDMTN.add(tableDMTN);
                    queries[i] = tableNameJSONArray.getJSONObject(i).getString("sql");
                    String tableColumnInfo = MainFrame.this.ioManager.getTableColumnInfo(tables[i]);
                    JSONArray columnJSONArray = new JSONArray(tableColumnInfo);
                    columns[i] = new String[columnJSONArray.length()];
                    columnInfos[i] = new String[columnJSONArray.length()][];
                    for (int j = 0; j < columnJSONArray.length(); j++) {
                        JSONObject columnJSONObject = columnJSONArray.getJSONObject(j);
                        columns[i][j] = columnJSONObject.getString("name");
                        columnInfos[i][j] = new String[4];
                        DefaultMutableTreeNode columnDMTN = new DefaultMutableTreeNode(columns[i][j]);
                        columnInfos[i][j][0] = "Column ID : " + String.valueOf(columnJSONObject.getInt("cid"));
                        columnDMTN.add(new DefaultMutableTreeNode(columnInfos[i][j][0]));
                        columnInfos[i][j][1] = "Type : " + columnJSONObject.getString("type");
                        columnDMTN.add(new DefaultMutableTreeNode(columnInfos[i][j][1]));
                        columnInfos[i][j][2] = "Def value : "
                                + String.valueOf(columnJSONObject.getString("dflt_value"));
                        columnDMTN.add(new DefaultMutableTreeNode(columnInfos[i][j][2]));
                        columnInfos[i][j][3] = "Not NULL : "
                                + String.valueOf((columnJSONObject.getInt("notnull") == 1));
                        columnDMTN.add(new DefaultMutableTreeNode(columnInfos[i][j][3]));
                        tableDMTN.add(columnDMTN);
                    }
                    databaseDMTN.add(tableDMTN);
                    waitingDialog.incrementProgressBar();
                }
            } catch (IOManagerException ex) {
                showDeviceDisconnectedDialog();
            }
            return null;
        }

        @Override
        protected void done() {
            closeProgressDialog();
        }

    }.execute();
    showProgressDialog(false, tableNameJSONArray.length(),
            "Getting info of " + tableNameJSONArray.length() + " tables");
    tableInfoTree.expandPath(new TreePath((TreeNode) tableInfoTree.getModel().getRoot()));
    tableNameJSONArray = null;

}

From source file:org.jfree.chart.demo.SuperDemo.java

private MutableTreeNode createPieChartsNode() {
    DefaultMutableTreeNode defaultmutabletreenode = new DefaultMutableTreeNode("Pie Charts");
    DefaultMutableTreeNode defaultmutabletreenode1 = new DefaultMutableTreeNode(
            new DemoDescription("PieChartDemo1", "PieChartDemo1.java"));
    DefaultMutableTreeNode defaultmutabletreenode2 = new DefaultMutableTreeNode(
            new DemoDescription("PieChartDemo2", "PieChartDemo2.java"));
    DefaultMutableTreeNode defaultmutabletreenode3 = new DefaultMutableTreeNode(
            new DemoDescription("PieChartDemo3", "PieChartDemo3.java"));
    DefaultMutableTreeNode defaultmutabletreenode4 = new DefaultMutableTreeNode(
            new DemoDescription("PieChartDemo4", "PieChartDemo4.java"));
    DefaultMutableTreeNode defaultmutabletreenode5 = new DefaultMutableTreeNode(
            new DemoDescription("PieChartDemo5", "PieChartDemo5.java"));
    DefaultMutableTreeNode defaultmutabletreenode6 = new DefaultMutableTreeNode(
            new DemoDescription("PieChartDemo6", "PieChartDemo6.java"));
    DefaultMutableTreeNode defaultmutabletreenode7 = new DefaultMutableTreeNode(
            new DemoDescription("PieChartDemo7", "PieChartDemo7.java"));
    DefaultMutableTreeNode defaultmutabletreenode8 = new DefaultMutableTreeNode(
            new DemoDescription("PieChartDemo8", "PieChartDemo8.java"));
    DefaultMutableTreeNode defaultmutabletreenode9 = new DefaultMutableTreeNode(
            new DemoDescription("PieChart3DDemo1", "PieChart3DDemo1.java"));
    DefaultMutableTreeNode defaultmutabletreenode10 = new DefaultMutableTreeNode(
            new DemoDescription("PieChart3DDemo2", "PieChart3DDemo2.java"));
    DefaultMutableTreeNode defaultmutabletreenode11 = new DefaultMutableTreeNode(
            new DemoDescription("PieChart3DDemo3", "PieChart3DDemo3.java"));
    DefaultMutableTreeNode defaultmutabletreenode12 = new DefaultMutableTreeNode(
            new DemoDescription("MultiplePieChartDemo1", "MultiplePieChartDemo1.java"));
    DefaultMutableTreeNode defaultmutabletreenode13 = new DefaultMutableTreeNode(
            new DemoDescription("RingChartDemo1", "RingChartDemo1.java"));
    defaultmutabletreenode.add(defaultmutabletreenode1);
    defaultmutabletreenode.add(defaultmutabletreenode2);
    defaultmutabletreenode.add(defaultmutabletreenode3);
    defaultmutabletreenode.add(defaultmutabletreenode4);
    defaultmutabletreenode.add(defaultmutabletreenode5);
    defaultmutabletreenode.add(defaultmutabletreenode6);
    defaultmutabletreenode.add(defaultmutabletreenode7);
    defaultmutabletreenode.add(defaultmutabletreenode8);
    defaultmutabletreenode.add(defaultmutabletreenode9);
    defaultmutabletreenode.add(defaultmutabletreenode10);
    defaultmutabletreenode.add(defaultmutabletreenode11);
    defaultmutabletreenode.add(defaultmutabletreenode12);
    defaultmutabletreenode.add(defaultmutabletreenode13);
    return defaultmutabletreenode;
}

From source file:mydropbox.MyDropboxSwing.java

private void sign_inActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_sign_inActionPerformed

    list = new ArrayList<>();
    diffList = new ArrayList<>();
    sign_in.setEnabled(false);// ww  w  . j av  a2 s.  c  o m
    jScrollPane1.setEnabled(true);
    jTree1.setEnabled(true);
    sync.setEnabled(true);
    reload.setEnabled(true);
    jTextArea1.setEnabled(true);
    jProgressBar1.setEnabled(true);
    log_out.setEnabled(true);
    username.setEnabled(false);
    password.setEnabled(false);
    File file = new File(urls);
    //Kiem tra dang nhap
    DomRepresentation login = null;
    try {
        login = LoginForm.result(username.getText(), password.getText());
        if (login == null) {
            JOptionPane.showMessageDialog(null, "Retry to login");
            return;
        }
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    //Load setting tu file

    //      userId = Integer.parseInt(login.getText("/User/UserId"));
    root = new DefaultMutableTreeNode("Dropbox");
    DefaultTreeModel defaultTreeModel = new DefaultTreeModel(root);
    jTree1.setModel(defaultTreeModel);

    AddNodeTree tree = new AddNodeTree();
    tree.addNode(file, root);
    //Init observer
    FileAlterationObserver fao = new FileAlterationObserver(file);
    fao.addListener(new FileWatcher());
    watcher = new FileAlterationMonitor(Constants.TIME_MONITOR);
    //Watch Dropbox folder
    watcher.addObserver(fao);
    System.out.println("Starting monitor. Ctrc - C to stop");
    try {
        //addAttr(urls);
        watcher.start();
    } catch (Exception ex) {
        Logger.getLogger(MyDropboxSwing.class.getName()).log(Level.SEVERE, null, ex);
    }

    loadXMLDoc();
}

From source file:it.unibas.spicygui.controllo.window.operator.ProjectTreeGenerator.java

private void analisiRicorsivaAggiuntaIstanza(Object root, Scenario scenario, DefaultTreeModel model,
        String stringa) {//from  w  w  w .  ja  v  a 2  s  . com
    int indice = model.getChildCount(root);
    for (int i = 0; i < indice; i++) {
        analisiRicorsivaAggiuntaIstanza(model.getChild(root, i), scenario, model, stringa);
    }
    //        if (indice == 2) {
    TreeTopComponentAdapter componentAdapter = (TreeTopComponentAdapter) ((DefaultMutableTreeNode) root)
            .getUserObject();
    TopComponent tc = componentAdapter.getTopComponent();
    if (tc != null && tc == scenario.getMappingTaskTopComponent()) {

        TreeTopComponentAdapter ttca = new TreeTopComponentAdapter(null, false, false, true);
        DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(ttca);
        TreeNode treeNode = ((TreeNode) root).getParent();
        TreeNode nodeInstancesFather = treeNode.getChildAt(2);
        //            if (stringa.equals(Costanti.SOURCE)) {
        TreeNode nodeInstacesSource = nodeInstancesFather.getChildAt(0);
        TreeNode nodeInstacesTarget = nodeInstancesFather.getChildAt(1);
        List<String> sourceInstancesName = (List<String>) scenario.getMappingTask().getSourceProxy()
                .getAnnotation(SpicyEngineConstants.XML_INSTANCE_FILE_LIST);
        List<String> targetInstancesName = (List<String>) scenario.getMappingTask().getTargetProxy()
                .getAnnotation(SpicyEngineConstants.XML_INSTANCE_FILE_LIST);
        int place = 0;
        String name = "xxx";
        if (sourceInstancesName.size() != nodeInstacesSource.getChildCount()) {
            place = nodeInstacesSource.getChildCount();
            name = findTitle(sourceInstancesName.get(sourceInstancesName.size() - 1));
            model.insertNodeInto(newNode, (DefaultMutableTreeNode) nodeInstacesSource, place);
        } else if (targetInstancesName.size() != nodeInstacesTarget.getChildCount()) {
            place = nodeInstacesTarget.getChildCount();
            name = findTitle(targetInstancesName.get(targetInstancesName.size() - 1));
            model.insertNodeInto(newNode, (DefaultMutableTreeNode) nodeInstacesTarget, place);
        }
        ttca.setName(name);
        scenario.getXQueryTopComponent().update();

        //                return;
        //            }

    }
    //            return;
    //        }

}

From source file:org.kuali.maven.plugins.externals.MojoHelper.java

/**
 * Convert each pom.xml into a <code>Project</code> object and then store each <code>Project</code> as the user object in a
 * <code>DefaultMutableTreeNode</code>
 *///w  ww .  j a  v  a2  s. c o  m
protected List<DefaultMutableTreeNode> getNodes(List<File> files) {
    List<DefaultMutableTreeNode> nodes = new ArrayList<DefaultMutableTreeNode>();
    for (File file : files) {
        String pomContents = read(file);
        GAV parent = pomUtils.getParentGAV(pomContents);
        GAV gav = pomUtils.getGAV(pomContents);
        Project project = new Project();
        project.setPom(file);
        project.setPomContents(pomContents);
        project.setGav(gav);
        project.setParent(parent);
        DefaultMutableTreeNode node = new DefaultMutableTreeNode(project);
        nodes.add(node);
    }
    return nodes;
}

From source file:hr.fer.zemris.vhdllab.view.explorer.ProjectExplorerView.java

private MutableTreeNode insertNode(MutableTreeNode parentNode, Object childObject) {
    MutableTreeNode childNode = new DefaultMutableTreeNode(childObject);
    model.insertNodeInto(childNode, parentNode, parentNode.getChildCount());
    return childNode;
}

From source file:de.tor.tribes.ui.windows.DSWorkbenchSplashScreen.java

protected HIDE_RESULT hideSplash() {
    try {//w w  w.  ja v  a 2  s . c om
        if (!new File(".").canWrite()) {
            try {
                throw new IOException(
                        "Failed to access installation directory " + new File(".").getAbsolutePath());
            } catch (Exception e) {
                showFatalError(e);
                return HIDE_RESULT.ERROR;
            }
        }
        File f = new File("./servers");
        if (!f.exists() && !f.mkdir()) {
            try {
                throw new IOException(
                        "Failed to create server directory at location " + new File(".").getAbsolutePath());
            } catch (Exception e) {
                showFatalError(e);
                return HIDE_RESULT.ERROR;
            }
        }

        ProfileManager.getSingleton().loadProfiles();
        if (ProfileManager.getSingleton().getProfiles().length == 0) {
            logger.debug("Starting first start wizard");

            //first start wizard
            if (!new File("./hfsw").exists()) {
                logger.debug(" - Initializing first start wizard");
                Map result = new HashMap<>();

                try {
                    WizardPanelProvider provider = new FirstStartWizard();
                    Wizard wizard = provider.createWizard();
                    logger.debug(" - Showing wizard");
                    result = (Map) WizardDisplayer.showWizard(wizard);
                    logger.debug("Wizard finished with result " + result);
                } catch (Throwable t) {
                    logger.error("Wizard exception", t);
                    result = null;
                }
                logger.debug(" - Wizard has finished");
                if (result == null) {
                    logger.warn(" - Wizard returned no result. Startup will fail.");
                    JOptionPaneHelper.showWarningBox(self,
                            "Du musst die grundlegenden Einstellungen zumindest einmalig durchfhren,\n"
                                    + "um DS Workbench verwenden zu knnen. Bitte starte DS Workbench neu.",
                            "Abbruch");
                    return HIDE_RESULT.ERROR;
                } else {
                    logger.debug("Wizard result: " + result);
                }
                logger.debug("- First start wizard finished");
                GlobalOptions.addProperty("proxySet", result.get("proxySet").toString());
                GlobalOptions.addProperty("proxyHost", result.get("proxyHost").toString());
                GlobalOptions.addProperty("proxyPort", result.get("proxyPort").toString());
                GlobalOptions.addProperty("proxyType", result.get("proxyType").toString());
                GlobalOptions.addProperty("proxyUser", result.get("proxyUser").toString());
                GlobalOptions.addProperty("proxyPassword", result.get("proxyPassword").toString());
                GlobalOptions.addProperty("default.server", result.get("server").toString());
                GlobalOptions.addProperty("default.player", result.get("tribe.id").toString());
                logger.debug("Creating initial profile");
                UserProfile p = UserProfile.create(GlobalOptions.getProperty("default.server"),
                        result.get("tribe.name").toString());
                GlobalOptions.setSelectedProfile(p);
                GlobalOptions.addProperty("selected.profile", Long.toString(p.getProfileId()));
                logger.debug(" - Disabling first start wizard");
                FileUtils.touch(new File("./hfsw"));
                GlobalOptions.saveProperties();
            }
        }

        //load properties, cursors, skins, world decoration
        logger.debug("Adding startup listeners");
        DataHolder.getSingleton().addDataHolderListener(this);
        DataHolder.getSingleton().addDataHolderListener(DSWorkbenchSettingsDialog.getSingleton());
        GlobalOptions.addDataHolderListener(this);
    } catch (Exception e) {
        logger.error("Failed to initialize global options", e);
        showFatalError(e);
        return HIDE_RESULT.ERROR;
    }

    logger.debug("Starting profile selection");
    boolean settingsRestored = false;

    ServerManager.loadServerList(DSWorkbenchSettingsDialog.getSingleton().getWebProxy());
    try {
        //open profile selection
        if (ProfileManager.getSingleton().getProfiles().length == 0) {
            logger.debug("No profile exists, SettingsDialog will handle this");
            //no profile found...this is handles by the settings validation
        } else if (ProfileManager.getSingleton().getProfiles().length == 1) {
            logger.debug("One profile exists. Using it...");
            //only one single profile was found, use it
            UserProfile profile = ProfileManager.getSingleton().getProfiles()[0];
            String server = profile.getServerId();
            GlobalOptions.setSelectedServer(server);
            GlobalOptions.setSelectedProfile(profile);
            GlobalOptions.addProperty("default.server", server);
            GlobalOptions.addProperty("selected.profile", Long.toString(profile.getProfileId()));
        } else {
            logger.debug("More than one profiles exist. Showing selection dialog");
            File f = new File("./servers");
            List<String> servers = new LinkedList<>();
            for (File server : f.listFiles()) {
                servers.add(server.getName());
            }
            //sort server names
            Collections.sort(servers, new Comparator<String>() {
                @Override
                public int compare(String o1, String o2) {
                    if (o1.length() < o2.length()) {
                        return -1;
                    } else if (o1.length() > o2.length()) {
                        return 1;
                    }
                    return o1.compareTo(o2);
                }
            });
            List<Object> path = new LinkedList<>();
            DefaultMutableTreeNode root = new DefaultMutableTreeNode("Profile");
            long selectedProfile = GlobalOptions.getProperties().getLong("selected.profile");
            path.add(root);
            for (String server : servers) {
                DefaultMutableTreeNode serverNode = new DefaultMutableTreeNode(server);
                boolean profileAdded = false;
                for (UserProfile profile : ProfileManager.getSingleton().getProfiles(server)) {
                    DefaultMutableTreeNode profileNode = new DefaultMutableTreeNode(profile);
                    if (profile.getProfileId() == selectedProfile) {
                        path.add(serverNode);
                        path.add(profileNode);
                    }
                    serverNode.add(profileNode);
                    profileAdded = true;
                }
                if (profileAdded) {
                    root.add(serverNode);
                }
            }

            jTree1.setModel(new DefaultTreeModel(root));
            jTree1.setSelectionPath(new TreePath(path.toArray()));
            jTree1.scrollPathToVisible(new TreePath(path.toArray()));
            jTree1.setCellRenderer(new ProfileTreeNodeRenderer());
            jProfileDialog.setVisible(true);
        }
        logger.debug("Profile selection finished");
        //check settings
        DSWorkbenchSettingsDialog.getSingleton().restoreProperties();
        settingsRestored = true;
        if (!DSWorkbenchSettingsDialog.getSingleton().checkSettings()) {
            logger.debug("Settings check in settings dialog failed");
            logger.info("Reading user settings returned error(s)");
            DSWorkbenchSettingsDialog.getSingleton().setBlocking(true);
            DSWorkbenchSettingsDialog.getSingleton().setVisible(true);
        }
    } catch (Exception e) {
        logger.warn("Failed to open profile manager", e);
    }

    if (!settingsRestored) {
        DSWorkbenchSettingsDialog.getSingleton().restoreProperties();
    }

    // <editor-fold defaultstate="collapsed" desc=" Check for data updates ">
    logger.debug("Checking for application updates");
    boolean checkForUpdates = GlobalOptions.getProperties().getBoolean("check.updates.on.startup");

    try {
        if (!DataHolder.getSingleton().loadData(checkForUpdates)) {
            throw new Exception("loadData() returned 'false'. See log for more details.");
        }
    } catch (Exception e) {
        logger.error("Failed to load server data", e);
        showFatalError(e);
        return HIDE_RESULT.ERROR;
    }
    // </editor-fold>
    try {
        logger.debug("Initializing application window");
        DSWorkbenchMainFrame.getSingleton().init();
        logger.info("Showing application window");

        DSWorkbenchMainFrame.getSingleton().setVisible(true);

        //check for version updates
        logger.info("Checking for DS Workbench update.");
        UpdateInfo info = GithubVersionCheck.getUpdateInformation();
        switch (info.getStatus()) {
        case UPDATE_AVAILABLE:
            NotifierFrame.doNotification(
                    "Eine neue DS Workbench Version ist verfgbar. Klick den grnen Punkt oben links, um auf die Download Seite zu gelangen. ",
                    NotifierFrame.NOTIFY_UPDATE);
        default:
            logger.info("No update available or update check failed.");
        }

        try {
            ReportServer.getSingleton().start(GlobalOptions.getProperties().getInt("report.server.port"));
        } catch (Exception e) {
            logger.error("Failed to start report server", e);
        }

        // <editor-fold defaultstate="collapsed" desc=" Init HelpSystem ">
        if (!Constants.DEBUG) {
            GlobalOptions.getHelpBroker().enableHelpKey(DSWorkbenchSimulatorFrame.getSingleton().getRootPane(),
                    "pages.astar", GlobalOptions.getHelpBroker().getHelpSet());
            GlobalOptions.getHelpBroker().enableHelpKey(DSWorkbenchMainFrame.getSingleton().getRootPane(),
                    "index", GlobalOptions.getHelpBroker().getHelpSet());
        }
        // </editor-fold>

        // <editor-fold defaultstate="collapsed" desc=" Init A*Star Servers ">
        ServerManager.giveSimulatorServerList();
        // </editor-fold>

        t.stopRunning();
        setVisible(false);
        GlobalOptions.removeDataHolderListener(this);

        return HIDE_RESULT.SUCCESS;
    } catch (Throwable th) {
        logger.fatal("Fatal error while running DS Workbench", th);
        showFatalError(th);
        return HIDE_RESULT.ERROR;
    }
}

From source file:SAXTreeValidator.java

/**
 * <p>//from ww  w. j  av  a2 s  . co  m
 *   This reports an entity that is skipped by the parser. This
 *     should only occur for non-validating parsers, and then is still
 *     implementation-dependent behavior.
 * </p>
 *
 * @param name <code>String</code> name of entity being skipped
 * @throws <code>SAXException</code> when things go wrong
 */
public void skippedEntity(String name) throws SAXException {
    DefaultMutableTreeNode skipped = new DefaultMutableTreeNode("Skipped Entity: '" + name + "'");
    current.add(skipped);
}

From source file:edu.harvard.i2b2.patientSet.ui.PatientSetJPanel.java

public DefaultMutableTreeNode addNode(QueryResultData node, DefaultMutableTreeNode parent) {
    // QueryInstanceData rundata = (QueryInstanceData)
    // parent.getUserObject();

    DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(node);

    QueryInstanceData tmpData = new QueryInstanceData();
    tmpData.name("working ......");
    tmpData.tooltip("A tmp node");
    tmpData.visualAttribute("LAO");
    DefaultMutableTreeNode tmpNode = new DefaultMutableTreeNode(tmpData);

    treeModel.insertNodeInto(childNode, parent, parent.getChildCount());
    if (!(node.visualAttribute().startsWith("L") || node.visualAttribute().equalsIgnoreCase("MA")
            || node.patientCount().equalsIgnoreCase("0"))) {
        treeModel.insertNodeInto(tmpNode, childNode, childNode.getChildCount());
    }//from  w  ww .  j av  a  2s .c  om

    DefaultMutableTreeNode tmpnode = (DefaultMutableTreeNode) parent.getChildAt(0);
    QueryData tmpdata = (QueryData) tmpnode.getUserObject();
    if (tmpdata.name().equalsIgnoreCase("working ......")) {
        treeModel.removeNodeFromParent(tmpnode);
    }

    return childNode;
}