bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public JViewport() { setOpaque(true); String scrollModeProp = System.getProperty("gnu.javax.swing.JViewport.scrollMode", "BLIT"); int myScrollMode; if (scrollModeProp.equalsIgnoreCase("simple")) myScrollMode = SIMPLE_SCROLL_MODE; else if (scrollModeProp.equalsIgnoreCase("backingstore")) myScrollMode = BACKINGSTORE_SCROLL_MODE; else myScrollMode = BLIT_SCROLL_MODE; setScrollMode(myScrollMode); updateUI(); setLayout(createLayoutManager()); lastPaintPosition = new Point(); cachedBlitFrom = new Point(); cachedBlitTo = new Point(); cachedBlitSize = new Dimension(); cachedBlitPaint = new Rectangle(); }
|
public JViewport() { setOpaque(true); String scrollModeProp = System.getProperty("gnu.javax.swing.JViewport.scrollMode", "BLIT"); int myScrollMode; if (scrollModeProp.equalsIgnoreCase("simple")) myScrollMode = SIMPLE_SCROLL_MODE; else if (scrollModeProp.equalsIgnoreCase("backingstore")) myScrollMode = BACKINGSTORE_SCROLL_MODE; else myScrollMode = BLIT_SCROLL_MODE; setScrollMode(myScrollMode); updateUI(); setLayout(createLayoutManager()); lastPaintPosition = new Point(); cachedBlitFrom = new Point(); cachedBlitTo = new Point(); cachedBlitSize = new Dimension(); cachedBlitPaint = new Rectangle(); }
| 3,310
|
public static ServantLocator read(InputStream input) { throw new MARSHAL(); }
|
public static ServantLocator read(InputStream input) { MARSHAL m = new MARSHAL("Inappropriate"); m.minor = Minor.Inappropriate; throw m; }
| 3,312
|
public static void write(OutputStream output, ServantLocator value) { throw new MARSHAL(); }
|
public static void write(OutputStream output, ServantLocator value) { MARSHAL m = new MARSHAL("Inappropriate"); m.minor = Minor.Inappropriate; throw m; }
| 3,313
|
private void init() { classXDFNodeName = "parameter"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"noteList"); attribOrder.add(0,"valueList"); attribOrder.add(0,"units"); attribOrder.add(0,"datatype"); attribOrder.add(0,"paramIdRef"); attribOrder.add(0,"paramId"); attribOrder.add(0,"description"); attribOrder.add(0,"name"); //set up the attribute hashtable key with the default initial value attribHash.put("noteList", new XMLAttribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put("valueList", new XMLAttribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put("units", new XMLAttribute(null, Constants.OBJECT_TYPE)); attribHash.put("datatype", new XMLAttribute(null, Constants.OBJECT_TYPE)); attribHash.put("paramIdRef", new XMLAttribute(null, Constants.STRING_TYPE)); //double check k.z. attribHash.put("paramId", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("description", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("name", new XMLAttribute(null, Constants.STRING_TYPE)); };
|
private void init() { classXDFNodeName = "parameter"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"noteList"); attribOrder.add(0,"valueList"); attribOrder.add(0,"units"); attribOrder.add(0,"datatype"); attribOrder.add(0,"paramIdRef"); attribOrder.add(0,"paramId"); attribOrder.add(0,"description"); attribOrder.add(0,"name"); //set up the attribute hashtable key with the default initial value attribHash.put("noteList", new XMLAttribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put("valueList", new XMLAttribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put("units", new XMLAttribute(null, Constants.OBJECT_TYPE)); attribHash.put("datatype", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("paramIdRef", new XMLAttribute(null, Constants.STRING_TYPE)); //double check k.z. attribHash.put("paramId", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("description", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("name", new XMLAttribute(null, Constants.STRING_TYPE)); };
| 3,314
|
public DoubleItem(int kind, int offsetToFP, Register lsb, Register msb, double value) { super(kind, offsetToFP, lsb, msb); this.value = value; }
|
public DoubleItem(int kind, int offsetToFP, Register lsb, Register msb, double value) { super(kind, offsetToFP, lsb, msb); this.value = value; }
| 3,315
|
protected DoubleWordItem cloneConstant() { return createConst(getValue()); }
|
protected DoubleWordItem cloneConstant() { return factory.createDConst(getValue()); }
| 3,316
|
public LabelView(Element element) { super(element); setPropertiesFromAttributes(); }
|
public LabelView(Element element) { super(element); valid = false; }
| 3,317
|
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory vf) { setPropertiesFromAttributes(); }
|
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory vf) { valid = false; super.changedUpdate(e, a, vf); }
| 3,318
|
protected FontMetrics getFontMetrics() { return getContainer().getGraphics().getFontMetrics(font); }
|
protected FontMetrics getFontMetrics() { if (! valid) setPropertiesFromAttributes(); Container c = getContainer(); FontMetrics fm; if (c != null) fm = c.getFontMetrics(font); else fm = Toolkit.getDefaultToolkit().getFontMetrics(font); return fm; }
| 3,321
|
protected void setPropertiesFromAttributes() { Element el = getElement(); AttributeSet atts = el.getAttributes(); // We cannot use StyleConstants.getBackground() here, because that returns // BLACK as default (when background == null). What we need is the // background setting of the text component instead, which is what we get // when background == null anyway. background = (Color) atts.getAttribute(StyleConstants.Background); foreground = StyleConstants.getForeground(atts); strikeThrough = StyleConstants.isStrikeThrough(atts); subscript = StyleConstants.isSubscript(atts); superscript = StyleConstants.isSuperscript(atts); underline = StyleConstants.isUnderline(atts); // Determine the font. String family = StyleConstants.getFontFamily(atts); int size = StyleConstants.getFontSize(atts); int style = Font.PLAIN; if (StyleConstants.isBold(atts)) style |= Font.BOLD; if (StyleConstants.isItalic(atts)) style |= Font.ITALIC; font = new Font(family, style, size); }
|
protected void setPropertiesFromAttributes() { Element el = getElement(); AttributeSet atts = el.getAttributes(); // We cannot use StyleConstants.getBackground() here, because that returns // BLACK as default (when background == null). What we need is the // background setting of the text component instead, which is what we get // when background == null anyway. background = (Color) atts.getAttribute(StyleConstants.Background); foreground = StyleConstants.getForeground(atts); strikeThrough = StyleConstants.isStrikeThrough(atts); subscript = StyleConstants.isSubscript(atts); superscript = StyleConstants.isSuperscript(atts); underline = StyleConstants.isUnderline(atts); // Determine the font. String family = StyleConstants.getFontFamily(atts); int size = StyleConstants.getFontSize(atts); int style = Font.PLAIN; if (StyleConstants.isBold(atts)) style |= Font.BOLD; if (StyleConstants.isItalic(atts)) style |= Font.ITALIC; font = new Font(family, style, size); }
| 3,327
|
protected void setPropertiesFromAttributes() { Element el = getElement(); AttributeSet atts = el.getAttributes(); // We cannot use StyleConstants.getBackground() here, because that returns // BLACK as default (when background == null). What we need is the // background setting of the text component instead, which is what we get // when background == null anyway. background = (Color) atts.getAttribute(StyleConstants.Background); foreground = StyleConstants.getForeground(atts); strikeThrough = StyleConstants.isStrikeThrough(atts); subscript = StyleConstants.isSubscript(atts); superscript = StyleConstants.isSuperscript(atts); underline = StyleConstants.isUnderline(atts); // Determine the font. String family = StyleConstants.getFontFamily(atts); int size = StyleConstants.getFontSize(atts); int style = Font.PLAIN; if (StyleConstants.isBold(atts)) style |= Font.BOLD; if (StyleConstants.isItalic(atts)) style |= Font.ITALIC; font = new Font(family, style, size); }
|
protected void setPropertiesFromAttributes() { Element el = getElement(); AttributeSet atts = el.getAttributes(); // We cannot use StyleConstants.getBackground() here, because that returns // BLACK as default (when background == null). What we need is the // background setting of the text component instead, which is what we get // when background == null anyway. background = (Color) atts.getAttribute(StyleConstants.Background); foreground = StyleConstants.getForeground(atts); strikeThrough = StyleConstants.isStrikeThrough(atts); subscript = StyleConstants.isSubscript(atts); superscript = StyleConstants.isSuperscript(atts); underline = StyleConstants.isUnderline(atts); // Determine the font. String family = StyleConstants.getFontFamily(atts); int size = StyleConstants.getFontSize(atts); int style = Font.PLAIN; if (StyleConstants.isBold(atts)) style |= Font.BOLD; if (StyleConstants.isItalic(atts)) style |= Font.ITALIC; font = new Font(family, style, size); }
| 3,328
|
public float getPreferredSpan(int axis) { if (axis != X_AXIS && axis != Y_AXIS) throw new IllegalArgumentException(); // make sure we have the metrics updateMetrics(); float span = 0; Element el = getElement(); switch (axis) { case X_AXIS: span = determineMaxLineLength(); case Y_AXIS: default: span = metrics.getHeight() * el.getElementCount(); break; } return span; }
|
public float getPreferredSpan(int axis) { if (axis != X_AXIS && axis != Y_AXIS) throw new IllegalArgumentException(); // make sure we have the metrics updateMetrics(); Element el = getElement(); switch (axis) { case X_AXIS: span = determineMaxLineLength(); case Y_AXIS: default: span = metrics.getHeight() * el.getElementCount(); break; } return span; }
| 3,330
|
protected void updateDamage(DocumentEvent changes, Shape a, ViewFactory f) { Element el = getElement(); ElementChange ec = changes.getChange(el); // If ec is null then no lines were added or removed, just // repaint the changed line if (ec == null) { int line = getElement().getElementIndex(changes.getOffset()); damageLineRange(line, line, a, getContainer()); return; } Element[] removed = ec.getChildrenRemoved(); Element[] newElements = ec.getChildrenAdded(); // If no Elements were added or removed, we just want to repaint // the area containing the line that was modified if (removed == null && newElements == null) { int line = getElement().getElementIndex(changes.getOffset()); damageLineRange(line, line, a, getContainer()); return; } // Check to see if we removed the longest line, if so we have to // search through all lines and find the longest one again if (removed != null) { for (int i = 0; i < removed.length; i++) if (removed[i].equals(longestLine)) { // reset maxLineLength and search through all lines for longest one maxLineLength = -1; determineMaxLineLength(); ((JTextComponent)getContainer()).repaint(); return; } } // If we've reached here, that means we haven't removed the longest line if (newElements == null) { // No lines were added, just repaint the container and exit ((JTextComponent)getContainer()).repaint(); return; } // Make sure we have the metrics updateMetrics(); // If we've reached here, that means we haven't removed the longest line // and we have added at least one line, so we have to check if added lines // are longer than the previous longest line Segment seg = getLineBuffer(); float longestNewLength = 0; Element longestNewLine = null; // Loop through the added lines to check their length for (int i = 0; i < newElements.length; i++) { Element child = newElements[i]; int start = child.getStartOffset(); int end = child.getEndOffset(); try { el.getDocument().getText(start, end - start, seg); } catch (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } if (seg == null || seg.array == null || seg.count == 0) continue; int width = metrics.charsWidth(seg.array, seg.offset, seg.count); if (width > longestNewLength) { longestNewLine = child; longestNewLength = width; } } // Check if the longest of the new lines is longer than our previous // longest line, and if so update our values if (longestNewLength > maxLineLength) { maxLineLength = longestNewLength; longestLine = longestNewLine; } // Repaint the container ((JTextComponent)getContainer()).repaint(); }
|
protected void updateDamage(DocumentEvent changes, Shape a, ViewFactory f) { Element el = getElement(); ElementChange ec = changes.getChange(el); // If ec is null then no lines were added or removed, just // repaint the changed line if (ec == null) { int line = el.getElementIndex(changes.getOffset()); if (changes.getType() == DocumentEvent.EventType.REMOVE && el.getElement(line) == longestLine) { maxLineLength = -1; if (determineMaxLineLength() != alloc.width) preferenceChanged(this, true, false); } damageLineRange(line, line, a, getContainer()); return; } Element[] removed = ec.getChildrenRemoved(); Element[] newElements = ec.getChildrenAdded(); // If no Elements were added or removed, we just want to repaint // the area containing the line that was modified if (removed == null && newElements == null) { int line = el.getElementIndex(changes.getOffset()); if (changes.getType() == DocumentEvent.EventType.REMOVE && el.getElement(line) == longestLine) { maxLineLength = -1; if (determineMaxLineLength() != alloc.width) preferenceChanged(this, true, false); } damageLineRange(line, line, a, getContainer()); return; } // Check to see if we removed the longest line, if so we have to // search through all lines and find the longest one again if (removed != null) { for (int i = 0; i < removed.length; i++) if (removed[i].equals(longestLine)) { // reset maxLineLength and search through all lines for longest one maxLineLength = -1; determineMaxLineLength(); ((JTextComponent)getContainer()).repaint(); return; } } // If we've reached here, that means we haven't removed the longest line if (newElements == null) { // No lines were added, just repaint the container and exit ((JTextComponent)getContainer()).repaint(); return; } // Make sure we have the metrics updateMetrics(); // If we've reached here, that means we haven't removed the longest line // and we have added at least one line, so we have to check if added lines // are longer than the previous longest line Segment seg = getLineBuffer(); float longestNewLength = 0; Element longestNewLine = null; // Loop through the added lines to check their length for (int i = 0; i < newElements.length; i++) { Element child = newElements[i]; int start = child.getStartOffset(); int end = child.getEndOffset(); try { el.getDocument().getText(start, end - start, seg); } catch (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } if (seg == null || seg.array == null || seg.count == 0) continue; int width = metrics.charsWidth(seg.array, seg.offset, seg.count); if (width > longestNewLength) { longestNewLine = child; longestNewLength = width; } } // Check if the longest of the new lines is longer than our previous // longest line, and if so update our values if (longestNewLength > maxLineLength) { maxLineLength = longestNewLength; longestLine = longestNewLine; } // Repaint the container ((JTextComponent)getContainer()).repaint(); }
| 3,331
|
protected void updateDamage(DocumentEvent changes, Shape a, ViewFactory f) { Element el = getElement(); ElementChange ec = changes.getChange(el); // If ec is null then no lines were added or removed, just // repaint the changed line if (ec == null) { int line = getElement().getElementIndex(changes.getOffset()); damageLineRange(line, line, a, getContainer()); return; } Element[] removed = ec.getChildrenRemoved(); Element[] newElements = ec.getChildrenAdded(); // If no Elements were added or removed, we just want to repaint // the area containing the line that was modified if (removed == null && newElements == null) { int line = getElement().getElementIndex(changes.getOffset()); damageLineRange(line, line, a, getContainer()); return; } // Check to see if we removed the longest line, if so we have to // search through all lines and find the longest one again if (removed != null) { for (int i = 0; i < removed.length; i++) if (removed[i].equals(longestLine)) { // reset maxLineLength and search through all lines for longest one maxLineLength = -1; determineMaxLineLength(); ((JTextComponent)getContainer()).repaint(); return; } } // If we've reached here, that means we haven't removed the longest line if (newElements == null) { // No lines were added, just repaint the container and exit ((JTextComponent)getContainer()).repaint(); return; } // Make sure we have the metrics updateMetrics(); // If we've reached here, that means we haven't removed the longest line // and we have added at least one line, so we have to check if added lines // are longer than the previous longest line Segment seg = getLineBuffer(); float longestNewLength = 0; Element longestNewLine = null; // Loop through the added lines to check their length for (int i = 0; i < newElements.length; i++) { Element child = newElements[i]; int start = child.getStartOffset(); int end = child.getEndOffset(); try { el.getDocument().getText(start, end - start, seg); } catch (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } if (seg == null || seg.array == null || seg.count == 0) continue; int width = metrics.charsWidth(seg.array, seg.offset, seg.count); if (width > longestNewLength) { longestNewLine = child; longestNewLength = width; } } // Check if the longest of the new lines is longer than our previous // longest line, and if so update our values if (longestNewLength > maxLineLength) { maxLineLength = longestNewLength; longestLine = longestNewLine; } // Repaint the container ((JTextComponent)getContainer()).repaint(); }
|
protected void updateDamage(DocumentEvent changes, Shape a, ViewFactory f) { Element el = getElement(); ElementChange ec = changes.getChange(el); // If ec is null then no lines were added or removed, just // repaint the changed line if (ec == null) { int line = getElement().getElementIndex(changes.getOffset()); damageLineRange(line, line, a, getContainer()); return; } Element[] removed = ec.getChildrenRemoved(); Element[] newElements = ec.getChildrenAdded(); // If no Elements were added or removed, we just want to repaint // the area containing the line that was modified if (removed == null && newElements == null) { int line = getElement().getElementIndex(changes.getOffset()); damageLineRange(line, line, a, getContainer()); return; } // Check to see if we removed the longest line, if so we have to // search through all lines and find the longest one again if (removed != null) { for (int i = 0; i < removed.length; i++) if (removed[i].equals(longestLine)) { // reset maxLineLength and search through all lines for longest one maxLineLength = -1; if (determineMaxLineLength() != alloc.width) preferenceChanged(this, true, removed.length != newElements.length); ((JTextComponent)getContainer()).repaint(); return; } } // If we've reached here, that means we haven't removed the longest line if (newElements == null) { // No lines were added, just repaint the container and exit ((JTextComponent)getContainer()).repaint(); return; } // Make sure we have the metrics updateMetrics(); // If we've reached here, that means we haven't removed the longest line // and we have added at least one line, so we have to check if added lines // are longer than the previous longest line Segment seg = getLineBuffer(); float longestNewLength = 0; Element longestNewLine = null; // Loop through the added lines to check their length for (int i = 0; i < newElements.length; i++) { Element child = newElements[i]; int start = child.getStartOffset(); int end = child.getEndOffset(); try { el.getDocument().getText(start, end - start, seg); } catch (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } if (seg == null || seg.array == null || seg.count == 0) continue; int width = metrics.charsWidth(seg.array, seg.offset, seg.count); if (width > longestNewLength) { longestNewLine = child; longestNewLength = width; } } // Check if the longest of the new lines is longer than our previous // longest line, and if so update our values if (longestNewLength > maxLineLength) { maxLineLength = longestNewLength; longestLine = longestNewLine; } // Repaint the container ((JTextComponent)getContainer()).repaint(); }
| 3,332
|
public int viewToModel(float x, float y, Shape a, Position.Bias[] b) { Rectangle rec = a.getBounds(); Document doc = getDocument(); Element root = doc.getDefaultRootElement(); // PlainView doesn't support line-wrapping so we can find out which // Element was clicked on just by the y-position int lineClicked = (int) (y - rec.y) / metrics.getHeight(); if (lineClicked >= root.getElementCount()) return getEndOffset() - 1; Element line = root.getElement(lineClicked); Segment s = getLineBuffer(); int start = line.getStartOffset(); // We don't want the \n at the end of the line. int end = line.getEndOffset() - 1; try { doc.getText(start, end - start, s); } catch (BadLocationException ble) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ble); throw ae; } int pos = Utilities.getTabbedTextOffset(s, metrics, rec.x, (int)x, this, start); return Math.max (0, pos); }
|
public int viewToModel(float x, float y, Shape a, Position.Bias[] b) { Rectangle rec = a.getBounds(); Document doc = getDocument(); Element root = doc.getDefaultRootElement(); // PlainView doesn't support line-wrapping so we can find out which // Element was clicked on just by the y-position int lineClicked = (int) (y - rec.y) / metrics.getHeight(); if (lineClicked >= root.getElementCount()) return getEndOffset() - 1; Element line = root.getElement(lineClicked); Segment s = getLineBuffer(); int start = line.getStartOffset(); // We don't want the \n at the end of the line. int end = line.getEndOffset() - 1; try { doc.getText(start, end - start, s); } catch (BadLocationException ble) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ble); throw ae; } int pos = Utilities.getTabbedTextOffset(s, metrics, rec.x, (int)x, this, start); return Math.max (0, pos); }
| 3,334
|
public void editingCanceled(ChangeEvent e) { cancelEditing(tree); }
|
public void editingCanceled(ChangeEvent e) { completeEditing(false, false, false); }
| 3,337
|
public void editingStopped(ChangeEvent e) { stopEditing(tree); }
|
public void editingStopped(ChangeEvent e) { completeEditing(false, false, true); }
| 3,338
|
public void keyPressed(KeyEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
public void keyPressed(KeyEvent e) { // TODO: What should be done here, if anything? }
| 3,339
|
public void keyReleased(KeyEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
public void keyReleased(KeyEvent e) { // TODO: What should be done here, if anything? }
| 3,340
|
public void keyTyped(KeyEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
public void keyTyped(KeyEvent e) { // TODO: What should be done here, if anything? }
| 3,341
|
public void mouseDragged(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
public void mouseDragged(MouseEvent e) { // TODO: What should be done here, if anything? }
| 3,343
|
public void mouseMoved(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
public void mouseMoved(MouseEvent e) { // TODO: What should be done here, if anything? }
| 3,344
|
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); } } } }
|
public void mousePressed(MouseEvent e) { if (! e.isConsumed()) { handleEvent(e); selectedOnPress = true; } else { // 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); } } } }
| 3,345
|
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); } } } }
|
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); } } } }
| 3,346
|
public void mouseReleased(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
public void mouseReleased(MouseEvent e) { // TODO: What should be done here, if anything? }
| 3,347
|
public void mouseClicked(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
public void mouseClicked(MouseEvent e) { // TODO: What should be done here, if anything? }
| 3,350
|
public void mouseEntered(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
public void mouseEntered(MouseEvent e) { // TODO: What should be done here, if anything? }
| 3,353
|
public void mouseExited(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
public void mouseExited(MouseEvent e) { // TODO: What should be done here, if anything? }
| 3,355
|
public void mousePressed(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
public void mousePressed(MouseEvent e) { // TODO: What should be done here, if anything? }
| 3,358
|
protected void removeFromSource() throws NotImplementedException { // TODO: Implement this properly. }
|
protected void removeFromSource() { // TODO: Implement this properly. }
| 3,360
|
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; }
|
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; }
| 3,362
|
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; }
|
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) { 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) { 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; }
| 3,363
|
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; }
|
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; }
| 3,364
|
public void propertyChange(PropertyChangeEvent event) throws NotImplementedException { // TODO: What should be done here, if anything? }
|
public void propertyChange(PropertyChangeEvent event) { // TODO: What should be done here, if anything? }
| 3,367
|
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); } }
|
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); } }
| 3,372
|
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); } }
|
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); } }
| 3,373
|
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(); }
|
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(); }
| 3,376
|
protected void completeUIInstall() { setShowsRootHandles(tree.getShowsRootHandles()); updateRenderer(); updateDepthOffset(); setSelectionModel(tree.getSelectionModel()); treeState = createLayoutCache(); treeSelectionModel.setRowMapper(treeState); configureLayoutCache(); updateSize(); }
|
protected void completeUIInstall() { setShowsRootHandles(tree.getShowsRootHandles()); updateRenderer(); updateDepthOffset(); setSelectionModel(tree.getSelectionModel()); configureLayoutCache(); treeState.setRootVisible(tree.isRootVisible()); treeSelectionModel.setRowMapper(treeState); configureLayoutCache(); updateSize(); }
| 3,378
|
protected void completeUIInstall() { setShowsRootHandles(tree.getShowsRootHandles()); updateRenderer(); updateDepthOffset(); setSelectionModel(tree.getSelectionModel()); treeState = createLayoutCache(); treeSelectionModel.setRowMapper(treeState); configureLayoutCache(); updateSize(); }
|
protected void completeUIInstall() { setShowsRootHandles(tree.getShowsRootHandles()); updateRenderer(); updateDepthOffset(); setSelectionModel(tree.getSelectionModel()); treeState = createLayoutCache(); treeSelectionModel.setRowMapper(treeState); updateSize(); }
| 3,379
|
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; }
|
private ActionMap createDefaultActions() { ActionMapUIResource am = new ActionMapUIResource(); Action action; action = new TreeHomeAction(-1, "selectFirst"); 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; }
| 3,380
|
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; }
|
private ActionMap createDefaultActions() { ActionMapUIResource am = new ActionMapUIResource(); Action action; action= new TreeAction(); am.put(action.getValue(Action.NAME), action); // TreeHomeAction. action = new TreeHomeAction(-1, "selectFirstChangeLead"); 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; }
| 3,381
|
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; }
|
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, "selectFirstExtendSelection"); 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; }
| 3,382
|
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; }
|
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, "selectLast"); 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; }
| 3,383
|
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; }
|
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, "selectLastChangeLead"); 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; }
| 3,384
|
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; }
|
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; }
| 3,385
|
protected TreePath getLastChildPath(TreePath parent) { return ((TreePath) parent.getLastPathComponent()); }
|
protected TreePath getLastChildPath(TreePath parent) { return (TreePath) parent.getLastPathComponent(); }
| 3,387
|
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()); }
|
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); SwingUtilities.replaceUIActionMap(tree, getActionMap()); }
| 3,389
|
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; }
|
protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY) { boolean cntlClick = false; if (! treeModel.isLeaf(path.getLastPathComponent())) { int width; // 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; }
| 3,390
|
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; }
|
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; }
| 3,391
|
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); } }
|
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path) { Rectangle bounds = getPathBounds(tree, path); TreePath parent = path.getParentPath(); boolean paintLine; if (isRootVisible()) paintLine = parent != null; else paintLine = parent != null && parent.getPathCount() > 1; if (paintLine) { Rectangle parentBounds = getPathBounds(tree, parent); paintVerticalLine(g, tree, parentBounds.x + 2* gap, parentBounds.y + parentBounds.height / 2, bounds.y + bounds.height / 2); } }
| 3,392
|
protected void setCellEditor(TreeCellEditor editor) { cellEditor = editor; createdCellEditor = true; }
|
protected void setCellEditor(TreeCellEditor editor) { cellEditor = editor; createdCellEditor = true; }
| 3,394
|
protected void setCellRenderer(TreeCellRenderer tcr) { currentCellRenderer = tcr; updateRenderer(); }
|
protected void setCellRenderer(TreeCellRenderer tcr) { completeEditing(); updateRenderer(); }
| 3,395
|
protected void setEditable(boolean newValue) { tree.setEditable(newValue); }
|
protected void setEditable(boolean newValue) { updateCellEditor(); }
| 3,397
|
protected boolean shouldPaintExpandControl(TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { Object node = path.getLastPathComponent(); return (! isLeaf && hasControlIcons()); }
|
protected boolean shouldPaintExpandControl(TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { Object node = path.getLastPathComponent(); return ! isLeaf && hasControlIcons(); }
| 3,402
|
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; }
|
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; }
| 3,403
|
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; }
|
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; }
| 3,404
|
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; }
|
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. Dimension size = editingComponent.getPreferredSize(); int rowHeight = getRowHeight(); if (size.height != bounds.height && rowHeight > 0) size.height = rowHeight; 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; }
| 3,405
|
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; }
|
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; }
| 3,406
|
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; }
|
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); tree.add(editingComponent); editingComponent.setBounds(bounds.x, bounds.y, size.width, size.height); editingComponent.validate(); editingPath = path; 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; }
| 3,407
|
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; }
|
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; }
| 3,408
|
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; }
|
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. 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); // 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; }
| 3,409
|
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; }
|
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; }
| 3,410
|
public boolean stopEditing(JTree tree) { if (isEditing(tree)) { completeEditing(false, false, true); finish(); } return ! isEditing(tree); }
|
public boolean stopEditing(JTree tree) { boolean ret = false; if (editingComponent != null && cellEditor.stopCellEditing()) { completeEditing(false, false, true); finish(); } return ! isEditing(tree); }
| 3,413
|
public boolean stopEditing(JTree tree) { if (isEditing(tree)) { completeEditing(false, false, true); finish(); } return ! isEditing(tree); }
|
public boolean stopEditing(JTree tree) { if (isEditing(tree)) { completeEditing(false, false, true); ret = true; } return ! isEditing(tree); }
| 3,414
|
public boolean stopEditing(JTree tree) { if (isEditing(tree)) { completeEditing(false, false, true); finish(); } return ! isEditing(tree); }
|
public boolean stopEditing(JTree tree) { if (isEditing(tree)) { completeEditing(false, false, true); finish(); } return ret; }
| 3,415
|
protected void toggleExpandState(TreePath path) { if (tree.isExpanded(path)) tree.collapsePath(path); else tree.expandPath(path); }
|
protected void toggleExpandState(TreePath path) { if (treeState.isExpanded(path)) tree.collapsePath(path); else tree.expandPath(path); }
| 3,416
|
protected void uninstallKeyboardActions() { action = null; tree.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).setParent( null); tree.getActionMap().setParent(null); }
|
protected void uninstallKeyboardActions() { tree.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).setParent( null); tree.getActionMap().setParent(null); }
| 3,417
|
protected void updateCellEditor() { if (tree.isEditable() && cellEditor == null) setCellEditor(createDefaultCellEditor()); createdCellEditor = true; }
|
protected void updateCellEditor() { if (tree.isEditable() && cellEditor == null) setCellEditor(createDefaultCellEditor()); createdCellEditor = true; }
| 3,418
|
protected void updateExpandedDescendants(TreePath path) { Enumeration expanded = tree.getExpandedDescendants(path); while (expanded.hasMoreElements()) 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); }
| 3,420
|
protected void updateRenderer() { if (tree != null) currentCellRenderer = tree.getCellRenderer(); if (currentCellRenderer == null) currentCellRenderer = createDefaultCellRenderer(); updateCellEditor(); }
|
protected void updateRenderer() { if (tree != null) currentCellRenderer = tree.getCellRenderer(); if (currentCellRenderer == null) currentCellRenderer = createDefaultCellRenderer(); updateCellEditor(); }
| 3,421
|
public FieldAxis addFieldAxis(FieldAxis fieldAxis) { if (!canAddFieldAxisObjToArray(fieldAxis)) return null; if (getFieldAxis() !=null) { List axisList = getAxisList(); axisList.remove(0); // axisList.add(0, fieldAxis); //replace the old fieldAxis with the new one } else { //add fieldAxis and increment dimension getAxisList().add(0, fieldAxis); //getDataCube().incrementDimension(fieldAxis); } //inficiency??? return getFieldAxis(); }
|
public FieldAxis addFieldAxis(FieldAxis fieldAxis) { if (!canAddFieldAxisObjToArray(fieldAxis)) return null; if (getFieldAxis() !=null) { List axisList = getAxisList(); axisList.remove(0); // axisList.add(0, fieldAxis); //replace the old fieldAxis with the new one } else { //add fieldAxis and increment dimension getAxisList().add(0, fieldAxis); //getDataCube().incrementDimension(fieldAxis); } //inficiency??? hasFieldAxis = true; return fieldAxis; }
| 3,423
|
public ParameterGroup addParamGroup (ParameterGroup group) { if (group !=null) { //add the group to the groupOwnedHash paramGroupOwnedHash.add(group); return group; } else { Log.warn("in Structure.addParamGroup(). ParameterGroup passed in is null"); return null; } }
|
public ParameterGroup addParamGroup (ParameterGroup group) { if (group !=null) { //add the group to the groupOwnedHash paramGroupOwnedHash.add(group); return group; } else { Log.warn("in Array.addParamGroup(). ParameterGroup passed in is null"); return null; } }
| 3,424
|
public boolean removeParamGroup(ParameterGroup group) { if (group == null) { Log.warn("in Structure.removeParamGroup(). ParameterGroup passed in is null"); return false; } return paramGroupOwnedHash.remove(group); }
|
public boolean removeParamGroup(ParameterGroup group) { if (group == null) { Log.warn("in Array.removeParamGroup(). ParameterGroup passed in is null"); return false; } return paramGroupOwnedHash.remove(group); }
| 3,425
|
public int getErrorLine() { return errorLineNum; }
|
public int getErrorLine() { return planes.getErrorLine(); }
| 3,432
|
void jbInit() throws Exception { // damn I hate putting this in but it is the only way to get // it to work correctly. What a pain in the ass. if (OperatingSystem.isMacOS() && OperatingSystem.hasJava14()) fullRepaint = true; // change by Luc - LDC If the font from the properties file does not // exist // select the default font String fontName = null; if (config.isPropertyExists("font")) { fontName = getStringProperty("font"); if (GUIGraphicsUtils.isFontNameExists(fontName) == false) fontName = null; } // if (!config.isPropertyExists("font")) { if (fontName == null) { font = new Font(GUIGraphicsUtils.getDefaultFont(), Font.PLAIN, 14); // font = new Font("Courier New",Font.PLAIN,14); config.setProperty("font", font.getFontName()); } else { //font = new Font(getStringProperty("font"),Font.PLAIN,14); font = new Font(fontName, Font.PLAIN, 14); } gui.setFont(font); lastAttr = 32; // default number of rows and columns numRows = 24; numCols = 80; goto_XY(1, 1); // set initial cursor position restriction = new Rectangle(0, 0); errorLineNum = numRows; updateCursorLoc = false; FontRenderContext frc = new FontRenderContext(font.getTransform(), true, true); lm = font.getLineMetrics("Wy", frc); fmWidth = (int) font.getStringBounds("W", frc).getWidth() + 1; fmHeight = (int) (font.getStringBounds("g", frc).getHeight() + lm.getDescent() + lm.getLeading()); oia = new ScreenOIA(this); oia.setKeyBoardLocked(true); checkOffScreenImage(); lenScreen = numRows * numCols; planes = new ScreenPlanes(this,numRows);// screen = new ScreenChar[lenScreen];//// for (int y = 0; y < lenScreen; y++) {// screen[y] = new ScreenChar(this);// screen[y].setCharAndAttr(' ', initAttr, false);// screen[y].setRowCol(getRow(y), getCol(y));// } screenFields = new ScreenFields(this); strokenizer = new KeyStrokenizer(); }
|
void jbInit() throws Exception { // damn I hate putting this in but it is the only way to get // it to work correctly. What a pain in the ass. if (OperatingSystem.isMacOS() && OperatingSystem.hasJava14()) fullRepaint = true; // change by Luc - LDC If the font from the properties file does not // exist // select the default font String fontName = null; if (config.isPropertyExists("font")) { fontName = getStringProperty("font"); if (GUIGraphicsUtils.isFontNameExists(fontName) == false) fontName = null; } // if (!config.isPropertyExists("font")) { if (fontName == null) { font = new Font(GUIGraphicsUtils.getDefaultFont(), Font.PLAIN, 14); // font = new Font("Courier New",Font.PLAIN,14); config.setProperty("font", font.getFontName()); } else { //font = new Font(getStringProperty("font"),Font.PLAIN,14); font = new Font(fontName, Font.PLAIN, 14); } gui.setFont(font); lastAttr = 32; // default number of rows and columns numRows = 24; numCols = 80; goto_XY(1, 1); // set initial cursor position restriction = new Rectangle(0, 0); updateCursorLoc = false; FontRenderContext frc = new FontRenderContext(font.getTransform(), true, true); lm = font.getLineMetrics("Wy", frc); fmWidth = (int) font.getStringBounds("W", frc).getWidth() + 1; fmHeight = (int) (font.getStringBounds("g", frc).getHeight() + lm.getDescent() + lm.getLeading()); oia = new ScreenOIA(this); oia.setKeyBoardLocked(true); checkOffScreenImage(); lenScreen = numRows * numCols; planes = new ScreenPlanes(this,numRows);// screen = new ScreenChar[lenScreen];//// for (int y = 0; y < lenScreen; y++) {// screen[y] = new ScreenChar(this);// screen[y].setCharAndAttr(' ', initAttr, false);// screen[y].setRowCol(getRow(y), getCol(y));// } screenFields = new ScreenFields(this); strokenizer = new KeyStrokenizer(); }
| 3,433
|
public void restoreErrorLine() { if (planes.isErrorLineSaved()) { planes.restoreErrorLine(); int y = fmHeight * planes.getErrorLine(); updateImage(0, y, bi.getWidth(), fmHeight); } }
|
protected void restoreErrorLine() { if (planes.isErrorLineSaved()) { planes.restoreErrorLine(); int y = fmHeight * planes.getErrorLine(); updateImage(0, y, bi.getWidth(), fmHeight); } }
| 3,434
|
public void restoreErrorLine() { if (planes.isErrorLineSaved()) { planes.restoreErrorLine(); int y = fmHeight * planes.getErrorLine(); updateImage(0, y, bi.getWidth(), fmHeight); } }
|
public void restoreErrorLine() { if (planes.isErrorLineSaved()) { planes.restoreErrorLine(); int y = fmHeight * (planes.getErrorLine()-1); updateImage(0, y, bi.getWidth(), fmHeight); } }
| 3,435
|
public void saveErrorLine() {// // if there is already an error line saved then do not save it again// // This signifies that there was a previous error and the original error// // line was not restored yet.// if (errorLine == null) {// errorLine = new ScreenChar[numCols];// int r = getPos(errorLineNum - 1, 0);//// for (int x = 0; x < numCols; x++) {// errorLine[x] = new ScreenChar(this);// errorLine[x].setCharAndAttr(screen[r + x].getChar(), screen[r// + x].getCharAttr(), false);// }// } planes.saveErrorLine(); }
|
protected void saveErrorLine() {// // if there is already an error line saved then do not save it again// // This signifies that there was a previous error and the original error// // line was not restored yet.// if (errorLine == null) {// errorLine = new ScreenChar[numCols];// int r = getPos(errorLineNum - 1, 0);//// for (int x = 0; x < numCols; x++) {// errorLine[x] = new ScreenChar(this);// errorLine[x].setCharAndAttr(screen[r + x].getChar(), screen[r// + x].getCharAttr(), false);// }// } planes.saveErrorLine(); }
| 3,436
|
public void setErrorLine(int line) { if (line == 0 || line > numRows) errorLineNum = numRows; else errorLineNum = line; }
|
public void setErrorLine(int line) { if (line == 0 || line > numRows) errorLineNum = numRows; else errorLineNum = line; }
| 3,437
|
public final void setRowsCols(int rows, int cols) { // default number of rows and columns numRows = rows; numCols = cols; lenScreen = numRows * numCols;// screen = new ScreenChar[lenScreen];//// for (int y = 0; y < lenScreen; y++) {// screen[y] = new ScreenChar(this);// screen[y].setCharAndAttr(' ', initAttr, false);// screen[y].setRowCol(getRow(y), getCol(y));// } errorLineNum = numRows; planes.setSize(rows); Rectangle r = gui.getDrawingBounds(); resizeScreenArea(r.width, r.height); gui.repaint(); }
|
public final void setRowsCols(int rows, int cols) { // default number of rows and columns numRows = rows; numCols = cols; lenScreen = numRows * numCols;// screen = new ScreenChar[lenScreen];//// for (int y = 0; y < lenScreen; y++) {// screen[y] = new ScreenChar(this);// screen[y].setCharAndAttr(' ', initAttr, false);// screen[y].setRowCol(getRow(y), getCol(y));// } planes.setSize(rows); Rectangle r = gui.getDrawingBounds(); resizeScreenArea(r.width, r.height); gui.repaint(); }
| 3,438
|
protected synchronized void updateImage(int x, int y, int width, int height) { if (gg2d == null) { //System.out.println("was null"); gg2d = (Graphics2D) gui.getGraphics(); } // check for selected area and erase it before updating screen if (gui.rubberband != null && gui.rubberband.isAreaSelected()) { gui.rubberband.erase(); } if (bi == null || gg2d == null) { if (bi == null) System.out.println("bi was null in update image"); if (gg2d == null) System.out.println("gg2d was null in update image"); return; } g2d.setClip(x, y, width, height); if (!cursorActive && x + width <= bi.getWidth(null) && y + height <= (bi.getHeight(null) - fmWidth)) { paintComponent2(g2d); } // if (tileimage != null) { // // AlphaComposite ac = // AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f); // g2d.setComposite(ac); // g2d.drawImage(tileimage, null, null); // } // LDC - WVL : 08/09/2003 : TR.000358 // TN5250j overpaints superimposed components // as swing doesn't support overlay detection when painting a component // we have to adhere to swing's paint request and use dirty rectangle // marking // instead of off-thread painting // So we replaced the complete block underneath by 1 repaint request // fix for jdk1.4 - found this while testing under jdk1.4 // if the height and or the width are equal to zero we skip the // the updating of the image. // if (gui.isVisible() && height > 0 && width > 0) { // bi.drawImageBuffer(gg2d,x,y,width,height); // } // if (gui.isVisible()) { // if (height > 0 && width > 0) { // We now redraw the selected area rectangle. if (gui.rubberband != null && gui.rubberband.isAreaSelected()) { gui.rubberband.draw(); } // if (!fullRepaint) { // bi.drawImageBuffer(gg2d,x,y,width,height); // } // else // gui.repaint(); // System.out.println(" something went right finally " + gui.isVisible() // + // " height " + height + " width " + width); // } // else { // bi.drawImageBuffer(gg2d); // System.out.println(" something is wrong here " + gui.isVisible() + // " height " + height + " width " + width); // } // } if (x == 0) width += bi.offLeft; else x += bi.offLeft; if (y == 0) height += bi.offTop; else y += bi.offTop; gui.repaint(x, y, width, height); }
|
protected void updateImage(int x, int y, int width, int height) { if (gg2d == null) { //System.out.println("was null"); gg2d = (Graphics2D) gui.getGraphics(); } // check for selected area and erase it before updating screen if (gui.rubberband != null && gui.rubberband.isAreaSelected()) { gui.rubberband.erase(); } if (bi == null || gg2d == null) { if (bi == null) System.out.println("bi was null in update image"); if (gg2d == null) System.out.println("gg2d was null in update image"); return; } g2d.setClip(x, y, width, height); if (!cursorActive && x + width <= bi.getWidth(null) && y + height <= (bi.getHeight(null) - fmWidth)) { paintComponent2(g2d); } // if (tileimage != null) { // // AlphaComposite ac = // AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f); // g2d.setComposite(ac); // g2d.drawImage(tileimage, null, null); // } // LDC - WVL : 08/09/2003 : TR.000358 // TN5250j overpaints superimposed components // as swing doesn't support overlay detection when painting a component // we have to adhere to swing's paint request and use dirty rectangle // marking // instead of off-thread painting // So we replaced the complete block underneath by 1 repaint request // fix for jdk1.4 - found this while testing under jdk1.4 // if the height and or the width are equal to zero we skip the // the updating of the image. // if (gui.isVisible() && height > 0 && width > 0) { // bi.drawImageBuffer(gg2d,x,y,width,height); // } // if (gui.isVisible()) { // if (height > 0 && width > 0) { // We now redraw the selected area rectangle. if (gui.rubberband != null && gui.rubberband.isAreaSelected()) { gui.rubberband.draw(); } // if (!fullRepaint) { // bi.drawImageBuffer(gg2d,x,y,width,height); // } // else // gui.repaint(); // System.out.println(" something went right finally " + gui.isVisible() // + // " height " + height + " width " + width); // } // else { // bi.drawImageBuffer(gg2d); // System.out.println(" something is wrong here " + gui.isVisible() + // " height " + height + " width " + width); // } // } if (x == 0) width += bi.offLeft; else x += bi.offLeft; if (y == 0) height += bi.offTop; else y += bi.offTop; gui.repaint(x, y, width, height); }
| 3,439
|
public synchronized int GetScreen(char buffer[], int bufferLength, int from, int length, int plane)// throws OhioException { {// if(buffer == null)// throw new OhioException(sessionVT.getSessionConfiguration(),// OhioScreen.class.getName(), "osohio.screen.ohio00300", 1); if(buffer == null) return 0; int min = Math.min(Math.min(buffer.length, bufferLength), screenSize); if ((from + min) > screenSize) { min = screenSize - from; } char[] pd = getPlaneData(from,from + min,plane); if(pd != null) { System.arraycopy(pd, 0, buffer, 0, min); return pd.length; } return 0; }
|
public synchronized int GetScreen(char buffer[], int bufferLength, int from, int length, int plane)// throws OhioException { {// if(buffer == null)// throw new OhioException(sessionVT.getSessionConfiguration(),// OhioScreen.class.getName(), "osohio.screen.ohio00300", 1); if(buffer == null) return 0; int min = Math.min(Math.min(buffer.length, bufferLength), screenSize); if ((from + min) > screenSize) { min = screenSize - from; } char[] pd = getPlaneData(from,from + min,plane); if(pd != null) { System.arraycopy(pd, 0, buffer, 0, min); return pd.length; } return 0; }
| 3,440
|
public synchronized int GetScreen(char buffer[], int bufferLength, int from, int length, int plane)// throws OhioException { {// if(buffer == null)// throw new OhioException(sessionVT.getSessionConfiguration(),// OhioScreen.class.getName(), "osohio.screen.ohio00300", 1); if(buffer == null) return 0; int min = Math.min(Math.min(buffer.length, bufferLength), screenSize); if ((from + min) > screenSize) { min = screenSize - from; } char[] pd = getPlaneData(from,from + min,plane); if(pd != null) { System.arraycopy(pd, 0, buffer, 0, min); return pd.length; } return 0; }
|
public synchronized int GetScreen(char buffer[], int bufferLength, int from, int length, int plane)// throws OhioException { {// if(buffer == null)// throw new OhioException(sessionVT.getSessionConfiguration(),// OhioScreen.class.getName(), "osohio.screen.ohio00300", 1); if(buffer == null) return 0; int min = Math.min(Math.min(buffer.length, bufferLength), screenSize); if ((from + min) > screenSize) { min = screenSize - from; } char[] pd = getPlaneData(from,from + min,plane); if(pd != null) { System.arraycopy(pd, 0, buffer, 0, min); return pd.length; } return 0; }
| 3,441
|
protected void setScreenCharAndAttr(int pos, char c, int attr, boolean isAttr) { screen[pos] = c; screenAttr[pos] = attr; disperseAttribute(pos,attr); screenIsAttr[pos] = isAttr; screenGUI[pos] = initChar; }
|
protected void setScreenCharAndAttr(int pos, char c, int attr, boolean isAttr) { screen[pos] = c; screenAttr[pos] = (char)attr; disperseAttribute(pos,attr); screenIsAttr[pos] = isAttr; screenGUI[pos] = initChar; }
| 3,442
|
protected void setScreenCharAndAttr(int pos, char c, int attr, boolean isAttr) { screen[pos] = c; screenAttr[pos] = attr; disperseAttribute(pos,attr); screenIsAttr[pos] = isAttr; screenGUI[pos] = initChar; }
|
protected void setScreenCharAndAttr(int pos, char c, int attr, boolean isAttr) { screen[pos] = c; screenAttr[pos] = attr; disperseAttribute(pos,attr); screenIsAttr[pos] = (isAttr ? '1' : '0'); screenGUI[pos] = initChar; }
| 3,443
|
protected void setScreenAttr(int pos, int attr) { screenAttr[pos] = attr; screenGUI[pos] = initChar; disperseAttribute(pos,attr); }
|
protected void setScreenAttr(int pos, int attr, boolean isAttr) { screenAttr[pos] = attr; screenGUI[pos] = initChar; disperseAttribute(pos,attr); }
| 3,444
|
protected void setScreenAttr(int pos, int attr) { screenAttr[pos] = attr; screenGUI[pos] = initChar; disperseAttribute(pos,attr); }
|
protected void setScreenAttr(int pos, int attr) { screenAttr[pos] = (char)attr; screenIsAttr[pos] = isAttr ? '1' : '0'; disperseAttribute(pos,attr); screenGUI[pos] = initChar; disperseAttribute(pos,attr); }
| 3,445
|
protected void setScreenAttr(int pos, int attr) { screenAttr[pos] = attr; screenGUI[pos] = initChar; disperseAttribute(pos,attr); }
|
protected void setScreenAttr(int pos, int attr) { screenAttr[pos] = attr; screenGUI[pos] = initChar; }
| 3,446
|
protected final void setChar(int pos, char c) { screenIsChanged[pos] = screen[pos] == c ? false : true; // if (isChanged) // System.out.println(sChar[0] + " - " + c); screen[pos] = c; if (screenIsAttr[pos]) setScreenCharAndAttr(pos,c,32,false); }
|
protected final void setChar(int pos, char c) { screenIsChanged[pos] = screen[pos] == c ? false : true; // if (isChanged) // System.out.println(sChar[0] + " - " + c); screen[pos] = c; if (screenIsAttr[pos] == '1') setScreenCharAndAttr(pos,c,32,false); }
| 3,447
|
protected boolean isErrorLineSaved() { return errorLine == null ? true : false; }
|
protected boolean isErrorLineSaved() { return errorLine == null ? false : true; }
| 3,448
|
protected void restoreErrorLine() { if (errorLine != null) { int r = scr.getPos(errorLineNum - 1, 0); for (int x = 0; x < numCols - 1; x++) {// screen[r + x].setCharAndAttr(errorLine[x].getChar(),// errorLine[x].getCharAttr(), false); this.setScreenCharAndAttr(r+x,errorLine[x],errorLineAttr[x],errorLineIsAttr[x]); } errorLine = null; errorLineAttr = null; errorLineIsAttr = null; } }
|
protected void restoreErrorLine() { if (errorLine != null) { int r = scr.getPos(errorLineNum - 1, 0); for (int x = 0; x < numCols - 1; x++) {// screen[r + x].setCharAndAttr(errorLine[x].getChar(),// errorLine[x].getCharAttr(), false); setScreenCharAndAttr(r+x,errorLine[x],errorLineAttr[x], (errorLineIsAttr[x] == '1' ? true : false)); } errorLine = null; errorLineAttr = null; errorLineIsAttr = null; } }
| 3,449
|
protected void saveErrorLine() { // if there is already an error line saved then do not save it again // This signifies that there was a previous error and the original error // line was not restored yet. if (errorLine == null) { errorLine = new char[numCols]; errorLineAttr = new int[numCols]; errorLineIsAttr = new boolean[numCols]; int r = scr.getPos(errorLineNum-1,0); for (int x = 0;x < numCols; x++) { errorLine[x] = screen[r+x]; errorLineAttr[x] = screenAttr[r+x]; errorLineIsAttr[x] = screenIsAttr[r+x]; } } }
|
protected void saveErrorLine() { // if there is already an error line saved then do not save it again // This signifies that there was a previous error and the original error // line was not restored yet. if (errorLine == null) { errorLine = new char[numCols]; errorLineAttr = new int[numCols]; errorLineIsAttr = new boolean[numCols]; int r = scr.getPos(errorLineNum-1,0); for (int x = 0;x < numCols; x++) { errorLine[x] = screen[r+x]; errorLineAttr[x] = screenAttr[r+x]; errorLineIsAttr[x] = screenIsAttr[r+x]; } } }
| 3,450
|
protected void setSize(int newSize) { int oldRows = numRows; screenSize = newSize; numCols = 80; switch (newSize) { case 24: numRows = 24; break; case 27: numRows = 27; numCols = 132; break; } // this is used here when size changes setErrorLine(numRows); screenSize = numRows * numCols; screen = new char[screenSize]; screenAttr = new int[screenSize]; screenIsAttr = new boolean[screenSize]; screenGUI = new char[screenSize]; screenColor = new char[screenSize]; screenExtended = new char[screenSize]; fieldExtended = new char[screenSize]; screenIsChanged = new boolean[screenSize]; initalizePlanes();// if (numRows != oldRows)// fireScreenSizeChanged(); }
|
protected void setSize(int newSize) { int oldRows = numRows; screenSize = newSize; numCols = 80; switch (newSize) { case 24: numRows = 24; break; case 27: numRows = 27; numCols = 132; break; } // this is used here when size changes setErrorLine(numRows); screenSize = numRows * numCols; screen = new char[screenSize]; screenAttr = new int[screenSize]; screenIsAttr = new boolean[screenSize]; screenGUI = new char[screenSize]; screenColor = new char[screenSize]; screenExtended = new char[screenSize]; fieldExtended = new char[screenSize]; screenIsChanged = new boolean[screenSize]; initalizePlanes();// if (numRows != oldRows)// fireScreenSizeChanged(); }
| 3,451
|
protected synchronized void startDevice() throws DriverException { // Claim the irq irq = bus.claimResources(getDevice(), KB_IRQ); try { // Set the mode setEnabled(true); } catch (DeviceException ex) { throw new DriverException("Cannot enable keyboard", ex); } // Start the rest super.startDevice(); // Make sure all queues are empty bus.processQueues(); }
|
protected synchronized void startDevice() throws DriverException { // Claim the irq irq = bus.claimResources(getDevice(), KB_IRQ); try { // Set the mode setEnabled(true); } catch (DeviceException ex) { throw new DriverException("Cannot enable keyboard", ex); } // Start the rest super.startDevice(); // Make sure all queues are empty bus.flush(); }
| 3,452
|
private static ORB createORB(Properties props, String orbClassName) { ORB orb = null; if (orbClassName == null) { orbClassName = getORBName(props, FUNCTIONAL_ORB); if (orbClassName == null) orbClassName = DEFAULT_FUNCTIONAL_ORB; } try { orb = (ORB) Class.forName(orbClassName).newInstance(); } catch (ClassNotFoundException ex) { noORB(orbClassName, ex); } catch (IllegalAccessException ex) { noORB(orbClassName, ex); } catch (InstantiationException ex) { noORB(orbClassName, ex); } return orb; }
|
private static ORB createORB(Properties props, String orbClassName) { ORB orb = null; if (orbClassName == null) { orbClassName = getORBName(props, FUNCTIONAL_ORB); if (orbClassName == null) orbClassName = DEFAULT_FUNCTIONAL_ORB; } try { orb = (ORB) ObjectCreator.forName(orbClassName).newInstance(); } catch (ClassNotFoundException ex) { noORB(orbClassName, ex); } catch (IllegalAccessException ex) { noORB(orbClassName, ex); } catch (InstantiationException ex) { noORB(orbClassName, ex); } return orb; }
| 3,453
|
public void paint(Graphics g) { RepaintManager rm = RepaintManager.currentManager(this); // We do a little stunt act here to switch on double buffering if it's // not already on. If we are not already doublebuffered, then we jump // into the method paintDoubleBuffered, which turns on the double buffer // and then calls paint(g) again. In the second call we go into the else // branch of this if statement and actually paint things to the double // buffer. When this method completes, the call stack unwinds back to // paintDoubleBuffered, where the buffer contents is finally drawn to the // screen. if (!isPaintingDoubleBuffered && isDoubleBuffered() && rm.isDoubleBufferingEnabled()) { Rectangle clip = g.getClipBounds(); paintDoubleBuffered(clip); } else { if (getClientProperty("bufferedDragging") != null && dragBuffer == null) { initializeDragBuffer(); } else if (getClientProperty("bufferedDragging") == null && dragBuffer != null) { dragBuffer = null; } if (g.getClip() == null) g.setClip(0, 0, getWidth(), getHeight()); if (dragBuffer != null && dragBufferInitialized) { g.drawImage(dragBuffer, 0, 0, this); } else { Graphics g2 = getComponentGraphics(g); paintComponent(g2); paintBorder(g2); paintChildren(g2); Rectangle clip = g2.getClipBounds(); if (clip == null || (clip.x == 0 && clip.y == 0 && clip.width == getWidth() && clip.height == getHeight())) RepaintManager.currentManager(this).markCompletelyClean(this); } } }
|
public void paint(Graphics g) { RepaintManager rm = RepaintManager.currentManager(this); // We do a little stunt act here to switch on double buffering if it's // not already on. If we are not already doublebuffered, then we jump // into the method paintDoubleBuffered, which turns on the double buffer // and then calls paint(g) again. In the second call we go into the else // branch of this if statement and actually paint things to the double // buffer. When this method completes, the call stack unwinds back to // paintDoubleBuffered, where the buffer contents is finally drawn to the // screen. if (!isPaintingDoubleBuffered && isDoubleBuffered() && rm.isDoubleBufferingEnabled()) { Rectangle clip = g.getClipBounds(); paintDoubleBuffered(clip); } else { if (getClientProperty("bufferedDragging") != null && dragBuffer == null) { initializeDragBuffer(); } else if (getClientProperty("bufferedDragging") == null && dragBuffer != null) { dragBuffer = null; } if (g.getClip() == null) g.setClip(0, 0, getWidth(), getHeight()); if (dragBuffer != null && dragBufferInitialized) { g.drawImage(dragBuffer, 0, 0, this); } else { Graphics g2 = getComponentGraphics(g); paintComponent(g2); paintBorder(g2); paintChildren(g2); Rectangle clip = g2.getClipBounds(); if (clip == null || (clip.x == 0 && clip.y == 0 && clip.width == getWidth() && clip.height == getHeight())) RepaintManager.currentManager(this).markCompletelyClean(this); } } }
| 3,454
|
public void tableChanged (TableModelEvent event) { // update the column model from the table model if the structure has // changed and the flag autoCreateColumnsFromModel is set if ((event.getFirstRow() ==TableModelEvent.HEADER_ROW) && autoCreateColumnsFromModel) createDefaultColumnsFromModel(); // If the structure changes, we need to revalidate, since that might // affect the size parameters of the JTable. Otherwise we only need // to perform a repaint to update the view. if (event.getType() == TableModelEvent.INSERT || event.getType() == TableModelEvent.DELETE) revalidate(); repaint(); }
|
public void tableChanged (TableModelEvent event) { // update the column model from the table model if the structure has // changed and the flag autoCreateColumnsFromModel is set if ((event.getFirstRow() ==TableModelEvent.HEADER_ROW) && autoCreateColumnsFromModel) createDefaultColumnsFromModel(); // If the structure changes, we need to revalidate, since that might // affect the size parameters of the JTable. Otherwise we only need // to perform a repaint to update the view. if (event.getType() == TableModelEvent.INSERT || event.getType() == TableModelEvent.DELETE) revalidate(); repaint(); }
| 3,455
|
private void processVTKeyTyped(KeyEvent e){ char kc = e.getKeyChar();// displayInfo(e,"Typed processed " + keyProcessed); // Hack to make german umlauts work under Linux // The problem is that these umlauts don't generate a keyPressed event // and so keyProcessed is true (even if is hasn't been processed) // so we check if it's a letter (with or without shift) and skip return if ((isLinux) && !((Character.isLetter(kc)) && (e.getModifiers() == 0 || e.getModifiers() == Event.SHIFT_MASK))) { if (Character.isISOControl(kc) || keyProcessed) { return; } }// displayInfo(e,"Typed processed " + keyProcessed); String s = "";// if (isLinux) {// lastKeyStroke = keyMap.getKeyStrokeText(e,isAltGr);// System.out.println("last " + lastKeyStroke);// if (lastKeyStroke != null) {// s = lastKeyStroke;// System.out.println("last " + s);// }// else// s +=kc;// }// else s += kc; if (!vt.isConnected() ) return; screen.sendKeys(s); if (recording) recordBuffer.append(s); keyProcessed = true; e.consume(); }
|
private void processVTKeyTyped(KeyEvent e){ char kc = e.getKeyChar();// displayInfo(e,"Typed processed " + keyProcessed); // Hack to make german umlauts work under Linux // The problem is that these umlauts don't generate a keyPressed event // and so keyProcessed is true (even if is hasn't been processed) // so we check if it's a letter (with or without shift) and skip return if (isLinux) { if (!((Character.isLetter(kc)) && (e.getModifiers() == 0 || e.getModifiers() == Event.SHIFT_MASK))) { if (Character.isISOControl(kc) || keyProcessed) { return; } }// displayInfo(e,"Typed processed " + keyProcessed); String s = "";// if (isLinux) {// lastKeyStroke = keyMap.getKeyStrokeText(e,isAltGr);// System.out.println("last " + lastKeyStroke);// if (lastKeyStroke != null) {// s = lastKeyStroke;// System.out.println("last " + s);// }// else// s +=kc;// }// else s += kc; if (!vt.isConnected() ) return; screen.sendKeys(s); if (recording) recordBuffer.append(s); keyProcessed = true; e.consume(); }
| 3,457
|
public Object clone () throws CloneNotSupportedException{ XMLAttribute cloneObj = null; cloneObj = (XMLAttribute) super.clone(); // need to deep copy the fields here too cloneObj.attribType = new String(this.attribType); if (attribValue == null) { return cloneObj; } if (attribValue instanceof String ) { cloneObj.attribValue = new String((String) this.attribValue); return cloneObj; } if (attribValue instanceof Integer) { cloneObj.attribValue = new Integer(((Integer) this.attribValue).intValue()); return cloneObj; } if (attribValue instanceof Double) { cloneObj.attribValue = new Double(((Double) this.attribValue).doubleValue()); return cloneObj; } if (attribValue instanceof Axis) { cloneObj.attribValue =((Axis) this.attribValue).clone(); } if (attribValue instanceof List) { cloneObj.attribValue = Collections.synchronizedList(new ArrayList(((List) this.attribValue).size())); int stop = ((List)this.attribValue).size(); for (int i = 0; i < stop; i ++) { Object obj = ((List)this.attribValue).get(i); if (obj instanceof Axis) { ((List)cloneObj.attribValue).add(((Axis) obj).clone()); } else { if (obj instanceof Field) { ((List)cloneObj.attribValue).add(((Field) obj).clone()); } else { if (obj instanceof FieldAxis) { ((List)cloneObj.attribValue).add(((FieldAxis) obj).clone()); } else { if (obj instanceof Note) { ((List)cloneObj.attribValue).add(((Note) obj).clone()); } else { if (obj instanceof Value) { ((List)cloneObj.attribValue).add(((Value) obj).clone()); } } } } } } } return cloneObj; }
|
public Object clone () throws CloneNotSupportedException{ XMLAttribute cloneObj = null; cloneObj = (XMLAttribute) super.clone(); // need to deep copy the fields here too cloneObj.attribType = new String(this.attribType); if (attribValue == null) { return cloneObj; } if (attribValue instanceof String ) { cloneObj.attribValue = new String((String) this.attribValue); return cloneObj; } if (attribValue instanceof Integer) { cloneObj.attribValue = new Integer(((Integer) this.attribValue).intValue()); return cloneObj; } if (attribValue instanceof Double) { cloneObj.attribValue = new Double(((Double) this.attribValue).doubleValue()); return cloneObj; } if (attribValue instanceof Axis) { cloneObj.attribValue =((Axis) this.attribValue).clone(); } if (attribValue instanceof List) { cloneObj.attribValue = Collections.synchronizedList(new ArrayList(((List) this.attribValue).size())); int stop = ((List)this.attribValue).size(); for (int i = 0; i < stop; i ++) { Object obj = ((List)this.attribValue).get(i); if (obj instanceof Axis) { ((List)cloneObj.attribValue).add(((Axis) obj).clone()); } else { if (obj instanceof Field) { ((List)cloneObj.attribValue).add(((Field) obj).clone()); } else { if (obj instanceof FieldAxis) { ((List)cloneObj.attribValue).add(((FieldAxis) obj).clone()); } else { if (obj instanceof Note) { ((List)cloneObj.attribValue).add(((Note) obj).clone()); } else { if (obj instanceof Value) { ((List)cloneObj.attribValue).add(((Value) obj).clone()); } } } } } } } return cloneObj; }
| 3,458
|
public Object clone () throws CloneNotSupportedException{ XMLAttribute cloneObj = null; cloneObj = (XMLAttribute) super.clone(); // need to deep copy the fields here too cloneObj.attribType = new String(this.attribType); if (attribValue == null) { return cloneObj; } if (attribValue instanceof String ) { cloneObj.attribValue = new String((String) this.attribValue); return cloneObj; } if (attribValue instanceof Integer) { cloneObj.attribValue = new Integer(((Integer) this.attribValue).intValue()); return cloneObj; } if (attribValue instanceof Double) { cloneObj.attribValue = new Double(((Double) this.attribValue).doubleValue()); return cloneObj; } if (attribValue instanceof Axis) { cloneObj.attribValue =((Axis) this.attribValue).clone(); } if (attribValue instanceof List) { cloneObj.attribValue = Collections.synchronizedList(new ArrayList(((List) this.attribValue).size())); int stop = ((List)this.attribValue).size(); for (int i = 0; i < stop; i ++) { Object obj = ((List)this.attribValue).get(i); if (obj instanceof Axis) { ((List)cloneObj.attribValue).add(((Axis) obj).clone()); } else { if (obj instanceof Field) { ((List)cloneObj.attribValue).add(((Field) obj).clone()); } else { if (obj instanceof FieldAxis) { ((List)cloneObj.attribValue).add(((FieldAxis) obj).clone()); } else { if (obj instanceof Note) { ((List)cloneObj.attribValue).add(((Note) obj).clone()); } else { if (obj instanceof Value) { ((List)cloneObj.attribValue).add(((Value) obj).clone()); } } } } } } } return cloneObj; }
|
public Object clone () throws CloneNotSupportedException{ XMLAttribute cloneObj = null; cloneObj = (XMLAttribute) super.clone(); // need to deep copy the fields here too if (attribValue == null) { return cloneObj; } if (attribValue instanceof String ) { cloneObj.attribValue = new String((String) this.attribValue); return cloneObj; } if (attribValue instanceof Integer) { cloneObj.attribValue = new Integer(((Integer) this.attribValue).intValue()); return cloneObj; } if (attribValue instanceof Double) { cloneObj.attribValue = new Double(((Double) this.attribValue).doubleValue()); return cloneObj; } if (attribValue instanceof Axis) { cloneObj.attribValue =((Axis) this.attribValue).clone(); } if (attribValue instanceof List) { cloneObj.attribValue = Collections.synchronizedList(new ArrayList(((List) this.attribValue).size())); int stop = ((List)this.attribValue).size(); for (int i = 0; i < stop; i ++) { Object obj = ((List)this.attribValue).get(i); if (obj instanceof Axis) { ((List)cloneObj.attribValue).add(((Axis) obj).clone()); } else { if (obj instanceof Field) { ((List)cloneObj.attribValue).add(((Field) obj).clone()); } else { if (obj instanceof FieldAxis) { ((List)cloneObj.attribValue).add(((FieldAxis) obj).clone()); } else { if (obj instanceof Note) { ((List)cloneObj.attribValue).add(((Note) obj).clone()); } else { if (obj instanceof Value) { ((List)cloneObj.attribValue).add(((Value) obj).clone()); } } } } } } } return cloneObj; }
| 3,459
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.