com.bbn.openmap.omGraphics
Class EditableOMRangeRings

java.lang.Object
  extended by com.bbn.openmap.event.MapMouseAdapter
      extended by com.bbn.openmap.omGraphics.EditableOMGraphic
          extended by com.bbn.openmap.omGraphics.EditableOMCircle
              extended by com.bbn.openmap.omGraphics.EditableOMRangeRings
All Implemented Interfaces:
MapMouseListener

public class EditableOMRangeRings
extends EditableOMCircle


Nested Class Summary
static class EditableOMRangeRings.OMRangeRingUndoEvent
          Subclass for undoing edits for OMRangeRing classes, handles events that may affect the extra GUI widgets.
 
Nested classes/interfaces inherited from class com.bbn.openmap.omGraphics.EditableOMGraphic
EditableOMGraphic.OMGraphicUndoEvent
 
Field Summary
protected  javax.swing.JComponent attributeBox
           
protected  java.text.DecimalFormat df
           
protected  boolean drawLabelsHolder
           
protected  javax.swing.JTextField intervalField
           
protected static int lastInterval
           
protected static Length lastUnit
           
protected  javax.swing.JToolBar rrToolBar
           
protected  javax.swing.JCheckBox snapCheckBox
           
protected static boolean snapToInterval
           
protected  javax.swing.JComboBox unitsCombo
           
 
Fields inherited from class com.bbn.openmap.omGraphics.EditableOMCircle
CENTER_POINT_INDEX, circle, E_POINT_INDEX, gpc, gpe, gpm, gpn, gpne, gpnw, gpo, gpr, gps, gpse, gpsw, gpw, lastRenderType, N_POINT_INDEX, NE_POINT_INDEX, NW_POINT_INDEX, OFFSET_POINT_INDEX, RADIUS_POINT_INDEX, S_POINT_INDEX, SE_POINT_INDEX, SW_POINT_INDEX, W_POINT_INDEX
 
Fields inherited from class com.bbn.openmap.omGraphics.EditableOMGraphic
actionMask, canGrabGraphic, DEBUG, DEBUG_DETAIL, gPoints, GRAB_POINT_DRAWING_ATTRIBUTES_ATTRIBUTE, holder, i18n, lastMouseEvent, listeners, mouseModeServiceList, movingPoint, popupIsUp, projection, SELECTED_GRAB_POINT_DRAWING_ATTRIBUTES_ATTRIBUTE, showGUI, stateMachine, undoStack, xorRendering
 
Constructor Summary
EditableOMRangeRings()
          Create the EditableOMRangeRings, setting the state machine to create the circle off of the gestures.
EditableOMRangeRings(GraphicAttributes ga)
          Create an EditableOMRangeRings with the circleType and renderType parameters in the GraphicAttributes object.
EditableOMRangeRings(OMRangeRings omc)
          Create the EditableOMRangeRings with an OMCircle already defined, ready for editing.
 
Method Summary
 void createGraphic(GraphicAttributes ga)
          Create and set the graphic within the state machine.
protected  UndoEvent createUndoEventForCurrentState(java.lang.String whatHappened)
          Create an UndoEvent that can get an OMRangeRing back to what it looks like right now.
 java.awt.Component getGUI(GraphicAttributes graphicAttributes)
          Modifies the gui to not include line type adjustments, and adds widgets to control range ring settings.
protected  javax.swing.JComponent getRangeRingGUI()
           
protected  javax.swing.JComponent getRangeRingGUI(int orientation, javax.swing.JComponent guiComp)
          Get the GUI associated with changing the Text.
 int interpretValue(java.lang.String intervalStr)
           
 boolean isSnapToInterval()
           
protected  void modifyOMGraphicForEditRender()
          A convenience method that gives an EditableOMGraphic a chance to modify the OMGraphic so it can be drawn quickly, by turning off labels, etc, right before the XORpainting happens.
protected  void resetOMGraphicAfterEditRender()
          A convenience method that gives an EditableOMGraphic a chance to reset the OMGraphic so it can be rendered normally, after it has been modified for quick paints.
protected  void setRadius(double radius)
          To be overloaded if needed when setting circle's radius.
 void setSnapToInterval(boolean sti)
           
 void updateInterval(int val)
           
 void updateInterval(java.lang.String intervalStr)
           
 
Methods inherited from class com.bbn.openmap.omGraphics.EditableOMCircle
assertGrabPoints, attachToMovingGrabPoint, clearGrabPoints, detachFromMovingGrabPoint, generate, getCanGrabGraphic, getGraphic, getMovingPoint, init, move, regenerate, render, setGrabPoints, setGrabPoints, setGraphic, setMovingPoint
 
