public class TLcyApplicationPaneManager extends Object
Manager of the ILcyApplicationPane
instances that currently exist. The
application pane manager offers functionality to:
java.awt.Component
It is the responsibility of the ILcyApplicationPaneFactory
to notify this manager
when it creates an application pane and when an application pane is removed.
One usually does not create instances of this class, but retrieves it from the
TLcyUserInterfaceManager
.
Modifier and Type | Class and Description |
---|---|
static interface |
TLcyApplicationPaneManager.ILcyApplicationPaneCallBack
This interface defines the callback operation for
applyOnApplicationPane . |
Constructor and Description |
---|
TLcyApplicationPaneManager() |
Modifier and Type | Method and Description |
---|---|
void |
addApplicationPaneManagerListener(ILcyApplicationPaneManagerListener aListener)
Adds the specified
ILcyApplicationPaneManagerListener to the list of listeners
that should be notified of the addition and removal of application panes. |
void |
applicationPaneAdded(ILcyApplicationPane aApplicationPane)
Adds the specified
ILcyApplicationPane to the list of existing application
panes. |
void |
applicationPaneRemoved(ILcyApplicationPane aApplicationPane)
Removes the specified
ILcyApplicationPane from the list of existing application
panes. |
void |
applyOnApplicationPane(Component aComponent,
TLcyApplicationPaneManager.ILcyApplicationPaneCallBack aCallBack)
Applies the specified callback to the
ILcyApplicationPane in which the
specified Component is present. |
ILcyApplicationPane |
getApplicationPane(Component aComponent)
Returns the
ILcyApplicationPane in which the specified component is present. |
ILcyApplicationPane |
getApplicationPane(int aIndex)
Returns the
ILcyApplicationPane at the specified index. |
int |
getApplicationPaneCount()
Returns the number of existing application panes.
|
List<ILcyApplicationPane> |
getApplicationPanes()
Returns a
List of the application panes. |
void |
removeApplicationPaneManagerListener(ILcyApplicationPaneManagerListener aListener)
Removes the specified
ILcyApplicationPaneManagerListener from the list of
listeners that should be notified of the addition and removal of application panes. |
public int getApplicationPaneCount()
Returns the number of existing application panes.
0
.public ILcyApplicationPane getApplicationPane(int aIndex)
Returns the ILcyApplicationPane
at the specified index.
aIndex
- The index of the desired application pane. This index must always be smaller than
the value returned by getApplicationPaneCount
.ILcyApplicationPane
at aIndex
. This is never
null
IndexOutOfBoundsException
- if aIndex
is greater than or equal to the value
returned by getApplicationPaneCount
.public List<ILcyApplicationPane> getApplicationPanes()
List
of the application panes.List
of the managed panes.public void applicationPaneAdded(ILcyApplicationPane aApplicationPane)
Adds the specified ILcyApplicationPane
to the list of existing application
panes. Any registered listeners are notified of this addition.
Note: it is the responsibility of the ILcyApplicationPaneFactory
to call this method. Addons requesting an ILcyApplicationPane
from this factory
should not call this method.
aApplicationPane
- The ILcyApplicationPane
to add to the list of existing
application panes. This must not be null
.addApplicationPaneManagerListener
public void applicationPaneRemoved(ILcyApplicationPane aApplicationPane)
Removes the specified ILcyApplicationPane
from the list of existing application
panes. Any registered listeners are notified of this removal.
Note: it is the responsibility of the ILcyApplicationPaneFactory
to call this method. ILcyApplicationPaneOwner
s being notified of the disposal of
an ILcyApplicationPane
should not call this method.
aApplicationPane
- The ILcyApplicationPane
to remove from the list of
existing application panes. This must not be null
.addApplicationPaneManagerListener
public void addApplicationPaneManagerListener(ILcyApplicationPaneManagerListener aListener)
Adds the specified ILcyApplicationPaneManagerListener
to the list of listeners
that should be notified of the addition and removal of application panes.
aListener
- The listener that should be notified of future additions and removals of
application panes. This must not be null
.applicationPaneAdded(ILcyApplicationPane)
,
applicationPaneRemoved(ILcyApplicationPane)
public void removeApplicationPaneManagerListener(ILcyApplicationPaneManagerListener aListener)
Removes the specified ILcyApplicationPaneManagerListener
from the list of
listeners that should be notified of the addition and removal of application panes.
aListener
- The listener that should no longer be notified of future additions and
removals of application panes. This must not be null
.applicationPaneAdded(ILcyApplicationPane)
,
applicationPaneRemoved(ILcyApplicationPane)
public ILcyApplicationPane getApplicationPane(Component aComponent)
Returns the ILcyApplicationPane
in which the specified component is present.
When you don't know when the specified component is added to an application pane, you should
use the applyOnApplicationPane
method, which will execute the specified callback when the component is
added to the application pane.
For instance, when a new ILcyApplicationPane
is created and added to this
manager, the content pane of this application pane is still empty. As a result, calling this
method in the implementation of ILcyApplicationPaneManagerListener.applicationPaneAdded
will always
result in null
.
The specified component does not need to be a direct child of the content pane of the
ILcyApplicationPane
. It can be anywhere in the AWT component hierarchy beneath the
content pane.
aComponent
- The Component
for which the ILcyApplicationPane
should be retrieved. This must not be null
.ILcyApplicationPane
in which aComponent
is present. This
can be null
.applyOnApplicationPane(java.awt.Component, com.luciad.lucy.gui.TLcyApplicationPaneManager.ILcyApplicationPaneCallBack)
public void applyOnApplicationPane(Component aComponent, TLcyApplicationPaneManager.ILcyApplicationPaneCallBack aCallBack)
Applies the specified callback to the ILcyApplicationPane
in which the
specified Component
is present. If the specified component is not yet present in
any existing ILcyApplicationPane
the necessary listeners are installed to execute
the callback the moment the component is added to an ILcyApplicationPane
.
The specified component does not need to be a direct child of the content pane of the
ILcyApplicationPane
. It can be anywhere in the AWT component hierarchy beneath the
content pane.
Warning: make sure that the specified component is or will be added to an
ILcyApplicationPane
. Failure to do so may result in memory leaks, as the callback
may then be referenced indefinitely.
aComponent
- The Component
for which the ILcyApplicationPane
should be retrieved. This must not be null
.aCallBack
- The callback that should be executed when the application pane is found. This
must not be null
.getApplicationPane(java.awt.Component)