Class TLcyUserInterfaceManager
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 Summary
ConstructorsConstructorDescriptionTLcyUserInterfaceManager(ILcyLucyEnv aLucyEnv, ILcyApplicationPaneFactory aApplicationPaneFactory, ILcyMenuBar aMainMenuBar) Constructs a newTLcyUserInterfaceManager. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTopLevelComponent(Component aTopLevelComponent) Adds a top levelComponent.Returns theTLcyActionBarManagerwhich can create and manage action bars in the Lucy application.Returns theILcyApplicationPaneFactoryassociated with thisTLcyUserInterfaceManager.Returns theTLcyApplicationPaneManager.Deprecated.Returns the composite DropTargetListener.Returns the main menu bar of Lucy.getTopLevelComponent(int aIndex) Returns the top levelcomponentat the the given index.intReturns the number of top levelComponents (like frames etc.) that currently exist.Returns aListof the top level components.voidremoveTopLevelComponent(Component aTopLevelComponent) Removes a top levelComponent.
-
Constructor Details
-
TLcyUserInterfaceManager
public TLcyUserInterfaceManager(ILcyLucyEnv aLucyEnv, ILcyApplicationPaneFactory aApplicationPaneFactory, ILcyMenuBar aMainMenuBar) Constructs a newTLcyUserInterfaceManager. There is normally no need to use the constructor: useILcyLucyEnv.getUserInterfaceManager()to retrieve this manager.- Parameters:
aLucyEnv- TheILcyLucyEnv.aApplicationPaneFactory- TheILcyApplicationPaneFactory.aMainMenuBar- The main menu bar as aILcyMenuBar.
-
-
Method Details
-
getApplicationPaneFactory
Returns theILcyApplicationPaneFactoryassociated with thisTLcyUserInterfaceManager. Addons should use theILcyApplicationPaneFactoryif 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
ILcyApplicationPaneFactoryassociated with thisILcyLucyEnv.
-
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.Usenew 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 ofILcyLucyEnv.addService(Object, int)and the Lucy developer guide for more information.Returns the composite
ILcyCustomizerPanelFactorythat can be used to create user interface to customize the properties of certain objects.This functionality is, amongst others, used by the:
TLcySelectionEditorAddOnto 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 usesTLcyDomainObjectContextas the object for theILcyCustomizerPanel, or an array ofTLcdDomainObjectContextinstances in case of multiple domain objects.TLcyToteAddOnto customize the contents of models. For instance, to display the features of all the domain objects in the model. It usesTLcyModelContextas the object for theILcyCustomizerPanel.TLcyMapAddOnto 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 usesTLcyLayerContextas the object for theILcyCustomizerPanel.TLcyMapAddOnto customize the properties of the model encoders used to save theILcdGXYViewof aILcyMapComponentas a georeferenced image. It usesTLcyModelEncoderContextas the object for theILcyCustomizerPanel.TLcyMapAddOnto customize the properties of the model encoders used to export the selected layers (save as). It usesTLcyModelEncoderContextas the object for theILcyCustomizerPanel.TLcyFormatBarAddOnto customize the properties of the model descriptors used to create new models. It usesTLcyModelMetaDataContextas the object for theILcyCustomizerPanel.
Add-ons wishing to add support to these add-ons for their own domain objects or layers should add an
ILcyCustomizerPanelFactoryto 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 ofILcyCustomizerPanelFactoryas well as to retrieve an appropriateILcyCustomizerPanelFactoryimplementation. - See Also:
-
addTopLevelComponent
Adds a top levelComponent. A top level component is typically aJFrameor aJAppletor so. It could also be aJDialog, 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 levelComponentto add.- See Also:
-
removeTopLevelComponent
Removes a top levelComponent.- Parameters:
aTopLevelComponent- The top levelComponentto remove.- See Also:
-
getTopLevelComponentCount
public int getTopLevelComponentCount()Returns the number of top levelComponents (like frames etc.) that currently exist.- Returns:
- the number of top level components.
- See Also:
-
getTopLevelComponent
Returns the top levelcomponentat 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
Dialogor so. In such a case, one should useTLcdAWTUtil.findParentFrame.- Parameters:
aIndex- The index to get thecomponentfor,0 <= aIndex <= getTopLevelComponentCount()- Returns:
- the top level
componentat the the given index - See Also:
-
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
TLcyTabbedPaneLucyEnvFactoryinstalls these listeners on the tabbed panes.- Returns:
- The composite DropTargetListener. This is never
null.
-
getApplicationPaneManager
Returns theTLcyApplicationPaneManager. 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 theILcyApplicationPaneof anyjava.awt.Component.- Returns:
- The
TLcyApplicationPaneManager. This is nevernull.
-
getActionBarManager
Returns the
TLcyActionBarManagerwhich 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 nevernull. - See Also:
-
getTopLevelComponents
Returns aListof the top level components.- Returns:
- an unmodifiable
Listof the top level components - Since:
- 2024.0
-
new TLcyCompositeCustomizerPanelFactory(aLucyEnv)instead.