public void mouseReleased(MouseEvent ae) { if(ae.isPopupTrigger()){ popup.show(ae.getComponent(),ae.getX(),ae.getY()); } TreePath tp = tree.getPathForLocation(ae.getX(), ae.getY()); if (tp != null) jtf.setText(tp.toString()); else jtf.setText(""); }
public void treeExpanded(TreeExpansionEvent evt) { // Get the node to be expanded. final TreePath path = evt.getPath(); final Object parentObj = path.getLastPathComponent(); if (parentObj instanceof ObjectTreeNode) { startExpandingTree((ObjectTreeNode)parentObj, false, null, false); _expandedPathNames.put(path.toString(), null); } }
public void treeCollapsed(TreeExpansionEvent evt) { _expandedPathNames.remove(evt.getPath().toString()); } }
public void treeExpanded(TreeExpansionEvent evt) { // Get the node to be expanded. final TreePath path = evt.getPath(); final Object parentObj = path.getLastPathComponent(); if (parentObj instanceof ObjectTreeNode) { startExpandingTree((ObjectTreeNode)parentObj, false, null, false); _expandedPathNames.put(path.toString(), null); } }
tree.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent me) { doMouseClicked(me); } }); } void doMouseClicked(MouseEvent me) { TreePath tp = tree.getPathForLocation(me.getX(), me.getY()); if (tp != null) { System.out.println(tp.toString()); } }
private JTreeChildrenShowUpCondition(@Nonnull JTree tree, @Nonnull TreePath path) { super(concat(path.toString(), " to show")); this.tree = tree; this.path = path; }
public void treeCollapsed(TreeExpansionEvent evt) { _expandedPathNames.remove(evt.getPath().toString()); } }
public void treeCollapsed (TreeExpansionEvent ev) { String evPathString = ev.getPath().toString(); evPathString = evPathString.substring(evPathString.indexOf("[")+1,evPathString.lastIndexOf("]")); evPathString = evPathString.substring(getTitle().length()+2,evPathString.length()); String rootPath = getRootPath().toString(); rootPath = rootPath.substring(rootPath.indexOf("[")+1,rootPath.lastIndexOf("]")); String path = "["+rootPath +", "+evPathString+"]"; pcp.unsetExpandedStateProperty(path); }
public void treeCollapsed (TreeExpansionEvent ev) { String evPathString = ev.getPath().toString(); evPathString = evPathString.substring(evPathString.indexOf("[")+1,evPathString.lastIndexOf("]")); evPathString = evPathString.substring(getTitle().length()+2,evPathString.length()); String rootPath = getRootPath().toString(); rootPath = rootPath.substring(rootPath.indexOf("[")+1,rootPath.lastIndexOf("]")); String path = "["+rootPath +", "+evPathString+"]"; pcp.unsetExpandedStateProperty(path); }
boolean hasPanelForNode(DefaultMutableTreeNode node) { TreePath path = new TreePath(node.getPath()); return panels.containsKey(pStr2Key(path.toString())); }
TreePanel getPanelForNode(DefaultMutableTreeNode node) { TreePath path = new TreePath(node.getPath()); String pathString = path.toString(); if (panels.containsKey(pStr2Key(pathString))) return (TreePanel)panels.get(pStr2Key(pathString)); //else return newPanel(node); else return null; }
TreePanel getPanelForNode(DefaultMutableTreeNode node) { TreePath path = new TreePath(node.getPath()); String pathString = path.toString(); if (panels.containsKey(pStr2Key(pathString))) return (TreePanel)panels.get(pStr2Key(pathString)); //else return newPanel(node); else return null; }
public String toString() { return Strings.get("tester.JTree.path_not_shown", new Object[] { path.toString(), dumpTree(tree) }); } }), timeout);
public String toString() { return Strings.get("tester.JTree.path_not_shown", new Object[] { path.toString(), dumpTree(tree) }); } }), timeout);
/** Upon window closing, the panel removes itself from the vector of visible panels (member of pcp). * Then, if this is the only visible panel left, the properties are saved; else, if this is the * main panel, all other visible panels are also closed and properties * are saved */ public void windowClosing(WindowEvent e) { if (IJ.debugMode) IJ.log("CP.windowClosing: "+isMainPanel); if (isMainPanel) pcp.saveProperties(); pcp.unsetPanelShowingProperty(getRootPath().toString()); }
/** Upon window closing, the panel removes itself from the vector of visible panels (member of pcp). * Then, if this is the only visible panel left, the properties are saved; else, if this is the * main panel, all other visible panels are also closed and properties * are saved */ public void windowClosing(WindowEvent e) { if (IJ.debugMode) IJ.log("CP.windowClosing: "+isMainPanel); if (isMainPanel) pcp.saveProperties(); pcp.unsetPanelShowingProperty(getRootPath().toString()); }
void close() { pFrame.dispatchEvent(new WindowEvent(pFrame,WindowEvent.WINDOW_CLOSING)); pcp.unsetPanelShowingProperty(getRootPath().toString()); }
@Override public void valueChanged(TreeSelectionEvent e) { try { Log.debug("Clicked: " + e.getPath().toString()); if (miDomain.isSelected()) { String host = trDomainTree.getSelectionPath().getPathComponent(2).toString(); attributePlugins.setArgs(host); } } catch (Exception ex) { } } }