Class TLcyApplicationPaneManager

java.lang.Object
com.luciad.lucy.gui.TLcyApplicationPaneManager

public class TLcyApplicationPaneManager extends Object

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:
  • 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

      public ILcyApplicationPane getApplicationPane(int aIndex)

      Returns the ILcyApplicationPane at the specified index.

      Parameters:
      aIndex - The index of the desired application pane. This index must always be smaller than the value returned by getApplicationPaneCount.
      Returns:
      The ILcyApplicationPane at aIndex. This is never null
      Throws:
      IndexOutOfBoundsException - if aIndex is greater than or equal to the value returned by getApplicationPaneCount.
    • getApplicationPanes

      public List<ILcyApplicationPane> getApplicationPanes()
      Returns a List of the application panes.
      Returns:
      an unmodifiable List of the managed panes.
      Since:
      2021.0
    • applicationPaneAdded

      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.

      Parameters:
      aApplicationPane - The ILcyApplicationPane to add to the list of existing application panes. This must not be null.
      See Also:
    • applicationPaneRemoved

      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. ILcyApplicationPaneOwners being notified of the disposal of an ILcyApplicationPane should not call this method.

      Parameters:
      aApplicationPane - The ILcyApplicationPane to remove from the list of existing application panes. This must not be null.
      See Also:
    • 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.

      Parameters:
      aListener - The listener that should be notified of future additions and removals of application panes. This must not be null.
      See Also:
    • removeApplicationPaneManagerListener

      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.

      Parameters:
      aListener - The listener that should no longer be notified of future additions and removals of application panes. This must not be null.
      See Also:
    • getApplicationPane

      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.

      Parameters:
      aComponent - The Component for which the ILcyApplicationPane should be retrieved. This must not be null.
      Returns:
      The ILcyApplicationPane in which aComponent is present. This can be null.
      See Also:
    • applyOnApplicationPane

      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.

      Parameters:
      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.
      See Also: