Each of the entries in the Lucy menu bar, tool bars and pop-up menus, is configured in a configuration file, such as the
default front-end configuration file lucy.cfg
, or the 2D/3D map configuration file TLcyLspMapAddOn.cfg
.
For example, you can use the configuration files to set the text and icon on the button, the tooltip and the location in the
user interface.
This guide explains the syntax used in those configuration files, and illustrates the various changes you can make to them.
For the remainder of this article, we will use the term action bar to refer in general to either the menu bar, tool bar or pop-up menu. |
Structure of the config files key-value pairs
The options for an action in the configuration file are defined as key-value pairs. The key consists of multiple parts:
TLcyMain.exitAction.menuBar.shortDescription=Close application
|_________________| |_____| |______________| |________________|
Action identifier Action Property Property
bar name value
name
-
Action identifier: a unique identifier for the action.
-
Action bar name: in the example, the action is inserted in an action bar called menuBar, which is the main menu bar of Lucy.
-
Property name: the property of the action bar item that you want to configure. For example the shortDescription property refers to the tool tip shown when you hover your mouse over the item in the action bar.
-
Property value: the values you can fill in here depend on the property you are defining. In the example, it is the text of the tool tip.
To configure action bars, you need to find out which action bars are available, and what the names and properties of existing action bar items are. This allows you to determine in which configuration file you need to look to adjust a certain action. See How to find the IDs of the available actions, tool bars, menu bars and pop-up menus for more information on how to obtain those IDs. |
Overview of the properties available to configure an action
The following table lists all properties that you can use to configure an item from an action bar.
Property | Required | Description |
---|---|---|
|
✓ |
A comma-separated list that describes the path in the action bar to the action. For a menu bar, this is the chain of menu, sub-menus, and eventually the name of the menu item itself. |
|
✗ |
Defines logical groups of items that belong together. Groups are typically visually separated from one another with horizontal or vertical line spacers. The value of this property is a comma-separated list with the same number of items as the list in the item property. It defines for each item at the corresponding index in the item property, in which group it is located. |
|
✗ |
The tooltip. It describe the action in a few words. |
|
✗ |
Identifier for a icon. The identifier is either a pre-defined constant such as The use of the icon depends on the type of action bar. For example, in a menu bar, Lucy displays the icon before the text. In a tool bar, Lucy only shows the icon. |
|
✗ |
Either If this property is not specified, the default value is |
|
✗ |
Either Specifies whether the action is inserted into the action bar or not.
If you set it to |
|
✗ |
Sets a keyboard stroke combination as a shortcut key for the action. Pressing that shortcut triggers the action. For example, the value |
|
✗ |
The Each action bar in Lucy has a default action. For example, when you double-click an object on the map, the default action of the map pop-up menu is triggered. It shows the object properties. In a pop-up menu, the menu item for the default action is displayed in bold. The value for this property is either Note that the standard Lucy framework cannot enforce that a double-click triggers the default action of an action bar. It is up to the component that owns the action bar to trigger the default action of that action bar when the component is double-clicked. In the previous example, it is the map component that triggers the default action when a map object is double-clicked. |
|
✗ |
A longer description of the action. Note that this property is currently not used in the user interface. |
Lucy also has the concept of toggle actions, with two states: active and inactive.
When the action is triggered, a switch occurs between the active and inactive states.
These actions are called active settables (ILcyActiveSettable
).
They have a few more configuration properties than regular actions:
Property | Required | Description |
---|---|---|
|
✗ |
Similar to the This icon is used on a toggle button when the button is selected and the active settable is in its active state.
When the active settable is in its inactive state and the button de-selected, the |
|
✗ |
Either When |
Accelerator keys
For the full specification of all possible accelerator, see the documentation of javax.swing.KeyStroke.getKeyStroke(java.lang.String)
.
cmd
has a special purpose; Lucy interprets it as ctrl
on Windows and Linux platforms and as command
on macOS.
Therefore if you define a shortcut as cmd O
, it means ctrl O
on Windows and Linux, command O
on Mac OS X.
If the shortcut is defined as ctrl O
, then it is always ctrl
on all platforms. You can see the accelerator key mappings in the table below.
Key |
Windows and Linux |
macOS |
cmd |
Ctrl |
Command (Cmd) |
ctrl |
Ctrl |
Ctrl |
alt |
Alt |
Alt |
meta |
Meta |
Command (Cmd) |
shift |
Shift |
Shift |