Refine search
public Object getParentObject() { TreePath tPath = tree.getSelectionPath(); if ((tPath != null) && (tPath.getParentPath() != null)) { return tPath.getParentPath().getLastPathComponent(); } return null; }
protected void addAnnotations(ActionEvent evt) { TreePath tpath = null; tpath = getTreePath(evt); Object path = tree.getSelectionPath().getLastPathComponent(); refreshTree(tree.getSelectionPath());
protected void arrowButtonDownAction(ActionEvent evt) { TreePath tpath = tree.getSelectionPath(); if (tpath != null) { Object current = tpath.getLastPathComponent(); Object child = tree.getModel().getChild(current, 0); if (child != null) { int objCnt = 2; while (parentpath != null) { Object po = parentpath.getLastPathComponent(); treeObjs[objCnt] = po; objCnt += 1;
protected void addAnnotation(ActionEvent evt) { TreePath tpath = null; tpath = getTreePath(evt); Object path = tree.getSelectionPath().getLastPathComponent(); if (!(path instanceof MondrianGuiDef.Annotations)) { JOptionPane.showMessageDialog( tree.setSelectionPath(tpath.pathByAddingChild(annotation)); refreshTree(tree.getSelectionPath()); setTableCellFocus(0);
void delete(TreePath tpath) { Object child = tpath.getLastPathComponent(); // to be deleted Object nextSibling = null; Object prevSibling = null; tree.setSelectionPath(tpath.getParentPath()); refreshTree(tree.getSelectionPath());
TreePath tpath = tree.getSelectionPath(); if (tpath != null) { Object value = tpath.getLastPathComponent(); TreePath parentpath = tpath.getParentPath(); if (parentpath != null) { Object parent = parentpath.getLastPathComponent(); if (parent instanceof MondrianGuiDef.Hierarchy) { ((MondrianGuiDef.Hierarchy) parent).relation = relationObj;
/** * Get the node that has been selected by the user, or null if * nothing is selected. * @return The node or <code>null</code> */ public ManagementModelNode getSelectedNode() { if (tree.getSelectionPath() == null) return null; return (ManagementModelNode)tree.getSelectionPath().getLastPathComponent(); }
public Object getSelectedObject() { Object selected = null; if (theTree != null) { TreePath selectionPath = theTree.getSelectionPath(); selected = (selectionPath == null) ? null : selectionPath.getLastPathComponent(); } return selected; }
@Override public void keyReleased(KeyEvent e) { TreePath path = sidebarTree.getSelectionPath(); if (path != null) { handleTreeSelection((DefaultMutableTreeNode) path.getLastPathComponent()); } } });
private RrdNode getSelectedRrdNode() { TreePath path = mainTree.getSelectionPath(); if (path != null) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent(); Object obj = node.getUserObject(); if (obj instanceof RrdNode) { return (RrdNode) obj; } } return null; }
private RrdNode getSelectedRrdNode() { TreePath path = mainTree.getSelectionPath(); if (path != null) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent(); Object obj = node.getUserObject(); if (obj instanceof RrdNode) { return (RrdNode) obj; } } return null; }
void updatePanel() { if (portTree.getSelectionPath().getLastPathComponent() instanceof PanelTreeNode) { PanelTreeNode node = (PanelTreeNode) portTree.getSelectionPath() .getLastPathComponent(); splitter.setRightComponent(node.getPanel()); } }
@Override public void mouseClicked(final MouseEvent e) { if (!e.isPopupTrigger() && e.getClickCount() == 2) { if (tree.getModel().isLeaf(tree.getSelectionPath().getLastPathComponent())) { runScripts(); } } }
public static CategoryTreeNode getSelectedCategoryTreeNode(JTree tree) { TreePath treePath = tree.getSelectionPath(); // if there is no selected root take the local root Object value = treePath != null ? treePath.getLastPathComponent() : tree.getModel().getChild(tree.getModel().getRoot(), 0); if (!(value instanceof CategoryTreeNode)) return null; return (CategoryTreeNode) value; }
public void valueChanged(TreeSelectionEvent e) { final TreePath selectedpath = imageTree.getSelectionPath(); if (selectedpath == null) { imageTree.setSelectionRow(0); } RenderedImage image = (RenderedImage) imageTree.getSelectionPath().getLastPathComponent(); imageInfo.setImage(image); }
public void actionPerformed(ActionEvent evt) { TreePath path = resultTree.getSelectionPath(); DefaultMutableTreeNode operNode = (DefaultMutableTreeNode)path.getLastPathComponent(); expandAllNodes(operNode); } }//}}}
public void keyPressed(KeyEvent e) { if (e.getKeyCode() != 10) return; // ENTER pressed? TreePath path = tree.getSelectionPath(); if (path == null) return; Object node = path.getLastPathComponent (); LanguagesNavigatorModel model = (LanguagesNavigatorModel) tree.getModel (); model.show (node); }
public Path getCurrentDir() { final TreePath path = tree.getSelectionPath(); if (path != null) { return ((TreeNode) path.getLastPathComponent()).getNodePath(); } return null; }
@Override protected Transferable createTransferable(JComponent c) { JTree tree = (JTree) c; TreePath path = tree.getSelectionPath(); DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent(); return new ObjectTransferable(node.getUserObject()); } }
public void valueChanged(TreeSelectionEvent e) { TreePath treePath = tree.getSelectionPath(); if (treePath != null) { getTextComponent().setText("" + treePath.getLastPathComponent()); highlightCompletedText(0); } else { getTextComponent().setText(""); } } });