/** String name is taken from the node. */ @Override public String toString() { return getDisplayName(); }
/** String name is taken from the node. */ public String toString () { return getDisplayName (); }
/** String name is taken from the node. */ public String toString () { return getDisplayName (); }
public String toId() { return "'" + getDisplayName() + "'@" + Integer.toHexString(System.identityHashCode(this)) + " parent: " + parent + " indexOf: " + indexOf; }
@Override public String convertValueToString(Object value) { if (value instanceof VisualizerNode) { return ((VisualizerNode) value).getDisplayName(); } else if (value instanceof Node) { return ((Node) value).getDisplayName(); } else { return super.convertValueToString(value); } }
public String getToolTipText(MouseEvent event) { if(event != null) { Point p = event.getPoint(); int selRow = getRowForLocation(p.x, p.y); if(selRow != -1) { TreePath path = getPathForRow(selRow); VisualizerNode v = (VisualizerNode)path.getLastPathComponent(); String tooltip = v.getShortDescription(); String displayName = v.getDisplayName (); if ((tooltip != null) && !tooltip.equals (displayName)) return tooltip; } } return null; }
public String getToolTipText(MouseEvent event) { if(event != null) { Point p = event.getPoint(); int selRow = getRowForLocation(p.x, p.y); if(selRow != -1) { TreePath path = getPathForRow(selRow); VisualizerNode v = (VisualizerNode)path.getLastPathComponent(); String tooltip = v.getShortDescription(); String displayName = v.getDisplayName (); if ((tooltip != null) && !tooltip.equals (displayName)) return tooltip; } } return null; }
/** * Overrides JComponent's getToolTipText method in order to allow * renderer's tips to be used if it has text set. * @param event the MouseEvent that initiated the ToolTip display */ public String getToolTipText (MouseEvent event) { if (event != null) { Point p = event.getPoint (); int index = locationToIndex (p); if (index >= 0) { VisualizerNode v = (VisualizerNode)getModel().getElementAt(index); String tooltip = v.getShortDescription(); String displayName = v.getDisplayName (); if ((tooltip != null) && !tooltip.equals (displayName)) { return tooltip; } } } return null; } };
@Override public String getToolTipText(MouseEvent event) { if (event != null) { Point p = event.getPoint(); int selRow = getRowForLocation(p.x, p.y); if (selRow != -1) { TreePath path = getPathForRow(selRow); VisualizerNode v = (VisualizerNode) path.getLastPathComponent(); String tooltip = v.getShortDescription(); String displayName = v.getDisplayName(); if ((tooltip != null) && !tooltip.equals(displayName)) { return tooltip; } } } return null; }
final String getToolTipTextImpl(MouseEvent event) { if (event != null) { Point p = event.getPoint(); int row = locationToIndex(p); if (row >= 0) { VisualizerNode v = (VisualizerNode) model.getElementAt(row); String tooltip = v.getShortDescription(); String displayName = v.getDisplayName(); if ((tooltip != null) && !tooltip.equals(displayName)) { return tooltip; } } } return null; }
/** * Overrides JComponent's getToolTipText method in order to allow * renderer's tips to be used if it has text set. * @param event the MouseEvent that initiated the ToolTip display */ public String getToolTipText (MouseEvent event) { if (event != null) { Point p = event.getPoint (); int index = locationToIndex (p); if (index >= 0) { VisualizerNode v = (VisualizerNode)getModel().getElementAt(index); String tooltip = v.getShortDescription(); String displayName = v.getDisplayName (); if ((tooltip != null) && !tooltip.equals (displayName)) { return tooltip; } } } return null; } };
/** * Overrides JComponent's getToolTipText method in order to allow * Node's tips to be used if they are useful. * * @param event the MouseEvent that initiated the ToolTip display */ public String getToolTipText (MouseEvent event) { if (event != null) { Point p = event.getPoint (); int row = locationToIndex (p); if (row >= 0) { VisualizerNode v = (VisualizerNode)model.getElementAt (row); String tooltip = v.getShortDescription(); String displayName = v.getDisplayName (); if ((tooltip != null) && !tooltip.equals (displayName)) return tooltip; } } return null; }
/** * Overrides JComponent's getToolTipText method in order to allow * Node's tips to be used if they are useful. * * @param event the MouseEvent that initiated the ToolTip display */ public String getToolTipText (MouseEvent event) { if (event != null) { Point p = event.getPoint (); int row = locationToIndex (p); if (row >= 0) { VisualizerNode v = (VisualizerNode)model.getElementAt (row); String tooltip = v.getShortDescription(); String displayName = v.getDisplayName (); if ((tooltip != null) && !tooltip.equals (displayName)) return tooltip; } } return null; }
@Override public String getStringValueAt(int row, int col) { Object value = getValueAt(row, col); String str; if (value instanceof Property) { Property p = (Property) value; Object v = null; try { v = p.getValue(); } catch (IllegalAccessException ex) { } catch (InvocationTargetException ex) { } if (v instanceof String) { str = (String) v; } else { str = null; } } else if (value instanceof VisualizerNode) { str = ((VisualizerNode) value).getDisplayName(); //str = Visualizer.findNode(value).getDisplayName(); } else { str = null; } return str; }
public String getToolTipText(MouseEvent event) { if(event != null) { Point p = event.getPoint(); p.translate(positionX, visibleRow * getRowHeight()); int selRow = getRowForLocation(p.x, p.y); if(selRow != -1) { TreePath path = getPathForRow(selRow); VisualizerNode v = (VisualizerNode)path.getLastPathComponent(); String tooltip = v.getShortDescription(); String displayName = v.getDisplayName (); if ((tooltip != null) && !tooltip.equals (displayName)) return tooltip; } } return null; }
public String getToolTipText(MouseEvent event) { if(event != null) { Point p = event.getPoint(); p.translate(positionX, visibleRow * getRowHeight()); int selRow = getRowForLocation(p.x, p.y); if(selRow != -1) { TreePath path = getPathForRow(selRow); VisualizerNode v = (VisualizerNode)path.getLastPathComponent(); String tooltip = v.getShortDescription(); String displayName = v.getDisplayName (); if ((tooltip != null) && !tooltip.equals (displayName)) return tooltip; } } return null; }
@Override public String getToolTipText(MouseEvent event) { if (event != null) { Point p = event.getPoint(); p.translate(positionX, visibleRow * getRowHeight()); int selRow = getRowForLocation(p.x, p.y); if (selRow != -1) { TreePath path = getPathForRow(selRow); VisualizerNode v = (VisualizerNode) path.getLastPathComponent(); String tooltip = v.getShortDescription(); String displayName = v.getDisplayName(); if ((tooltip != null) && !tooltip.equals(displayName)) { return tooltip; } } } return null; }
results.add (path); String elementName = ((VisualizerNode)path.getLastPathComponent()).getDisplayName();
@Override public String getStringValueAt(int row, int col) { Object value = transformValue(getValueAt(row, col)); String str; if (value instanceof Property) { Property p = (Property) value; Object v = null; try { v = p.getValue(); } catch (IllegalAccessException ex) { } catch (InvocationTargetException ex) { } if (v instanceof String) { str = (String) v; } else { str = null; } } else if (value instanceof VisualizerNode) { str = ((VisualizerNode) value).getDisplayName(); } else if (value instanceof Node) { str = ((Node) value).getDisplayName(); } else if (value instanceof String) { str = (String) value; } else { str = null; } return str; }
/** Finds the component that is capable of drawing the cell in a tree. * @param value value can be either <code>Node</code> * or a <code>VisualizerNode</code>. * @return component to draw the value */ @Override public Component getTreeCellRendererComponent( JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus ) { VisualizerNode vis = findVisualizerNode(value); if (vis == draggedOver) { sel = true; } String text = vis.getHtmlDisplayName(); boolean isHtml = text != null; if (!isHtml) { text = vis.getDisplayName(); } //Get our result value - really it is ren, but this call causes //it to configure itself with the passed values Component result = renderer.getTreeCellRendererComponent(tree, text, sel, expanded, leaf, row, hasFocus); result.setEnabled(tree.isEnabled()); renderer.setHtml(isHtml); //Do our additional configuration - set up the icon and possibly //do some hacks to make it look focused for TreeTableView configureFrom(renderer, tree, expanded, sel, vis); return result; }