Class TLcyUserInterfaceManager

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

public class TLcyUserInterfaceManager extends Object
Manager that takes care of all pluggable user interface related things.

The most important part of the pluggable user interface is the ILcyApplicationPaneFactory that creates ILcyApplicationPanes. It allows to create panels containing parts of the user interface, without knowing how this panel is represented to the user. They could for example be tabs in a tabbed pane, internal frames, regular frames, ...

By retrieving the main menu bar of the application, addons can add their own menu items.

It also has a TLcyCompositeCustomizerPanelFactory that keeps a collection of ILcyCustomizerPanelFactorys, which create ILcyCustomizerPanels. Such a panel is used to customize some existing object, for example a layer or a domain object.

This manager also keeps a collection of top level Components, typically the top level typically frames or windows of the application.

See Also:
  • Constructor Details

    • TLcyUserInterfaceManager

      public TLcyUserInterfaceManager(ILcyLucyEnv aLucyEnv, ILcyApplicationPaneFactory aApplicationPaneFactory, ILcyMenuBar aMainMenuBar)
      Constructs a new TLcyUserInterfaceManager. There is normally no need to use the constructor: use ILcyLucyEnv.getUserInterfaceManager() to retrieve this manager.
      Parameters:
      aLucyEnv - The ILcyLucyEnv.
      aApplicationPaneFactory - The ILcyApplicationPaneFactory.
      aMainMenuBar - The main menu bar as a ILcyMenuBar.
  • Method Details

    • getApplicationPaneFactory

      public ILcyApplicationPaneFactory getApplicationPaneFactory()
      Returns the ILcyApplicationPaneFactory associated with this TLcyUserInterfaceManager. Addons should use the ILcyApplicationPaneFactory if they want to create their own pane (e.g. to display some GUI to the user). Note that you cannot make any assumptions on the type of the factory nor on the type of the application panes it creates.
      Returns:
      the ILcyApplicationPaneFactory associated with this ILcyLucyEnv.
    • getMainMenuBar

      public ILcyMenuBar getMainMenuBar()
      Returns the main menu bar of Lucy. Addons can use this method to add their own actions to the menu bar.
      Returns:
      the main menu bar of Lucy.
    • getCompositeCustomizerPanelFactory

      @Deprecated public TLcyCompositeCustomizerPanelFactory getCompositeCustomizerPanelFactory()
      Deprecated.
      Use new TLcyCompositeCustomizerPanelFactory(aLucyEnv) instead. The Lucy API offers composite implementations of all interfaces which can be registered on the services. Those composite implementations will use those registered instances when the constructor with the Lucy back-end as parameter is used. See the javadoc of ILcyLucyEnv.addService(Object, int) and the Lucy developer guide for more information.

      Returns the composite ILcyCustomizerPanelFactory that can be used to create user interface to customize the properties of certain objects.

      This functionality is, amongst others, used by the:

      • TLcySelectionEditorAddOn to customize the properties of domain objects. For instance, to change the location of some points in a polyline, or to change a feature of a domain object. It uses TLcyDomainObjectContext as the object for the ILcyCustomizerPanel, or an array of TLcdDomainObjectContext instances in case of multiple domain objects.
      • TLcyToteAddOn to customize the contents of models. For instance, to display the features of all the domain objects in the model. It uses TLcyModelContext as the object for the ILcyCustomizerPanel.
      • TLcyMapAddOn to customize the properties of layers. For instance, to change the fill color of the polygon painter, or to change the visibility of the layer. It uses TLcyLayerContext as the object for the ILcyCustomizerPanel.
      • TLcyMapAddOn to customize the properties of the model encoders used to save the ILcdGXYView of a ILcyMapComponent as a georeferenced image. It uses TLcyModelEncoderContext as the object for the ILcyCustomizerPanel.
      • TLcyMapAddOn to customize the properties of the model encoders used to export the selected layers (save as). It uses TLcyModelEncoderContext as the object for the ILcyCustomizerPanel.
      • TLcyFormatBarAddOn to customize the properties of the model descriptors used to create new models. It uses TLcyModelMetaDataContext as the object for the ILcyCustomizerPanel.

      Add-ons wishing to add support to these add-ons for their own domain objects or layers should add an ILcyCustomizerPanelFactory to the composite factory returned by this method.

      Note: the returned composite instance works on the Lucy services.

      Returns:
      The composite ILcyCustomizerPanelFactory. This instance can be used to register specific implementations of ILcyCustomizerPanelFactory as well as to retrieve an appropriate ILcyCustomizerPanelFactory implementation.
      See Also:
    • addTopLevelComponent

      public void addTopLevelComponent(Component aTopLevelComponent)
      Adds a top level Component. A top level component is typically a JFrame or a JApplet or so. It could also be a JDialog, but only if that dialog is not hooked to another frame.

      The top level components can change at runtime. For instance when a new application pane is displayed in its own frame, or when one of the frames of the application is closed at some point.

      The idea of storing a collection of top level components is that addons can have access all top level components. An example is the look and feel addon that needs to tell every top level component to update itself according to a new look and feel.

      Parameters:
      aTopLevelComponent - The top level Component to add.
      See Also:
    • removeTopLevelComponent

      public void removeTopLevelComponent(Component aTopLevelComponent)
      Removes a top level Component.
      Parameters:
      aTopLevelComponent - The top level Component to remove.
      See Also:
    • getTopLevelComponentCount

      public int getTopLevelComponentCount()
      Returns the number of top level Components (like frames etc.) that currently exist.
      Returns:
      the number of top level components.
      See Also:
    • getTopLevelComponent

      public Component getTopLevelComponent(int aIndex)
      Returns the top level component at the the given index. These top level components can for instance be used to change the look and feel while the program is running.

      This method should not be used to find a parent for a Dialog or so. In such a case, one should use TLcdAWTUtil.findParentFrame.

      Parameters:
      aIndex - The index to get the component for, 0 <= aIndex <= getTopLevelComponentCount()
      Returns:
      the top level component at the the given index
      See Also:
    • getCompositeDropTargetListener

      public TLcyCompositeDropTargetListener getCompositeDropTargetListener()

      Returns the composite DropTargetListener. You can add DropTargetListeners here to enable specific drag and drop behaviour for your addons. It is up to the front-end to attach these listeners to a component in the front-end. For instance, the TLcyTabbedPaneLucyEnvFactory installs these listeners on the tabbed panes.

      Returns:
      The composite DropTargetListener. This is never null.
    • getApplicationPaneManager

      public TLcyApplicationPaneManager getApplicationPaneManager()
      Returns the TLcyApplicationPaneManager. This manager manages the list of existing application panes, and allows you to listen for the addition or removal of application panes, as well as to retrieve the ILcyApplicationPane of any java.awt.Component.
      Returns:
      The TLcyApplicationPaneManager. This is never null.
    • getActionBarManager

      public TLcyActionBarManager getActionBarManager()

      Returns the TLcyActionBarManager which can create and manage action bars in the Lucy application. As these action bars are centrally managed, addons can add actions and active settables to the action bars of other addons.

      Returns:
      The TLcyActionBarManager. This is never null.
      See Also:
    • getTopLevelComponents

      public List<Component> getTopLevelComponents()
      Returns a List of the top level components.
      Returns:
      an unmodifiable List of the top level components
      Since:
      2024.0