Class TLcyApplicationPaneManager
Manager of the ILcyApplicationPane instances that currently exist. The
application pane manager offers functionality to:
- retrieve the existing application panes
- listen to the creation of new application panes
- listen for the removal of existing application panes
- retrieve the application pane for a given
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.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThis interface defines the callback operation forapplyOnApplicationPane. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the specifiedILcyApplicationPaneManagerListenerto the list of listeners that should be notified of the addition and removal of application panes.voidapplicationPaneAdded(ILcyApplicationPane aApplicationPane) Adds the specifiedILcyApplicationPaneto the list of existing application panes.voidapplicationPaneRemoved(ILcyApplicationPane aApplicationPane) Removes the specifiedILcyApplicationPanefrom the list of existing application panes.voidapplyOnApplicationPane(Component aComponent, TLcyApplicationPaneManager.ILcyApplicationPaneCallBack aCallBack) Applies the specified callback to theILcyApplicationPanein which the specifiedComponentis present.getApplicationPane(int aIndex) Returns theILcyApplicationPaneat the specified index.getApplicationPane(Component aComponent) Returns theILcyApplicationPanein which the specified component is present.intReturns the number of existing application panes.Returns aListof the application panes.voidRemoves the specifiedILcyApplicationPaneManagerListenerfrom the list of listeners that should be notified of the addition and removal of application panes.
-
Constructor Details
-
TLcyApplicationPaneManager
public TLcyApplicationPaneManager()
-
-
Method Details
-
getApplicationPaneCount
public int getApplicationPaneCount()Returns the number of existing application panes.
- Returns:
- The number of existing application panes. It is always greater than or equal to
0.
-
getApplicationPane
Returns the
ILcyApplicationPaneat the specified index.- Parameters:
aIndex- The index of the desired application pane. This index must always be smaller than the value returned bygetApplicationPaneCount.- Returns:
- The
ILcyApplicationPaneataIndex. This is nevernull - Throws:
IndexOutOfBoundsException- ifaIndexis greater than or equal to the value returned bygetApplicationPaneCount.
-
getApplicationPanes
Returns aListof the application panes.- Returns:
- an unmodifiable
Listof the managed panes. - Since:
- 2021.0
-
applicationPaneAdded
Adds the specified
ILcyApplicationPaneto the list of existing application panes. Any registered listeners are notified of this addition.Note: it is the responsibility of the
ILcyApplicationPaneFactoryto call this method. Addons requesting anILcyApplicationPanefrom this factory should not call this method.- Parameters:
aApplicationPane- TheILcyApplicationPaneto add to the list of existing application panes. This must not benull.- See Also:
-
applicationPaneRemoved
Removes the specified
ILcyApplicationPanefrom the list of existing application panes. Any registered listeners are notified of this removal.Note: it is the responsibility of the
ILcyApplicationPaneFactoryto call this method.ILcyApplicationPaneOwners being notified of the disposal of anILcyApplicationPaneshould not call this method.- Parameters:
aApplicationPane- TheILcyApplicationPaneto remove from the list of existing application panes. This must not benull.- See Also:
-
addApplicationPaneManagerListener
Adds the specified
ILcyApplicationPaneManagerListenerto the list of listeners that should be notified of the addition and removal of application panes.- Parameters:
aListener- The listener that should be notified of future additions and removals of application panes. This must not benull.- See Also:
-
removeApplicationPaneManagerListener
Removes the specified
ILcyApplicationPaneManagerListenerfrom the list of listeners that should be notified of the addition and removal of application panes.- Parameters:
aListener- The listener that should no longer be notified of future additions and removals of application panes. This must not benull.- See Also:
-
getApplicationPane
Returns the
ILcyApplicationPanein which the specified component is present. When you don't know when the specified component is added to an application pane, you should use theapplyOnApplicationPanemethod, which will execute the specified callback when the component is added to the application pane.For instance, when a new
ILcyApplicationPaneis 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 ofILcyApplicationPaneManagerListener.applicationPaneAddedwill always result innull.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.- Parameters:
aComponent- TheComponentfor which theILcyApplicationPaneshould be retrieved. This must not benull.- Returns:
- The
ILcyApplicationPanein whichaComponentis present. This can benull. - See Also:
-
applyOnApplicationPane
public void applyOnApplicationPane(Component aComponent, TLcyApplicationPaneManager.ILcyApplicationPaneCallBack aCallBack) Applies the specified callback to the
ILcyApplicationPanein which the specifiedComponentis present. If the specified component is not yet present in any existingILcyApplicationPanethe necessary listeners are installed to execute the callback the moment the component is added to anILcyApplicationPane.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.- Parameters:
aComponent- TheComponentfor which theILcyApplicationPaneshould be retrieved. This must not benull.aCallBack- The callback that should be executed when the application pane is found. This must not benull.- See Also:
-