The TLcyFormatBarAddOn
provides one menu item or tool bar item that controls the presence of a container
for ALcyFormatBar
instances, located at the bottom of a map component. Layer selection in a ILcyGenericMapComponent
is monitored, and the format bar that matches the format of the selected layer is displayed in the container.
An ALcyFormatBar
is a Swing component that provides tools to manipulate the layers of the format. Manipulation can mean anything here. A
typical use consists of making buttons available for drawing new domain objects, and adding them into the layer and its model.
A number of existing addons show their respective tool bars inside an ALcyFormatBar
. They include the TLcyDrawingAddOn
, the TLcyMS2525bAddOn
, and the TLcyAPP6AAddOn
.
The Adding support for custom editable data to a Lightspeed view and Adding support for custom (editable) data to a GXY view tutorials also use the format bar to show some buttons.
If the menu bar or toolbar item is activated and no ALcyFormatBar
can be created for any
layer in the map with an ALcyFormatBarFactory
, an attempt is made to create a new layer for this purpose. To do so, a ALcyDefaultModelDescriptorFactory
is used to create an ILcdModelDescriptor
. If multiple factories are available, the end user is asked to select one. With the ILcdModelDescriptor
, an ILcdModel
is created using an ILcdModelFactory
. A layer for that model is created using a layer factory and added to the map, for example, a ILcdGXYLayerFactory
is used for an ILcyMapComponent
The ALcyFormatBarFactory
objects, ALcyDefaultModelDescriptorFactory
objects, ILcdModelFactory
objects and layer factories are all retrieved using the ILcyLucyEnv
method getServices
. As such, they must be registered using addService
.