rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
if (pos == null) { int mark = offset; if (mark >= gapStart) mark += (gapEnd - gapStart); pos = new GapContentPosition(mark); positions.put(pos, null); }
public Position createPosition(final int offset) throws BadLocationException { // We try to find a GapContentPosition at the specified offset and return // that. Otherwise we must create a new one. GapContentPosition pos = null; Set positionSet = positions.keySet(); for (Iterator i = positionSet.itera...
System.err.print("positionMarks: "); for (int i = 0; i < numMarks; i++) System.err.print(positionMarks[i] + ", "); System.err.println();
System.out.print("positionMarks: "); for (int i = 0; i < marks.size(); i++) System.out.print(((Mark) marks.get(i)).mark + ", "); System.out.println();
private void dumpMarks() { System.err.print("positionMarks: "); for (int i = 0; i < numMarks; i++) System.err.print(positionMarks[i] + ", "); System.err.println(); }
if ((where < gapStart) && ((gapStart - where) < len))
if (where + len <= gapStart)
public void getChars(int where, int len, Segment txt) throws BadLocationException { // check arguments int length = length(); if (where < 0) throw new BadLocationException("the where argument may not be below zero", where); if (where >= length) throw new BadLocationException("the where arg...
char[] copy = new char[len]; int lenFirst = gapStart - where; System.arraycopy(buffer, where, copy, 0, lenFirst); System.arraycopy(buffer, gapEnd, copy, lenFirst, len - lenFirst); txt.array = copy; txt.offset = 0;
txt.array = buffer; txt.offset = where; txt.count = len; } else if (where > gapStart) { txt.array = buffer; txt.offset = gapEnd + where - gapStart;
public void getChars(int where, int len, Segment txt) throws BadLocationException { // check arguments int length = length(); if (where < 0) throw new BadLocationException("the where argument may not be below zero", where); if (where >= length) throw new BadLocationException("the where arg...
int beforeGap = gapStart - where; if (txt.isPartialReturn()) {
public void getChars(int where, int len, Segment txt) throws BadLocationException { // check arguments int length = length(); if (where < 0) throw new BadLocationException("the where argument may not be below zero", where); if (where >= length) throw new BadLocationException("the where arg...
if (where < gapStart)
public void getChars(int where, int len, Segment txt) throws BadLocationException { // check arguments int length = length(); if (where < 0) throw new BadLocationException("the where argument may not be below zero", where); if (where >= length) throw new BadLocationException("the where arg...
txt.offset = where + (gapEnd - gapStart);
{ txt.array = new char[len]; txt.offset = 0; System.arraycopy(buffer, where, txt.array, 0, beforeGap); System.arraycopy(buffer, gapEnd, txt.array, beforeGap, len - beforeGap);
public void getChars(int where, int len, Segment txt) throws BadLocationException { // check arguments int length = length(); if (where < 0) throw new BadLocationException("the where argument may not be below zero", where); if (where >= length) throw new BadLocationException("the where arg...
}
public void getChars(int where, int len, Segment txt) throws BadLocationException { // check arguments int length = length(); if (where < 0) throw new BadLocationException("the where argument may not be below zero", where); if (where >= length) throw new BadLocationException("the where arg...
Vector res = v; if (res == null) res = new Vector();
int end = offset + length; int startIndex; int endIndex; if (offset < gapStart) { if (offset == 0) startIndex = 0; else startIndex = searchFirst(offset); if (end >= gapStart) endIndex = searchFirst(end + (gapEnd - gapStart) + 1); else endIndex = searchFirst(end + 1); }
protected Vector getPositionsInRange(Vector v, int offset, int length) { Vector res = v; if (res == null) res = new Vector(); else res.clear(); int endOffs = offset + length; Set positionSet = positions.keySet(); for (Iterator i = positionSet.iterator(); i.hasNext();) { GapCon...
res.clear(); int endOffs = offset + length; Set positionSet = positions.keySet(); for (Iterator i = positionSet.iterator(); i.hasNext();)
protected Vector getPositionsInRange(Vector v, int offset, int length) { Vector res = v; if (res == null) res = new Vector(); else res.clear(); int endOffs = offset + length; Set positionSet = positions.keySet(); for (Iterator i = positionSet.iterator(); i.hasNext();) { GapCon...
GapContentPosition p = (GapContentPosition) i.next(); int offs = p.getOffset(); if (offs >= offset && offs < endOffs) res.add(p);
startIndex = searchFirst(offset + (gapEnd - gapStart)); endIndex = searchFirst(end + (gapEnd - gapStart) + 1); } if (v == null) v = new Vector(); for (int i = startIndex; i < endIndex; i++) { v.add(new UndoPosRef((Mark) marks.get(i)));
protected Vector getPositionsInRange(Vector v, int offset, int length) { Vector res = v; if (res == null) res = new Vector(); else res.clear(); int endOffs = offset + length; Set positionSet = positions.keySet(); for (Iterator i = positionSet.iterator(); i.hasNext();) { GapCon...
return res;
return v;
protected Vector getPositionsInRange(Vector v, int offset, int length) { Vector res = v; if (res == null) res = new Vector(); else res.clear(); int endOffs = offset + length; Set positionSet = positions.keySet(); for (Iterator i = positionSet.iterator(); i.hasNext();) { GapCon...
return new InsertUndo(where, strLen);
return undo;
public UndoableEdit insertString(int where, String str) throws BadLocationException { // check arguments int length = length(); int strLen = str.length(); if (where < 0) throw new BadLocationException("The where argument cannot be smaller" + " than the zero",...
return new UndoRemove(where, removedText);
return undoRemove;
public UndoableEdit remove(int where, int nitems) throws BadLocationException { // check arguments int length = length(); if ((where + nitems) >= length) throw new BadLocationException("where + nitems cannot be greater" + " than the content length", where + nitems); String removedText = get...
if (gapStart != position) shiftGap(position); if (rmSize > 0) shiftGapEndUp(gapEnd + rmSize); if ((gapEnd - gapStart) <= addSize) shiftEnd((addSize - gapEnd + gapStart + 1) * 2 + gapEnd + DEFAULT_BUFSIZE); if (addItems != null)
if (addSize == 0)
protected void replace(int position, int rmSize, Object addItems, int addSize) { if (gapStart != position) shiftGap(position); // Remove content if (rmSize > 0) shiftGapEndUp(gapEnd + rmSize); // If gap is too small, enlarge the gap. if ((gapEnd - gapStart) <= add...
System.arraycopy(addItems, 0, buffer, gapStart, addSize); resetMarksAtZero(); gapStart += addSize;
removeImpl(position, rmSize); return;
protected void replace(int position, int rmSize, Object addItems, int addSize) { if (gapStart != position) shiftGap(position); // Remove content if (rmSize > 0) shiftGapEndUp(gapEnd + rmSize); // If gap is too small, enlarge the gap. if ((gapEnd - gapStart) <= add...
else if (rmSize > addSize) { removeImpl(position + addSize, rmSize - addSize); } else { int endSize = addSize - rmSize; int end = addImpl(position + rmSize, endSize); System.arraycopy(addItems, rmSize, buffer, end, endSize); addSize = rmSize; } System.arraycopy(addItems, 0, buffer, position, addSize);
protected void replace(int position, int rmSize, Object addItems, int addSize) { if (gapStart != position) shiftGap(position); // Remove content if (rmSize > 0) shiftGapEndUp(gapEnd + rmSize); // If gap is too small, enlarge the gap. if ((gapEnd - gapStart) <= add...
positionMarks[0] = 0;
for (int i = 0; i < marks.size(); i++) { Mark m = (Mark) marks.get(i); if (m.mark <= gapEnd) m.mark = 0; }
protected void resetMarksAtZero() { if (gapStart != 0) return; positionMarks[0] = 0; }
int delta = newSize - gapEnd + gapStart; adjustPositionsInRange(gapEnd, buffer.length - gapEnd, delta);
int oldEnd = getGapEnd(); int oldSize = getArrayLength(); int upper = oldSize - oldEnd; int size = (newSize + 1) * 2; int newEnd = size - upper;
protected void shiftEnd(int newSize) { assert newSize > (gapEnd - gapStart) : "The new gap size must be greater " + "than the old gap size"; int delta = newSize - gapEnd + gapStart; // Update the marks after the gapEnd. adjustPositionsInRange(gapEnd, buffer.lengt...
char[] newBuf = (char[]) allocateArray(length() + newSize); System.arraycopy(buffer, 0, newBuf, 0, gapStart); System.arraycopy(buffer, gapEnd, newBuf, gapStart + newSize, buffer.length - gapEnd); gapEnd = gapStart + newSize;
char[] newBuf = (char[]) allocateArray(size); System.arraycopy(buffer, 0, newBuf, 0, Math.min(size, oldSize));
protected void shiftEnd(int newSize) { assert newSize > (gapEnd - gapStart) : "The new gap size must be greater " + "than the old gap size"; int delta = newSize - gapEnd + gapStart; // Update the marks after the gapEnd. adjustPositionsInRange(gapEnd, buffer.lengt...
int delta = gapEnd - oldEnd; int adjIndex = searchFirst(oldEnd); int count = marks.size(); for (int i = adjIndex; i < count; i++) { Mark m = (Mark) marks.get(i); m.mark += delta; }
protected void shiftEnd(int newSize) { assert newSize > (gapEnd - gapStart) : "The new gap size must be greater " + "than the old gap size"; int delta = newSize - gapEnd + gapStart; // Update the marks after the gapEnd. adjustPositionsInRange(gapEnd, buffer.lengt...
if (newGapStart == gapStart) return; int newGapEnd = newGapStart + gapEnd - gapStart; if (newGapStart < gapStart) { adjustPositionsInRange(newGapStart, gapStart - newGapStart, gapEnd - gapStart); System.arraycopy(buffer, newGapStart, buffer, newGapEnd, gapStart - newGapStart);
int oldStart = gapStart; int delta = newGapStart - oldStart; int oldEnd = gapEnd; int newGapEnd = oldEnd + delta; int size = oldEnd - oldStart;
protected void shiftGap(int newGapStart) { if (newGapStart == gapStart) return; int newGapEnd = newGapStart + gapEnd - gapStart; if (newGapStart < gapStart) { // Update the positions between newGapStart and (old) gapStart. The marks // must be shifted by (gapEnd - gapStart). a...
else
else if (delta < 0)
protected void shiftGap(int newGapStart) { if (newGapStart == gapStart) return; int newGapEnd = newGapStart + gapEnd - gapStart; if (newGapStart < gapStart) { // Update the positions between newGapStart and (old) gapStart. The marks // must be shifted by (gapEnd - gapStart). a...
adjustPositionsInRange(gapEnd, newGapEnd - gapEnd, -(gapEnd - gapStart)); System.arraycopy(buffer, gapEnd, buffer, gapStart, newGapStart - gapStart); gapStart = newGapStart; gapEnd = newGapEnd;
int adjIndex = searchFirst(newGapStart); int count = marks.size(); for (int i = adjIndex; i < count; i++) { Mark m = (Mark) marks.get(i); if (m.mark >= oldEnd) break; m.mark += size; }
protected void shiftGap(int newGapStart) { if (newGapStart == gapStart) return; int newGapEnd = newGapStart + gapEnd - gapStart; if (newGapStart < gapStart) { // Update the positions between newGapStart and (old) gapStart. The marks // must be shifted by (gapEnd - gapStart). a...
if (gapStart == 0)
protected void shiftGap(int newGapStart) { if (newGapStart == gapStart) return; int newGapEnd = newGapStart + gapEnd - gapStart; if (newGapStart < gapStart) { // Update the positions between newGapStart and (old) gapStart. The marks // must be shifted by (gapEnd - gapStart). a...
setPositionsInRange(gapEnd, newGapEnd, false);
int adjIndex = searchFirst(gapEnd); int count = marks.size(); for (int i = adjIndex; i < count; i++) { Mark m = (Mark) marks.get(i); if (m.mark >= newGapEnd) break; m.mark = newGapEnd; }
protected void shiftGapEndUp(int newGapEnd) { if (newGapEnd == gapEnd) return; assert newGapEnd > gapEnd : "The new gap end must be greater than the " + "old gap end."; setPositionsInRange(gapEnd, newGapEnd, false); gapEnd = newGapEnd; }
resetMarksAtZero();
protected void shiftGapEndUp(int newGapEnd) { if (newGapEnd == gapEnd) return; assert newGapEnd > gapEnd : "The new gap end must be greater than the " + "old gap end."; setPositionsInRange(gapEnd, newGapEnd, false); gapEnd = newGapEnd; }
setPositionsInRange(newGapStart, gapStart, false);
int adjIndex = searchFirst(newGapStart); int count = marks.size(); for (int i = adjIndex; i < count; i++) { Mark m = (Mark) marks.get(i); if (m.mark > gapStart) break; m.mark = gapEnd; }
protected void shiftGapStartDown(int newGapStart) { if (newGapStart == gapStart) return; assert newGapStart < gapStart : "The new gap start must be less than the " + "old gap start."; setPositionsInRange(newGapStart, gapStart, false); gapStart = newGapStart; }
resetMarksAtZero();
protected void shiftGapStartDown(int newGapStart) { if (newGapStart == gapStart) return; assert newGapStart < gapStart : "The new gap start must be less than the " + "old gap start."; setPositionsInRange(newGapStart, gapStart, false); gapStart = newGapStart; }
for (Iterator i = positions.iterator(); i.hasNext();) { UndoPosRef undoPosRef = (UndoPosRef) i.next(); undoPosRef.reset(); } Collections.sort(marks);
protected void updateUndoPositions(Vector positions, int offset, int length) { // We do nothing here. }
List tempList; ResourceBundle bundle; Enumeration keys;
private static String[] getISOStrings(String tableName) { List tempList; ResourceBundle bundle; Enumeration keys; int count = 0; String[] strings; tempList = new ArrayList(); bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); keys = ((Hashtable) bundle.getObject(tableName...
String[] strings;
ResourceBundle bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); Enumeration e = bundle.getKeys(); ArrayList tempList = new ArrayList();
private static String[] getISOStrings(String tableName) { List tempList; ResourceBundle bundle; Enumeration keys; int count = 0; String[] strings; tempList = new ArrayList(); bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); keys = ((Hashtable) bundle.getObject(tableName...
tempList = new ArrayList(); bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); keys = ((Hashtable) bundle.getObject(tableName)).keys(); while (keys.hasMoreElements())
while (e.hasMoreElements())
private static String[] getISOStrings(String tableName) { List tempList; ResourceBundle bundle; Enumeration keys; int count = 0; String[] strings; tempList = new ArrayList(); bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); keys = ((Hashtable) bundle.getObject(tableName...
String nextString;
String key = (String) e.nextElement();
private static String[] getISOStrings(String tableName) { List tempList; ResourceBundle bundle; Enumeration keys; int count = 0; String[] strings; tempList = new ArrayList(); bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); keys = ((Hashtable) bundle.getObject(tableName...
nextString = (String) keys.nextElement(); if (nextString.length() == 2 && Character.isLetter(nextString.charAt(0)) && Character.isLetter(nextString.charAt(1)))
if (key.startsWith(tableName + "."))
private static String[] getISOStrings(String tableName) { List tempList; ResourceBundle bundle; Enumeration keys; int count = 0; String[] strings; tempList = new ArrayList(); bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); keys = ((Hashtable) bundle.getObject(tableName...
tempList.add(nextString);
String str = key.substring(tableName.length() + 1); if (str.length() == 2 && Character.isLetter(str.charAt(0)) && Character.isLetter(str.charAt(1))) { tempList.add(str);
private static String[] getISOStrings(String tableName) { List tempList; ResourceBundle bundle; Enumeration keys; int count = 0; String[] strings; tempList = new ArrayList(); bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); keys = ((Hashtable) bundle.getObject(tableName...
strings = new String[count];
} String[] strings = new String[count];
private static String[] getISOStrings(String tableName) { List tempList; ResourceBundle bundle; Enumeration keys; int count = 0; String[] strings; tempList = new ArrayList(); bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); keys = ((Hashtable) bundle.getObject(tableName...
{
private static String[] getISOStrings(String tableName) { List tempList; ResourceBundle bundle; Enumeration keys; int count = 0; String[] strings; tempList = new ArrayList(); bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); keys = ((Hashtable) bundle.getObject(tableName...
}
private static String[] getISOStrings(String tableName) { List tempList; ResourceBundle bundle; Enumeration keys; int count = 0; String[] strings; tempList = new ArrayList(); bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); keys = ((Hashtable) bundle.getObject(tableName...
invalidate();
public void updateUI() { setUI((DesktopPaneUI) UIManager.getUI(this)); invalidate(); }
if (popup.parent != null) popup.parent.remove(popup); popup.parent = this; if (peer != null) popup.addNotify();
public synchronized void add(PopupMenu popup) { if (popups == null) popups = new Vector(); popups.add(popup); }
public synchronized void addHierarchyBoundsListener(HierarchyBoundsListener l) { hierarchyBoundsListener = AWTEventMulticaster.add(hierarchyBoundsListener, l);
addHierarchyBoundsListener(HierarchyBoundsListener l) { hierarchyBoundsListener = AWTEventMulticaster.add(hierarchyBoundsListener, l);
public synchronized void addHierarchyBoundsListener(HierarchyBoundsListener l) { hierarchyBoundsListener = AWTEventMulticaster.add(hierarchyBoundsListener, l); if (hierarchyBoundsListener != null) enableEvents(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK); }
public boolean areFocusTraversalKeysSet(int id) { if (id < KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS || id > KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS) throw new IllegalArgumentException();
public boolean areFocusTraversalKeysSet (int id) { if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS && id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS && id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS) throw new IllegalArgumentException ();
public boolean areFocusTraversalKeysSet(int id) { if (id < KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS || id > KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS) throw new IllegalArgumentException(); return focusTraversalKeys != null && focusTraversalKeys[id] != null; }
public Rectangle bounds() { return getBounds();
public Rectangle bounds() { return new Rectangle (x, y, width, height);
public Rectangle bounds() { return getBounds(); }
public int checkImage(Image image, ImageObserver observer) { return checkImage(image, image.getWidth(observer), image.getHeight(observer), observer);
public int checkImage(Image image, ImageObserver observer) { return checkImage(image, -1, -1, observer);
public int checkImage(Image image, ImageObserver observer) { return checkImage(image, image.getWidth(observer), image.getHeight(observer), observer); }
public boolean contains(int x, int y) { return x >= 0 && y >= 0 && x < width && y < height;
public boolean contains(int x, int y) { return inside (x, y);
public boolean contains(int x, int y) { return x >= 0 && y >= 0 && x < width && y < height; }
public Image createImage(ImageProducer producer) {
public Image createImage(ImageProducer producer) { if (peer != null)
public Image createImage(ImageProducer producer) { // XXX What if peer or producer is null? return peer.createImage(producer); }
else return getToolkit().createImage(producer);
public Image createImage(ImageProducer producer) { // XXX What if peer or producer is null? return peer.createImage(producer); }
public void disable() { setEnabled(false);
public void disable() { this.enabled = false; if (peer != null) peer.setEnabled (false);
public void disable() { setEnabled(false); }
void dispatchEventImpl(AWTEvent e) { if (e.id <= ComponentEvent.COMPONENT_LAST && e.id >= ComponentEvent.COMPONENT_FIRST && (componentListener != null || (eventMask & AWTEvent.COMPONENT_EVENT_MASK) != 0)) processEvent(e); else if (e.id <= KeyEvent.KEY_LAST && e.id >= KeyEvent.KEY_FIRST && (keyListener != null || (eve...
void dispatchEventImpl(AWTEvent e) { if (eventTypeEnabled (e.id))
void dispatchEventImpl(AWTEvent e) { //System.out.println("dispatchEventImpl(" + e + ") on "+ this + ", eventMask=" + eventMask); // Make use of event id's in order to avoid multiple instanceof tests. if (e.id <= ComponentEvent.COMPONENT_LAST && e.id >= ComponentEvent.COMPONENT_FIRST && (componentListener != null |...
public void doLayout() {
public void doLayout() { layout ();
public void doLayout() { // nothing to do unless we're a container }
public void enable() { setEnabled(true);
public void enable() { this.enabled = true; if (peer != null) peer.setEnabled (true);
public void enable() { setEnabled(true); }
return parent == null ? null : parent.getBackground();
return parent == null ? SystemColor.window : parent.getBackground();
public Color getBackground() { if (background != null) return background; return parent == null ? null : parent.getBackground(); }
public Rectangle getBounds() { return new Rectangle(x, y, width, height);
public Rectangle getBounds() { return bounds ();
public Rectangle getBounds() { return new Rectangle(x, y, width, height); }
public Component getComponentAt(int x, int y) { return contains(x, y) ? this : null;
public Component getComponentAt(int x, int y) { return locate (x, y);
public Component getComponentAt(int x, int y) { return contains(x, y) ? this : null; }
public Container getFocusCycleRootAncestor() { throw new Error("not implemented");
public Container getFocusCycleRootAncestor () { if (this instanceof Window && ((Container) this).isFocusCycleRoot ()) return (Container) this; Container parent = getParent (); while (parent != null && !parent.isFocusCycleRoot ()) parent = parent.getParent (); return parent;
public Container getFocusCycleRootAncestor() { // XXX Implement. throw new Error("not implemented"); }
public Set getFocusTraversalKeys(int id) { if (id < KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS || id > KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS)
public Set getFocusTraversalKeys (int id) { if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS && id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS && id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS)
public Set getFocusTraversalKeys(int id) { if (id < KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS || id > KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS) throw new IllegalArgumentException(); Set s = null; if (focusTraversalKeys != null) s = focusTraversalKeys[id]; if (s == null && parent != null) s = parent.get...
return parent == null ? null : parent.getFont();
if (parent != null) return parent.getFont (); else return new Font ("Dialog", Font.PLAIN, 12);
public Font getFont() { if (font != null) return font; return parent == null ? null : parent.getFont(); }
return parent == null ? null : parent.getForeground();
return parent == null ? SystemColor.windowText : parent.getForeground();
public Color getForeground() { if (foreground != null) return foreground; return parent == null ? null : parent.getForeground(); }
public Point getLocation() { return new Point(x, y);
public Point getLocation() { return location ();
public Point getLocation() { return new Point(x, y); }
public Dimension getMinimumSize() { if (minSize == null) minSize = (peer != null ? peer.getMinimumSize() : new Dimension(width, height)); return minSize;
public Dimension getMinimumSize() { return minimumSize();
public Dimension getMinimumSize() { if (minSize == null) minSize = (peer != null ? peer.getMinimumSize() : new Dimension(width, height)); return minSize; }
public Dimension getPreferredSize() { if (prefSize == null) prefSize = (peer != null ? peer.getPreferredSize() : new Dimension(width, height)); return prefSize;
public Dimension getPreferredSize() { return preferredSize();
public Dimension getPreferredSize() { if (prefSize == null) prefSize = (peer != null ? peer.getPreferredSize() : new Dimension(width, height)); return prefSize; }
public Dimension getSize() { return new Dimension(width, height);
public Dimension getSize() { return size ();
public Dimension getSize() { return new Dimension(width, height); }
public boolean hasFocus() { return isFocusOwner();
public boolean hasFocus () { KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager (); Component focusOwner = manager.getFocusOwner (); return this == focusOwner;
public boolean hasFocus() { return isFocusOwner(); }
public void hide() { setVisible(false);
public void hide() { if (isVisible()) { if (peer != null) peer.setVisible(false); this.visible = false; invalidate(); ComponentEvent ce = new ComponentEvent(this,ComponentEvent.COMPONENT_HIDDEN); getToolkit().getSystemEventQueue().postEvent(ce); }
public void hide() { setVisible(false); }
public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h) { int rate = -1; if ((flags & (FRAMEBITS | ALLBITS)) != 0) { rate = 0; } else if ((flags & SOMEBITS) != 0) { rate = 10;
public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h) { if ((flags & (FRAMEBITS | ALLBITS)) != 0) repaint (); else if ((flags & SOMEBITS) != 0) { if (incrementalDraw) { if (redrawRate != null) { long tm = redrawRate.longValue(); if (tm < 0) tm = 0; repaint (tm);
public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h) { int rate = -1; if ((flags & (FRAMEBITS | ALLBITS)) != 0) { rate = 0; } else if ((flags & SOMEBITS) != 0) { rate = 10; } if (rate > 0) { repaint(10, x, y, w, h); } return ((flags & (ABORT | ALLBITS)) == 0); }
if (rate > 0) { repaint(10, x, y, w, h);
else repaint (100);
public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h) { int rate = -1; if ((flags & (FRAMEBITS | ALLBITS)) != 0) { rate = 0; } else if ((flags & SOMEBITS) != 0) { rate = 10; } if (rate > 0) { repaint(10, x, y, w, h); } return ((flags & (ABORT | ALLBITS)) == 0); }
return ((flags & (ABORT | ALLBITS)) == 0);
} return (flags & (ALLBITS | ABORT | ERROR)) == 0;
public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h) { int rate = -1; if ((flags & (FRAMEBITS | ALLBITS)) != 0) { rate = 0; } else if ((flags & SOMEBITS) != 0) { rate = 10; } if (rate > 0) { repaint(10, x, y, w, h); } return ((flags & (ABORT | ALLBITS)) == 0); }
public boolean inside(int x, int y) { return contains(x, y);
public boolean inside(int x, int y) { return x >= 0 && y >= 0 && x < width && y < height;
public boolean inside(int x, int y) { return contains(x, y); }
public boolean isFocusOwner() { throw new Error("not implemented");
public boolean isFocusOwner() { return hasFocus ();
public boolean isFocusOwner() { // XXX Implement. throw new Error("not implemented"); }
public void layout() { doLayout();
public void layout() {
public void layout() { doLayout(); }
public Component locate(int x, int y) { return getComponentAt(x, y);
public Component locate(int x, int y) { return contains (x, y) ? this : null;
public Component locate(int x, int y) { return getComponentAt(x, y); }
public Point location() { return getLocation();
public Point location() { return new Point (x, y);
public Point location() { return getLocation(); }
public Dimension minimumSize() { return getMinimumSize();
public Dimension minimumSize() { if (minSize == null) minSize = (peer != null ? peer.getMinimumSize() : new Dimension(width, height)); return minSize;
public Dimension minimumSize() { return getMinimumSize(); }
public void move(int x, int y) { setLocation(x, y);
public void move(int x, int y) { int oldx = this.x; int oldy = this.y; if (this.x == x && this.y == y) return; invalidate (); this.x = x; this.y = y; if (peer != null) peer.setBounds (x, y, width, height); if (isLightweight() && width != 0 && height !=0) { parent.repaint(oldx, oldy, width, height); repaint(); } if ...
public void move(int x, int y) { setLocation(x, y); }
public void nextFocus() { transferFocus();
public void nextFocus () { KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager (); manager.focusNextComponent (this);
public void nextFocus() { transferFocus(); }
public void paint(Graphics g) {
public void paint(Graphics g) { if (!isLightweight() && peer != null) peer.paint(g);
public void paint(Graphics g) { }
if (peer != null) peer.paint(g);
public void paintAll(Graphics g) { if (!visible) return; if (peer != null) peer.paint(g); paint(g); }
public Dimension preferredSize() { return getPreferredSize();
public Dimension preferredSize() { if (prefSize == null) if (peer == null) return new Dimension(width, height); else prefSize = peer.getPreferredSize(); return prefSize;
public Dimension preferredSize() { return getPreferredSize(); }
else if (e instanceof PaintEvent) processPaintEvent((PaintEvent) e);
protected void processEvent(AWTEvent e) { //System.out.println("processEvent(" + e + ") on " + this); /* Note: the order of these if statements are important. Subclasses must be checked first. Eg. MouseEvent must be checked before ComponentEvent, since a MouseEvent object is also an instance of a Compone...
public synchronized void removeHierarchyBoundsListener(HierarchyBoundsListener l) { hierarchyBoundsListener = AWTEventMulticaster.remove(hierarchyBoundsListener, l);
removeHierarchyBoundsListener(HierarchyBoundsListener l) { hierarchyBoundsListener = AWTEventMulticaster.remove(hierarchyBoundsListener, l);
public synchronized void removeHierarchyBoundsListener(HierarchyBoundsListener l) { hierarchyBoundsListener = AWTEventMulticaster.remove(hierarchyBoundsListener, l); }
public void requestFocus() {
public void requestFocus () { if (isDisplayable () && isShowing () && isFocusable ()) { synchronized (getTreeLock ()) { Container parent = getParent (); while (parent != null && !(parent instanceof Window)) parent = parent.getParent (); Window toplevel = (Window) parent; if (toplevel.isFocusableWindow ()) {
public void requestFocus() { // If there's no peer then this component can't get the focus. We // treat it as a silent rejection of the request. if (peer != null) peer.requestFocus(); }
peer.requestFocus();
peer.requestFocus (); else { EventQueue eq = Toolkit.getDefaultToolkit ().getSystemEventQueue (); eq.postEvent (new FocusEvent(this, FocusEvent.FOCUS_GAINED)); } } else pendingFocusRequest = new FocusEvent(this, FocusEvent.FOCUS_GAINED); } }
public void requestFocus() { // If there's no peer then this component can't get the focus. We // treat it as a silent rejection of the request. if (peer != null) peer.requestFocus(); }
public boolean requestFocusInWindow() { requestFocus(); return true;
public boolean requestFocusInWindow () { return requestFocusInWindow (false);
public boolean requestFocusInWindow() { // XXX Implement correctly. requestFocus(); return true; }
public void reshape(int x, int y, int width, int height) { setBounds(x, y, width, height);
public void reshape(int x, int y, int width, int height) { int oldx = this.x; int oldy = this.y; int oldwidth = this.width; int oldheight = this.height; if (this.x == x && this.y == y && this.width == width && this.height == height) return; invalidate (); this.x = x; this.y = y; this.width = width; this.height = heigh...
public void reshape(int x, int y, int width, int height) { setBounds(x, y, width, height); }
public void resize(int width, int height) { setSize(width, height);
public void resize(int width, int height) { int oldwidth = this.width; int oldheight = this.height; if (this.width == width && this.height == height) return; invalidate (); this.width = width; this.height = height; if (peer != null) peer.setBounds (x, y, width, height); if (isLightweight()) { if (oldwidth != 0 && ol...
public void resize(int width, int height) { setSize(width, height); }
public void setBackground(Color c) {
public void setBackground(Color c) { if (c == null && parent != null) c = parent.getBackground();
public void setBackground(Color c) { firePropertyChange("background", background, c); if (peer != null) peer.setBackground(c); background = c; }
if (peer != null)
if (peer != null && c != null)
public void setBackground(Color c) { firePropertyChange("background", background, c); if (peer != null) peer.setBackground(c); background = c; }
public void setBounds(int x, int y, int w, int h) { if (this.x == x && this.y == y && width == w && height == h) { return; } invalidate(); this.x = x; this.y = y; width = w; height = h; if (peer != null) { peer.setBounds(x, y, w, h); }
public void setBounds(int x, int y, int w, int h) { reshape (x, y, w, h);
public void setBounds(int x, int y, int w, int h) { if (this.x == x && this.y == y && width == w && height == h) { return; } invalidate(); this.x = x; this.y = y; width = w; height = h; if (peer != null) { peer.setBounds(x, y, w, h); } }
public void setEnabled(boolean b) { this.enabled = b; if (peer != null) peer.setEnabled(b);
public void setEnabled(boolean b) { enable (b);
public void setEnabled(boolean b) { this.enabled = b; if (peer != null) peer.setEnabled(b); }
throw new IllegalArgumentException();
{ Container parent = getParent (); while (parent != null) { if (parent.areFocusTraversalKeysSet (id)) { keystrokes = parent.getFocusTraversalKeys (id); break; } parent = parent.getParent (); } if (keystrokes == null) keystrokes = KeyboardFocusManager.getCurrentKeyboardFocusManager (). getDefaultFocusTraversalKeys (id...
public void setFocusTraversalKeys(int id, Set keystrokes) { if (keystrokes == null) throw new IllegalArgumentException(); Set sa; Set sb; String name; switch (id) { case KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS : sa = getFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS); sb = getFocusT...
invalidate();
public void setFont(Font f) { firePropertyChange("font", font, f); if (peer != null) peer.setFont(f); font = f; }
public void setLocation(int x, int y) { if (this.x == x && this.y == y) return; invalidate(); this.x = x; this.y = y; if (peer != null) peer.setBounds(x, y, width, height);
public void setLocation(int x, int y) { move (x, y);
public void setLocation(int x, int y) { if (this.x == x && this.y == y) return; invalidate(); this.x = x; this.y = y; if (peer != null) peer.setBounds(x, y, width, height); }
public void setSize(int width, int height) { if (this.width == width && this.height == height) return; invalidate(); this.width = width; this.height = height; if (peer != null) peer.setBounds(x, y, width, height);
public void setSize(int width, int height) { resize (width, height);
public void setSize(int width, int height) { if (this.width == width && this.height == height) return; invalidate(); this.width = width; this.height = height; if (peer != null) peer.setBounds(x, y, width, height); }
if (peer != null) peer.setVisible(b); this.visible = b;
show (b);
public void setVisible(boolean b) { // Inspection by subclassing shows that Sun's implementation calls // show(boolean) which then calls show() or hide(). It is the show() // method that is overriden in subclasses like Window. if (peer != null) peer.setVisible(b); this.visible = b; }
public void show() { setVisible(true);
public void show() { if(!isVisible()) { this.visible = true; if (peer != null) peer.setVisible(true); invalidate(); ComponentEvent ce = new ComponentEvent(this,ComponentEvent.COMPONENT_SHOWN); getToolkit().getSystemEventQueue().postEvent(ce); }
public void show() { setVisible(true); }
public Dimension size() { return getSize();
public Dimension size() { return new Dimension (width, height);
public Dimension size() { return getSize(); }
public void transferFocus() { Component next; if (parent == null) next = findNextFocusComponent(null); else next = parent.findNextFocusComponent(this); if (next != null && next != this) next.requestFocus();
public void transferFocus () { nextFocus ();
public void transferFocus() { Component next; if (parent == null) next = findNextFocusComponent(null); else next = parent.findNextFocusComponent(this); if (next != null && next != this) next.requestFocus(); }
public void transferFocusBackward() { throw new Error("not implemented");
public void transferFocusBackward () { KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager (); manager.focusPreviousComponent (this);
public void transferFocusBackward() { // XXX Implement. throw new Error("not implemented"); }
public void transferFocusUpCycle() { throw new Error("not implemented");
public void transferFocusUpCycle () { KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager (); manager.upFocusCycle (this);
public void transferFocusUpCycle() { // XXX Implement. throw new Error("not implemented"); }