## com.bbn.openmap.omGraphics
Class EditableOMScalingRaster

    java.lang.Object
      com.bbn.openmap.event.MapMouseAdapter
          com.bbn.openmap.omGraphics.EditableOMGraphic
              com.bbn.openmap.omGraphics.EditableOMScalingRaster

All Implemented Interfaces:
  MapMouseListener

public class EditableOMScalingRaster
extends EditableOMGraphic

The EditableOMScalingRaster encompasses an OMScalingRaster, providing methods for modifying or creating it. This class only modifies OMScaling Rasters in lat/lon space (RENDERTYPE_LATLON). When you grab at the raster, you change the size of the entire rect. Grabbing the center point moves the raster. If there is an offset point, moving the center point changes the rect's position in relation to the offset point. Moving the offset point moves the rect, keeping the distance to the center point constant.

Field Summary
`static int` `CENTER_POINT_INDEX`
`protected OffsetGrabPoint` `gpc`
`protected GrabPoint` `gpne`
`protected GrabPoint` `gpnw`
`protected OffsetGrabPoint` `gpo`
`protected GrabPoint` `gpse`
`protected GrabPoint` `gpsw`
`protected int` `lastRenderType`
`static int` `NE_POINT_INDEX`
`static int` `NW_POINT_INDEX`
`static int` `OFFSET_POINT_INDEX`
`static java.lang.String` `OffsetResetCmd`
`protected OMScalingRaster` `raster`
`static int` `SE_POINT_INDEX`
`static int` `SW_POINT_INDEX`

Fields inherited from class com.bbn.openmap.omGraphics.EditableOMGraphic
`actionMask, canGrabGraphic, DEBUG, DEBUG_DETAIL, gPoints, holder, lastMouseEvent, listeners, mouseModeServiceList, movingPoint, projection, showGUI, stateMachine`

Constructor Summary
`EditableOMScalingRaster()` Create the EditableOMRect, setting the state machine to create the rect off of the gestures.
`EditableOMScalingRaster(GraphicAttributes ga)` Create an EditableOMScalingRaster with the rectType and renderType parameters in the GraphicAttributes object.
`EditableOMScalingRaster(OMScalingRaster omsr)` Create the EditableOMScalingRaster with an OMScalingRaster already defined, ready for editing.

Method Summary
`void` `assertGrabPoints()` Check to make sure the grab points are not null.
`void` `attachToMovingGrabPoint(OffsetGrabPoint gp)` Attach to the Moving OffsetGrabPoint so if it moves, it will move this EditableOMGraphic with it.
`protected void` `clearGrabPoints()`
`void` `createGraphic(GraphicAttributes ga)` Create and set the graphic within the state machine.
`void` `detachFromMovingGrabPoint(OffsetGrabPoint gp)` Detach from a Moving OffsetGrabPoint.
`boolean` `generate(Projection proj)` Use the current projection to place the graphics on the screen.
`OMGraphic` `getGraphic()` Get the OMGraphic being created/modified by the EditableOMScalingRaster.
`void` `init()` Create and initialize the state machine that interprets the modifying gestures/commands, as well as ititialize the grab points.
`void` `initRectSize()`
`void` `move(java.awt.event.MouseEvent e)` Called to set the OffsetGrabPoint to the current mouse location, and update the OffsetGrabPoint with all the other GrabPoint locations, so everything can shift smoothly.
`void` `regenerate(Projection proj)` Given a new projection, the grab points may need to be repositioned off the current position of the graphic.
`void` `render(java.awt.Graphics graphics)` Draw the EditableOMScalingRaster parts into the java.awt.Graphics object.
`void` `setGrabPoints()` Take the current location of the GrabPoints, and modify the location parameters of the OMScalingRaster with them.
`void` `setGrabPoints(OMGraphic graphic)` Set the grab points for the graphic provided, setting them on the extents of the graphic.
`protected void` `setGrabPointsForOMSI()`
`protected void` `setGrabPointsForOMSI(OMScalingIcon icon)`
`void` `setGraphic(OMGraphic graphic)` Set the graphic within the state machine.
`void` `setMovingPoint(GrabPoint gp)` Set the GrabPoint that is in the middle of being modified, as a result of a mouseDragged event, or other selection process.

Methods inherited from class com.bbn.openmap.omGraphics.EditableOMGraphic

`_getMovingPoint, addEOMGListener, cleanMap, finalize, fireEvent, fireEvent, fireEvent, fireEvent, getActionMask, getCanGrabGraphic, getGrabPoint, getGrabPoints, getGUI, getGUI, getMouseModeServiceList, getMovingPoint, getMovingPoint, getProjection, getShowGUI, getStateMachine, handleInitialMouseEvent, modifyOMGraphicForEditRender, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseMoved, mousePressed, mouseReleased, redraw, redraw, redraw, removeEOMGListener, repaint, repaintRender, reset, resetOMGraphicAfterEditRender, setActionMask, setCanGrabGraphic, setGrabPoint, setGrabPoints, setMouseModeServiceList, setProjection, setShowGUI, setStateMachine`

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### gpnw

    protected GrabPoint gpnw

### gpne

    protected GrabPoint gpne

### gpsw

    protected GrabPoint gpsw

### gpse

    protected GrabPoint gpse

### gpc

    protected OffsetGrabPoint gpc

### gpo

    protected OffsetGrabPoint gpo

### raster

    protected OMScalingRaster raster

### OffsetResetCmd

    public static final java.lang.String OffsetResetCmd

See Also:
  Constant Field Values

### CENTER_POINT_INDEX

    public static final int CENTER_POINT_INDEX

See Also:
  Constant Field Values

