The OMDrawingTool is also a com.bbn.openmap.gui.Tool, which allows it to appear in the OpenMap toolbar. The OMDrawingTool keeps track of whether it is a tool, and appears accordingly:
If the OMDrawingTool is being used as a tool (getUseAsTool() == true), then it will set itself to be visible. If you are putting an OMDrawingTool in the OpenMap application and you want the color/line/graphic options to be visible in the toolbar, use the itTool property for the OMDrawingTool in the properties file. If you are using your own OMDrawingTool, in your EditorLayerTool for instance, you should set useAsTool(true) programmatically to get the visiblity of the tool to appear. There is a property to tell the OMDrawingTool to be visible when it is inactive, and that flag is true by default. You can set that property (visibleWhenInactive) to change this behavior. If the OMDrawingTool is not being used as a tool, it can be brought up in a window. This window can be brought up with a right click or control-click on the object being edited.
If the OMGraphic being edited doesn't want to have the OMDrawingTool visible, it won't be. Neither the tool nor the option to bring the window up won't be displayed with a right/control click.
The OMDrawingTool uses a behavior mask to give control over how it behaves. You can control if the attribute palette appears, if a popup gui appears by default when the editing is complete, or appear when the alt+mouse key or right mouse key is pressed. You should set this mask if you are not sure about the values that other components may have set on the OMDrawingTool.
The OMDrawingTool uses EditToolLoaders to determine what EditableOMGraphic can be used for a particular class name or OMGraphic type. If a loader for an OMGraphic type is not found, then that OMGraphic type won't be handled, and the tool will react to a create() or edit() call with a null object pointer. If a loader is found, and the OMgraphic can be edited or modified, then the create() or edit() methods will return a pointer to the OMGraphic being modified.
The GUI for the OMDrawingTool is multi-layered. The OMDrawingTool contains a GraphicsAttributes object, which is an extension of the GraphicAttributes object. The GraphicAttributes GUI within the tool lets you change the colors, line width and line dash pattern of the current OMGraphic. The GraphicAttributes conttribution to the GUI is not yet implemented, but will let you change the render type and line type of the OMGraphic. Finally, the EditableOMGraphic is given an opportunity to change and set parameters of the OMGraphic that is knows about - for instance, the EditableOMLine object will soon provide an interface to set arrowheads on the lines, as well as set the amount of arc a line has (it's currently not implemented).
|
|
|
|
|
|
|
|
|
|