bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
public Window(Window owner, GraphicsConfiguration gc) { this (); synchronized (getTreeLock()) { if (owner == null) throw new IllegalArgumentException ("owner must not be null"); parent = owner; owner.ownedWindows.add(new WeakReference(this)); } // FIXME: make this text visible in the window. SecurityManager s = System.getSecurityManager(); if (s != null && ! s.checkTopLevelWindow(this)) warningString = System.getProperty("awt.appletWarning"); if (gc != null && gc.getDevice().getType() != GraphicsDevice.TYPE_RASTER_SCREEN) throw new IllegalArgumentException ("gc must be from a screen device"); if (gc == null) graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment() .getDefaultScreenDevice() .getDefaultConfiguration(); else graphicsConfiguration = gc; }
public Window(Window owner, GraphicsConfiguration gc) { this (); synchronized (getTreeLock()) { if (owner == null) throw new IllegalArgumentException ("owner must not be null"); parent = owner; owner.ownedWindows.add(new WeakReference(this)); } // FIXME: make this text visible in the window. SecurityManager s = System.getSecurityManager(); if (s != null && ! s.checkTopLevelWindow(this)) warningString = System.getProperty("awt.appletWarning"); if (gc != null && gc.getDevice().getType() != GraphicsDevice.TYPE_RASTER_SCREEN) throw new IllegalArgumentException ("gc must be from a screen device"); if (gc == null) graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment() .getDefaultScreenDevice() .getDefaultConfiguration(); else graphicsConfiguration = gc; }
15,830
public Serializable extract_Value() throws BAD_OPERATION { try { return ((ValueBaseHolder) has).value; } catch (ClassCastException ex) { return new BAD_OPERATION("Value type expected"); } }
public Serializable extract_Value() throws BAD_OPERATION { try { return ((ValueBaseHolder) has).value; } } catch (Exception ex) { return new BAD_OPERATION("Value type expected"); } }
15,831
public ObjectHolder(org.omg.CORBA.Object initial_value) { value = initial_value; }
public ObjectHolder() { value = initial_value; }
15,832
public ObjectHolder(org.omg.CORBA.Object initial_value) { value = initial_value; }
public ObjectHolder(org.omg.CORBA.Object initial_value) { }
15,833
public PrincipalHolder(Principal initial_value) { value = initial_value; }
public PrincipalHolder() { value = initial_value; }
15,834
public PrincipalHolder(Principal initial_value) { value = initial_value; }
public PrincipalHolder(Principal initial_value) { }
15,835
public TypeCodeHolder(TypeCode initial_value) { value = initial_value; }
public TypeCodeHolder() { value = initial_value; }
15,836
public TypeCodeHolder(TypeCode initial_value) { value = initial_value; }
public TypeCodeHolder(TypeCode initial_value) { }
15,837
public ValueBaseHolder(Serializable initial) { value = initial; }
public ValueBaseHolder() { value = initial; }
15,838
public ValueBaseHolder(Serializable initial) { value = initial; }
public ValueBaseHolder(Serializable initial) { }
15,839
public AnyHolder(Any initial_value) { value = initial_value; }
public AnyHolder() { value = initial_value; }
15,840
public AnyHolder(Any initial_value) { value = initial_value; }
public AnyHolder(Any initial_value) { }
15,841
public BooleanHolder(boolean initial_value) { value = initial_value; }
public BooleanHolder() { value = initial_value; }
15,842
public BooleanHolder(boolean initial_value) { value = initial_value; }
public BooleanHolder(boolean initial_value) { }
15,843
public CharHolder(char initial_value) { value = initial_value; }
public CharHolder() { value = initial_value; }
15,844
public CharHolder(char initial_value) { value = initial_value; }
public CharHolder(char initial_value) { }
15,845
public DoubleHolder(double initial_value) { value = initial_value; }
public DoubleHolder() { value = initial_value; }
15,846
public DoubleHolder(double initial_value) { value = initial_value; }
public DoubleHolder(double initial_value) { }
15,847
public FixedHolder(BigDecimal initial_value) { value = initial_value; }
public FixedHolder() { value = initial_value; }
15,848
public FixedHolder(BigDecimal initial_value) { value = initial_value; }
public FixedHolder(BigDecimal initial_value) { }
15,849
public FloatHolder(float initial_value) { value = initial_value; }
public FloatHolder() { value = initial_value; }
15,850
public FloatHolder(float initial_value) { value = initial_value; }
public FloatHolder(float initial_value) { }
15,851
public IntHolder(int initial_value) { value = initial_value; }
public IntHolder() { value = initial_value; }
15,852
public IntHolder(int initial_value) { value = initial_value; }
public IntHolder(int initial_value) { }
15,853
public LongHolder(long initial_value) { value = initial_value; }
public LongHolder() { value = initial_value; }
15,854
public LongHolder(long initial_value) { value = initial_value; }
public LongHolder(long initial_value) { }
15,855
public OctetHolder(byte initial_value) { value = initial_value; }
public OctetHolder() { value = initial_value; }
15,856
public OctetHolder(byte initial_value) { value = initial_value; }
public OctetHolder(byte initial_value) { }
15,857
public ShortHolder(short initial_value) { value = initial_value; }
public ShortHolder() { value = initial_value; }
15,858
public ShortHolder(short initial_value) { value = initial_value; }
public ShortHolder(short initial_value) { }
15,859
public StringHolder(String initial_value) { value = initial_value; }
public StringHolder() { value = initial_value; }
15,860
public StringHolder(String initial_value) { value = initial_value; }
public StringHolder(String initial_value) { }
15,861
public WCharHolder(char initial_value) { value = initial_value; }
public WCharHolder() { value = initial_value; }
15,862
public WCharHolder(char initial_value) { value = initial_value; }
public WCharHolder(char initial_value) { }
15,863
public WStringHolder(String initial_value) { value = initial_value; }
public WStringHolder() { value = initial_value; }
15,864
public WStringHolder(String initial_value) { value = initial_value; }
public WStringHolder(String initial_value) { }
15,865
public UnsatisfiedLinkError(String s) { super(s); }
public UnsatisfiedLinkError(String s) { super(s); }
15,866
public void mousePressed(MouseEvent e) { Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon"); if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; } // add gap*2 for the space before and after the text if (icon != null) bounds.width += icon.getIconWidth() + gap*2; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { if (inBounds) { selectPath(tree, path); if (e.getClickCount() == 2 && !isLeaf(row)) toggleExpandState(path); } if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); tree.scrollPathToVisible(path); } else if (tree.isEditable()) startEditing(path, e); } } }
public void mousePressed(MouseEvent e) { Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon"); if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; } // add gap*2 for the space before and after the text if (icon != null) bounds.width += icon.getIconWidth() + gap * 2; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { if (inBounds) { selectPath(tree, path); if (e.getClickCount() == 2 && !isLeaf(row)) toggleExpandState(path); } if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); tree.scrollPathToVisible(path); } else if (tree.isEditable()) startEditing(path, e); } } }
15,867
public Rectangle getNodeDimensions(Object cell, int row, int depth, boolean expanded, Rectangle size) { if (size == null || cell == null) return null; String s = cell.toString(); Font f = tree.getFont(); FontMetrics fm = tree.getToolkit().getFontMetrics(f); if (s != null) { size.x = getRowX(row, depth); size.width = SwingUtilities.computeStringWidth(fm, s); size.height = fm.getHeight(); } return size; }
public Rectangle getNodeDimensions(Object cell, int row, int depth, boolean expanded, Rectangle size) { if (size == null || cell == null) return null; String s = cell.toString(); Font f = tree.getFont(); FontMetrics fm = tree.getToolkit().getFontMetrics(f); if (s != null) { size.x = getRowX(row, depth); size.width = SwingUtilities.computeStringWidth(fm, s); size.height = getMaxHeight(tree); size.y = size.height * row; } return size; }
15,868
protected TreeCellEditor createDefaultCellEditor() { if (currentCellRenderer != null) return new DefaultTreeCellEditor(tree, (DefaultTreeCellRenderer) currentCellRenderer, cellEditor); return new DefaultTreeCellEditor(tree, (DefaultTreeCellRenderer) createDefaultCellRenderer(), cellEditor); }
protected TreeCellEditor createDefaultCellEditor() { if (currentCellRenderer != null) return new DefaultTreeCellEditor( tree, (DefaultTreeCellRenderer) currentCellRenderer, cellEditor); return new DefaultTreeCellEditor( tree, (DefaultTreeCellRenderer) createDefaultCellRenderer(), cellEditor); }
15,870
protected TreeCellEditor createDefaultCellEditor() { if (currentCellRenderer != null) return new DefaultTreeCellEditor(tree, (DefaultTreeCellRenderer) currentCellRenderer, cellEditor); return new DefaultTreeCellEditor(tree, (DefaultTreeCellRenderer) createDefaultCellRenderer(), cellEditor); }
protected TreeCellEditor createDefaultCellEditor() { if (currentCellRenderer != null) return new DefaultTreeCellEditor( tree, (DefaultTreeCellRenderer) currentCellRenderer, cellEditor); return new DefaultTreeCellEditor( tree, (DefaultTreeCellRenderer) createDefaultCellRenderer(), cellEditor); }
15,871
public TreePath getClosestPathForLocation(JTree tree, int x, int y) { int row = Math.round(y / getRowHeight()); TreePath path = getPathForRow(tree, row); // no row is visible at this node while (row > 0 && path == null) { --row; path = getPathForRow(tree, row); } return path; }
public TreePath getClosestPathForLocation(JTree tree, int x, int y) { int row = Math.round(y / getMaxHeight(tree)); TreePath path = getPathForRow(tree, row); // no row is visible at this node while (row > 0 && path == null) { --row; path = getPathForRow(tree, row); } return path; }
15,872
Object getNextVisibleNode(Object node) { if (currentVisiblePath != null) { Object[] nodes = currentVisiblePath.getPath(); int i = 0; while (i < nodes.length && !node.equals(nodes[i])) i++; // return the next node if (i+1 < nodes.length) return nodes[i+1]; } return null; }
Object getNextVisibleNode(Object node) { if (currentVisiblePath != null) { Object[] nodes = currentVisiblePath.getPath(); int i = 0; while (i < nodes.length && !node.equals(nodes[i])) i++; // return the next node if (i+1 < nodes.length) return nodes[i+1]; } return null; }
15,873
Object getParent(Object root, Object node) { if (root == null || node == null || root.equals(node)) return null; if (node instanceof TreeNode) return ((TreeNode) node).getParent(); return findNode(root, node); }
Object getParent(Object root, Object node) { if (root == null || node == null || root.equals(node)) return null; if (node instanceof TreeNode) return ((TreeNode) node).getParent(); return findNode(root, node); }
15,874
public Rectangle getPathBounds(JTree tree, TreePath path) { Rectangle bounds = null; int row = -1; Object cell = null; if (path != null) { row = getRowForPath(tree, path); cell = path.getLastPathComponent(); bounds = new Rectangle(0, row * getRowHeight(), 0, 0); } return nodeDimensions.getNodeDimensions(cell, row, getLevel(cell), tree.isExpanded(path), bounds); }
public Rectangle getPathBounds(JTree tree, TreePath path) { int row = -1; Object cell = null; if (path != null) { row = getRowForPath(tree, path); cell = path.getLastPathComponent(); bounds = new Rectangle(0, row * getRowHeight(), 0, 0); } return nodeDimensions.getNodeDimensions(cell, row, getLevel(cell), tree.isExpanded(path), bounds); }
15,875
public Rectangle getPathBounds(JTree tree, TreePath path) { Rectangle bounds = null; int row = -1; Object cell = null; if (path != null) { row = getRowForPath(tree, path); cell = path.getLastPathComponent(); bounds = new Rectangle(0, row * getRowHeight(), 0, 0); } return nodeDimensions.getNodeDimensions(cell, row, getLevel(cell), tree.isExpanded(path), bounds); }
public Rectangle getPathBounds(JTree tree, TreePath path) { Rectangle bounds = null; int row = -1; Object cell = null; if (path != null) { row = getRowForPath(tree, path); cell = path.getLastPathComponent(); } return nodeDimensions.getNodeDimensions(cell, row, getLevel(cell), tree.isExpanded(path), bounds); }
15,876
public Rectangle getPathBounds(JTree tree, TreePath path) { Rectangle bounds = null; int row = -1; Object cell = null; if (path != null) { row = getRowForPath(tree, path); cell = path.getLastPathComponent(); bounds = new Rectangle(0, row * getRowHeight(), 0, 0); } return nodeDimensions.getNodeDimensions(cell, row, getLevel(cell), tree.isExpanded(path), bounds); }
public Rectangle getPathBounds(JTree tree, TreePath path) { Rectangle bounds = null; int row = -1; Object cell = null; if (path != null) { row = getRowForPath(tree, path); cell = path.getLastPathComponent(); bounds = new Rectangle(0, row * getRowHeight(), 0, 0); } return nodeDimensions.getNodeDimensions(cell, row, getLevel(cell), tree.isExpanded(path), bounds); }
15,877
public Rectangle getPathBounds(JTree tree, TreePath path) { Rectangle bounds = null; int row = -1; Object cell = null; if (path != null) { row = getRowForPath(tree, path); cell = path.getLastPathComponent(); bounds = new Rectangle(0, row * getRowHeight(), 0, 0); } return nodeDimensions.getNodeDimensions(cell, row, getLevel(cell), tree.isExpanded(path), bounds); }
public Rectangle getPathBounds(JTree tree, TreePath path) { Rectangle bounds = null; int row = -1; Object cell = null; if (path != null) { row = getRowForPath(tree, path); cell = path.getLastPathComponent(); bounds = new Rectangle(0, row * getRowHeight(), 0, 0); } return nodeDimensions.getNodeDimensions(cell, row, getLevel(cell), tree.isExpanded(path), new Rectangle()); }
15,878
Object[] getPathToRoot(Object node, int depth) { if (node == null) { if (depth == 0) return null; return new Object[depth]; } Object[] path = getPathToRoot(getParent(treeModel.getRoot(), node), depth + 1); path[path.length - depth - 1] = node; return path; }
Object[] getPathToRoot(Object node, int depth) { if (node == null) { if (depth == 0) return null; return new Object[depth]; } Object[] path = getPathToRoot(getParent(treeModel.getRoot(), node), depth + 1); path[path.length - depth - 1] = node; return path; }
15,879
Object getPreviousVisibleNode(Object node) { if (currentVisiblePath != null) { Object[] nodes = currentVisiblePath.getPath(); int i = 0; while (i < nodes.length && !node.equals(nodes[i])) i++; // return the next node if (i-1 >= 0) return nodes[i-1]; } return null; }
Object getPreviousVisibleNode(Object node) { if (currentVisiblePath != null) { Object[] nodes = currentVisiblePath.getPath(); int i = 0; while (i < nodes.length && !node.equals(nodes[i])) i++; // return the next node if (i-1 >= 0) return nodes[i-1]; } return null; }
15,880
public void installUI(JComponent c) { tree = (JTree) c; prepareForUIInstall(); super.installUI(c); installDefaults(); installComponents(); installKeyboardActions(); installListeners(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; TreeModel mod = tree.getModel(); setModel(mod); if (mod != null) { Object root = mod.getRoot(); if (root != null) { TreePath path = new TreePath(root); if (!tree.isExpanded(path)) toggleExpandState(path); } } treeSelectionModel = tree.getSelectionModel(); completeUIInstall(); }
public void installUI(JComponent c) { tree = (JTree) c; prepareForUIInstall(); super.installUI(c); installDefaults(); installComponents(); installKeyboardActions(); installListeners(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; TreeModel mod = tree.getModel(); setModel(mod); if (mod != null) { Object root = mod.getRoot(); if (root != null) { TreePath path = new TreePath(root); if (!tree.isExpanded(path)) toggleExpandState(path); } } treeSelectionModel = tree.getSelectionModel(); completeUIInstall(); }
15,881
protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY) { boolean cntlClick = false; int row = getRowForPath(tree, path); if (!isLeaf(row)) { Rectangle bounds = getPathBounds(tree, path); if (hasControlIcons() && (mouseX < bounds.x) && (mouseX > (bounds.x - getCurrentControlIcon(path).getIconWidth() - gap))) cntlClick = true; } return cntlClick; }
protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY) { boolean cntlClick = false; int row = getRowForPath(tree, path); if (!isLeaf(row)) { Rectangle bounds = getPathBounds(tree, path); if (hasControlIcons() && (mouseX < bounds.x) && (mouseX > (bounds.x - getCurrentControlIcon(path).getIconWidth() - gap))) cntlClick = true; } return cntlClick; }
15,882
protected boolean isMultiSelectEvent(MouseEvent event) { return (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.CONTIGUOUS_TREE_SELECTION); }
protected boolean isMultiSelectEvent(MouseEvent event) { return (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.CONTIGUOUS_TREE_SELECTION); }
15,883
protected boolean isToggleSelectionEvent(MouseEvent event) { return (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.SINGLE_TREE_SELECTION); }
protected boolean isToggleSelectionEvent(MouseEvent event) { return (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.SINGLE_TREE_SELECTION); }
15,884
protected void paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { if (shouldPaintExpandControl(path, row, isExpanded, hasBeenExpanded, isLeaf)) { Icon icon = getCurrentControlIcon(path); int iconW = icon.getIconWidth(); int x = bounds.x - rightChildIndent + iconW/2; if (x + iconW > bounds.x) x = bounds.x - rightChildIndent - gap; icon.paintIcon(tree, g, x, bounds.y + bounds.height/2 - icon.getIconHeight()/2); } }
protected void paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { if (shouldPaintExpandControl(path, row, isExpanded, hasBeenExpanded, isLeaf)) { Icon icon = getCurrentControlIcon(path); int iconW = icon.getIconWidth(); int x = bounds.x - rightChildIndent + iconW/2; if (x + iconW > bounds.x) x = bounds.x - rightChildIndent - gap; icon.paintIcon(tree, g, x, bounds.y + bounds.height/2 - icon.getIconHeight()/2); } }
15,885
protected void paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { if (shouldPaintExpandControl(path, row, isExpanded, hasBeenExpanded, isLeaf)) { Icon icon = getCurrentControlIcon(path); int iconW = icon.getIconWidth(); int x = bounds.x - rightChildIndent + iconW/2; if (x + iconW > bounds.x) x = bounds.x - rightChildIndent - gap; icon.paintIcon(tree, g, x, bounds.y + bounds.height/2 - icon.getIconHeight()/2); } }
protected void paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { if (shouldPaintExpandControl(path, row, isExpanded, hasBeenExpanded, isLeaf)) { Icon icon = getCurrentControlIcon(path); int iconW = icon.getIconWidth(); int x = bounds.x - rightChildIndent + iconW / 2; if (x + iconW > bounds.x) x = bounds.x - rightChildIndent - gap; icon.paintIcon(tree, g, x, bounds.y + bounds.height/2 - icon.getIconHeight()/2); } }
15,886
protected void paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { if (shouldPaintExpandControl(path, row, isExpanded, hasBeenExpanded, isLeaf)) { Icon icon = getCurrentControlIcon(path); int iconW = icon.getIconWidth(); int x = bounds.x - rightChildIndent + iconW/2; if (x + iconW > bounds.x) x = bounds.x - rightChildIndent - gap; icon.paintIcon(tree, g, x, bounds.y + bounds.height/2 - icon.getIconHeight()/2); } }
protected void paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { if (shouldPaintExpandControl(path, row, isExpanded, hasBeenExpanded, isLeaf)) { Icon icon = getCurrentControlIcon(path); int iconW = icon.getIconWidth(); int x = bounds.x - rightChildIndent + iconW/2; if (x + iconW > bounds.x) x = bounds.x - rightChildIndent - gap; icon.paintIcon(tree, g, x, bounds.y + bounds.height / 2 - icon.getIconHeight() / 2); } }
15,887
protected void paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { if (row != 0) paintHorizontalLine(g, tree, bounds.y + bounds.height/2, bounds.x - gap - 2, bounds.x); }
protected void paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { if (row != 0) paintHorizontalLine(g, tree, bounds.y + bounds.height/2, bounds.x - gap - 2, bounds.x); }
15,888
protected void paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { if (row != 0) paintHorizontalLine(g, tree, bounds.y + bounds.height/2, bounds.x - gap - 2, bounds.x); }
protected void paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { if (row != 0) paintHorizontalLine(g, tree, bounds.y + bounds.height/2, bounds.x - gap - 2, bounds.x); }
15,889
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { boolean selected = tree.isPathSelected(path); boolean hasIcons = false; Object node = path.getLastPathComponent(); if (tree.isVisible(path)) { if (!validCachedPreferredSize) updateCachedPreferredSize(); paintExpandControl(g, clipBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf); if (row != 0) bounds.x += gap; bounds.width = preferredSize.width + bounds.x; if (editingComponent != null && editingPath != null && isEditing(tree) && node.equals(editingPath.getLastPathComponent())) { rendererPane.paintComponent(g, editingComponent.getParent(), null, bounds); } else { TreeCellRenderer dtcr = tree.getCellRenderer(); if (dtcr == null) dtcr = createDefaultCellRenderer(); Component c = dtcr.getTreeCellRendererComponent(tree, node, selected, isExpanded, isLeaf, row, tree.hasFocus()); rendererPane.paintComponent(g, c, c.getParent(), bounds); } } }
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { boolean selected = tree.isPathSelected(path); boolean hasIcons = false; Object node = path.getLastPathComponent(); if (tree.isVisible(path)) { if (!validCachedPreferredSize) updateCachedPreferredSize(); paintExpandControl(g, clipBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf); if (row != 0) bounds.x += gap; bounds.width = preferredSize.width + bounds.x; if (editingComponent != null && editingPath != null && isEditing(tree) && node.equals(editingPath.getLastPathComponent())) { rendererPane.paintComponent(g, editingComponent.getParent(), null, bounds); } else { TreeCellRenderer dtcr = tree.getCellRenderer(); if (dtcr == null) dtcr = createDefaultCellRenderer(); Component c = dtcr.getTreeCellRendererComponent(tree, node, selected, isExpanded, isLeaf, row, tree.hasFocus()); rendererPane.paintComponent(g, c, c.getParent(), bounds); } } }
15,890
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { boolean selected = tree.isPathSelected(path); boolean hasIcons = false; Object node = path.getLastPathComponent(); if (tree.isVisible(path)) { if (!validCachedPreferredSize) updateCachedPreferredSize(); paintExpandControl(g, clipBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf); if (row != 0) bounds.x += gap; bounds.width = preferredSize.width + bounds.x; if (editingComponent != null && editingPath != null && isEditing(tree) && node.equals(editingPath.getLastPathComponent())) { rendererPane.paintComponent(g, editingComponent.getParent(), null, bounds); } else { TreeCellRenderer dtcr = tree.getCellRenderer(); if (dtcr == null) dtcr = createDefaultCellRenderer(); Component c = dtcr.getTreeCellRendererComponent(tree, node, selected, isExpanded, isLeaf, row, tree.hasFocus()); rendererPane.paintComponent(g, c, c.getParent(), bounds); } } }
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { boolean selected = tree.isPathSelected(path); boolean hasIcons = false; Object node = path.getLastPathComponent(); if (tree.isVisible(path)) { if (!validCachedPreferredSize) updateCachedPreferredSize(); paintExpandControl(g, clipBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf); if (row != 0) bounds.x += gap; bounds.width = preferredSize.width + bounds.x; if (editingComponent != null && editingPath != null && isEditing(tree) && node.equals(editingPath.getLastPathComponent())) { rendererPane.paintComponent(g, editingComponent.getParent(), null, bounds); } else { TreeCellRenderer dtcr = tree.getCellRenderer(); if (dtcr == null) dtcr = createDefaultCellRenderer(); Component c = dtcr.getTreeCellRendererComponent(tree, node, selected, isExpanded, isLeaf, row, tree.hasFocus()); rendererPane.paintComponent(g, c, c.getParent(), bounds); } } }
15,891
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { boolean selected = tree.isPathSelected(path); boolean hasIcons = false; Object node = path.getLastPathComponent(); if (tree.isVisible(path)) { if (!validCachedPreferredSize) updateCachedPreferredSize(); paintExpandControl(g, clipBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf); if (row != 0) bounds.x += gap; bounds.width = preferredSize.width + bounds.x; if (editingComponent != null && editingPath != null && isEditing(tree) && node.equals(editingPath.getLastPathComponent())) { rendererPane.paintComponent(g, editingComponent.getParent(), null, bounds); } else { TreeCellRenderer dtcr = tree.getCellRenderer(); if (dtcr == null) dtcr = createDefaultCellRenderer(); Component c = dtcr.getTreeCellRendererComponent(tree, node, selected, isExpanded, isLeaf, row, tree.hasFocus()); rendererPane.paintComponent(g, c, c.getParent(), bounds); } } }
protectedvoidpaintRow(Graphicsg,RectangleclipBounds,Insetsinsets,Rectanglebounds,TreePathpath,introw,booleanisExpanded,booleanhasBeenExpanded,booleanisLeaf){booleanselected=tree.isPathSelected(path);booleanhasIcons=false;Objectnode=path.getLastPathComponent();if(tree.isVisible(path)){if(!validCachedPreferredSize)updateCachedPreferredSize();paintExpandControl(g,clipBounds,insets,bounds,path,row,isExpanded,hasBeenExpanded,isLeaf);if(row!=0)bounds.x+=gap;bounds.width=preferredSize.width+bounds.x;if(editingComponent!=null&&editingPath!=null&&isEditing(tree)&&node.equals(editingPath.getLastPathComponent())){rendererPane.paintComponent(g,editingComponent.getParent(),null,bounds);}else{TreeCellRendererdtcr=tree.getCellRenderer();if(dtcr==null)dtcr=createDefaultCellRenderer();Componentc=dtcr.getTreeCellRendererComponent(tree,node,selected,isExpanded,isLeaf,row,tree.hasFocus());rendererPane.paintComponent(g,c,c.getParent(),bounds);}}}
15,892
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { boolean selected = tree.isPathSelected(path); boolean hasIcons = false; Object node = path.getLastPathComponent(); if (tree.isVisible(path)) { if (!validCachedPreferredSize) updateCachedPreferredSize(); paintExpandControl(g, clipBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf); if (row != 0) bounds.x += gap; bounds.width = preferredSize.width + bounds.x; if (editingComponent != null && editingPath != null && isEditing(tree) && node.equals(editingPath.getLastPathComponent())) { rendererPane.paintComponent(g, editingComponent.getParent(), null, bounds); } else { TreeCellRenderer dtcr = tree.getCellRenderer(); if (dtcr == null) dtcr = createDefaultCellRenderer(); Component c = dtcr.getTreeCellRendererComponent(tree, node, selected, isExpanded, isLeaf, row, tree.hasFocus()); rendererPane.paintComponent(g, c, c.getParent(), bounds); } } }
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { boolean selected = tree.isPathSelected(path); boolean hasIcons = false; Object node = path.getLastPathComponent(); if (tree.isVisible(path)) { if (!validCachedPreferredSize) updateCachedPreferredSize(); paintExpandControl(g, clipBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf); if (row != 0) bounds.x += gap; bounds.width = preferredSize.width + bounds.x; if (editingComponent != null && editingPath != null && isEditing(tree) && node.equals(editingPath.getLastPathComponent())) { rendererPane.paintComponent(g, editingComponent.getParent(), null, bounds); } else { TreeCellRenderer dtcr = tree.getCellRenderer(); if (dtcr == null) dtcr = createDefaultCellRenderer(); Component c = dtcr.getTreeCellRendererComponent(tree, node, selected, isExpanded, isLeaf, row, tree.hasFocus()); rendererPane.paintComponent(g, c, c.getParent(), bounds); } } }
15,893
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path) { int max = tree.getVisibleRowCount(); for (int i = 0; i < max; i++) { Object curr = path.getPathComponent(i); TreePath currPath = new TreePath(getPathToRoot(curr, 0)); int numChild = treeModel.getChildCount(curr); if (numChild > 0 && tree.isExpanded(currPath)) { Rectangle bounds = getPathBounds(tree, currPath); Rectangle lastChildBounds = getPathBounds(tree, new TreePath(getPathToRoot( treeModel.getChild(curr, numChild - 1), 0))); paintVerticalLine(g, tree, bounds.x + gap + 2, bounds.y + bounds.height - 2, lastChildBounds.y + lastChildBounds.height/2); } } }
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path) { int max = tree.getVisibleRowCount(); for (int i = 0; i < max; i++) { Object curr = path.getPathComponent(i); TreePath currPath = new TreePath(getPathToRoot(curr, 0)); int numChild = treeModel.getChildCount(curr); if (numChild > 0 && tree.isExpanded(currPath)) { Rectangle bounds = getPathBounds(tree, currPath); Rectangle lastChildBounds = getPathBounds(tree, new TreePath(getPathToRoot( treeModel.getChild(curr, numChild - 1), 0))); paintVerticalLine(g, tree, bounds.x + gap + 2, bounds.y + bounds.height - 2, lastChildBounds.y + lastChildBounds.height/2); } } }
15,894
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path) { int max = tree.getVisibleRowCount(); for (int i = 0; i < max; i++) { Object curr = path.getPathComponent(i); TreePath currPath = new TreePath(getPathToRoot(curr, 0)); int numChild = treeModel.getChildCount(curr); if (numChild > 0 && tree.isExpanded(currPath)) { Rectangle bounds = getPathBounds(tree, currPath); Rectangle lastChildBounds = getPathBounds(tree, new TreePath(getPathToRoot( treeModel.getChild(curr, numChild - 1), 0))); paintVerticalLine(g, tree, bounds.x + gap + 2, bounds.y + bounds.height - 2, lastChildBounds.y + lastChildBounds.height/2); } } }
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path) { int max = tree.getVisibleRowCount(); for (int i = 0; i < max; i++) { Object curr = path.getPathComponent(i); TreePath currPath = new TreePath(getPathToRoot(curr, 0)); int numChild = treeModel.getChildCount(curr); if (numChild > 0 && tree.isExpanded(currPath)) { Rectangle bounds = getPathBounds(tree, currPath); Rectangle lastChildBounds = getPathBounds(tree, new TreePath(getPathToRoot( treeModel.getChild(curr, numChild - 1), 0))); paintVerticalLine(g, tree, bounds.x + gap + 2, bounds.y + bounds.height - 2, lastChildBounds.y + lastChildBounds.height/2); } } }
15,895
void selectPath(JTree tree, TreePath path) { if (path != null) { if (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.SINGLE_TREE_SELECTION) { tree.getSelectionModel().clearSelection(); tree.addSelectionPath(path); tree.setLeadSelectionPath(path); } else if (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.CONTIGUOUS_TREE_SELECTION) { // TODO } else { tree.addSelectionPath(path); tree.setLeadSelectionPath(path); tree.getSelectionModel().setSelectionMode (TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); } } }
void selectPath(JTree tree, TreePath path) { if (path != null) { if (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.SINGLE_TREE_SELECTION) { tree.getSelectionModel().clearSelection(); tree.addSelectionPath(path); tree.setLeadSelectionPath(path); } else if (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.CONTIGUOUS_TREE_SELECTION) { // TODO } else { tree.addSelectionPath(path); tree.setLeadSelectionPath(path); tree.getSelectionModel().setSelectionMode (TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); } } }
15,896
void selectPath(JTree tree, TreePath path) { if (path != null) { if (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.SINGLE_TREE_SELECTION) { tree.getSelectionModel().clearSelection(); tree.addSelectionPath(path); tree.setLeadSelectionPath(path); } else if (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.CONTIGUOUS_TREE_SELECTION) { // TODO } else { tree.addSelectionPath(path); tree.setLeadSelectionPath(path); tree.getSelectionModel().setSelectionMode (TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); } } }
void selectPath(JTree tree, TreePath path) { if (path != null) { if (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.SINGLE_TREE_SELECTION) { tree.getSelectionModel().clearSelection(); tree.addSelectionPath(path); tree.setLeadSelectionPath(path); } else if (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.CONTIGUOUS_TREE_SELECTION) { // TODO } else { tree.addSelectionPath(path); tree.setLeadSelectionPath(path); tree.getSelectionModel().setSelectionMode (TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); } } }
15,897
void selectPath(JTree tree, TreePath path) { if (path != null) { if (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.SINGLE_TREE_SELECTION) { tree.getSelectionModel().clearSelection(); tree.addSelectionPath(path); tree.setLeadSelectionPath(path); } else if (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.CONTIGUOUS_TREE_SELECTION) { // TODO } else { tree.addSelectionPath(path); tree.setLeadSelectionPath(path); tree.getSelectionModel().setSelectionMode (TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); } } }
void selectPath(JTree tree, TreePath path) { if (path != null) { if (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.SINGLE_TREE_SELECTION) { tree.getSelectionModel().clearSelection(); tree.addSelectionPath(path); tree.setLeadSelectionPath(path); } else if (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.CONTIGUOUS_TREE_SELECTION) { // TODO } else { tree.addSelectionPath(path); tree.setLeadSelectionPath(path); tree.getSelectionModel().setSelectionMode (TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); } } }
15,898
protected void setRowHeight(int rowHeight) { if (rowHeight == 0) rowHeight = this.rowHeight; treeState.setRowHeight(rowHeight); }
protected void setRowHeight(int rowHeight) { if (rowHeight == 0) rowHeight = Math.max(getMaxHeight(tree), 20); treeState.setRowHeight(rowHeight); }
15,899
protected void uninstallKeyboardActions() { action = null; tree.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).setParent(null); tree.getActionMap().setParent(null); }
protected void uninstallKeyboardActions() { action = null; tree.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).setParent( null); tree.getActionMap().setParent(null); }
15,900
protected void updateCachedPreferredSize() { int maxWidth = 0; boolean isLeaf = false; if (currentVisiblePath != null) { Object[] path = currentVisiblePath.getPath(); for (int i = 0; i < path.length; i++) { TreePath curr = new TreePath(getPathToRoot(path[i], 0)); Rectangle bounds = getPathBounds(tree, curr); if (treeModel != null) isLeaf = treeModel.isLeaf(path[i]); if (!isLeaf && hasControlIcons()) bounds.width += getCurrentControlIcon(curr).getIconWidth(); maxWidth = Math.max(maxWidth, bounds.x + bounds.width); } preferredSize = new Dimension(maxWidth, (getRowHeight() * path.length)); } else preferredSize = new Dimension(0, 0); validCachedPreferredSize = true; }
protected void updateCachedPreferredSize() { int maxWidth = 0; boolean isLeaf = false; if (currentVisiblePath != null) { Object[] path = currentVisiblePath.getPath(); for (int i = 0; i < path.length; i++) { TreePath curr = new TreePath(getPathToRoot(path[i], 0)); Rectangle bounds = getPathBounds(tree, curr); if (treeModel != null) isLeaf = treeModel.isLeaf(path[i]); if (!isLeaf && hasControlIcons()) bounds.width += getCurrentControlIcon(curr).getIconWidth(); maxWidth = Math.max(maxWidth, bounds.x + bounds.width); } maxHeight = 0; maxHeight = getMaxHeight(tree); preferredSize = new Dimension(maxWidth, (maxHeight * path.length)); } else preferredSize = new Dimension(0, 0); validCachedPreferredSize = true; }
15,901
protected void updateCachedPreferredSize() { int maxWidth = 0; boolean isLeaf = false; if (currentVisiblePath != null) { Object[] path = currentVisiblePath.getPath(); for (int i = 0; i < path.length; i++) { TreePath curr = new TreePath(getPathToRoot(path[i], 0)); Rectangle bounds = getPathBounds(tree, curr); if (treeModel != null) isLeaf = treeModel.isLeaf(path[i]); if (!isLeaf && hasControlIcons()) bounds.width += getCurrentControlIcon(curr).getIconWidth(); maxWidth = Math.max(maxWidth, bounds.x + bounds.width); } preferredSize = new Dimension(maxWidth, (getRowHeight() * path.length)); } else preferredSize = new Dimension(0, 0); validCachedPreferredSize = true; }
protected void updateCachedPreferredSize() { int maxWidth = 0; boolean isLeaf = false; if (currentVisiblePath != null) { Object[] path = currentVisiblePath.getPath(); for (int i = 0; i < path.length; i++) { TreePath curr = new TreePath(getPathToRoot(path[i], 0)); Rectangle bounds = getPathBounds(tree, curr); if (treeModel != null) isLeaf = treeModel.isLeaf(path[i]); if (!isLeaf && hasControlIcons()) bounds.width += getCurrentControlIcon(curr).getIconWidth(); maxWidth = Math.max(maxWidth, bounds.x + bounds.width); } preferredSize = new Dimension(maxWidth, (getRowHeight() * path.length)); } else preferredSize = new Dimension(0, 0); validCachedPreferredSize = true; }
15,902
void updateCurrentVisiblePath() { if (treeModel == null) return; Object next = treeModel.getRoot(); if (next == null) return; TreePath rootPath = new TreePath(next); Rectangle bounds = getPathBounds(tree, rootPath); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((bounds.width == 0 && bounds.height == 0) || (!isRootVisible() && tree.isExpanded(new TreePath(next)))) { next = getNextNode(next); rootPath = new TreePath(next); } Object root = next; TreePath current = null; while (next != null) { if (current == null) current = rootPath; else current = current.pathByAddingChild(next); do { TreePath path = new TreePath(getPathToRoot(next, 0)); if ((tree.isVisible(path) && tree.isExpanded(path)) || treeModel.isLeaf(next)) next = getNextNode(next); else { Object pNext = next; next = getNextSibling(pNext); // if no next sibling, check parent's next sibling. if (next == null) { Object parent = getParent(root, pNext); while (next == null && parent != null) { next = getNextSibling(parent); if (next == null) parent = getParent(root, parent); } } } } while (next != null && !tree.isVisible(new TreePath(getPathToRoot(next, 0)))); } currentVisiblePath = current; tree.setVisibleRowCount(getRowCount(tree)); if (tree.getSelectionModel() != null && tree.getSelectionCount() == 0 && currentVisiblePath != null) selectPath(tree, new TreePath(getPathToRoot(currentVisiblePath. getPathComponent(0), 0))); }
void updateCurrentVisiblePath() { if (treeModel == null) return; Object next = treeModel.getRoot(); if (next == null) return; TreePath rootPath = new TreePath(next); Rectangle bounds = getPathBounds(tree, rootPath); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((bounds.width == 0 && bounds.height == 0) || (!isRootVisible() && tree.isExpanded(new TreePath(next)))) { next = getNextNode(next); rootPath = new TreePath(next); } Object root = next; TreePath current = null; while (next != null) { if (current == null) current = rootPath; else current = current.pathByAddingChild(next); do { TreePath path = new TreePath(getPathToRoot(next, 0)); if ((tree.isVisible(path) && tree.isExpanded(path)) || treeModel.isLeaf(next)) next = getNextNode(next); else { Object pNext = next; next = getNextSibling(pNext); // if no next sibling, check parent's next sibling. if (next == null) { Object parent = getParent(root, pNext); while (next == null && parent != null) { next = getNextSibling(parent); if (next == null) parent = getParent(root, parent); } } } } while (next != null && !tree.isVisible(new TreePath(getPathToRoot(next, 0)))); } currentVisiblePath = current; tree.setVisibleRowCount(getRowCount(tree)); if (tree.getSelectionModel() != null && tree.getSelectionCount() == 0 && currentVisiblePath != null) selectPath(tree, new TreePath(getPathToRoot(currentVisiblePath. getPathComponent(0), 0))); }
15,903
void updateCurrentVisiblePath() { if (treeModel == null) return; Object next = treeModel.getRoot(); if (next == null) return; TreePath rootPath = new TreePath(next); Rectangle bounds = getPathBounds(tree, rootPath); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((bounds.width == 0 && bounds.height == 0) || (!isRootVisible() && tree.isExpanded(new TreePath(next)))) { next = getNextNode(next); rootPath = new TreePath(next); } Object root = next; TreePath current = null; while (next != null) { if (current == null) current = rootPath; else current = current.pathByAddingChild(next); do { TreePath path = new TreePath(getPathToRoot(next, 0)); if ((tree.isVisible(path) && tree.isExpanded(path)) || treeModel.isLeaf(next)) next = getNextNode(next); else { Object pNext = next; next = getNextSibling(pNext); // if no next sibling, check parent's next sibling. if (next == null) { Object parent = getParent(root, pNext); while (next == null && parent != null) { next = getNextSibling(parent); if (next == null) parent = getParent(root, parent); } } } } while (next != null && !tree.isVisible(new TreePath(getPathToRoot(next, 0)))); } currentVisiblePath = current; tree.setVisibleRowCount(getRowCount(tree)); if (tree.getSelectionModel() != null && tree.getSelectionCount() == 0 && currentVisiblePath != null) selectPath(tree, new TreePath(getPathToRoot(currentVisiblePath. getPathComponent(0), 0))); }
void updateCurrentVisiblePath() { if (treeModel == null) return; Object next = treeModel.getRoot(); if (next == null) return; TreePath rootPath = new TreePath(next); Rectangle bounds = getPathBounds(tree, rootPath); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((bounds.width == 0 && bounds.height == 0) || (!isRootVisible() && tree.isExpanded(new TreePath(next)))) { next = getNextNode(next); rootPath = new TreePath(next); } Object root = next; TreePath current = null; while (next != null) { if (current == null) current = rootPath; else current = current.pathByAddingChild(next); do { TreePath path = new TreePath(getPathToRoot(next, 0)); if ((tree.isVisible(path) && tree.isExpanded(path)) || treeModel.isLeaf(next)) next = getNextNode(next); else { Object pNext = next; next = getNextSibling(pNext); // if no next sibling, check parent's next sibling. if (next == null) { Object parent = getParent(root, pNext); while (next == null && parent != null) { next = getNextSibling(parent); if (next == null) parent = getParent(root, parent); } } } } while (next != null && !tree.isVisible(new TreePath(getPathToRoot(next, 0)))); } currentVisiblePath = current; tree.setVisibleRowCount(getRowCount(tree)); if (tree.getSelectionModel() != null && tree.getSelectionCount() == 0 && currentVisiblePath != null) selectPath(tree, new TreePath(getPathToRoot(currentVisiblePath. getPathComponent(0), 0))); }
15,904
void updateCurrentVisiblePath() { if (treeModel == null) return; Object next = treeModel.getRoot(); if (next == null) return; TreePath rootPath = new TreePath(next); Rectangle bounds = getPathBounds(tree, rootPath); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((bounds.width == 0 && bounds.height == 0) || (!isRootVisible() && tree.isExpanded(new TreePath(next)))) { next = getNextNode(next); rootPath = new TreePath(next); } Object root = next; TreePath current = null; while (next != null) { if (current == null) current = rootPath; else current = current.pathByAddingChild(next); do { TreePath path = new TreePath(getPathToRoot(next, 0)); if ((tree.isVisible(path) && tree.isExpanded(path)) || treeModel.isLeaf(next)) next = getNextNode(next); else { Object pNext = next; next = getNextSibling(pNext); // if no next sibling, check parent's next sibling. if (next == null) { Object parent = getParent(root, pNext); while (next == null && parent != null) { next = getNextSibling(parent); if (next == null) parent = getParent(root, parent); } } } } while (next != null && !tree.isVisible(new TreePath(getPathToRoot(next, 0)))); } currentVisiblePath = current; tree.setVisibleRowCount(getRowCount(tree)); if (tree.getSelectionModel() != null && tree.getSelectionCount() == 0 && currentVisiblePath != null) selectPath(tree, new TreePath(getPathToRoot(currentVisiblePath. getPathComponent(0), 0))); }
void updateCurrentVisiblePath() { if (treeModel == null) return; Object next = treeModel.getRoot(); if (next == null) return; TreePath rootPath = new TreePath(next); Rectangle bounds = getPathBounds(tree, rootPath); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((bounds.width == 0 && bounds.height == 0) || (!isRootVisible() && tree.isExpanded(new TreePath(next)))) { next = getNextNode(next); rootPath = new TreePath(next); } Object root = next; TreePath current = null; while (next != null) { if (current == null) current = rootPath; else current = current.pathByAddingChild(next); do { TreePath path = new TreePath(getPathToRoot(next, 0)); if ((tree.isVisible(path) && tree.isExpanded(path)) || treeModel.isLeaf(next)) next = getNextNode(next); else { Object pNext = next; next = getNextSibling(pNext); // if no next sibling, check parent's next sibling. if (next == null) { Object parent = getParent(root, pNext); while (next == null && parent != null) { next = getNextSibling(parent); if (next == null) parent = getParent(root, parent); } } } } while (next != null && !tree.isVisible(new TreePath(getPathToRoot(next, 0)))); } currentVisiblePath = current; tree.setVisibleRowCount(getRowCount(tree)); if (tree.getSelectionModel() != null && tree.getSelectionCount() == 0 && currentVisiblePath != null) selectPath(tree, new TreePath(getPathToRoot(currentVisiblePath. getPathComponent(0), 0))); }
15,905
protected void updateRenderer() { if (tree != null) { if(tree.getCellRenderer() == null) { if(currentCellRenderer == null) currentCellRenderer = createDefaultCellRenderer(); tree.setCellRenderer(currentCellRenderer); } } }
protected void updateRenderer() { if (tree != null) { if (tree.getCellRenderer() == null) { if(currentCellRenderer == null) currentCellRenderer = createDefaultCellRenderer(); tree.setCellRenderer(currentCellRenderer); } } }
15,906
protected void updateRenderer() { if (tree != null) { if(tree.getCellRenderer() == null) { if(currentCellRenderer == null) currentCellRenderer = createDefaultCellRenderer(); tree.setCellRenderer(currentCellRenderer); } } }
protected void updateRenderer() { if (tree != null) { if(tree.getCellRenderer() == null) { if (currentCellRenderer == null) currentCellRenderer = createDefaultCellRenderer(); tree.setCellRenderer(currentCellRenderer); } } }
15,907
public Object getCellEditorValue();
public Object getCellEditorValue();
15,908
public Icon getIcon() { return icon; }
public Icon getIcon() { return icon; }
15,909
public void cancelCellEditing();
public void cancelCellEditing();
15,910
public abstract Rectangle getNodeDimensions(Object value0, int value1, int value2, boolean value3, Rectangle value4);
public abstract Rectangle getNodeDimensions(Object value0, int value1, int value2, boolean value3, Rectangle value4);
15,911
public Object getLastPathComponent() { return path[path.length - 1]; } // getLastPathComponent()
public Object getLastPathComponent() { return path[path.length - 1]; } // getLastPathComponent()
15,912
public Object getLastPathComponent() { return path[path.length - 1]; } // getLastPathComponent()
public Object getLastPathComponent() { return path[path.length - 1]; } // getLastPathComponent()
15,913
public boolean isEnabled() { return enabled; } // isEnabled()
public boolean isEnabled() { return enabled; } // isEnabled()
15,914
public boolean stopCellEditing();
public boolean stopCellEditing();
15,915
public DefaultTreeCellEditor(JTree value0, DefaultTreeCellRenderer value1, TreeCellEditor value2) { // TODO } // DefaultTreeCellEditor()
public DefaultTreeCellEditor(JTree value0, DefaultTreeCellRenderer value1, TreeCellEditor value2) { // TODO } // DefaultTreeCellEditor()
15,916
public DefaultTreeCellRenderer() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); setLeafIcon(getDefaultLeafIcon()); setOpenIcon(getDefaultOpenIcon()); setClosedIcon(getDefaultClosedIcon()); setTextNonSelectionColor(defaults.getColor("Tree.textForeground")); setTextSelectionColor(defaults.getColor("Tree.selectionForeground")); setBackgroundNonSelectionColor(defaults.getColor("Tree.textBackground")); setBackgroundSelectionColor(defaults.getColor("Tree.selectionBackground")); setBorderSelectionColor(defaults.getColor("Tree.selectionBorderColor")); }
public DefaultTreeCellRenderer() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); setLeafIcon(getDefaultLeafIcon()); setOpenIcon(getDefaultOpenIcon()); setClosedIcon(getDefaultClosedIcon()); setTextNonSelectionColor(defaults.getColor("Tree.textForeground")); setTextSelectionColor(defaults.getColor("Tree.selectionForeground")); setBackgroundNonSelectionColor(defaults.getColor("Tree.textBackground")); setBackgroundSelectionColor(defaults.getColor("Tree.selectionBackground")); setBorderSelectionColor(defaults.getColor("Tree.selectionBorderColor")); }
15,917
public DefaultTreeCellRenderer() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); setLeafIcon(getDefaultLeafIcon()); setOpenIcon(getDefaultOpenIcon()); setClosedIcon(getDefaultClosedIcon()); setTextNonSelectionColor(defaults.getColor("Tree.textForeground")); setTextSelectionColor(defaults.getColor("Tree.selectionForeground")); setBackgroundNonSelectionColor(defaults.getColor("Tree.textBackground")); setBackgroundSelectionColor(defaults.getColor("Tree.selectionBackground")); setBorderSelectionColor(defaults.getColor("Tree.selectionBorderColor")); }
public DefaultTreeCellRenderer() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); setLeafIcon(getDefaultLeafIcon()); setOpenIcon(getDefaultOpenIcon()); setClosedIcon(getDefaultClosedIcon()); setTextNonSelectionColor(defaults.getColor("Tree.textForeground")); setTextSelectionColor(defaults.getColor("Tree.selectionForeground")); setBackgroundNonSelectionColor(defaults.getColor("Tree.textBackground")); setBackgroundSelectionColor(defaults.getColor("Tree.selectionBackground")); setBorderSelectionColor(defaults.getColor("Tree.selectionBorderColor")); }
15,918
public FixedHeightLayoutCache() { // TODO } // FixedHeightLayoutCache()
public FixedHeightLayoutCache() { // TODO } // FixedHeightLayoutCache()
15,919
public Object[] getPath() { return path; } // getPath()
public Object[] getPath() { return path; } // getPath()
15,920
public Object[] getPath() { return path; } // getPath()
public Object[] getPath() { return path; } // getPath()
15,921
public int getPathCount() { return path.length; } // getPathCount()
public int getPathCount() { return path.length; } // getPathCount()
15,922
public int getPathCount() { return path.length; } // getPathCount()
public int getPathCount() { return path.length; } // getPathCount()
15,923
public Object getPathComponent(int position) { return path[position]; } // getPathComponent()
public Object getPathComponent(int position) { return path[position]; } // getPathComponent()
15,924
public Object getPathComponent(int position) { return path[position]; } // getPathComponent()
public Object getPathComponent(int position) { return path[position]; } // getPathComponent()
15,925
public void paintComponent(Graphics graphics, Component c, Container p, Rectangle r) { // TODO } // paintComponent()
public void paintComponent(Graphics graphics, Component c, Container p, Rectangle r) { // TODO } // paintComponent()
15,926
public boolean shouldSelectCell(EventObject event);
public boolean shouldSelectCell(EventObject event);
15,927
public boolean isCellEditable(EventObject event);
public boolean isCellEditable(EventObject event);
15,928
public TreePath pathByAddingChild(Object element) { return new TreePath(this, element); } // pathByAddingChild()
public TreePath pathByAddingChild(Object element) { return new TreePath(this, element); } // pathByAddingChild()
15,929
public TreePath pathByAddingChild(Object element) { return new TreePath(this, element); } // pathByAddingChild()
public TreePath pathByAddingChild(Object element) { return new TreePath(this, element); } // pathByAddingChild()
15,930