1038 |
if ((c != null) && c.equals(background)) |
if ((c != null) && c.equals(background)) |
1039 |
return; |
return; |
1040 |
|
|
|
// If c is null, inherit from closest ancestor whose bg is set. |
|
|
if (c == null && parent != null) |
|
|
c = parent.getBackground(); |
|
|
if (peer != null && c != null) |
|
|
peer.setBackground(c); |
|
|
|
|
1041 |
Color previous = background; |
Color previous = background; |
1042 |
background = c; |
background = c; |
1043 |
|
if (peer != null && c != null) |
1044 |
|
peer.setBackground(c); |
1045 |
firePropertyChange("background", previous, c); |
firePropertyChange("background", previous, c); |
1046 |
} |
} |
1047 |
|
|
1405 |
{ |
{ |
1406 |
if (parent != null) |
if (parent != null) |
1407 |
{ |
{ |
|
Rectangle parentBounds = parent.getBounds(); |
|
1408 |
Rectangle oldBounds = new Rectangle(oldx, oldy, oldwidth, |
Rectangle oldBounds = new Rectangle(oldx, oldy, oldwidth, |
1409 |
oldheight); |
oldheight); |
1410 |
Rectangle newBounds = new Rectangle(x, y, width, height); |
Rectangle newBounds = new Rectangle(x, y, width, height); |
1715 |
valid = false; |
valid = false; |
1716 |
prefSize = null; |
prefSize = null; |
1717 |
minSize = null; |
minSize = null; |
1718 |
if (parent != null && parent.valid) |
if (parent != null && parent.isValid()) |
1719 |
parent.invalidate(); |
parent.invalidate(); |
1720 |
} |
} |
1721 |
|
|
1882 |
*/ |
*/ |
1883 |
public void repaint() |
public void repaint() |
1884 |
{ |
{ |
1885 |
if(!isShowing()) |
if (isShowing()) |
|
{ |
|
|
Component p = parent; |
|
|
if (p != null) |
|
|
p.repaint(0, getX(), getY(), width, height); |
|
|
} |
|
|
else |
|
1886 |
repaint(0, 0, 0, width, height); |
repaint(0, 0, 0, width, height); |
1887 |
} |
} |
1888 |
|
|
1897 |
*/ |
*/ |
1898 |
public void repaint(long tm) |
public void repaint(long tm) |
1899 |
{ |
{ |
1900 |
if(!isShowing()) |
if (isShowing()) |
|
{ |
|
|
Component p = parent; |
|
|
if (p != null) |
|
|
p.repaint(tm, getX(), getY(), width, height); |
|
|
} |
|
|
else |
|
1901 |
repaint(tm, 0, 0, width, height); |
repaint(tm, 0, 0, width, height); |
1902 |
} |
} |
1903 |
|
|
1915 |
*/ |
*/ |
1916 |
public void repaint(int x, int y, int w, int h) |
public void repaint(int x, int y, int w, int h) |
1917 |
{ |
{ |
1918 |
if(!isShowing()) |
if (isShowing()) |
|
{ |
|
|
Component p = parent; |
|
|
if (p != null) |
|
|
p.repaint(0, x + getX(), y + getY(), width, height); |
|
|
} |
|
|
else |
|
1919 |
repaint(0, x, y, w, h); |
repaint(0, x, y, w, h); |
1920 |
} |
} |
1921 |
|
|
1934 |
*/ |
*/ |
1935 |
public void repaint(long tm, int x, int y, int width, int height) |
public void repaint(long tm, int x, int y, int width, int height) |
1936 |
{ |
{ |
1937 |
if(!isShowing()) |
if (isShowing()) |
|
{ |
|
|
Component p = parent; |
|
|
if (p != null) |
|
|
p.repaint(tm, x + getX(), y + getY(), width, height); |
|
|
} |
|
|
else |
|
1938 |
{ |
{ |
1939 |
ComponentPeer p = peer; |
ComponentPeer p = peer; |
1940 |
if (p != null) |
if (p != null) |
2638 |
{ |
{ |
2639 |
mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, listener); |
mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, listener); |
2640 |
if (mouseMotionListener != null) |
if (mouseMotionListener != null) |
2641 |
enableEvents(AWTEvent.MOUSE_EVENT_MASK); |
enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK); |
2642 |
} |
} |
2643 |
|
|
2644 |
/** |
/** |
2771 |
} |
} |
2772 |
|
|
2773 |
/** |
/** |
2774 |
* Returns all registered EventListers of the given listenerType. |
* Returns all registered {@link EventListener}s of the given |
2775 |
|
* <code>listenerType</code>. |
2776 |
* |
* |
2777 |
* @param listenerType the class of listeners to filter |
* @param listenerType the class of listeners to filter (<code>null</code> |
2778 |
* @return an array of registered listeners |
* not permitted). |
2779 |
|
* |
2780 |
|
* @return An array of registered listeners. |
2781 |
|
* |
2782 |
|
* @throws ClassCastException if <code>listenerType</code> does not implement |
2783 |
|
* the {@link EventListener} interface. |
2784 |
|
* @throws NullPointerException if <code>listenerType</code> is |
2785 |
|
* <code>null</code>. |
2786 |
|
* |
2787 |
* @see #getComponentListeners() |
* @see #getComponentListeners() |
2788 |
* @see #getFocusListeners() |
* @see #getFocusListeners() |
2789 |
* @see #getHierarchyListeners() |
* @see #getHierarchyListeners() |
4859 |
case MouseEvent.MOUSE_EXITED: |
case MouseEvent.MOUSE_EXITED: |
4860 |
case MouseEvent.MOUSE_PRESSED: |
case MouseEvent.MOUSE_PRESSED: |
4861 |
case MouseEvent.MOUSE_RELEASED: |
case MouseEvent.MOUSE_RELEASED: |
|
case MouseEvent.MOUSE_MOVED: |
|
|
case MouseEvent.MOUSE_DRAGGED: |
|
4862 |
return (mouseListener != null |
return (mouseListener != null |
|
|| mouseMotionListener != null |
|
4863 |
|| (eventMask & AWTEvent.MOUSE_EVENT_MASK) != 0); |
|| (eventMask & AWTEvent.MOUSE_EVENT_MASK) != 0); |
4864 |
|
case MouseEvent.MOUSE_MOVED: |
4865 |
|
case MouseEvent.MOUSE_DRAGGED: |
4866 |
|
return (mouseMotionListener != null |
4867 |
|
|| (eventMask & AWTEvent.MOUSE_MOTION_EVENT_MASK) != 0); |
4868 |
|
|
4869 |
case FocusEvent.FOCUS_GAINED: |
case FocusEvent.FOCUS_GAINED: |
4870 |
case FocusEvent.FOCUS_LOST: |
case FocusEvent.FOCUS_LOST: |