|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
de.schlichtherle.swing.EnhancedPanel
public class EnhancedPanel
This class adds methods to fire PanelEvent
s.
Note that in TrueZIP 6.1, this class has been refactored to coalesce multiple panel events for the same cause by posting them to the AWT's Event Queue, from which the coalesced event would then be dispatched by AWT's Event Dispatching Thread.
However, since TrueZIP 6.4, these events are fired synchronously again, whereby it is ensured that only a single event is fired for each cause.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
EnhancedPanel()
Creates a new EnhancedPanel with a double buffer
and a flow layout. |
|
EnhancedPanel(boolean isDoubleBuffered)
Creates a new EnhancedPanel with FlowLayout
and the specified buffering strategy. |
|
EnhancedPanel(LayoutManager layout)
Create a new buffered EnhancedPanel with the specified
layout manager. |
|
EnhancedPanel(LayoutManager layout,
boolean isDoubleBuffered)
Creates a new EnhancedPanel with the specified layout
manager and buffering strategy. |
Method Summary | |
---|---|
void |
addPanelListener(PanelListener listener)
Adds the listener to the list of receivers for
PanelEvent s. |
protected AWTEvent |
coalesceEvents(AWTEvent existingEvent,
AWTEvent newEvent)
Deprecated. See EnhancedPanel . |
protected void |
fireAncestorWindowHidden(PanelEvent event)
Deprecated. You should not call this method directly. |
protected void |
fireAncestorWindowShown(PanelEvent event)
Deprecated. You should not call this method directly. |
Window |
getAncestorWindow()
Returns the ancestor Window of this Panel or
null if the component is not (yet) placed in a
Window . |
EventListener[] |
getListeners(Class listenerType)
|
PanelListener[] |
getPanelListeners()
Returns an array of all the panel listeners registered on this component. |
protected void |
processEvent(AWTEvent event)
Deprecated. See EnhancedPanel . |
protected void |
processPanelEvent(PanelEvent event)
Calls fireAncestorWindowShown(de.schlichtherle.swing.event.PanelEvent) or
fireAncestorWindowHidden(de.schlichtherle.swing.event.PanelEvent) , depending on the ID of the given
event . |
void |
removePanelListener(PanelListener listener)
Removes the listener from the list of receivers for
PanelEvent s. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EnhancedPanel(LayoutManager layout, boolean isDoubleBuffered)
EnhancedPanel
with the specified layout
manager and buffering strategy.
layout
- The LayoutManager
to use.isDoubleBuffered
- A boolean, true for double-buffering, which
uses additional memory space to achieve fast, flicker-free
updates.public EnhancedPanel(LayoutManager layout)
EnhancedPanel
with the specified
layout manager.
layout
- The LayoutManager
to use.public EnhancedPanel(boolean isDoubleBuffered)
EnhancedPanel
with FlowLayout
and the specified buffering strategy.
If isDoubleBuffered
is true, the EnhancedPanel
will use a double buffer.
isDoubleBuffered
- A boolean, true for double-buffering, which
uses additional memory space to achieve fast, flicker-free
updates.public EnhancedPanel()
EnhancedPanel
with a double buffer
and a flow layout.
Method Detail |
---|
protected AWTEvent coalesceEvents(AWTEvent existingEvent, AWTEvent newEvent)
EnhancedPanel
.
PanelEvent
multiple times from the same source.
coalesceEvents
in class Component
protected void processEvent(AWTEvent event)
EnhancedPanel
.
PanelEvent
s.
processEvent
in class Container
protected void processPanelEvent(PanelEvent event)
fireAncestorWindowShown(de.schlichtherle.swing.event.PanelEvent)
or
fireAncestorWindowHidden(de.schlichtherle.swing.event.PanelEvent)
, depending on the ID of the given
event
.
public Window getAncestorWindow()
Window
of this Panel
or
null
if the component is not (yet) placed in a
Window
.
public void addPanelListener(PanelListener listener)
listener
to the list of receivers for
PanelEvent
s.
Note that the listener doesn't get serialized with this component!
listener
- The listener to add.
If this method is called n
times with the same
listener, any events generated will be delivered to this
listener n
times.
NullPointerException
- If listener
is
null
.public void removePanelListener(PanelListener listener)
listener
from the list of receivers for
PanelEvent
s.
listener
- The listener to remove.
If this listener has been added
multiple times, it is removed from the list only once.
NullPointerException
- If listener
is
null
.public PanelListener[] getPanelListeners()
PanelListener
s or an empty
array if no panel listeners are currently registered.addPanelListener(de.schlichtherle.swing.event.PanelListener)
,
removePanelListener(de.schlichtherle.swing.event.PanelListener)
public EventListener[] getListeners(Class listenerType)
getListeners
in class JComponent
protected void fireAncestorWindowShown(PanelEvent event)
event
- The event to be fired.protected void fireAncestorWindowHidden(PanelEvent event)
event
- The event to be fired.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |