tools.xml
Submitted by Pieter De Graef on Mon, 16/03/2009 - 17:12
This xml file specifies all known tools and actions that can be used in either a toolbar (DynamicToolbar widget) or the layertree (LayerTree widget). Only tools and actions from this list can be used in the configuration of a toolbar or layertree. If you want to use other tools, you'll have to add them manually, but normally it is not necessary to change this file. Another observation is that we've carefully named each of these tools, with toggle buttons all ending with 'Mode'. ZoomIn versus ZoomInMode for example. The ZoomIn is an action in the Toolbar that, when clicked, will immediatly zoom in. ZoomInMode on the other hand is a toggle button. This means that zooming will only occur when the user start clicking on the map for as long as the ZoomInMode is enabled. To show the difference between a toggle button and an action button, look carefully at the following 2 images: difference between a toggle button and an action button
The basic list of tools that comes with geomajas is listed below. As you may see, some of them need extra parameters while others don't. Zooming for example, needs to know how much it should zoom on a single zooming event. The first tool defined here (ToolbarSeparator) is a special case, as it is not really a button. It is used a separation between logical groups of buttons, and presented as a vertical line.
<?xml version="1.0" encoding="UTF-8"?> <tools xmlns="http://geomajas.org/schemas/configuration/"> <!-- TOOLBAR ACTIONS AND TOOLS --> <tool id="ToolbarSeparator" /> <tool id="ZoomIn"> <parameter name="delta" value="1.5" /> </tool> <tool id="ZoomOut"> <parameter name="delta" value="0.5" /> </tool> <tool id="ZoomInMode"> <parameter name="delta" value="0.25" /> </tool> <tool id="ZoomOutMode"> <parameter name="delta" value="0.25" /> </tool> <tool id="ZoomPrevious" /> <tool id="ZoomNext" /> <tool id="ZoomToRectangleMode" /> <tool id="ZoomToSelection" /> <tool id="PanToSelection" /> <tool id="PanMode"> <parameter name="hideLabelsOnDrag" value="true" /> </tool> <tool id="DeselectAll" /> <tool id="MeasureDistanceMode"> <parameter name="simple" value="false" /> <parameter name="useSnapHelp" value="true" /> </tool> <tool id="FeatureInfoMode" /> <tool id="SelectionMode"> <parameter name="singleSelection" value="false" /> <parameter name="supportEditing" value="true" /> </tool> <tool id="MarkedEditMode"> <parameter name="useMarkings" value="true" /> <parameter name="useSnapHelp" value="true" /> <parameter name="allowHoles" value="true" /> </tool> <tool id="EditMode"> <parameter name="useMarkings" value="false" /> <parameter name="useSnapHelp" value="true" /> <parameter name="allowHoles" value="true" /> </tool> <tool id="SplitPolygonMode" /> <tool id="MergePolygonMode" /> <tool id="NavigateMode" /> <tool id="RectangleSelectionMode"> <parameter name="supportEditing" value="true" /> </tool> <tool id="FetchPdf"> <parameter name="downloadMethod" value="0" /> </tool> <!-- LAYERTREE ACTIONS AND TOOLS --> <tool id="LayerVisibleTool" /> <tool id="LayerSnappingTool" /> <tool id="LayerLabeledTool" /> <tool id="ShowTableAction" /> </tools> |