1 |
/* Panel.java -- Simple container object |
/* Panel.java -- Simple container object |
2 |
Copyright (C) 1999, 2002 Free Software Foundation, Inc. |
Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
38 |
|
|
39 |
package java.awt; |
package java.awt; |
40 |
|
|
|
import java.awt.event.PaintEvent; |
|
41 |
import javax.accessibility.Accessible; |
import javax.accessibility.Accessible; |
42 |
import javax.accessibility.AccessibleContext; |
import javax.accessibility.AccessibleContext; |
43 |
import javax.accessibility.AccessibleRole; |
import javax.accessibility.AccessibleRole; |
46 |
* A panel is a simple container class. It's default layout is the |
* A panel is a simple container class. It's default layout is the |
47 |
* <code>FlowLayout</code> manager. |
* <code>FlowLayout</code> manager. |
48 |
* |
* |
49 |
* @author Aaron M. Renn <arenn@urbanophile.com> |
* @author Aaron M. Renn (arenn@urbanophile.com) |
50 |
* @author Eric Blake <ebb9@email.byu.edu> |
* @author Eric Blake (ebb9@email.byu.edu) |
51 |
* @see FlowLayout |
* @see FlowLayout |
52 |
* @since 1.0 |
* @since 1.0 |
53 |
* @status updated to 1.4 |
* @status updated to 1.4 |
97 |
} |
} |
98 |
|
|
99 |
/** |
/** |
|
* Consume initial application-requested paint event if it has not |
|
|
* already been consumed, and if the initial system-requested paint |
|
|
* event has not already been handled. Otherwise, call |
|
|
* super.dispatchEventImpl. These extra steps are required to |
|
|
* prevent a Panel from being painted twice when it is initially |
|
|
* shown. |
|
|
* |
|
|
* @param e the event to dispatch |
|
|
*/ |
|
|
void dispatchEventImpl (AWTEvent e) |
|
|
{ |
|
|
if (e instanceof PaintEvent) |
|
|
{ |
|
|
if (e.id == PaintEvent.UPDATE) |
|
|
{ |
|
|
if (!initialUpdateConsumed |
|
|
&& !initialSystemUpdateDone) |
|
|
{ |
|
|
e.consume (); |
|
|
initialUpdateConsumed = true; |
|
|
} |
|
|
} |
|
|
else if (e.id == PaintEvent.PAINT) |
|
|
initialSystemUpdateDone = true; |
|
|
} |
|
|
else |
|
|
super.dispatchEventImpl (e); |
|
|
} |
|
|
|
|
|
/** |
|
100 |
* Notifies this object to create its native peer. |
* Notifies this object to create its native peer. |
101 |
* |
* |
102 |
* @see #isDisplayable() |
* @see #isDisplayable() |