DrawingTool (OpenMap API)
Date: 2016-12-09

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bbn.openmap.tools.drawing
Interface DrawingTool

All Known Implementing Classes:
  OMDrawingTool

    public interface DrawingTool

A DrawingTool is an object that can take a request for editing an OMGraphic, or for creating an OMGraphic from a classname, and find a EditTool to do the job. The DrawingTool is responsible for providing any user interface that is needed to adjust the OMGraphic.

Method Summary
`void` | `addLoader(EditToolLoader loader)` Add an EditToolLoader to the DrawingTool, expanding the DrawingTool's capability to handle more graphic types.
`boolean` | `canEdit(java.lang.Class clas)` Check to see if the class type can be created/edited by the DrawingTool.
`OMGraphic` | `create(java.lang.String classname, DrawingToolRequestor requestor)` Given a classname, provide an OMGraphic for that classname.
`OMGraphic` | `create(java.lang.String classname, GraphicAttributes ga, DrawingToolRequestor requestor)` Given a classname, provide an OMGraphic for that classname.
`OMGraphic` | `create(java.lang.String classname, GraphicAttributes ga, DrawingToolRequestor requestor, boolean showGUI)` Same as create(String, GraphicAttributes, DrawingToolRequestor), except that you have to option of suppressing the GUI that could be available from the EditableOMGraphic.
`OMGraphic` | `edit(EditableOMGraphic eomg, DrawingToolRequestor requestor)` Given an EditableOMGraphic, direct events to the EditableOMGraphic so that it can modify its OMGraphic.
`OMGraphic` | `edit(EditableOMGraphic eomg, DrawingToolRequestor requestor, java.awt.event.MouseEvent e)` A slightly different edit method, where the EditableOMGraphic is put directly into edit mode, and the mouse events immediately start making modifications to the OMGraphic.
`OMGraphic` | `edit(OMGraphic g, DrawingToolRequestor requestor)` Given an OMGraphic, set things up so that the OMGraphic will be edited.
`OMGraphic` | `edit(OMGraphic g, DrawingToolRequestor requestor, boolean showGUI)` Same as edit(omGraphic, DrawingToolRequestor), except that you have to option of suppressing the GUI that could be available from the EditableOMGraphic.
`OMGraphic` | `edit(OMGraphic g, DrawingToolRequestor requestor, java.awt.event.MouseEvent e)` A slightly different edit method, where the EditableOMGraphic is put directly into edit mode, and the mouse events immediately start making modifications to the OMGraphic.
`int` | `getBehaviorMask()` A integer that is looked at internally, bitwise, to determine different behaviors.
`EditToolLoader[]` | `getLoaders()` Get an array of EditToolLoaders that the DrawingTool knows about.
`void` | `removeLoader(EditToolLoader loader)` Remove an EditToolLoader from the DrawingTool.
`void` | `setBehaviorMask(int mask)` A integer that is looked at internally, bitwise, to determine different behaviors.
`void` | `setLoaders(EditToolLoader[] loaders)` Set the loaders within the DrawingTool.

Method Detail

### setBehaviorMask

    void setBehaviorMask(int mask)

  A integer that is looked at internally, bitwise, to determine different behaviors. If you care about specific behavior of the DrawingTool, you should set this to what you want to make sure the tool acts the way you want.

### getBehaviorMask

    int getBehaviorMask()

  A integer that is looked at internally, bitwise, to determine different behaviors.

### create

    OMGraphic create(java.lang.String classname,
                     DrawingToolRequestor requestor)

  Given a classname, provide an OMGraphic for that classname. It's assumed that the DrawingTool will be holding on to an EditableOMGraphic encasing the returned OMGraphic, and that the parameters of the OMGraphic may still change depending on user input.

  Parameters:
    `classname` - the classname of the OMGraphic to create.
    `requestor` - the Component that is requesting the OMGraphic. The requestor gets notified when the user is finished with the DrawingTool and the graphic is ready.
  Returns:
    OMGraphic if everything's OK, null if the request can't be fulfilled.

### create

    OMGraphic create(java.lang.String classname,
                     GraphicAttributes ga,
                     DrawingToolRequestor requestor)

  Given a classname, provide an OMGraphic for that classname. It's assumed that the DrawingTool will be holding on to an EditableOMGraphic encasing the returned OMGraphic, and that the parameters of the OMGraphic may still change depending on user input.

  Parameters:
    `classname` - the classname of the OMGraphic to create.
    `ga` - GraphicAttributes object that contains more information about the type of line to be created.
    `requestor` - the Component that is requesting the OMGraphic. The requestor gets notified when the user is finished with the DrawingTool and the graphic is ready.
  Returns:
    OMGraphic if everything's OK, null if the request can't be fulfilled.

