rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
public final void run() { boolean done = false; me = Thread.currentThread(); // load the first response screen try { loadStream(abyte2, 0); } catch (IOException ioef) { System.out.println(" run() " + ioef.getMessage()); } while (!done) { try {// waitingForInput = false; byte[] abyte0 = readIncoming(); loadStream(abyte0, 0); } catch (SocketException se) {// System.out.println(" DataStreamProducer thread interrupted and stopping " + se.getMessage()); System.out.println(" DataStreamProducer thread interrupted and stopping "); done = true;// vt.disconnect(); } catch (IOException ioe) {// System.out.println(ioe.getMessage());// invited = true; if (me.isInterrupted()) done = true; } catch (Exception ex) { System.out.println(ex.getMessage());// invited = true; if (me.isInterrupted()) done = true; } } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/99debc0e39981c309029bd7389a7d7c50837d87b/DataStreamProducer.java/clean/tn5250j/src/org/tn5250j/DataStreamProducer.java
|
||
cancelEditing(tree);
|
completeEditing(false, false, false);
|
public void editingCanceled(ChangeEvent e) { cancelEditing(tree); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
stopEditing(tree);
|
completeEditing(false, false, true);
|
public void editingStopped(ChangeEvent e) { stopEditing(tree); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
if (lead!=null)
|
if (lead != null)
|
void repaintLeadRow() { TreePath lead = tree.getLeadSelectionPath(); if (lead!=null) tree.repaint(tree.getPathBounds(lead)); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
throws NotImplementedException
|
public void keyPressed(KeyEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
public void keyPressed(KeyEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
||
throws NotImplementedException
|
public void keyReleased(KeyEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
public void keyReleased(KeyEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
||
throws NotImplementedException
|
public void keyTyped(KeyEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
char typed = Character.toLowerCase(e.getKeyChar()); for (int row = tree.getLeadSelectionRow() + 1; row < tree.getRowCount(); row++) { if (checkMatch(row, typed)) { tree.setSelectionRow(row); tree.scrollRowToVisible(row); return; } } for (int row = 0; row < tree.getLeadSelectionRow(); row++) { if (checkMatch(row, typed)) { tree.setSelectionRow(row); tree.scrollRowToVisible(row); return; } }
|
public void keyTyped(KeyEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
throws NotImplementedException
|
public void mouseDragged(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
public void mouseDragged(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
||
throws NotImplementedException
|
public void mouseMoved(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
public void mouseMoved(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
||
if (tree != null && tree.isEnabled())
|
if (! e.isConsumed()) { handleEvent(e); selectedOnPress = true; } else
|
public void mousePressed(MouseEvent e) { if (tree != null && tree.isEnabled()) { // Maybe stop editing and return. if (isEditing(tree) && tree.getInvokesStopCellEditing() && !stopEditing(tree)) return; int x = e.getX(); int y = e.getY(); TreePath path = getClosestPathForLocation(tree, x, y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); if (SwingUtilities.isLeftMouseButton(e)) checkForClickInExpandControl(path, x, y); if (x > bounds.x && x <= (bounds.x + bounds.width)) { if (! startEditing(path, e)) selectPathForEvent(path, e); } } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
if (isEditing(tree) && tree.getInvokesStopCellEditing() && !stopEditing(tree)) return; int x = e.getX(); int y = e.getY(); TreePath path = getClosestPathForLocation(tree, x, y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); if (SwingUtilities.isLeftMouseButton(e)) checkForClickInExpandControl(path, x, y); if (x > bounds.x && x <= (bounds.x + bounds.width)) { if (! startEditing(path, e)) selectPathForEvent(path, e); } }
|
selectedOnPress = false;
|
public void mousePressed(MouseEvent e) { if (tree != null && tree.isEnabled()) { // Maybe stop editing and return. if (isEditing(tree) && tree.getInvokesStopCellEditing() && !stopEditing(tree)) return; int x = e.getX(); int y = e.getY(); TreePath path = getClosestPathForLocation(tree, x, y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); if (SwingUtilities.isLeftMouseButton(e)) checkForClickInExpandControl(path, x, y); if (x > bounds.x && x <= (bounds.x + bounds.width)) { if (! startEditing(path, e)) selectPathForEvent(path, e); } } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
throws NotImplementedException
|
public void mouseReleased(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
if (! e.isConsumed() && ! selectedOnPress) handleEvent(e);
|
public void mouseReleased(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
source.addMouseListener(this); source.addMouseMotionListener(this); dispatch(e);
|
public MouseInputHandler(Component source, Component destination, MouseEvent e) { this.source = source; this.destination = destination; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
throws NotImplementedException
|
public void mouseClicked(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
dispatch(e);
|
public void mouseClicked(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
throws NotImplementedException
|
public void mouseDragged(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
dispatch(e);
|
public void mouseDragged(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
throws NotImplementedException
|
public void mouseEntered(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
if (! SwingUtilities.isLeftMouseButton(e)) removeFromSource();
|
public void mouseEntered(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
throws NotImplementedException
|
public void mouseExited(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
if (! SwingUtilities.isLeftMouseButton(e)) removeFromSource();
|
public void mouseExited(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
throws NotImplementedException
|
public void mouseMoved(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
removeFromSource();
|
public void mouseMoved(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
throws NotImplementedException
|
public void mousePressed(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
public void mousePressed(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
||
throws NotImplementedException
|
public void mouseReleased(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
dispatch(e); removeFromSource();
|
public void mouseReleased(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
throws NotImplementedException
|
protected void removeFromSource() throws NotImplementedException { // TODO: Implement this properly. }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
if (source != null) { source.removeMouseListener(this); source.removeMouseMotionListener(this); } source = null; destination = null;
|
protected void removeFromSource() throws NotImplementedException { // TODO: Implement this properly. }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
if (size == null || cell == null) return null; String s = cell.toString(); Font f = tree.getFont(); FontMetrics fm = tree.getToolkit().getFontMetrics(f); if (s != null)
|
Dimension prefSize; if (editingComponent != null && editingRow == row)
|
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) { TreePath path = treeState.getPathForRow(row); size.x = getRowX(row, depth); size.width = SwingUtilities.computeStringWidth(fm, s); size.width = size.width + getCurrentControlIcon(path).getIconWidth() + gap + getNodeIcon(path).getIconWidth(); size.height = getMaxHeight(tree); size.y = size.height * row; } return size; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
TreePath path = treeState.getPathForRow(row);
|
prefSize = editingComponent.getPreferredSize(); int rowHeight = getRowHeight(); if (rowHeight > 0 && rowHeight != prefSize.height) prefSize.height = rowHeight; } else { Component rend = currentCellRenderer.getTreeCellRendererComponent(tree, cell, tree.isRowSelected(row), expanded, treeModel.isLeaf(cell), row, false); rendererPane.add(rend); rend.validate(); prefSize = rend.getPreferredSize(); } if (size != null) {
|
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) { TreePath path = treeState.getPathForRow(row); size.x = getRowX(row, depth); size.width = SwingUtilities.computeStringWidth(fm, s); size.width = size.width + getCurrentControlIcon(path).getIconWidth() + gap + getNodeIcon(path).getIconWidth(); size.height = getMaxHeight(tree); size.y = size.height * row; } return size; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
size.width = SwingUtilities.computeStringWidth(fm, s); size.width = size.width + getCurrentControlIcon(path).getIconWidth() + gap + getNodeIcon(path).getIconWidth(); size.height = getMaxHeight(tree); size.y = size.height * row;
|
size.y = prefSize.height * row; size.width = prefSize.width; size.height = prefSize.height;
|
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) { TreePath path = treeState.getPathForRow(row); size.x = getRowX(row, depth); size.width = SwingUtilities.computeStringWidth(fm, s); size.width = size.width + getCurrentControlIcon(path).getIconWidth() + gap + getNodeIcon(path).getIconWidth(); size.height = getMaxHeight(tree); size.y = size.height * row; } return size; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
else size = new Rectangle(getRowX(row, depth), prefSize.height * row, prefSize.width, prefSize.height);
|
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) { TreePath path = treeState.getPathForRow(row); size.x = getRowX(row, depth); size.width = SwingUtilities.computeStringWidth(fm, s); size.width = size.width + getCurrentControlIcon(path).getIconWidth() + gap + getNodeIcon(path).getIconWidth(); size.height = getMaxHeight(tree); size.y = size.height * row; } return size; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
else if (property.equals(JTree.EDITABLE_PROPERTY)) setEditable(((Boolean) event.getNewValue()).booleanValue());
|
public void propertyChange(PropertyChangeEvent event) { String property = event.getPropertyName(); if (property.equals(JTree.ROOT_VISIBLE_PROPERTY)) { validCachedPreferredSize = false; treeState.setRootVisible(tree.isRootVisible()); tree.repaint(); } else if (property.equals(JTree.SELECTION_MODEL_PROPERTY)) { treeSelectionModel = tree.getSelectionModel(); treeSelectionModel.setRowMapper(treeState); } else if (property.equals(JTree.TREE_MODEL_PROPERTY)) { setModel(tree.getModel()); } else if (property.equals(JTree.CELL_RENDERER_PROPERTY)) { setCellRenderer(tree.getCellRenderer()); // Update layout. if (treeState != null) treeState.invalidateSizes(); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
throws NotImplementedException
|
public void propertyChange(PropertyChangeEvent event) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
treeSelectionModel.resetRowSelection();
|
public void propertyChange(PropertyChangeEvent event) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
completeEditing();
|
public void treeCollapsed(TreeExpansionEvent event) { validCachedPreferredSize = false; treeState.setExpandedState(event.getPath(), false); // The maximal cell height may change maxHeight = 0; tree.revalidate(); tree.repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
tree.scrollPathToVisible(tree.getLeadSelectionPath());
|
public void actionPerformed(ActionEvent e) { if (tree != null) { String command = (String) getValue(Action.NAME); if (command.equals("selectFirst")) { ensureRowsAreVisible(0, 0); tree.setSelectionInterval(0, 0); } if (command.equals("selectFirstChangeLead")) { ensureRowsAreVisible(0, 0); tree.setLeadSelectionPath(getPathForRow(tree, 0)); } if (command.equals("selectFirstExtendSelection")) { ensureRowsAreVisible(0, 0); TreePath anchorPath = tree.getAnchorSelectionPath(); if (anchorPath == null) tree.setSelectionInterval(0, 0); else { int anchorRow = getRowForPath(tree, anchorPath); tree.setSelectionInterval(0, anchorRow); tree.setAnchorSelectionPath(anchorPath); tree.setLeadSelectionPath(getPathForRow(tree, 0)); } } else if (command.equals("selectLast")) { int end = getRowCount(tree) - 1; ensureRowsAreVisible(end, end); tree.setSelectionInterval(end, end); } else if (command.equals("selectLastChangeLead")) { int end = getRowCount(tree) - 1; ensureRowsAreVisible(end, end); tree.setLeadSelectionPath(getPathForRow(tree, end)); } else if (command.equals("selectLastExtendSelection")) { int end = getRowCount(tree) - 1; ensureRowsAreVisible(end, end); TreePath anchorPath = tree.getAnchorSelectionPath(); if (anchorPath == null) tree.setSelectionInterval(end, end); else { int anchorRow = getRowForPath(tree, anchorPath); tree.setSelectionInterval(end, anchorRow); tree.setAnchorSelectionPath(anchorPath); tree.setLeadSelectionPath(getPathForRow(tree, end)); } } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
tree.scrollPathToVisible(tree.getLeadSelectionPath());
|
public void actionPerformed(ActionEvent e) { TreePath currentPath = tree.getLeadSelectionPath(); int currentRow; if (currentPath != null) currentRow = treeState.getRowForPath(currentPath); else currentRow = 0; int rows = treeState.getRowCount(); int nextRow = currentRow + 1; int prevRow = currentRow - 1; boolean hasNext = nextRow < rows; boolean hasPrev = prevRow >= 0 && rows > 0; TreePath newPath; String command = (String) getValue(Action.NAME); if (command.equals("selectPreviousChangeLead") && hasPrev) { newPath = treeState.getPathForRow(prevRow); tree.setSelectionPath(newPath); tree.setAnchorSelectionPath(newPath); tree.setLeadSelectionPath(newPath); } else if (command.equals("selectPreviousExtendSelection") && hasPrev) { newPath = treeState.getPathForRow(prevRow); // If the new path is already selected, the selection shrinks, // unselecting the previously current path. if (tree.isPathSelected(newPath)) tree.getSelectionModel().removeSelectionPath(currentPath); // This must be called in any case because it updates the model // lead selection index. tree.addSelectionPath(newPath); tree.setLeadSelectionPath(newPath); } else if (command.equals("selectPrevious") && hasPrev) { newPath = treeState.getPathForRow(prevRow); tree.setSelectionPath(newPath); } else if (command.equals("selectNext") && hasNext) { newPath = treeState.getPathForRow(nextRow); tree.setSelectionPath(newPath); } else if (command.equals("selectNextExtendSelection") && hasNext) { newPath = treeState.getPathForRow(nextRow); // If the new path is already selected, the selection shrinks, // unselecting the previously current path. if (tree.isPathSelected(newPath)) tree.getSelectionModel().removeSelectionPath(currentPath); // This must be called in any case because it updates the model // lead selection index. tree.addSelectionPath(newPath); tree.setLeadSelectionPath(newPath); } else if (command.equals("selectNextChangeLead") && hasNext) { newPath = treeState.getPathForRow(nextRow); tree.setSelectionPath(newPath); tree.setAnchorSelectionPath(newPath); tree.setLeadSelectionPath(newPath); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
newVisible.y -= (visible.height - newVisible.height);
|
newVisible.y -= visible.height - newVisible.height;
|
public void actionPerformed(ActionEvent e) { String command = (String) getValue(Action.NAME); boolean extendSelection = command.equals("scrollUpExtendSelection") || command.equals("scrollDownExtendSelection"); boolean changeSelection = command.equals("scrollUpChangeSelection") || command.equals("scrollDownChangeSelection"); // Disable change lead, unless we are in discontinuous mode. if (!extendSelection && !changeSelection && tree.getSelectionModel().getSelectionMode() != TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION) { changeSelection = true; } int rowCount = getRowCount(tree); if (rowCount > 0 && treeSelectionModel != null) { Dimension maxSize = tree.getSize(); TreePath lead = tree.getLeadSelectionPath(); TreePath newPath = null; Rectangle visible = tree.getVisibleRect(); if (direction == -1) // The RI handles -1 as up. { newPath = getClosestPathForLocation(tree, visible.x, visible.y); if (newPath.equals(lead)) // Corner case, adjust one page up. { visible.y = Math.max(0, visible.y - visible.height); newPath = getClosestPathForLocation(tree, visible.x, visible.y); } } else // +1 is down. { visible.y = Math.min(maxSize.height, visible.y + visible.height - 1); newPath = getClosestPathForLocation(tree, visible.x, visible.y); if (newPath.equals(lead)) // Corner case, adjust one page down. { visible.y = Math.min(maxSize.height, visible.y + visible.height - 1); newPath = getClosestPathForLocation(tree, visible.x, visible.y); } } // Determine new visible rect. Rectangle newVisible = getPathBounds(tree, newPath); newVisible.x = visible.x; newVisible.width = visible.width; if (direction == -1) { newVisible.height = visible.height; } else { newVisible.y -= (visible.height - newVisible.height); newVisible.height = visible.height; } if (extendSelection) { // Extend selection. TreePath anchorPath = tree.getAnchorSelectionPath(); if (anchorPath == null) { tree.setSelectionPath(newPath); } else { int newIndex = getRowForPath(tree, newPath); int anchorIndex = getRowForPath(tree, anchorPath); tree.setSelectionInterval(Math.min(anchorIndex, newIndex), Math.max(anchorIndex, newIndex)); tree.setAnchorSelectionPath(anchorPath); tree.setLeadSelectionPath(newPath); } } else if (changeSelection) { tree.setSelectionPath(newPath); } else // Change lead. { tree.setLeadSelectionPath(newPath); } tree.scrollRectToVisible(newVisible); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
if (tree.isEditing()) tree.cancelEditing();
|
completeEditing();
|
public void valueChanged(TreeSelectionEvent event) { if (tree.isEditing()) tree.cancelEditing(); TreePath op = event.getOldLeadSelectionPath(); TreePath np = event.getNewLeadSelectionPath(); // Repaint of the changed lead selection path. if (op != np) { Rectangle o = treeState.getBounds(event.getOldLeadSelectionPath(), new Rectangle()); Rectangle n = treeState.getBounds(event.getNewLeadSelectionPath(), new Rectangle()); if (o!=null) tree.repaint(o); if (n!=null) tree.repaint(n); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
if (o!=null)
|
if (o != null)
|
public void valueChanged(TreeSelectionEvent event) { if (tree.isEditing()) tree.cancelEditing(); TreePath op = event.getOldLeadSelectionPath(); TreePath np = event.getNewLeadSelectionPath(); // Repaint of the changed lead selection path. if (op != np) { Rectangle o = treeState.getBounds(event.getOldLeadSelectionPath(), new Rectangle()); Rectangle n = treeState.getBounds(event.getNewLeadSelectionPath(), new Rectangle()); if (o!=null) tree.repaint(o); if (n!=null) tree.repaint(n); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
if (n!=null)
|
if (n != null)
|
public void valueChanged(TreeSelectionEvent event) { if (tree.isEditing()) tree.cancelEditing(); TreePath op = event.getOldLeadSelectionPath(); TreePath np = event.getNewLeadSelectionPath(); // Repaint of the changed lead selection path. if (op != np) { Rectangle o = treeState.getBounds(event.getOldLeadSelectionPath(), new Rectangle()); Rectangle n = treeState.getBounds(event.getNewLeadSelectionPath(), new Rectangle()); if (o!=null) tree.repaint(o); if (n!=null) tree.repaint(n); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
tree.scrollPathToVisible(tree.getLeadSelectionPath());
|
public void actionPerformed(ActionEvent e) { int selected = tree.getLeadSelectionRow(); if (selected != -1 && isLeaf(selected)) { TreePath anchorPath = tree.getAnchorSelectionPath(); TreePath leadPath = tree.getLeadSelectionPath(); toggleExpandState(getPathForRow(tree, selected)); // Need to do this, so that the toggling doesn't mess up the lead // and anchor. tree.setLeadSelectionPath(leadPath); tree.setAnchorSelectionPath(anchorPath); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
!(parent.getPathCount()==1 && !tree.isRootVisible()) )
|
! (parent.getPathCount() == 1 && ! tree.isRootVisible()))
|
public void actionPerformed(ActionEvent e) { TreePath current = tree.getLeadSelectionPath(); if (current == null) return; String command = (String) getValue(Action.NAME); if (command.equals("selectParent")) { if (current == null) return; if (tree.isExpanded(current)) { tree.collapsePath(current); } else { // If the node is not expanded (also, if it is a leaf node), // we just select the parent. We do not select the root if it // is not visible. TreePath parent = current.getParentPath(); if (parent != null && !(parent.getPathCount()==1 && !tree.isRootVisible()) ) tree.setSelectionPath(parent); } } else if (command.equals("selectChild")) { Object node = current.getLastPathComponent(); int nc = treeModel.getChildCount(node); if (nc == 0 || treeState.isExpanded(current)) { // If the node is leaf or it is already expanded, // we just select the next row. int nextRow = tree.getLeadSelectionRow() + 1; if (nextRow <= tree.getRowCount()) tree.setSelectionRow(nextRow); } else { tree.expandPath(current); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
tree.scrollPathToVisible(tree.getLeadSelectionPath());
|
public void actionPerformed(ActionEvent e) { TreePath current = tree.getLeadSelectionPath(); if (current == null) return; String command = (String) getValue(Action.NAME); if (command.equals("selectParent")) { if (current == null) return; if (tree.isExpanded(current)) { tree.collapsePath(current); } else { // If the node is not expanded (also, if it is a leaf node), // we just select the parent. We do not select the root if it // is not visible. TreePath parent = current.getParentPath(); if (parent != null && !(parent.getPathCount()==1 && !tree.isRootVisible()) ) tree.setSelectionPath(parent); } } else if (command.equals("selectChild")) { Object node = current.getLastPathComponent(); int nc = treeModel.getChildCount(node); if (nc == 0 || treeState.isExpanded(current)) { // If the node is leaf or it is already expanded, // we just select the next row. int nextRow = tree.getLeadSelectionRow() + 1; if (nextRow <= tree.getRowCount()) tree.setSelectionRow(nextRow); } else { tree.expandPath(current); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
completeEditing(false, false, false); finish();
|
if (editingComponent != null) completeEditing(false, true, false);
|
public void cancelEditing(JTree tree) { // There is no need to send the cancel message to the editor, // as the cancellation event itself arrives from it. This would // only be necessary when cancelling the editing programatically. completeEditing(false, false, false); finish(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
if (tree.getInvokesStopCellEditing() && stopEditingInCompleteEditing && editingComponent != null) cellEditor.stopCellEditing();
|
protected void completeEditing() { completeEditing(false, true, false); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
treeState = createLayoutCache();
|
configureLayoutCache(); treeState.setRootVisible(tree.isRootVisible());
|
protected void completeUIInstall() { setShowsRootHandles(tree.getShowsRootHandles()); updateRenderer(); updateDepthOffset(); setSelectionModel(tree.getSelectionModel()); treeState = createLayoutCache(); treeSelectionModel.setRowMapper(treeState); configureLayoutCache(); updateSize(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
configureLayoutCache();
|
protected void completeUIInstall() { setShowsRootHandles(tree.getShowsRootHandles()); updateRenderer(); updateDepthOffset(); setSelectionModel(tree.getSelectionModel()); treeState = createLayoutCache(); treeSelectionModel.setRowMapper(treeState); configureLayoutCache(); updateSize(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
action= new TreeAction();
|
action = new TreeHomeAction(-1, "selectFirst");
|
private ActionMap createDefaultActions() { ActionMapUIResource am = new ActionMapUIResource(); Action action; action= new TreeAction(); am.put(action.getValue(Action.NAME), action); // TreeHomeAction. action= new TreeHomeAction(-1, "selectFirst"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(-1, "selectFirstChangeLead"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(-1, "selectFirstExtendSelection"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLast"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLastChangeLead"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLastExtendSelection"); am.put(action.getValue(Action.NAME), action); // TreeIncrementAction. action = new TreeIncrementAction(-1, "selectPrevious"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(-1, "selectPreviousExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(-1, "selectPreviousChangeLead"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNext"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNextExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNextChangeLead"); am.put(action.getValue(Action.NAME), action); // TreeTraverseAction. action = new TreeTraverseAction(-1, "selectParent"); am.put(action.getValue(Action.NAME), action); action = new TreeTraverseAction(1, "selectChild"); am.put(action.getValue(Action.NAME), action); // TreeToggleAction. action = new TreeToggleAction("toggleAndAnchor"); am.put(action.getValue(Action.NAME), action); // TreePageAction. action = new TreePageAction(-1, "scrollUpChangeSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(-1, "scrollUpExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(-1, "scrollUpChangeLead"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownChangeSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownChangeLead"); am.put(action.getValue(Action.NAME), action); return am; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
action= new TreeHomeAction(-1, "selectFirst");
|
action = new TreeHomeAction(-1, "selectFirstChangeLead");
|
private ActionMap createDefaultActions() { ActionMapUIResource am = new ActionMapUIResource(); Action action; action= new TreeAction(); am.put(action.getValue(Action.NAME), action); // TreeHomeAction. action= new TreeHomeAction(-1, "selectFirst"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(-1, "selectFirstChangeLead"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(-1, "selectFirstExtendSelection"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLast"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLastChangeLead"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLastExtendSelection"); am.put(action.getValue(Action.NAME), action); // TreeIncrementAction. action = new TreeIncrementAction(-1, "selectPrevious"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(-1, "selectPreviousExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(-1, "selectPreviousChangeLead"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNext"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNextExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNextChangeLead"); am.put(action.getValue(Action.NAME), action); // TreeTraverseAction. action = new TreeTraverseAction(-1, "selectParent"); am.put(action.getValue(Action.NAME), action); action = new TreeTraverseAction(1, "selectChild"); am.put(action.getValue(Action.NAME), action); // TreeToggleAction. action = new TreeToggleAction("toggleAndAnchor"); am.put(action.getValue(Action.NAME), action); // TreePageAction. action = new TreePageAction(-1, "scrollUpChangeSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(-1, "scrollUpExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(-1, "scrollUpChangeLead"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownChangeSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownChangeLead"); am.put(action.getValue(Action.NAME), action); return am; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
action= new TreeHomeAction(-1, "selectFirstChangeLead");
|
action = new TreeHomeAction(-1, "selectFirstExtendSelection");
|
private ActionMap createDefaultActions() { ActionMapUIResource am = new ActionMapUIResource(); Action action; action= new TreeAction(); am.put(action.getValue(Action.NAME), action); // TreeHomeAction. action= new TreeHomeAction(-1, "selectFirst"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(-1, "selectFirstChangeLead"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(-1, "selectFirstExtendSelection"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLast"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLastChangeLead"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLastExtendSelection"); am.put(action.getValue(Action.NAME), action); // TreeIncrementAction. action = new TreeIncrementAction(-1, "selectPrevious"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(-1, "selectPreviousExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(-1, "selectPreviousChangeLead"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNext"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNextExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNextChangeLead"); am.put(action.getValue(Action.NAME), action); // TreeTraverseAction. action = new TreeTraverseAction(-1, "selectParent"); am.put(action.getValue(Action.NAME), action); action = new TreeTraverseAction(1, "selectChild"); am.put(action.getValue(Action.NAME), action); // TreeToggleAction. action = new TreeToggleAction("toggleAndAnchor"); am.put(action.getValue(Action.NAME), action); // TreePageAction. action = new TreePageAction(-1, "scrollUpChangeSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(-1, "scrollUpExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(-1, "scrollUpChangeLead"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownChangeSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownChangeLead"); am.put(action.getValue(Action.NAME), action); return am; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
action= new TreeHomeAction(-1, "selectFirstExtendSelection");
|
action = new TreeHomeAction(1, "selectLast");
|
private ActionMap createDefaultActions() { ActionMapUIResource am = new ActionMapUIResource(); Action action; action= new TreeAction(); am.put(action.getValue(Action.NAME), action); // TreeHomeAction. action= new TreeHomeAction(-1, "selectFirst"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(-1, "selectFirstChangeLead"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(-1, "selectFirstExtendSelection"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLast"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLastChangeLead"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLastExtendSelection"); am.put(action.getValue(Action.NAME), action); // TreeIncrementAction. action = new TreeIncrementAction(-1, "selectPrevious"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(-1, "selectPreviousExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(-1, "selectPreviousChangeLead"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNext"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNextExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNextChangeLead"); am.put(action.getValue(Action.NAME), action); // TreeTraverseAction. action = new TreeTraverseAction(-1, "selectParent"); am.put(action.getValue(Action.NAME), action); action = new TreeTraverseAction(1, "selectChild"); am.put(action.getValue(Action.NAME), action); // TreeToggleAction. action = new TreeToggleAction("toggleAndAnchor"); am.put(action.getValue(Action.NAME), action); // TreePageAction. action = new TreePageAction(-1, "scrollUpChangeSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(-1, "scrollUpExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(-1, "scrollUpChangeLead"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownChangeSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownChangeLead"); am.put(action.getValue(Action.NAME), action); return am; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
action= new TreeHomeAction(1, "selectLast");
|
action = new TreeHomeAction(1, "selectLastChangeLead");
|
private ActionMap createDefaultActions() { ActionMapUIResource am = new ActionMapUIResource(); Action action; action= new TreeAction(); am.put(action.getValue(Action.NAME), action); // TreeHomeAction. action= new TreeHomeAction(-1, "selectFirst"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(-1, "selectFirstChangeLead"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(-1, "selectFirstExtendSelection"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLast"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLastChangeLead"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLastExtendSelection"); am.put(action.getValue(Action.NAME), action); // TreeIncrementAction. action = new TreeIncrementAction(-1, "selectPrevious"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(-1, "selectPreviousExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(-1, "selectPreviousChangeLead"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNext"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNextExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNextChangeLead"); am.put(action.getValue(Action.NAME), action); // TreeTraverseAction. action = new TreeTraverseAction(-1, "selectParent"); am.put(action.getValue(Action.NAME), action); action = new TreeTraverseAction(1, "selectChild"); am.put(action.getValue(Action.NAME), action); // TreeToggleAction. action = new TreeToggleAction("toggleAndAnchor"); am.put(action.getValue(Action.NAME), action); // TreePageAction. action = new TreePageAction(-1, "scrollUpChangeSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(-1, "scrollUpExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(-1, "scrollUpChangeLead"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownChangeSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownChangeLead"); am.put(action.getValue(Action.NAME), action); return am; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
action= new TreeHomeAction(1, "selectLastChangeLead"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLastExtendSelection");
|
action = new TreeHomeAction(1, "selectLastExtendSelection");
|
private ActionMap createDefaultActions() { ActionMapUIResource am = new ActionMapUIResource(); Action action; action= new TreeAction(); am.put(action.getValue(Action.NAME), action); // TreeHomeAction. action= new TreeHomeAction(-1, "selectFirst"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(-1, "selectFirstChangeLead"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(-1, "selectFirstExtendSelection"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLast"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLastChangeLead"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLastExtendSelection"); am.put(action.getValue(Action.NAME), action); // TreeIncrementAction. action = new TreeIncrementAction(-1, "selectPrevious"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(-1, "selectPreviousExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(-1, "selectPreviousChangeLead"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNext"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNextExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNextChangeLead"); am.put(action.getValue(Action.NAME), action); // TreeTraverseAction. action = new TreeTraverseAction(-1, "selectParent"); am.put(action.getValue(Action.NAME), action); action = new TreeTraverseAction(1, "selectChild"); am.put(action.getValue(Action.NAME), action); // TreeToggleAction. action = new TreeToggleAction("toggleAndAnchor"); am.put(action.getValue(Action.NAME), action); // TreePageAction. action = new TreePageAction(-1, "scrollUpChangeSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(-1, "scrollUpExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(-1, "scrollUpChangeLead"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownChangeSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownChangeLead"); am.put(action.getValue(Action.NAME), action); return am; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
action = new TreeStartEditingAction("startEditing"); am.put(action.getValue(Action.NAME), action); action = new TreeCancelEditingAction("cancel"); am.put(action.getValue(Action.NAME), action);
|
private ActionMap createDefaultActions() { ActionMapUIResource am = new ActionMapUIResource(); Action action; action= new TreeAction(); am.put(action.getValue(Action.NAME), action); // TreeHomeAction. action= new TreeHomeAction(-1, "selectFirst"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(-1, "selectFirstChangeLead"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(-1, "selectFirstExtendSelection"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLast"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLastChangeLead"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLastExtendSelection"); am.put(action.getValue(Action.NAME), action); // TreeIncrementAction. action = new TreeIncrementAction(-1, "selectPrevious"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(-1, "selectPreviousExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(-1, "selectPreviousChangeLead"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNext"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNextExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreeIncrementAction(1, "selectNextChangeLead"); am.put(action.getValue(Action.NAME), action); // TreeTraverseAction. action = new TreeTraverseAction(-1, "selectParent"); am.put(action.getValue(Action.NAME), action); action = new TreeTraverseAction(1, "selectChild"); am.put(action.getValue(Action.NAME), action); // TreeToggleAction. action = new TreeToggleAction("toggleAndAnchor"); am.put(action.getValue(Action.NAME), action); // TreePageAction. action = new TreePageAction(-1, "scrollUpChangeSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(-1, "scrollUpExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(-1, "scrollUpChangeLead"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownChangeSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownExtendSelection"); am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownChangeLead"); am.put(action.getValue(Action.NAME), action); return am; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
return ((TreePath) parent.getLastPathComponent());
|
return (TreePath) parent.getLastPathComponent();
|
protected TreePath getLastChildPath(TreePath parent) { return ((TreePath) parent.getLastPathComponent()); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
hashColor = UIManager.getColor("Tree.hash"); if (hashColor == null) hashColor = Color.black;
|
protected void installDefaults() { LookAndFeel.installColorsAndFont(tree, "Tree.background", "Tree.foreground", "Tree.font"); tree.setOpaque(true); rightChildIndent = UIManager.getInt("Tree.rightChildIndent"); leftChildIndent = UIManager.getInt("Tree.leftChildIndent"); totalChildIndent = rightChildIndent + leftChildIndent; setRowHeight(UIManager.getInt("Tree.rowHeight")); tree.setRowHeight(getRowHeight()); tree.setScrollsOnExpand(UIManager.getBoolean("Tree.scrollsOnExpand")); setExpandedIcon(UIManager.getIcon("Tree.expandedIcon")); setCollapsedIcon(UIManager.getIcon("Tree.collapsedIcon")); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
action = new TreeAction();
|
protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) SharedUIDefaults.get("Tree.focusInputMap"); SwingUtilities.replaceUIInputMap(tree, JComponent.WHEN_FOCUSED, focusInputMap); InputMap ancestorInputMap = (InputMap) SharedUIDefaults.get("Tree.ancestorInputMap"); SwingUtilities.replaceUIInputMap(tree, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, ancestorInputMap); action = new TreeAction(); SwingUtilities.replaceUIActionMap(tree, getActionMap()); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
treeSelectionModel.addPropertyChangeListener (selectionModelPropertyChangeListener);
|
treeSelectionModel.addPropertyChangeListener( selectionModelPropertyChangeListener);
|
protected void installListeners() { propertyChangeListener = createPropertyChangeListener(); tree.addPropertyChangeListener(propertyChangeListener); focusListener = createFocusListener(); tree.addFocusListener(focusListener); treeSelectionListener = createTreeSelectionListener(); tree.addTreeSelectionListener(treeSelectionListener); mouseListener = createMouseListener(); tree.addMouseListener(mouseListener); keyListener = createKeyListener(); tree.addKeyListener(keyListener); selectionModelPropertyChangeListener = createSelectionModelPropertyChangeListener(); if (treeSelectionModel != null && selectionModelPropertyChangeListener != null) { treeSelectionModel.addPropertyChangeListener (selectionModelPropertyChangeListener); } componentListener = createComponentListener(); tree.addComponentListener(componentListener); treeExpansionListener = createTreeExpansionListener(); tree.addTreeExpansionListener(treeExpansionListener); treeModelListener = createTreeModelListener(); if (treeModel != null) treeModel.addTreeModelListener(treeModelListener); cellEditorListener = createCellEditorListener(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
int width = 8;
|
int width;
|
protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY) { boolean cntlClick = false; if (! treeModel.isLeaf(path.getLastPathComponent())) { int width = 8; // Only guessing. Icon expandedIcon = getExpandedIcon(); if (expandedIcon != null) width = expandedIcon.getIconWidth(); Insets i = tree.getInsets(); int left = getRowX(tree.getRowForPath(path), path.getPathCount() - 1) -getRightChildIndent() - width / 2 + i.left; cntlClick = mouseX >= left && mouseX <= left + width; } return cntlClick; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
int left = getRowX(tree.getRowForPath(path), path.getPathCount() - 1) -getRightChildIndent() - width / 2 + i.left;
|
int depth; if (isRootVisible()) depth = path.getPathCount()-1; else depth = path.getPathCount()-2; int left = getRowX(tree.getRowForPath(path), depth) - width + i.left;
|
protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY) { boolean cntlClick = false; if (! treeModel.isLeaf(path.getLastPathComponent())) { int width = 8; // Only guessing. Icon expandedIcon = getExpandedIcon(); if (expandedIcon != null) width = expandedIcon.getIconWidth(); Insets i = tree.getInsets(); int left = getRowX(tree.getRowForPath(path), path.getPathCount() - 1) -getRightChildIndent() - width / 2 + i.left; cntlClick = mouseX >= left && mouseX <= left + width; } return cntlClick; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
if (parent != null)
|
boolean paintLine; if (isRootVisible()) paintLine = parent != null; else paintLine = parent != null && parent.getPathCount() > 1; if (paintLine)
|
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path) { Rectangle bounds = getPathBounds(tree, path); TreePath parent = path.getParentPath(); if (parent != null) { Rectangle parentBounds = getPathBounds(tree, parent); paintVerticalLine(g, tree, parentBounds.x + 2* gap, parentBounds.y + parentBounds.height / 2, bounds.y + bounds.height / 2); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
paintVerticalLine(g, tree, parentBounds.x + 2* gap,
|
paintVerticalLine(g, tree, parentBounds.x + 2 * gap,
|
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path) { Rectangle bounds = getPathBounds(tree, path); TreePath parent = path.getParentPath(); if (parent != null) { Rectangle parentBounds = getPathBounds(tree, parent); paintVerticalLine(g, tree, parentBounds.x + 2* gap, parentBounds.y + parentBounds.height / 2, bounds.y + bounds.height / 2); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
stopEditingInCompleteEditing = true;
|
protected void prepareForUIInstall() { lastSelectedRow = -1; preferredSize = new Dimension(); largeModel = tree.isLargeModel(); preferredSize = new Dimension(); setModel(tree.getModel()); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
cellEditor = editor; createdCellEditor = true;
|
updateCellEditor();
|
protected void setCellEditor(TreeCellEditor editor) { cellEditor = editor; createdCellEditor = true; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
currentCellRenderer = tcr;
|
completeEditing();
|
protected void setCellRenderer(TreeCellRenderer tcr) { currentCellRenderer = tcr; updateRenderer(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
if (treeState != null) { treeState.invalidateSizes(); updateSize(); }
|
protected void setCellRenderer(TreeCellRenderer tcr) { currentCellRenderer = tcr; updateRenderer(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
tree.setEditable(newValue);
|
updateCellEditor();
|
protected void setEditable(boolean newValue) { tree.setEditable(newValue); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
completeEditing();
|
protected void setLargeModel(boolean largeModel) { if (largeModel != this.largeModel) { tree.removeComponentListener(componentListener); this.largeModel = largeModel; tree.addComponentListener(componentListener); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
completeEditing();
|
protected void setRootVisible(boolean newValue) { tree.setRootVisible(newValue); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
completeEditing();
|
protected void setRowHeight(int rowHeight) { if (rowHeight == 0) rowHeight = getMaxHeight(tree); treeState.setRowHeight(rowHeight); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
completeEditing();
|
protected void setSelectionModel(TreeSelectionModel newLSM) { if (newLSM != null) { treeSelectionModel = newLSM; tree.setSelectionModel(treeSelectionModel); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
return (! isLeaf && hasControlIcons());
|
return ! isLeaf && hasControlIcons();
|
protected boolean shouldPaintExpandControl(TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { Object node = path.getLastPathComponent(); return (! isLeaf && hasControlIcons()); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
updateCellEditor(); TreeCellEditor ed = getCellEditor();
|
if (isEditing(tree) && tree.getInvokesStopCellEditing() && ! stopEditing(tree)) return false;
|
protected boolean startEditing(TreePath path, MouseEvent event) { updateCellEditor(); TreeCellEditor ed = getCellEditor(); if (ed != null && (event == EDIT || ed.shouldSelectCell(event)) && ed.isCellEditable(event)) { Rectangle bounds = getPathBounds(tree, path); // Extend the right boundary till the tree width. bounds.width = tree.getWidth() - bounds.x; editingPath = path; editingRow = tree.getRowForPath(editingPath); Object value = editingPath.getLastPathComponent(); stopEditingInCompleteEditing = false; boolean expanded = tree.isExpanded(editingPath); isEditing = true; editingComponent = ed.getTreeCellEditorComponent(tree, value, true, expanded, isLeaf(editingRow), editingRow); // Remove all previous components (if still present). Only one // container with the editing component inside is allowed in the tree. tree.removeAll(); // The editing component must be added to its container. We add the // container, not the editing component itself. Component container = editingComponent.getParent(); container.setBounds(bounds); tree.add(container); editingComponent.requestFocus(); return true; } return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
if (ed != null && (event == EDIT || ed.shouldSelectCell(event)) && ed.isCellEditable(event))
|
completeEditing(); TreeCellEditor ed = cellEditor; if (ed != null && tree.isPathEditable(path))
|
protected boolean startEditing(TreePath path, MouseEvent event) { updateCellEditor(); TreeCellEditor ed = getCellEditor(); if (ed != null && (event == EDIT || ed.shouldSelectCell(event)) && ed.isCellEditable(event)) { Rectangle bounds = getPathBounds(tree, path); // Extend the right boundary till the tree width. bounds.width = tree.getWidth() - bounds.x; editingPath = path; editingRow = tree.getRowForPath(editingPath); Object value = editingPath.getLastPathComponent(); stopEditingInCompleteEditing = false; boolean expanded = tree.isExpanded(editingPath); isEditing = true; editingComponent = ed.getTreeCellEditorComponent(tree, value, true, expanded, isLeaf(editingRow), editingRow); // Remove all previous components (if still present). Only one // container with the editing component inside is allowed in the tree. tree.removeAll(); // The editing component must be added to its container. We add the // container, not the editing component itself. Component container = editingComponent.getParent(); container.setBounds(bounds); tree.add(container); editingComponent.requestFocus(); return true; } return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
bounds.width = tree.getWidth() - bounds.x;
|
Dimension size = editingComponent.getPreferredSize(); int rowHeight = getRowHeight(); if (size.height != bounds.height && rowHeight > 0) size.height = rowHeight;
|
protected boolean startEditing(TreePath path, MouseEvent event) { updateCellEditor(); TreeCellEditor ed = getCellEditor(); if (ed != null && (event == EDIT || ed.shouldSelectCell(event)) && ed.isCellEditable(event)) { Rectangle bounds = getPathBounds(tree, path); // Extend the right boundary till the tree width. bounds.width = tree.getWidth() - bounds.x; editingPath = path; editingRow = tree.getRowForPath(editingPath); Object value = editingPath.getLastPathComponent(); stopEditingInCompleteEditing = false; boolean expanded = tree.isExpanded(editingPath); isEditing = true; editingComponent = ed.getTreeCellEditorComponent(tree, value, true, expanded, isLeaf(editingRow), editingRow); // Remove all previous components (if still present). Only one // container with the editing component inside is allowed in the tree. tree.removeAll(); // The editing component must be added to its container. We add the // container, not the editing component itself. Component container = editingComponent.getParent(); container.setBounds(bounds); tree.add(container); editingComponent.requestFocus(); return true; } return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
editingPath = path; editingRow = tree.getRowForPath(editingPath);
|
if (size.width != bounds.width || size.height != bounds.height) { editorHasDifferentSize = true; treeState.invalidatePathBounds(path); updateSize(); } else editorHasDifferentSize = false;
|
protected boolean startEditing(TreePath path, MouseEvent event) { updateCellEditor(); TreeCellEditor ed = getCellEditor(); if (ed != null && (event == EDIT || ed.shouldSelectCell(event)) && ed.isCellEditable(event)) { Rectangle bounds = getPathBounds(tree, path); // Extend the right boundary till the tree width. bounds.width = tree.getWidth() - bounds.x; editingPath = path; editingRow = tree.getRowForPath(editingPath); Object value = editingPath.getLastPathComponent(); stopEditingInCompleteEditing = false; boolean expanded = tree.isExpanded(editingPath); isEditing = true; editingComponent = ed.getTreeCellEditorComponent(tree, value, true, expanded, isLeaf(editingRow), editingRow); // Remove all previous components (if still present). Only one // container with the editing component inside is allowed in the tree. tree.removeAll(); // The editing component must be added to its container. We add the // container, not the editing component itself. Component container = editingComponent.getParent(); container.setBounds(bounds); tree.add(container); editingComponent.requestFocus(); return true; } return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
Object value = editingPath.getLastPathComponent();
|
tree.add(editingComponent); editingComponent.setBounds(bounds.x, bounds.y, size.width, size.height); editingComponent.validate(); editingPath = path;
|
protected boolean startEditing(TreePath path, MouseEvent event) { updateCellEditor(); TreeCellEditor ed = getCellEditor(); if (ed != null && (event == EDIT || ed.shouldSelectCell(event)) && ed.isCellEditable(event)) { Rectangle bounds = getPathBounds(tree, path); // Extend the right boundary till the tree width. bounds.width = tree.getWidth() - bounds.x; editingPath = path; editingRow = tree.getRowForPath(editingPath); Object value = editingPath.getLastPathComponent(); stopEditingInCompleteEditing = false; boolean expanded = tree.isExpanded(editingPath); isEditing = true; editingComponent = ed.getTreeCellEditorComponent(tree, value, true, expanded, isLeaf(editingRow), editingRow); // Remove all previous components (if still present). Only one // container with the editing component inside is allowed in the tree. tree.removeAll(); // The editing component must be added to its container. We add the // container, not the editing component itself. Component container = editingComponent.getParent(); container.setBounds(bounds); tree.add(container); editingComponent.requestFocus(); return true; } return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
boolean expanded = tree.isExpanded(editingPath); isEditing = true; editingComponent = ed.getTreeCellEditorComponent(tree, value, true, expanded, isLeaf(editingRow), editingRow);
|
tree.setSelectionRow(editingRow); stopEditingInCompleteEditing = true; }
|
protected boolean startEditing(TreePath path, MouseEvent event) { updateCellEditor(); TreeCellEditor ed = getCellEditor(); if (ed != null && (event == EDIT || ed.shouldSelectCell(event)) && ed.isCellEditable(event)) { Rectangle bounds = getPathBounds(tree, path); // Extend the right boundary till the tree width. bounds.width = tree.getWidth() - bounds.x; editingPath = path; editingRow = tree.getRowForPath(editingPath); Object value = editingPath.getLastPathComponent(); stopEditingInCompleteEditing = false; boolean expanded = tree.isExpanded(editingPath); isEditing = true; editingComponent = ed.getTreeCellEditorComponent(tree, value, true, expanded, isLeaf(editingRow), editingRow); // Remove all previous components (if still present). Only one // container with the editing component inside is allowed in the tree. tree.removeAll(); // The editing component must be added to its container. We add the // container, not the editing component itself. Component container = editingComponent.getParent(); container.setBounds(bounds); tree.add(container); editingComponent.requestFocus(); return true; } return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
tree.removeAll();
|
editorRequestFocus(editingComponent); if (event instanceof MouseEvent) { Point p = SwingUtilities.convertPoint(tree, event.getX(), event.getY(), editingComponent); Component active = SwingUtilities.getDeepestComponentAt(editingComponent, p.x, p.y); if (active != null) { MouseInputHandler ih = new MouseInputHandler(tree, active, event);
|
protected boolean startEditing(TreePath path, MouseEvent event) { updateCellEditor(); TreeCellEditor ed = getCellEditor(); if (ed != null && (event == EDIT || ed.shouldSelectCell(event)) && ed.isCellEditable(event)) { Rectangle bounds = getPathBounds(tree, path); // Extend the right boundary till the tree width. bounds.width = tree.getWidth() - bounds.x; editingPath = path; editingRow = tree.getRowForPath(editingPath); Object value = editingPath.getLastPathComponent(); stopEditingInCompleteEditing = false; boolean expanded = tree.isExpanded(editingPath); isEditing = true; editingComponent = ed.getTreeCellEditorComponent(tree, value, true, expanded, isLeaf(editingRow), editingRow); // Remove all previous components (if still present). Only one // container with the editing component inside is allowed in the tree. tree.removeAll(); // The editing component must be added to its container. We add the // container, not the editing component itself. Component container = editingComponent.getParent(); container.setBounds(bounds); tree.add(container); editingComponent.requestFocus(); return true; } return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
Component container = editingComponent.getParent(); container.setBounds(bounds); tree.add(container); editingComponent.requestFocus();
|
} }
|
protected boolean startEditing(TreePath path, MouseEvent event) { updateCellEditor(); TreeCellEditor ed = getCellEditor(); if (ed != null && (event == EDIT || ed.shouldSelectCell(event)) && ed.isCellEditable(event)) { Rectangle bounds = getPathBounds(tree, path); // Extend the right boundary till the tree width. bounds.width = tree.getWidth() - bounds.x; editingPath = path; editingRow = tree.getRowForPath(editingPath); Object value = editingPath.getLastPathComponent(); stopEditingInCompleteEditing = false; boolean expanded = tree.isExpanded(editingPath); isEditing = true; editingComponent = ed.getTreeCellEditorComponent(tree, value, true, expanded, isLeaf(editingRow), editingRow); // Remove all previous components (if still present). Only one // container with the editing component inside is allowed in the tree. tree.removeAll(); // The editing component must be added to its container. We add the // container, not the editing component itself. Component container = editingComponent.getParent(); container.setBounds(bounds); tree.add(container); editingComponent.requestFocus(); return true; } return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
else editingComponent = null; }
|
protected boolean startEditing(TreePath path, MouseEvent event) { updateCellEditor(); TreeCellEditor ed = getCellEditor(); if (ed != null && (event == EDIT || ed.shouldSelectCell(event)) && ed.isCellEditable(event)) { Rectangle bounds = getPathBounds(tree, path); // Extend the right boundary till the tree width. bounds.width = tree.getWidth() - bounds.x; editingPath = path; editingRow = tree.getRowForPath(editingPath); Object value = editingPath.getLastPathComponent(); stopEditingInCompleteEditing = false; boolean expanded = tree.isExpanded(editingPath); isEditing = true; editingComponent = ed.getTreeCellEditorComponent(tree, value, true, expanded, isLeaf(editingRow), editingRow); // Remove all previous components (if still present). Only one // container with the editing component inside is allowed in the tree. tree.removeAll(); // The editing component must be added to its container. We add the // container, not the editing component itself. Component container = editingComponent.getParent(); container.setBounds(bounds); tree.add(container); editingComponent.requestFocus(); return true; } return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
tree.scrollPathToVisible(path); if (path != null && tree.isVisible(path))
|
public void startEditingAtPath(JTree tree, TreePath path) { startEditing(path, null); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
if (isEditing(tree))
|
boolean ret = false; if (editingComponent != null && cellEditor.stopCellEditing())
|
public boolean stopEditing(JTree tree) { if (isEditing(tree)) { completeEditing(false, false, true); finish(); } return ! isEditing(tree); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
finish();
|
ret = true;
|
public boolean stopEditing(JTree tree) { if (isEditing(tree)) { completeEditing(false, false, true); finish(); } return ! isEditing(tree); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
return ! isEditing(tree);
|
return ret;
|
public boolean stopEditing(JTree tree) { if (isEditing(tree)) { completeEditing(false, false, true); finish(); } return ! isEditing(tree); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
if (tree.isExpanded(path))
|
if (treeState.isExpanded(path))
|
protected void toggleExpandState(TreePath path) { if (tree.isExpanded(path)) tree.collapsePath(path); else tree.expandPath(path); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
action = null;
|
protected void uninstallKeyboardActions() { action = null; tree.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).setParent( null); tree.getActionMap().setParent(null); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
if (tree.isEditable() && cellEditor == null) setCellEditor(createDefaultCellEditor());
|
completeEditing(); TreeCellEditor newEd = null; if (tree != null && tree.isEditable()) { newEd = tree.getCellEditor(); if (newEd == null) { newEd = createDefaultCellEditor(); if (newEd != null) { tree.setCellEditor(newEd);
|
protected void updateCellEditor() { if (tree.isEditable() && cellEditor == null) setCellEditor(createDefaultCellEditor()); createdCellEditor = true; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
} } if (newEd != cellEditor) { if (cellEditor != null && cellEditorListener != null) cellEditor.removeCellEditorListener(cellEditorListener); cellEditor = newEd; if (cellEditorListener == null) cellEditorListener = createCellEditorListener(); if (cellEditor != null && cellEditorListener != null) cellEditor.addCellEditorListener(cellEditorListener); createdCellEditor = false; } }
|
protected void updateCellEditor() { if (tree.isEditable() && cellEditor == null) setCellEditor(createDefaultCellEditor()); createdCellEditor = true; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
|
treeState.setExpandedState(((TreePath) expanded.nextElement()), true);
|
treeState.setExpandedState((TreePath) expanded.nextElement(), true);
|
protected void updateExpandedDescendants(TreePath path) { Enumeration expanded = tree.getExpandedDescendants(path); while (expanded.hasMoreElements()) treeState.setExpandedState(((TreePath) expanded.nextElement()), true); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
currentCellRenderer = tree.getCellRenderer(); if (currentCellRenderer == null) currentCellRenderer = createDefaultCellRenderer();
|
{ TreeCellRenderer rend = tree.getCellRenderer(); if (rend != null) { createdRenderer = false; currentCellRenderer = rend; if (createdCellEditor) tree.setCellEditor(null); } else { tree.setCellRenderer(createDefaultCellRenderer()); createdRenderer = true; } } else { currentCellRenderer = null; createdRenderer = false; }
|
protected void updateRenderer() { if (tree != null) currentCellRenderer = tree.getCellRenderer(); if (currentCellRenderer == null) currentCellRenderer = createDefaultCellRenderer(); updateCellEditor(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTreeUI.java
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.