Class TLcyUserInterfaceManager
ILcyApplicationPaneFactory
that creates ILcyApplicationPane
s. 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
ILcyCustomizerPanelFactory
s, which create
ILcyCustomizerPanel
s. 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 Component
s, typically the top level
typically frames or windows of the application.- See Also:
-
Constructor Summary
ConstructorDescriptionTLcyUserInterfaceManager
(ILcyLucyEnv aLucyEnv, ILcyApplicationPaneFactory aApplicationPaneFactory, ILcyMenuBar aMainMenuBar) Constructs a newTLcyUserInterfaceManager
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTopLevelComponent
(Component aTopLevelComponent) Adds a top levelComponent
.Returns theTLcyActionBarManager
which can create and manage action bars in the Lucy application.Returns theILcyApplicationPaneFactory
associated with thisTLcyUserInterfaceManager
.Returns theTLcyApplicationPaneManager
.Deprecated.Returns the composite DropTargetListener.Returns the main menu bar of Lucy.getTopLevelComponent
(int aIndex) Returns the top levelcomponent
at the the given index.int
Returns the number of top levelComponent
s (like frames etc.) that currently exist.Returns aList
of the top level components.void
removeTopLevelComponent
(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 theILcyApplicationPaneFactory
associated with thisTLcyUserInterfaceManager
. Addons should use theILcyApplicationPaneFactory
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 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
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 usesTLcyDomainObjectContext
as the object for theILcyCustomizerPanel
, or an array ofTLcdDomainObjectContext
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 usesTLcyModelContext
as the object for theILcyCustomizerPanel
.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 usesTLcyLayerContext
as the object for theILcyCustomizerPanel
.TLcyMapAddOn
to customize the properties of the model encoders used to save theILcdGXYView
of aILcyMapComponent
as a georeferenced image. It usesTLcyModelEncoderContext
as the object for theILcyCustomizerPanel
.TLcyMapAddOn
to customize the properties of the model encoders used to export the selected layers (save as). It usesTLcyModelEncoderContext
as the object for theILcyCustomizerPanel
.TLcyFormatBarAddOn
to customize the properties of the model descriptors used to create new models. It usesTLcyModelMetaDataContext
as the object for theILcyCustomizerPanel
.
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 ofILcyCustomizerPanelFactory
as well as to retrieve an appropriateILcyCustomizerPanelFactory
implementation. - See Also:
-
addTopLevelComponent
Adds a top levelComponent
. A top level component is typically aJFrame
or aJApplet
or 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 levelComponent
to add.- See Also:
-
removeTopLevelComponent
Removes a top levelComponent
.- Parameters:
aTopLevelComponent
- The top levelComponent
to remove.- See Also:
-
getTopLevelComponentCount
public int getTopLevelComponentCount()Returns the number of top levelComponent
s (like frames etc.) that currently exist.- Returns:
- the number of top level components.
- See Also:
-
getTopLevelComponent
Returns the top levelcomponent
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 useTLcdAWTUtil.findParentFrame
.- Parameters:
aIndex
- The index to get thecomponent
for,0 <= aIndex <= getTopLevelComponentCount()
- Returns:
- the top level
component
at 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
TLcyTabbedPaneLucyEnvFactory
installs 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 theILcyApplicationPane
of anyjava.awt.Component
.- Returns:
- The
TLcyApplicationPaneManager
. This is nevernull
.
-
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 nevernull
. - See Also:
-
getTopLevelComponents
Returns aList
of the top level components.- Returns:
- an unmodifiable
List
of the top level components - Since:
- 2024.0
-
new TLcyCompositeCustomizerPanelFactory(aLucyEnv)
instead.