### NW_POINT_INDEX

    public static final int NW_POINT_INDEX

See Also:
  Constant Field Values

### NE_POINT_INDEX

    public static final int NE_POINT_INDEX

See Also:
  Constant Field Values

### SW_POINT_INDEX

    public static final int SW_POINT_INDEX

See Also:
  Constant Field Values

### SE_POINT_INDEX

    public static final int SE_POINT_INDEX

See Also:
  Constant Field Values

### OFFSET_POINT_INDEX

    public static final int OFFSET_POINT_INDEX

See Also:
  Constant Field Values

### lastRenderType

    protected int lastRenderType

Constructor Detail

### EditableOMScalingRaster

    public EditableOMScalingRaster()

  Create the EditableOMRect, setting the state machine to create the rect off of the gestures.

### EditableOMScalingRaster

    public EditableOMScalingRaster(GraphicAttributes ga)

  Create an EditableOMScalingRaster with the rectType and renderType parameters in the GraphicAttributes object.

### EditableOMScalingRaster

    public EditableOMScalingRaster(OMScalingRaster omsr)

  Create the EditableOMScalingRaster with an OMScalingRaster already defined, ready for editing.

Parameters:
  `omsr` - OMScalingRaster that should be edited.

Method Detail

### init

    public void init()

  Create and initialize the state machine that interprets the modifying gestures/commands, as well as ititialize the grab points. Also allocates the grab point array needed by the EditableOMScalingRaster.

### setGraphic

    public void setGraphic(OMGraphic graphic)

  Set the graphic within the state machine. If the graphic is null, then one shall be created, and located off screen until the gestures driving the state machine place it on the map.

  Specified by:
    `setGraphic` in class `EditableOMGraphic`
  Parameters:
    `graphic` - OMGraphic.

### createGraphic

    public void createGraphic(GraphicAttributes ga)

  Create and set the graphic within the state machine. The GraphicAttributes describe the type of rect to create.

  Specified by:
    `createGraphic` in class `EditableOMGraphic`
  Parameters:
    `ga` - GraphicAttributes, describing the graphic to be created.

### getGraphic

    public OMGraphic getGraphic()

  Get the OMGraphic being created/modified by the EditableOMScalingRaster.

  Specified by:
    `getGraphic` in class `EditableOMGraphic`

### attachToMovingGrabPoint

    public void attachToMovingGrabPoint(OffsetGrabPoint gp)

  Attach to the Moving OffsetGrabPoint so if it moves, it will move this EditableOMGraphic with it. EditableOMGraphic version doesn't do anything, each subclass has to decide which of its OffsetGrabPoints should be attached to it.

  Overrides:
    `attachToMovingGrabPoint` in class `EditableOMGraphic`

### detachFromMovingGrabPoint

    public void detachFromMovingGrabPoint(OffsetGrabPoint gp)

  Detach from a Moving OffsetGrabPoint. The EditableOMGraphic version doesn't do anything, each subclass should remove whatever GrabPoint it would have attached to an OffsetGrabPoint.

  Overrides:
    `detachFromMovingGrabPoint` in class `EditableOMGraphic`

### setMovingPoint

    public void setMovingPoint(GrabPoint gp)

  Set the GrabPoint that is in the middle of being modified, as a result of a mouseDragged event, or other selection process.

  Overrides:
    `setMovingPoint` in class `EditableOMGraphic`

### initRectSize

    public void initRectSize()

### assertGrabPoints

    public void assertGrabPoints()

  Check to make sure the grab points are not null. If they are, allocate them, and them assign them to the array.

### clearGrabPoints

    protected void clearGrabPoints()

### setGrabPoints

    public void setGrabPoints(OMGraphic graphic)

  Set the grab points for the graphic provided, setting them on the extents of the graphic. Called when you want to set the grab points off the location of the graphic.

### setGrabPointsForOMSI

    protected void setGrabPointsForOMSI(OMScalingIcon icon)

  Parameters:
    `icon` -

### setGrabPointsForOMSI

    protected void setGrabPointsForOMSI()

### setGrabPoints

    public void setGrabPoints()

  Take the current location of the GrabPoints, and modify the location parameters of the OMScalingRaster with them. Called when you want the graphic to change according to the grab points.

  Specified by:
    `setGrabPoints` in class `EditableOMGraphic`

### move

    public void move(java.awt.event.MouseEvent e)

  Called to set the OffsetGrabPoint to the current mouse location, and update the OffsetGrabPoint with all the other GrabPoint locations, so everything can shift smoothly. Should also set the OffsetGrabPoint to the movingPoint. Should be called only once at the beginning of the general movement, in order to set the movingPoint. After that, redraw(e) should just be called, and the movingPoint will make the adjustments to the graphic that are needed.

  Specified by:
    `move` in class `EditableOMGraphic`

### generate

    public boolean generate(Projection proj)

  Use the current projection to place the graphics on the screen. Has to be called to at least assure the graphics that they are ready for rendering. Called when the graphic position changes.

  Specified by:
    `generate` in class `EditableOMGraphic`
  Parameters:
    `proj` - com.bbn.openmap.proj.Projection
  Returns:
    true

### regenerate

    public void regenerate(Projection proj)

  Given a new projection, the grab points may need to be repositioned off the current position of the graphic. Called when the projection changes.

  Specified by:
    `regenerate` in class `EditableOMGraphic`

### render

    public void render(java.awt.Graphics graphics)

  Draw the EditableOMScalingRaster parts into the java.awt.Graphics object. The grab points are only rendered if the rect machine state is RectSelectedState.RECT_SELECTED.

  Specified by:
    `render` in class `EditableOMGraphic`
  Parameters:
    `graphics` - java.awt.Graphics.

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