public class TLcyUserInterfaceManager extends Object
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.Constructor and Description |
---|
TLcyUserInterfaceManager(ILcyLucyEnv aLucyEnv,
ILcyApplicationPaneFactory aApplicationPaneFactory,
ILcyMenuBar aMainMenuBar)
Constructs a new
TLcyUserInterfaceManager . |
Modifier and Type | Method and Description |
---|---|
void |
addTopLevelComponent(Component aTopLevelComponent)
Adds a top level
Component . |
TLcyActionBarManager |
getActionBarManager()
Returns the
TLcyActionBarManager which can create and manage action bars in the
Lucy application. |
ILcyApplicationPaneFactory |
getApplicationPaneFactory()
Returns the
ILcyApplicationPaneFactory associated with this TLcyUserInterfaceManager . |
TLcyApplicationPaneManager |
getApplicationPaneManager()
Returns the
TLcyApplicationPaneManager . |
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. |
TLcyCompositeDropTargetListener |
getCompositeDropTargetListener()
Returns the composite DropTargetListener.
|
ILcyMenuBar |
getMainMenuBar()
Returns the main menu bar of Lucy.
|
Component |
getTopLevelComponent(int aIndex)
Returns the top level
component at the the given index. |
int |
getTopLevelComponentCount()
Returns the number of top level
Component s (like frames etc.)
that currently exist. |
void |
removeTopLevelComponent(Component aTopLevelComponent)
Removes a top level
Component . |
public TLcyUserInterfaceManager(ILcyLucyEnv aLucyEnv, ILcyApplicationPaneFactory aApplicationPaneFactory, ILcyMenuBar aMainMenuBar)
TLcyUserInterfaceManager
. There is normally no need to use the constructor:
use ILcyLucyEnv.getUserInterfaceManager()
to retrieve this manager.aLucyEnv
- The ILcyLucyEnv
.aApplicationPaneFactory
- The ILcyApplicationPaneFactory
.aMainMenuBar
- The main menu bar as a ILcyMenuBar
.public ILcyApplicationPaneFactory getApplicationPaneFactory()
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.ILcyApplicationPaneFactory
associated with this ILcyLucyEnv
.public ILcyMenuBar getMainMenuBar()
@Deprecated public TLcyCompositeCustomizerPanelFactory getCompositeCustomizerPanelFactory()
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
.
ILcyCustomizerPanelFactory
. This instance can be used to
register specific implementations of ILcyCustomizerPanelFactory
as well as to
retrieve an appropriate ILcyCustomizerPanelFactory
implementation.ILcyCustomizerPanelFactory
,
ILcyCustomizerPanel
public void addTopLevelComponent(Component aTopLevelComponent)
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.
aTopLevelComponent
- The top level Component
to add.removeTopLevelComponent(java.awt.Component)
public void removeTopLevelComponent(Component aTopLevelComponent)
Component
.aTopLevelComponent
- The top level Component
to remove.addTopLevelComponent(java.awt.Component)
public int getTopLevelComponentCount()
Component
s (like frames etc.)
that currently exist.getTopLevelComponent(int)
public Component getTopLevelComponent(int aIndex)
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
.
aIndex
- The index to get the component
for,
0 <= aIndex <= getTopLevelComponentCount()
component
at the the given indexgetTopLevelComponentCount()
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.
null
.public TLcyApplicationPaneManager getApplicationPaneManager()
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
.TLcyApplicationPaneManager
. This is never null
.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.
TLcyActionBarManager
. This is never null
.TLcyActionBarUtil