Methods inherited from class com.bbn.openmap.omGraphics.EditableOMGraphic
_getMovingPoint, addEOMGListener, cleanMap, createAttributePanel, finalize, fireEvent, fireEvent, fireEvent, fireEvent, getActionMask, getGrabPoint, getGrabPoints, getGUI, getMouseModeServiceList, getMovingPoint, getProjection, getProjectionPoint, getShowGUI, getStateMachine, getUndoStack, handleInitialMouseEvent, isMouseEventTouching, isMouseEventTouchingTheEdge, isPopupIsUp, isXorRendering, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseMoved, mousePressed, mouseReleased, redraw, redraw, redraw, removeEOMGListener, repaint, repaintRender, reset, setActionMask, setCanGrabGraphic, setGrabPoint, setGrabPoints, setMouseModeServiceList, setPopupIsUp, setProjection, setShowGUI, setStateMachine, setUndoStack, setXorRendering, updateCurrentState
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastInterval

protected static int lastInterval

lastUnit

protected static Length lastUnit

snapToInterval

protected static boolean snapToInterval

intervalField

protected javax.swing.JTextField intervalField

unitsCombo

protected javax.swing.JComboBox unitsCombo

snapCheckBox

protected javax.swing.JCheckBox snapCheckBox

rrToolBar

protected javax.swing.JToolBar rrToolBar

df

protected transient java.text.DecimalFormat df

attributeBox

protected javax.swing.JComponent attributeBox

drawLabelsHolder

protected boolean drawLabelsHolder
Constructor Detail

EditableOMRangeRings

public EditableOMRangeRings()
Create the EditableOMRangeRings, setting the state machine to create the circle off of the gestures.


EditableOMRangeRings

public EditableOMRangeRings(GraphicAttributes ga)
Create an EditableOMRangeRings with the circleType and renderType parameters in the GraphicAttributes object.


EditableOMRangeRings

public EditableOMRangeRings(OMRangeRings omc)
Create the EditableOMRangeRings with an OMCircle already defined, ready for editing.

Parameters:
omc - OMCircle that should be edited.
Method Detail

createGraphic

public void createGraphic(GraphicAttributes ga)
Create and set the graphic within the state machine. The GraphicAttributes describe the type of circle to create.

Overrides:
createGraphic in class EditableOMCircle
Parameters:
ga - GraphicAttributes, describing the graphic to be created.

getGUI

public java.awt.Component getGUI(GraphicAttributes graphicAttributes)
Modifies the gui to not include line type adjustments, and adds widgets to control range ring settings.

Overrides:
getGUI in class EditableOMCircle
Parameters:
graphicAttributes - the GraphicAttributes to use to get the GUI widget from to control those parameters for this EOMG.
Returns:
java.awt.Component to use to control parameters for this EOMG.

updateInterval

public void updateInterval(int val)

updateInterval

public void updateInterval(java.lang.String intervalStr)

interpretValue

public int interpretValue(java.lang.String intervalStr)

getRangeRingGUI

protected javax.swing.JComponent getRangeRingGUI()

getRangeRingGUI

protected javax.swing.JComponent getRangeRingGUI(int orientation,
                                                 javax.swing.JComponent guiComp)
Get the GUI associated with changing the Text.

Parameters:
orientation - SwingConstants.HORIZONTAL/VERTICAL
guiComp - the JComponent to add stuff to. If the orientation is HORIZONTAL, the components will be added directly to this component, or to a new JComponent that is returned if null. If the orientation is Vertical, a button will be added to the guiComp, or returned. This button will call up a dialog box with the settings, since they don't really lay out vertically.
Returns:
JComponent for controlling range-ring specific attributes.

modifyOMGraphicForEditRender

protected void modifyOMGraphicForEditRender()
A convenience method that gives an EditableOMGraphic a chance to modify the OMGraphic so it can be drawn quickly, by turning off labels, etc, right before the XORpainting happens. The OMGraphic should be configured so that the render method does the least amount of painting possible. Note that the DrawingAttributes for the OMGraphic have already been set to DrawingAttributes.DEFAULT (black line, clear fill).

Overrides:
modifyOMGraphicForEditRender in class EditableOMGraphic

resetOMGraphicAfterEditRender

protected void resetOMGraphicAfterEditRender()
A convenience method that gives an EditableOMGraphic a chance to reset the OMGraphic so it can be rendered normally, after it has been modified for quick paints. The DrawingAttributes for the OMGraphic have already been reset to their normal settings, from the DrawingAttributes.DEFAULT settings that were used for the quick paint.

Overrides:
resetOMGraphicAfterEditRender in class EditableOMGraphic

isSnapToInterval

public boolean isSnapToInterval()

setSnapToInterval

public void setSnapToInterval(boolean sti)

setRadius

protected void setRadius(double radius)
Description copied from class: EditableOMCircle
To be overloaded if needed when setting circle's radius.

Overrides:
setRadius in class EditableOMCircle
Parameters:
radius - in DECIMAL_DEGREES

createUndoEventForCurrentState

protected UndoEvent createUndoEventForCurrentState(java.lang.String whatHappened)
Create an UndoEvent that can get an OMRangeRing back to what it looks like right now.

Overrides:
createUndoEventForCurrentState in class EditableOMGraphic
Parameters:
whatHappened - String describing what got you here. You can leave this null if you just want to go with the default.
Returns:
UndoEvent reflecting current state. May be null if undo isn't handled. Returning null is the default action.


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