Search in sources :

Example 6 with LinkNode

use of cbit.vcell.xml.gui.MiriamTreeModel.LinkNode in project vcell by virtualcell.

the class BioModelTreePanel method getJTree2.

/**
 * Return the JTree2 property value.
 * @return cbit.gui.JTreeFancy
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private JTree getJTree2() {
    if (ivjJTree2 == null) {
        try {
            javax.swing.tree.DefaultTreeSelectionModel ivjLocalSelectionModel;
            ivjLocalSelectionModel = new javax.swing.tree.DefaultTreeSelectionModel();
            ivjLocalSelectionModel.setRowMapper(getLocalSelectionModelVariableHeightLayoutCache());
            ivjJTree2 = new JTree();
            ivjJTree2.setName("JTree2");
            ivjJTree2.setModel(new DefaultTreeModel(new DefaultMutableTreeNode("loading", false)));
            ivjJTree2.setBounds(0, 0, 78, 72);
            ivjJTree2.setRootVisible(true);
            ivjJTree2.setSelectionModel(ivjLocalSelectionModel);
            MouseListener mouseListener = new MouseAdapter() {

                public void mousePressed(MouseEvent e) {
                    if (e.getClickCount() == 2) {
                        Object node = ivjJTree2.getLastSelectedPathComponent();
                        if (node instanceof LinkNode) {
                            String link = ((LinkNode) node).getLink();
                            if (link != null) {
                                DialogUtils.browserLauncher(ivjJTree2, link, "failed to launch");
                            }
                        }
                    }
                }
            };
            ivjJTree2.addMouseListener(mouseListener);
        // user code begin {1}
        // user code end
        } catch (java.lang.Throwable ivjExc) {
            // user code begin {2}
            // user code end
            handleException(ivjExc);
        }
    }
    return ivjJTree2;
}
Also used : MouseEvent(java.awt.event.MouseEvent) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) MouseAdapter(java.awt.event.MouseAdapter) DefaultTreeModel(javax.swing.tree.DefaultTreeModel) JTree(javax.swing.JTree) MouseListener(java.awt.event.MouseListener) LinkNode(cbit.vcell.xml.gui.MiriamTreeModel.LinkNode)

Aggregations

LinkNode (cbit.vcell.xml.gui.MiriamTreeModel.LinkNode)6 MouseEvent (java.awt.event.MouseEvent)3 MouseListener (java.awt.event.MouseListener)3 JLabel (javax.swing.JLabel)3 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)3 BioModelNode (cbit.vcell.desktop.BioModelNode)2 Geometry (cbit.vcell.geometry.Geometry)2 SimulationContext (cbit.vcell.mapping.SimulationContext)2 MouseAdapter (java.awt.event.MouseAdapter)2 JTree (javax.swing.JTree)2 BioModelInfo (org.vcell.util.document.BioModelInfo)2 BioModel (cbit.vcell.biomodel.BioModel)1 MiriamRefGroup (cbit.vcell.biomodel.meta.MiriamManager.MiriamRefGroup)1 MiriamResource (cbit.vcell.biomodel.meta.MiriamManager.MiriamResource)1 DocumentEditorTreeFolderClass (cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderClass)1 DocumentEditorTreeFolderNode (cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderNode)1 Annotation (cbit.vcell.desktop.Annotation)1 BioModelCellRenderer (cbit.vcell.desktop.BioModelCellRenderer)1 RbmModelContainer (cbit.vcell.model.Model.RbmModelContainer)1 DateNode (cbit.vcell.xml.gui.MiriamTreeModel.DateNode)1