### create

    OMGraphic create(java.lang.String classname,
                     GraphicAttributes ga,
                     DrawingToolRequestor requestor,
                     boolean showGUI)

  Same as create(String, GraphicAttributes, DrawingToolRequestor), except that you have to option of suppressing the GUI that could be available from the EditableOMGraphic.

  Parameters:
    `classname` - the classname of the OMGraphic to create.
    `ga` - GraphicAttributes object that contains more information about the type of line to be created.
    `requestor` - the Component that is requesting the OMGraphic. The requestor gets notified when the user is finished with the DrawingTool and the graphic is ready.
    `showGUI` - set to true (default) if a GUI showing attribute controls should be displayed.
  Returns:
    OMGraphic if everything's OK, null if the request can't be fulfilled.

### edit

    OMGraphic edit(OMGraphic g,
                   DrawingToolRequestor requestor)

  Given an OMGraphic, set things up so that the OMGraphic will be edited. Returns the OMGraphic being edited. Shouldn't assume that the two objects are the same. It's assumed that the DrawingTool will be holding on to an EditableOMGraphic encasing the returned OMGraphic, and that the parameters of the OMGraphic may still change depending on user input.

  Parameters:
    `g` - the OMGraphic to wrap in an EditableOMGraphic, and therefore to edit.
    `requestor` - the Component that is requesting the OMGraphic. The requestor gets notified when the user is finished with the DrawingTool and the graphic is ready.
  Returns:
    OMGraphic if everything's OK, null if the request can't be fulfilled.

### edit

    OMGraphic edit(OMGraphic g,
                   DrawingToolRequestor requestor,
                   boolean showGUI)

  Same as edit(omGraphic, DrawingToolRequestor), except that you have to option of suppressing the GUI that could be available from the EditableOMGraphic.

  Parameters:
    `g` - the OMGraphic to wrap in an EditableOMGraphic, and therefore to edit.
    `requestor` - the Component that is requesting the OMGraphic. The requestor gets notified when the user is finished with the DrawingTool and the graphic is ready.
    `showGUI` - set to true (default) if a GUI showing attribute controls should be displayed.
  Returns:
    OMGraphic if everything's OK, null if the request can't be fulfilled.

### edit

    OMGraphic edit(EditableOMGraphic eomg,
                   DrawingToolRequestor requestor)

  Given an EditableOMGraphic, direct events to the EditableOMGraphic so that it can modify its OMGraphic. With this method, the loaders are not needed.

  Parameters:
    `eomg` - and EditableOMGraphic to manipulate.
    `requestor` - the Component that is requesting the OMGraphic. The requestor gets notified when the user is finished with the DrawingTool and the graphic is ready.
  Returns:
    OMGraphic if everything's OK, null if the request can't be fulfilled.

### edit

    OMGraphic edit(OMGraphic g,
                   DrawingToolRequestor requestor,
                   java.awt.event.MouseEvent e)

  A slightly different edit method, where the EditableOMGraphic is put directly into edit mode, and the mouse events immediately start making modifications to the OMGraphic.

  Parameters:
    `g` - OMGraphic to modify
    `requestor` - the Component that is requesting the OMGraphic. The requestor gets notified when the user is finished with the DrawingTool and the graphic is ready.
    `e` - MouseEvent to use to start editing with.
  Returns:
    OMGraphic being modified.

### edit

    OMGraphic edit(EditableOMGraphic eomg,
                   DrawingToolRequestor requestor,
                   java.awt.event.MouseEvent e)

  A slightly different edit method, where the EditableOMGraphic is put directly into edit mode, and the mouse events immediately start making modifications to the OMGraphic.

  Parameters:
    `eomg` - EditableOMGraphic to modify
    `requestor` - the Component that is requesting the OMGraphic. The requestor gets notified when the user is finished with the DrawingTool and the graphic is ready.
    `e` - MouseEvent to use to start editing with.
  Returns:
    OMGraphic being modified contained within the EditableOMGraphic.

### canEdit

    boolean canEdit(java.lang.Class clas)

  Check to see if the class type can be created/edited by the DrawingTool.

### addLoader

    void addLoader(EditToolLoader loader)

  Add an EditToolLoader to the DrawingTool, expanding the DrawingTool's capability to handle more graphic types.

### removeLoader

    void removeLoader(EditToolLoader loader)

  Remove an EditToolLoader from the DrawingTool.

### getLoaders

    EditToolLoader[] getLoaders()

  Get an array of EditToolLoaders that the DrawingTool knows about.

### setLoaders

    void setLoaders(EditToolLoader[] loaders)

  Set the loaders within the DrawingTool.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details