bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public AccessibleAction getAccessibleAction() throws NotImplementedException { return null; }
|
public AccessibleAction getAccessibleAction() throws NotImplementedException { return this; }
| 4,999
|
public int getAccessibleActionCount() throws NotImplementedException { return 0; }
|
public int getAccessibleActionCount() { return 0; }
| 5,000
|
public int getAccessibleActionCount() throws NotImplementedException { return 0; }
|
public int getAccessibleActionCount() throws NotImplementedException { return 1; }
| 5,001
|
public String getAccessibleActionDescription(int value0) throws NotImplementedException { return null; }
|
public String getAccessibleActionDescription(int value0) throws NotImplementedException { return null; }
| 5,002
|
public String getAccessibleActionDescription(int value0) throws NotImplementedException { return null; }
|
public String getAccessibleActionDescription(int value0) throws NotImplementedException { return UIManager.getString("ComboBox.togglePopupText"); }
| 5,003
|
public Accessible getAccessibleChild(int value0) throws NotImplementedException { return null; }
|
public Accessible getAccessibleChild(int value0) throws NotImplementedException { return null; }
| 5,004
|
public Accessible getAccessibleChild(int value0) throws NotImplementedException { return null; }
|
public Accessible getAccessibleChild(int value0) throws NotImplementedException { ComponentUI ui = getUI(); Accessible child = null; if (ui != null) child = ui.getAccessibleChild(JComboBox.this, index); else child = super.getAccessibleChild(index); return child; }
| 5,005
|
public int getAccessibleChildrenCount() throws NotImplementedException { return 0; }
|
public int getAccessibleChildrenCount() throws NotImplementedException { ComponentUI ui = getUI(); int count; if (ui != null) count = ui.getAccessibleChildrenCount(JComboBox.this); else count = super.getAccessibleChildrenCount(); return count; }
| 5,006
|
public int getAccessibleSelectionCount() throws NotImplementedException { return 0; }
|
public int getAccessibleSelectionCount() throws NotImplementedException { Object sel = getSelectedItem(); int count = 0; if (sel != null) count = 1; return count; }
| 5,007
|
public boolean isAccessibleChildSelected(int value0) throws NotImplementedException { return false; }
|
public boolean isAccessibleChildSelected(int value0) throws NotImplementedException { return false; }
| 5,008
|
public boolean isAccessibleChildSelected(int value0) throws NotImplementedException { return false; }
|
public boolean isAccessibleChildSelected(int value0) throws NotImplementedException { return getSelectedIndex() == index; }
| 5,009
|
public void removeAccessibleSelection(int value0) throws NotImplementedException { // TODO: Implement this properly. }
|
public void removeAccessibleSelection(int value0) throws NotImplementedException { // TODO: Implement this properly. }
| 5,010
|
EventDispatchThread(EventQueue queue) { super(); setName("AWT-EventQueue-" + ++dispatchThreadNum); this.queue = queue; setPriority(NORM_PRIORITY + 1); start(); }
|
EventDispatchThread(EventQueue queue) { super(); setName("AWT-EventQueue-" + ++dispatchThreadNum); this.queue = queue; setPriority(NORM_PRIORITY + 1); }
| 5,012
|
public void run() { while (true) { try { AWTEvent evt = queue.getNextEvent(); if (isInterrupted ()) { // We are interrupted when we should finish executing return; } KeyboardFocusManager manager; manager = KeyboardFocusManager.getCurrentKeyboardFocusManager (); // Try to dispatch this event to the current keyboard focus // manager. It will dispatch all FocusEvents, all // WindowEvents related to focus, and all KeyEvents, // returning true. Otherwise, it returns false and we // dispatch the event normally. if (!manager.dispatchEvent (evt)) queue.dispatchEvent(evt); } catch (ThreadDeath death) { // If someone wants to kill us, let them. return; } catch (InterruptedException ie) { // We are interrupted when we should finish executing return; } catch (Throwable x) { System.err.println("Exception during event dispatch:"); x.printStackTrace(System.err); } } }
|
public void run() { while (true) { try { AWTEvent evt = queue.getNextEvent(); if (isInterrupted ()) { // We are interrupted when we should finish executing return; } KeyboardFocusManager manager; manager = KeyboardFocusManager.getCurrentKeyboardFocusManager (); // Try to dispatch this event to the current keyboard focus // manager. It will dispatch all FocusEvents, all // WindowEvents related to focus, and all KeyEvents, // returning true. Otherwise, it returns false and we // dispatch the event normally. if (!manager.dispatchEvent (evt)) queue.dispatchEvent(evt); } catch (ThreadDeath death) { // If someone wants to kill us, let them. return; } catch (InterruptedException ie) { // We are interrupted when we should finish executing return; } catch (Throwable x) { System.err.println("Exception during event dispatch:"); x.printStackTrace(System.err); } } }
| 5,013
|
public void run() { while (true) { try { AWTEvent evt = queue.getNextEvent(); if (isInterrupted ()) { // We are interrupted when we should finish executing return; } KeyboardFocusManager manager; manager = KeyboardFocusManager.getCurrentKeyboardFocusManager (); // Try to dispatch this event to the current keyboard focus // manager. It will dispatch all FocusEvents, all // WindowEvents related to focus, and all KeyEvents, // returning true. Otherwise, it returns false and we // dispatch the event normally. if (!manager.dispatchEvent (evt)) queue.dispatchEvent(evt); } catch (ThreadDeath death) { // If someone wants to kill us, let them. return; } catch (InterruptedException ie) { // We are interrupted when we should finish executing return; } catch (Throwable x) { System.err.println("Exception during event dispatch:"); x.printStackTrace(System.err); } } }
|
public void run() { while (true) { try { AWTEvent evt = queue.getNextEvent(); if (isInterrupted ()) { // We are interrupted when we should finish executing return; } KeyboardFocusManager manager; manager = KeyboardFocusManager.getCurrentKeyboardFocusManager (); // Try to dispatch this event to the current keyboard focus // manager. It will dispatch all FocusEvents, all // WindowEvents related to focus, and all KeyEvents, // returning true. Otherwise, it returns false and we // dispatch the event normally. if (!manager.dispatchEvent (evt)) queue.dispatchEvent(evt); } catch (ThreadDeath death) { // If someone wants to kill us, let them. return; } catch (InterruptedException ie) { // We are interrupted when we should finish executing return; } catch (Throwable x) { System.err.println("Exception during event dispatch:"); x.printStackTrace(System.err); } } }
| 5,014
|
public void run() { while (true) { try { AWTEvent evt = queue.getNextEvent(); if (isInterrupted ()) { // We are interrupted when we should finish executing return; } KeyboardFocusManager manager; manager = KeyboardFocusManager.getCurrentKeyboardFocusManager (); // Try to dispatch this event to the current keyboard focus // manager. It will dispatch all FocusEvents, all // WindowEvents related to focus, and all KeyEvents, // returning true. Otherwise, it returns false and we // dispatch the event normally. if (!manager.dispatchEvent (evt)) queue.dispatchEvent(evt); } catch (ThreadDeath death) { // If someone wants to kill us, let them. return; } catch (InterruptedException ie) { // We are interrupted when we should finish executing return; } catch (Throwable x) { System.err.println("Exception during event dispatch:"); x.printStackTrace(System.err); } } }
|
public void run() { while (true) { try { AWTEvent evt = queue.getNextEvent(); if (isInterrupted ()) { // We are interrupted when we should finish executing return; } KeyboardFocusManager manager; manager = KeyboardFocusManager.getCurrentKeyboardFocusManager (); // Try to dispatch this event to the current keyboard focus // manager. It will dispatch all FocusEvents, all // WindowEvents related to focus, and all KeyEvents, // returning true. Otherwise, it returns false and we // dispatch the event normally. if (!manager.dispatchEvent (evt)) queue.dispatchEvent(evt); } catch (ThreadDeath death) { // If someone wants to kill us, let them. return; } catch (InterruptedException ie) { // We are interrupted when we should finish executing return; } catch (Throwable x) { System.err.println("Exception during event dispatch:"); x.printStackTrace(System.err); } } }
| 5,015
|
private final void runFinalization() { VmAbstractHeap heap = heapManager.getFirstHeap(); while (heap != null) { visitor.setCurrentHeap(heap); heap.walk(visitor, true, ObjectFlags.GC_COLOUR_MASK, ObjectFlags.GC_YELLOW); heap = heap.getNext(); } }
|
private final void runFinalization() { VmAbstractHeap heap = heapManager.getHeapList(); while (heap != null) { visitor.setCurrentHeap(heap); heap.walk(visitor, true, ObjectFlags.GC_COLOUR_MASK, ObjectFlags.GC_YELLOW); heap = heap.getNext(); } }
| 5,016
|
addLayoutComponent(Component component, Object constraints){ if (constraints != null && ! (constraints instanceof String)) throw new IllegalArgumentException("Constraint must be a string"); addLayoutComponent((String) constraints, component);}
|
addLayoutComponent(Component component, Object constraints){ if (constraints != null && ! (constraints instanceof String)) throw new IllegalArgumentException("Constraint must be a string"); addLayoutComponent((String) constraints, component);}
| 5,018
|
calcCompSize(Component comp, int what){ if (comp == null || !comp.isVisible()) return new Dimension(0, 0); if (what == MIN) return comp.getMinimumSize(); else if (what == MAX) return comp.getMaximumSize(); return comp.getPreferredSize();}
|
calcCompSize(Component comp, int what){ if (comp == null || !comp.isVisible()) return new Dimension(0, 0); if (what == MIN) return comp.getMinimumSize(); else if (what == MAX) return comp.getMaximumSize(); return comp.getPreferredSize();}
| 5,019
|
calcSize(Container target, int what){ synchronized (target.getTreeLock ()) { Insets ins = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension ndim = calcCompSize(my_north, what); Dimension sdim = calcCompSize(my_south, what); Dimension edim = calcCompSize(my_east, what); Dimension wdim = calcCompSize(my_west, what); Dimension cdim = calcCompSize(center, what); int width = edim.width + cdim.width + wdim.width + (hgap * 2); // check for overflow if (width < edim.width || width < cdim.width || width < cdim.width) width = Integer.MAX_VALUE; if (ndim.width > width) width = ndim.width; if (sdim.width > width) width = sdim.width; width += (ins.left + ins.right); int height = edim.height; if (cdim.height > height) height = cdim.height; if (wdim.height > height) height = wdim.height; int addedHeight = height + (ndim.height + sdim.height + (vgap * 2) + ins.top + ins.bottom); // check for overflow if (addedHeight < height) height = Integer.MAX_VALUE; else height = addedHeight; return(new Dimension(width, height)); }}
|
calcSize(Container target, int what){ synchronized (target.getTreeLock ()) { Insets ins = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension ndim = calcCompSize(my_north, what); Dimension sdim = calcCompSize(my_south, what); Dimension edim = calcCompSize(my_east, what); Dimension wdim = calcCompSize(my_west, what); Dimension cdim = calcCompSize(center, what); int width = edim.width + cdim.width + wdim.width + (hgap * 2); // check for overflow if (width < edim.width || width < cdim.width || width < cdim.width) width = Integer.MAX_VALUE; if (ndim.width > width) width = ndim.width; if (sdim.width > width) width = sdim.width; width += (ins.left + ins.right); int height = edim.height; if (cdim.height > height) height = cdim.height; if (wdim.height > height) height = wdim.height; int addedHeight = height + (ndim.height + sdim.height + (vgap * 2) + ins.top + ins.bottom); // check for overflow if (addedHeight < height) height = Integer.MAX_VALUE; else height = addedHeight; return(new Dimension(width, height)); }}
| 5,020
|
getHgap(){ return(hgap);}
|
getHgap(){ return(hgap);}
| 5,021
|
getLayoutAlignmentX(Container parent){ return(parent.getAlignmentX());}
|
getLayoutAlignmentX(Container parent){ return(parent.getAlignmentX());}
| 5,022
|
getLayoutAlignmentY(Container parent){ return(parent.getAlignmentY());}
|
getLayoutAlignmentY(Container parent){ return(parent.getAlignmentY());}
| 5,023
|
getVgap(){ return(vgap);}
|
getVgap(){ return(vgap);}
| 5,024
|
invalidateLayout(Container parent){}
|
invalidateLayout(Container parent){}
| 5,025
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
| 5,026
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); int targetWidth = target.getWidth(); int targetHeight = target.getHeight(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
| 5,027
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (targetWidth <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
| 5,028
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
| 5,029
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (targetHeight <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
| 5,030
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = t.height - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); int x3; if (t.width <= i.right + e.width) x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); else x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3; if (t.height <= i.bottom + s.height) y3 = y2 + midh + vgap; else y3 = targetHeight - i.bottom - s.height; int hh = y3-y2-(s.height == 0 ? 0 : vgap); setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
| 5,031
|
maximumLayoutSize(Container target){ return calcSize(target, MAX);}
|
maximumLayoutSize(Container target){ return calcSize(target, MAX);}
| 5,032
|
minimumLayoutSize(Container target){ return calcSize(target, MIN);}
|
minimumLayoutSize(Container target){ return calcSize(target, MIN);}
| 5,033
|
preferredLayoutSize(Container target){ return calcSize(target, PREF);}
|
preferredLayoutSize(Container target){ return calcSize(target, PREF);}
| 5,034
|
removeLayoutComponent(Component component){ if (north == component) north = null; if (south == component) south = null; if (east == component) east = null; if (west == component) west = null; if (center == component) center = null; if (firstItem == component) firstItem = null; if (lastItem == component) lastItem = null; if (firstLine == component) firstLine = null; if (lastLine == component) lastLine = null;}
|
removeLayoutComponent(Component component){ if (north == component) north = null; if (south == component) south = null; if (east == component) east = null; if (west == component) west = null; if (center == component) center = null; if (firstItem == component) firstItem = null; if (lastItem == component) lastItem = null; if (firstLine == component) firstLine = null; if (lastLine == component) lastLine = null;}
| 5,035
|
setBounds(Component comp, int x, int y, int w, int h){ if (comp == null) return; comp.setBounds(x, y, w, h);}
|
setBounds(Component comp, int x, int y, int w, int h){ if (comp == null) return; comp.setBounds(x, y, w, h);}
| 5,036
|
setHgap(int hgap){ this.hgap = hgap;}
|
setHgap(int hgap){ this.hgap = hgap;}
| 5,037
|
setVgap(int vgap){ this.vgap = vgap;}
|
setVgap(int vgap){ this.vgap = vgap;}
| 5,038
|
toString(){ return getClass().getName() + "[hgap=" + hgap + ",vgap=" + vgap + "]";}
|
toString(){ return getClass().getName() + "[hgap=" + hgap + ",vgap=" + vgap + "]";}
| 5,039
|
public int findPC(int offset) { final int[] table = this.table; if (table != null) { final int length = table.length; int lastPC = 0; for (int i = 0; i < length; i += 2) { final int o = table[i+1]; if (o > offset) { return lastPC; } else { lastPC = table[i+0]; } } } return 0; }
|
public int findPC(int offset) { final int[] table = this.table; if (table != null) { final int length = table.length; int lastPC = 0; for (int i = 0; i < length; i += 2) { final int o = table[i+1]; if (o > offset) { return lastPC; } else { lastPC = table[i+0]; } } } return 0; }
| 5,040
|
protected void installKeyboardActions() { // FIXME: create actions and keystrokes. registerKeyboardAction(); }
|
protected void installKeyboardActions() { // FIXME: create actions and keystrokes. registerKeyboardActions(); }
| 5,041
|
public boolean equals(Object obj) { if ((obj instanceof MediaName && this instanceof MediaName) || (obj instanceof MediaTray && this instanceof MediaTray) || (obj instanceof MediaSizeName && this instanceof MediaSizeName)) { return ((Media) obj).getValue() == this.getValue(); } return false; }
|
public boolean equals(Object obj) { if ((obj instanceof MediaName && this instanceof MediaName) || (obj instanceof MediaTray && this instanceof MediaTray) || (obj instanceof MediaSizeName && this instanceof MediaSizeName)) { return ((Media) obj).getValue() == this.getValue(); } return false; }
| 5,044
|
public boolean equals(Object obj) { if ((obj instanceof MediaName && this instanceof MediaName) || (obj instanceof MediaTray && this instanceof MediaTray) || (obj instanceof MediaSizeName && this instanceof MediaSizeName)) { return ((Media) obj).getValue() == this.getValue(); } return false; }
|
public boolean equals(Object obj) { if ((obj instanceof MediaName && this instanceof MediaName) || (obj instanceof MediaTray && this instanceof MediaTray) || (obj instanceof MediaSizeName && this instanceof MediaSizeName)) { return ((Media) obj).getValue() == this.getValue(); } return (obj.getClass() == this.getClass() && ((Media) obj).getValue() == this.getValue()); }
| 5,045
|
private final void secureSetAccessible(boolean flag) { if (flag && ((this instanceof Constructor && ((Constructor)this).getDeclaringClass() == Class.class) || ((Member)this).getDeclaringClass() == AccessibleObject.class)) throw new SecurityException( "Cannot make object accessible: " + this); this.flag = flag; }
|
private final void secureSetAccessible(boolean flag) { if (flag && ((this instanceof Constructor && ((Constructor)this).getDeclaringClass() == Class.class) || ((Member)this).getDeclaringClass() == AccessibleObject.class)) throw new SecurityException( "Cannot make object accessible: " + this); this.flag = flag; }
| 5,046
|
public SwingFramePeer(SwingToolkit toolkit, JDesktopPane desktopPane, Frame frame) { super(); this.toolkit = toolkit; desktopPane.add(this); SwingToolkit.copyAwtProperties(frame, this); getContentPane().setLayout(null); setLocation(frame.getLocation()); setSize(frame.getSize()); setResizable(frame.isResizable()); setIconifiable(true); setMaximizable(true); setClosable(true); try { setIcon(frame.getState() == Frame.ICONIFIED); } catch (PropertyVetoException x) { } setState(frame.getState()); setTitle(frame.getTitle()); setIconImage(frame.getIconImage()); setMenuBar(frame.getMenuBar()); }
|
public SwingFramePeer(SwingToolkit toolkit, JDesktopPane desktopPane, Frame frame) { super(); this.toolkit = toolkit; desktopPane.add(this); SwingToolkit.copyAwtProperties(frame, this); getContentPane().setLayout(null); setLocation(frame.getLocation()); setSize(frame.getSize()); setResizable(frame.isResizable()); setIconifiable(true); setMaximizable(true); setClosable(true); try { setIcon(frame.getState() == Frame.ICONIFIED); } catch (PropertyVetoException x) { } setState(frame.getState()); setTitle(frame.getTitle()); setIconImage(frame.getIconImage()); setMenuBar(frame.getMenuBar()); }
| 5,047
|
public SwingFramePeer(SwingToolkit toolkit, JDesktopPane desktopPane, Frame frame) { super(); this.toolkit = toolkit; desktopPane.add(this); SwingToolkit.copyAwtProperties(frame, this); getContentPane().setLayout(null); setLocation(frame.getLocation()); setSize(frame.getSize()); setResizable(frame.isResizable()); setIconifiable(true); setMaximizable(true); setClosable(true); try { setIcon(frame.getState() == Frame.ICONIFIED); } catch (PropertyVetoException x) { } setState(frame.getState()); setTitle(frame.getTitle()); setIconImage(frame.getIconImage()); setMenuBar(frame.getMenuBar()); }
|
public SwingFramePeer(SwingToolkit toolkit, JDesktopPane desktopPane, Frame frame) { super(); this.toolkit = toolkit; this.frame = new SwingFrame(awtFrame); desktopPane.add(frame); SwingToolkit.copyAwtProperties(frame, this); getContentPane().setLayout(null); setLocation(frame.getLocation()); setSize(frame.getSize()); setResizable(frame.isResizable()); setIconifiable(true); setMaximizable(true); setClosable(true); try { setIcon(frame.getState() == Frame.ICONIFIED); } catch (PropertyVetoException x) { } setState(frame.getState()); setTitle(frame.getTitle()); setIconImage(frame.getIconImage()); setMenuBar(frame.getMenuBar()); }
| 5,048
|
public SwingFramePeer(SwingToolkit toolkit, JDesktopPane desktopPane, Frame frame) { super(); this.toolkit = toolkit; desktopPane.add(this); SwingToolkit.copyAwtProperties(frame, this); getContentPane().setLayout(null); setLocation(frame.getLocation()); setSize(frame.getSize()); setResizable(frame.isResizable()); setIconifiable(true); setMaximizable(true); setClosable(true); try { setIcon(frame.getState() == Frame.ICONIFIED); } catch (PropertyVetoException x) { } setState(frame.getState()); setTitle(frame.getTitle()); setIconImage(frame.getIconImage()); setMenuBar(frame.getMenuBar()); }
|
public SwingFramePeer(SwingToolkit toolkit, JDesktopPane desktopPane, Frame frame) { super(); this.toolkit = toolkit; desktopPane.add(this); SwingToolkit.copyAwtProperties(frame, this); getContentPane().setLayout(null); setLocation(frame.getLocation()); setSize(frame.getSize()); setResizable(frame.isResizable()); setIconifiable(true); setMaximizable(true); setClosable(true); try { setIcon(frame.getState() == Frame.ICONIFIED); } catch (PropertyVetoException x) { } setState(frame.getState()); setTitle(frame.getTitle()); setIconImage(frame.getIconImage()); setMenuBar(frame.getMenuBar()); }
| 5,049
|
public SwingFramePeer(SwingToolkit toolkit, JDesktopPane desktopPane, Frame frame) { super(); this.toolkit = toolkit; desktopPane.add(this); SwingToolkit.copyAwtProperties(frame, this); getContentPane().setLayout(null); setLocation(frame.getLocation()); setSize(frame.getSize()); setResizable(frame.isResizable()); setIconifiable(true); setMaximizable(true); setClosable(true); try { setIcon(frame.getState() == Frame.ICONIFIED); } catch (PropertyVetoException x) { } setState(frame.getState()); setTitle(frame.getTitle()); setIconImage(frame.getIconImage()); setMenuBar(frame.getMenuBar()); }
|
public SwingFramePeer(SwingToolkit toolkit, JDesktopPane desktopPane, Frame frame) { super(); this.toolkit = toolkit; desktopPane.add(this); SwingToolkit.copyAwtProperties(frame, this); getContentPane().setLayout(null); setLocation(frame.getLocation()); setSize(frame.getSize()); setResizable(frame.isResizable()); setIconifiable(true); setMaximizable(true); setClosable(true); try { frame.setIcon(awtFrame.getState() == Frame.ICONIFIED); } catch (PropertyVetoException x) { } setState(frame.getState()); setTitle(frame.getTitle()); setIconImage(frame.getIconImage()); setMenuBar(frame.getMenuBar()); }
| 5,050
|
public SwingFramePeer(SwingToolkit toolkit, JDesktopPane desktopPane, Frame frame) { super(); this.toolkit = toolkit; desktopPane.add(this); SwingToolkit.copyAwtProperties(frame, this); getContentPane().setLayout(null); setLocation(frame.getLocation()); setSize(frame.getSize()); setResizable(frame.isResizable()); setIconifiable(true); setMaximizable(true); setClosable(true); try { setIcon(frame.getState() == Frame.ICONIFIED); } catch (PropertyVetoException x) { } setState(frame.getState()); setTitle(frame.getTitle()); setIconImage(frame.getIconImage()); setMenuBar(frame.getMenuBar()); }
|
public SwingFramePeer(SwingToolkit toolkit, JDesktopPane desktopPane, Frame frame) { super(); this.toolkit = toolkit; desktopPane.add(this); SwingToolkit.copyAwtProperties(frame, this); getContentPane().setLayout(null); setLocation(frame.getLocation()); setSize(frame.getSize()); setResizable(frame.isResizable()); setIconifiable(true); setMaximizable(true); setClosable(true); try { setIcon(frame.getState() == Frame.ICONIFIED); } catch (PropertyVetoException x) { } setState(frame.getState()); setTitle(frame.getTitle()); setIconImage(frame.getIconImage()); setMenuBar(frame.getMenuBar()); }
| 5,051
|
public void addAWTComponent(Component awtComponent, JComponent peer) { getContentPane().add(peer); }
|
public void addAWTComponent(Component awtComponent, JComponent peer) { frame.getContentPane().add(peer); }
| 5,052
|
public void coalescePaintEvent(PaintEvent e) { System.err.println(e); }
|
public void coalescePaintEvent(PaintEvent e) { }
| 5,053
|
public void createBuffers(int x, BufferCapabilities bufferCapabilities) { }
|
public void createBuffers(int x, BufferCapabilities capabilities) throws AWTException { }
| 5,054
|
public void flip(BufferCapabilities.FlipContents flipContents) { }
|
public void flip(FlipContents contents) { }
| 5,055
|
public boolean requestFocus(Component lightweightChild, boolean temporary, boolean focusedWindowChangeAllowed, long time) { return true; }
|
public boolean requestFocus(Component lightweightChild, boolean temporary, boolean focusedWindowChangeAllowed, long time) { return true; }
| 5,056
|
public void setIconImage(Image im) { }
|
public void setIconImage(Image image) { }
| 5,057
|
public void setMaximizedBounds(java.awt.Rectangle bounds) { }
|
public void setMaximizedBounds(Rectangle r) { }
| 5,058
|
public void setState(int state) { if (state == Frame.ICONIFIED) { } else // state == Frame.NORMAL { } }
|
public void setState(int state) { if (state == Frame.ICONIFIED) { } else // state == Frame.NORMAL { } }
| 5,060
|
public Log () { configure(DEFAULT_CONFIG_FILE); }
|
public Log () { }
| 5,061
|
public void configure(String configFileName) { Properties props = new Properties(); //the property hashtable try { FileInputStream istream = new FileInputStream(configFileName); props.load(istream); istream.close(); } catch (IOException e) { System.err.println("Could not read configuration file [" + configFileName+ "]."); // e.printStackTrace(); System.err.println("Ignoring configuration file [" + configFileName+"]."); System.err.println("using default config"); defaultConfig(); return; } // If we reach here, then the config file is alright. System.out.println("Reading configuration."); configure(props); }
|
public static void configure(String configFileName) { Properties props = new Properties(); //the property hashtable try { FileInputStream istream = new FileInputStream(configFileName); props.load(istream); istream.close(); } catch (IOException e) { System.err.println("Could not read configuration file [" + configFileName+ "]."); // e.printStackTrace(); System.err.println("Ignoring configuration file [" + configFileName+"]."); System.err.println("using default config"); defaultConfig(); return; } // If we reach here, then the config file is alright. System.out.println("Reading configuration."); configure(props); }
| 5,062
|
public void debug(String msg) { if (priority > Priority.DEBUG) return; try { output.write(msg.getBytes()); output.write(Constants.NEW_LINE.getBytes()); } catch (IOException e) { System.err.println("error in Log.debug()"); e.printStackTrace(); } }
|
public static void debug(String msg) { if (priority > Priority.DEBUG) return; try { output.write(msg.getBytes()); output.write(Constants.NEW_LINE.getBytes()); } catch (IOException e) { System.err.println("error in Log.debug()"); e.printStackTrace(); } }
| 5,063
|
public void defaultConfig() { output = DEFAULT_OUTPUTSTREAM; priority = DEFAULT_PRIORITY; }
|
public static void defaultConfig() { output = DEFAULT_OUTPUTSTREAM; priority = DEFAULT_PRIORITY; }
| 5,064
|
public void error(String msg) { if (priority > Priority.ERROR) return; try { output.write(msg.getBytes()); output.write(Constants.NEW_LINE.getBytes()); } catch (IOException e) { System.err.println("error in Log.error()"); e.printStackTrace(); } }
|
public static void error(String msg) { if (priority > Priority.ERROR) return; try { output.write(msg.getBytes()); output.write(Constants.NEW_LINE.getBytes()); } catch (IOException e) { System.err.println("error in Log.error()"); e.printStackTrace(); } }
| 5,065
|
public void info(String msg) { if (priority > Priority.INFO) return; try { output.write(msg.getBytes()); output.write(Constants.NEW_LINE.getBytes()); } catch (IOException e) { System.err.println("error in Log.info()"); e.printStackTrace(); } }
|
public static void info(String msg) { if (priority > Priority.INFO) return; try { output.write(msg.getBytes()); output.write(Constants.NEW_LINE.getBytes()); } catch (IOException e) { System.err.println("error in Log.info()"); e.printStackTrace(); } }
| 5,066
|
public void warn(String msg) { if (priority > Priority.WARN) return; try { output.write(msg.getBytes()); output.write(Constants.NEW_LINE.getBytes()); } catch (IOException e) { System.err.println("error in Log.warn()"); e.printStackTrace(); } }
|
public static void warn(String msg) { if (priority > Priority.WARN) return; try { output.write(msg.getBytes()); output.write(Constants.NEW_LINE.getBytes()); } catch (IOException e) { System.err.println("error in Log.warn()"); e.printStackTrace(); } }
| 5,067
|
private void postEvent(int id, long time, int modifiers, int keyCode, char keyChar) { JNodeToolkit tk = (JNodeToolkit) Toolkit.getDefaultToolkit(); KeyEvent me = new KeyEvent(tk.getTop(), id, time, modifiers, keyCode, keyChar); eventQueue.postEvent(me); }
|
private void postEvent(int id, long time, int modifiers, int keyCode, char keyChar) { JNodeToolkit tk = (JNodeToolkit) Toolkit.getDefaultToolkit(); Frame top = tk.getTop(); if(top == null){ return; } KeyEvent me = new KeyEvent(top, id, time, modifiers, keyCode, keyChar); eventQueue.postEvent(me); }
| 5,068
|
public KeyEvent(Component source, int id, long when, int modifiers, int keyCode, char keyChar) { this(source, id, when, modifiers, keyCode, keyChar, KEY_LOCATION_UNKNOWN); }
|
public KeyEvent(Component source, int id, long when, int modifiers, int keyCode, char keyChar, int keyLocation) { this(source, id, when, modifiers, keyCode, keyChar, KEY_LOCATION_UNKNOWN); }
| 5,069
|
public KeyEvent(Component source, int id, long when, int modifiers, int keyCode, char keyChar) { this(source, id, when, modifiers, keyCode, keyChar, KEY_LOCATION_UNKNOWN); }
|
public KeyEvent(Component source, int id, long when, int modifiers, int keyCode, char keyChar) { super(source, id, when, modifiers); this.keyCode = keyCode; this.keyChar = keyChar; this.keyLocation = keyLocation; if ((id == KEY_TYPED && (keyCode != VK_UNDEFINED || keyChar == CHAR_UNDEFINED)) || keyLocation < KEY_LOCATION_UNKNOWN || keyLocation > KEY_LOCATION_NUMPAD) throw new IllegalArgumentException(); }
| 5,070
|
protected void nextRandomBytes(byte[] buffer) { if (rnd != null) { rnd.nextBytes(buffer); } else if (irnd != null) { try { irnd.nextBytes(buffer, 0, buffer.length); } catch (IllegalStateException x) { throw new RuntimeException("nextRandomBytes(): " + String.valueOf(x)); } catch (LimitReachedException x) { throw new RuntimeException("nextRandomBytes(): " + String.valueOf(x)); } } else { new SecureRandom ().nextBytes(buffer); } }
|
protected void nextRandomBytes(byte[] buffer) { if (rnd != null) { rnd.nextBytes(buffer); } else if (irnd != null) { try { irnd.nextBytes(buffer, 0, buffer.length); } catch (IllegalStateException x) { throw new RuntimeException("nextRandomBytes(): " + String.valueOf(x)); } catch (LimitReachedException x) { throw new RuntimeException("nextRandomBytes(): " + String.valueOf(x)); } } else { new SecureRandom ().nextBytes(buffer); } }
| 5,071
|
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); Dimension screenSize = getToolkit().getScreenSize(); boolean fit = true; Dimension size; // Determine the size of the popup menu if (this.getSize().width == 0 && this.getSize().width == 0) size = this.getPreferredSize(); else size = this.getSize(); if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else popup = new HeavyWeightPopup(this); } if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); SwingUtilities.convertPointFromScreen(p, layeredPane); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(p.x, p.y, size.width, size.height); } else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); } } else { firePopupMenuWillBecomeInvisible(); popup.hide(); } } }
|
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); Dimension screenSize = getToolkit().getScreenSize(); boolean fit = true; Dimension size; // Determine the size of the popup menu if (this.getSize().width == 0 && this.getSize().width == 0) size = this.getPreferredSize(); else size = this.getSize(); if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else popup = new HeavyWeightPopup(this); } if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); SwingUtilities.convertPointFromScreen(p, layeredPane); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(p.x, p.y, size.width, size.height); } else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); } } else { firePopupMenuWillBecomeInvisible(); popup.hide(); } } }
| 5,074
|
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); Dimension screenSize = getToolkit().getScreenSize(); boolean fit = true; Dimension size; // Determine the size of the popup menu if (this.getSize().width == 0 && this.getSize().width == 0) size = this.getPreferredSize(); else size = this.getSize(); if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else popup = new HeavyWeightPopup(this); } if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); SwingUtilities.convertPointFromScreen(p, layeredPane); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(p.x, p.y, size.width, size.height); } else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); } } else { firePopupMenuWillBecomeInvisible(); popup.hide(); } } }
|
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); Dimension screenSize = getToolkit().getScreenSize(); boolean fit = true; Dimension size; // Determine the size of the popup menu if (this.getSize().width == 0 && this.getSize().width == 0) size = this.getPreferredSize(); else size = this.getSize(); if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else popup = new HeavyWeightPopup(this); } if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); SwingUtilities.convertPointFromScreen(p, layeredPane); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(p.x, p.y, size.width, size.height); } else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); } } else { firePopupMenuWillBecomeInvisible(); popup.hide(); } } }
| 5,075
|
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); Dimension screenSize = getToolkit().getScreenSize(); boolean fit = true; Dimension size; // Determine the size of the popup menu if (this.getSize().width == 0 && this.getSize().width == 0) size = this.getPreferredSize(); else size = this.getSize(); if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else popup = new HeavyWeightPopup(this); } if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); SwingUtilities.convertPointFromScreen(p, layeredPane); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(p.x, p.y, size.width, size.height); } else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); } } else { firePopupMenuWillBecomeInvisible(); popup.hide(); } } }
|
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); Dimension screenSize = getToolkit().getScreenSize(); boolean fit = true; Dimension size; // Determine the size of the popup menu if (this.getSize().width == 0 && this.getSize().width == 0) size = this.getPreferredSize(); else size = this.getSize(); if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else popup = new HeavyWeightPopup(this); } if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); SwingUtilities.convertPointFromScreen(p, layeredPane); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(p.x, p.y, size.width, size.height); } else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); } } else { firePopupMenuWillBecomeInvisible(); popup.hide(); } } }
| 5,076
|
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); Dimension screenSize = getToolkit().getScreenSize(); boolean fit = true; Dimension size; // Determine the size of the popup menu if (this.getSize().width == 0 && this.getSize().width == 0) size = this.getPreferredSize(); else size = this.getSize(); if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else popup = new HeavyWeightPopup(this); } if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); SwingUtilities.convertPointFromScreen(p, layeredPane); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(p.x, p.y, size.width, size.height); } else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); } } else { firePopupMenuWillBecomeInvisible(); popup.hide(); } } }
|
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); Dimension screenSize = getToolkit().getScreenSize(); boolean fit = true; Dimension size; // Determine the size of the popup menu if (this.getSize().width == 0 && this.getSize().width == 0) size = this.getPreferredSize(); else size = this.getSize(); if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else popup = new HeavyWeightPopup(this); if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); SwingUtilities.convertPointFromScreen(p, layeredPane); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(p.x, p.y, size.width, size.height); else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); else { firePopupMenuWillBecomeInvisible(); popup.hide();
| 5,077
|
public void show(Component component, int x, int y) { setInvoker(component); Point p = new Point(x, y); SwingUtilities.convertPointToScreen(p, component); setLocation(p.x, p.y); setVisible(true); }
|
public void show(Component component, int x, int y) { setInvoker(component); Point p = new Point(x, y); SwingUtilities.convertPointToScreen(p, component); setLocation(p.x, p.y); setVisible(true); }
| 5,078
|
public void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) {// synchronized (lock) { gg2d.drawImage(bi.getSubimage(x,y,width,height),null,x,y);// } }
|
public synchronized void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) {// synchronized (lock) { gg2d.drawImage(bi.getSubimage(x,y,width,height),null,x,y);// } }
| 5,080
|
protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { // FIXME: Figure out how to fetch the row heights from the TableView's // element. super.layoutMajorAxis(targetSpan, axis, offsets, spans); }
|
protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { // FIXME: Figure out how to fetch the row heights from the TableView's // element. super.layoutMinorAxis(targetSpan, axis, offsets, spans); }
| 5,083
|
public TableView(Element el) { super(el, Y_AXIS); int numChildren = el.getElementCount(); View[] rows = new View[numChildren]; for (int i = 0; i < numChildren; ++i) { Element rowEl = el.getElement(i); TableRow rowView = createTableRow(rowEl); rows[i] = rowView; } replace(0, 0, rows); }
|
public TableView(Element el) { super(el, Y_AXIS); int numChildren = el.getElementCount(); View[] rows = new View[numChildren]; for (int i = 0; i < numChildren; ++i) { Element rowEl = el.getElement(i); TableRow rowView = createTableRow(rowEl); rows[i] = rowView; } replace(0, 0, rows); }
| 5,085
|
String[] getValues(Argument arg) { return (String[])args.get(arg); }
|
String[] getValues(Argument arg) { return (String[])args.get(arg); }
| 5,087
|
boolean isSet(Parameter param) { return args.containsKey(param); }
|
boolean isSet(Parameter param) { return args.containsKey(param); }
| 5,088
|
public int size() { return args.size(); }
|
public int size() { return args.size(); }
| 5,089
|
public Object getCellEditorValue() { return null; // TODO } // getCellEditorValue()
|
public Object getCellEditorValue() { return value; // TODO } // getCellEditorValue()
| 5,092
|
public boolean isCellEditable(EventObject event) { return false; // TODO } // isCellEditable()
|
public boolean isCellEditable(EventObject event) { if (!(event instanceof MouseEvent)) return true; return false; // TODO } // isCellEditable()
| 5,093
|
public void setValue(Object event) { }
|
public void setValue(Object value) { }
| 5,095
|
public boolean shouldSelectCell(EventObject event) { return false; // TODO } // shouldSelectCell()
|
public boolean shouldSelectCell(EventObject event) { return true; // TODO } // shouldSelectCell()
| 5,097
|
public boolean startCellEditing(EventObject event) { return false; // TODO } // startCellEditing()
|
public boolean startCellEditing(EventObject event) { return true; // TODO } // startCellEditing()
| 5,098
|
public boolean stopCellEditing() { return false; // TODO } // stopCellEditing()
|
public boolean stopCellEditing() { fireEditingStopped(); return true; // TODO } // stopCellEditing()
| 5,099
|
public Object getCellEditorValue() { return null; // TODO } // getCellEditorValue()
|
public Object getCellEditorValue() { return delegate.getCellEditorValue(); // TODO } // getCellEditorValue()
| 5,102
|
public int getClickCountToStart() { return 0; // TODO } // getClickCountToStart()
|
public int getClickCountToStart() { return clickCountToStart; // TODO } // getClickCountToStart()
| 5,103
|
public Component getComponent() { return null; // TODO } // getComponent()
|
public Component getComponent() { return editorComponent; // TODO } // getComponent()
| 5,104
|
public Component getTableCellEditorComponent(JTable tree, Object value, boolean isSelected, int row, int column) { return null; // TODO } // getTableCellEditorComponent()
|
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { return null; // TODO } // getTableCellEditorComponent()
| 5,105
|
public Component getTableCellEditorComponent(JTable tree, Object value, boolean isSelected, int row, int column) { return null; // TODO } // getTableCellEditorComponent()
|
public Component getTableCellEditorComponent(JTable tree, Object value, boolean isSelected, int row, int column) { if (editorComponent instanceof JTextField) { ((JTextField)editorComponent).setText(value.toString()); delegate = new EditorDelegate(); ((JTextField)editorComponent).addActionListener(delegate); } else { } return editorComponent; // TODO } // getTableCellEditorComponent()
| 5,106
|
public boolean isCellEditable(EventObject event) { return false; // TODO } // isCellEditable()
|
public boolean isCellEditable(EventObject event) { return delegate.isCellEditable(event); // TODO } // isCellEditable()
| 5,107
|
public boolean shouldSelectCell(EventObject event) { return false; // TODO } // shouldSelectCell()
|
public boolean shouldSelectCell(EventObject event) { return delegate.shouldSelectCell(event); // TODO } // shouldSelectCell()
| 5,109
|
public boolean stopCellEditing() { return false; // TODO } // stopCellEditing()
|
public boolean stopCellEditing() { return delegate.stopCellEditing(); // TODO } // stopCellEditing()
| 5,110
|
private void init() { classXDFNodeName = "fieldAxis"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"fieldList"); attribOrder.add(0,"axisIdRef"); attribOrder.add(0,"axisId"); attribOrder.add(0,"align"); //not sure what it is??? attribOrder.add(0,"description"); attribOrder.add(0,"name"); //set up the attribute hashtable key with the default initial value //set the minimum array size(essentially the size of the axis) attribHash.put("fieldList", new XMLAttribute(Collections.synchronizedList(new ArrayList(super.sDefaultDataArraySize)), Constants.LIST_TYPE)); attribHash.put("axisIdRef", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("axisId", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("align", new XMLAttribute(null, Constants.STRING_TYPE)); //double check?? attribHash.put("description", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("name", new XMLAttribute(null, Constants.STRING_TYPE)); length = 0; }
|
private void init() { classXDFNodeName = "fieldAxis"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"fieldList"); attribOrder.add(0,"axisIdRef"); attribOrder.add(0,"axisId"); attribOrder.add(0,"align"); //not sure what it is??? attribOrder.add(0,"description"); attribOrder.add(0,"name"); //set up the attribute hashtable key with the default initial value //set the minimum array size(essentially the size of the axis) attribHash.put("fieldList", new XMLAttribute(Collections.synchronizedList(new ArrayList(Specification.getInstance().getDefaultDataArraySize())), Constants.LIST_TYPE)); attribHash.put("axisIdRef", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("axisId", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("align", new XMLAttribute(null, Constants.STRING_TYPE)); //double check?? attribHash.put("description", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("name", new XMLAttribute(null, Constants.STRING_TYPE)); length = 0; }
| 5,111
|
public void checkAccess(ThreadGroup g) { if (g.getParent() != null) checkPermission(new RuntimePermission("modifyThreadGroup")); }
|
public void checkAccess(Thread thread) { if (g.getParent() != null) checkPermission(new RuntimePermission("modifyThreadGroup")); }
| 5,116
|
public void checkAccess(ThreadGroup g) { if (g.getParent() != null) checkPermission(new RuntimePermission("modifyThreadGroup")); }
|
public void checkAccess(ThreadGroup g) { if (g.getParent() != null) checkPermission(new RuntimePermission("modifyThreadGroup")); }
| 5,117
|
public Session5250 (Properties props, String configurationResource, String sessionName, SessionConfig config) { propFileName = config.getConfigurationResource(); sesConfig = config; this.configurationResource = configurationResource; this.sessionName = sessionName; sesProps = props; sce = new SessionChangeEvent(this); if (sesProps.containsKey(SESSION_HEART_BEAT)) heartBeat = true; screen = new Screen5250(); screen.setVT(vt); }
|
public Session5250 (Properties props, String configurationResource, String sessionName, SessionConfig config) { propFileName = config.getConfigurationResource(); sesConfig = config; this.configurationResource = configurationResource; this.sessionName = sessionName; sesProps = props; sce = new SessionChangeEvent(this); if (sesProps.containsKey(SESSION_HEART_BEAT)) heartBeat = true; screen = new Screen5250(); }
| 5,118
|
public boolean isConnected() { return vt.isConnected(); }
|
public boolean isConnected() { if (vt == null) return false; else return vt.isConnected(); }
| 5,119
|
public String getSystemDisplayName(File f) throws NotImplementedException { // FIXME: Implement; return null; }
|
public String getSystemDisplayName(File f) { // FIXME: Implement; return null; }
| 5,120
|
public String getSystemDisplayName(File f) throws NotImplementedException { // FIXME: Implement; return null; }
|
public String getSystemDisplayName(File f) throws NotImplementedException { // FIXME: Implement; String name = null; if (f != null) { if (isRoot(f)) name = f.getAbsolutePath(); else { try { String path = f.getCanonicalPath(); name = path.substring(path.lastIndexOf(File.separator) + 1); } catch (IOException e) { name = f.getName(); } } } return name; }
| 5,121
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.