|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bbn.openmap.event.MapMouseAdapter
com.bbn.openmap.omGraphics.EditableOMGraphic
com.bbn.openmap.omGraphics.EditableOMCircle
public class EditableOMCircle
The EditableOMCircle encompasses an OMCircle, providing methods for modifying or creating it. This class only modifies circles in lat/lon space (RENDERTYPE_LATLON) - and ellipses in screen space (RENDERTYPE_XY or RENDERTYPE_OFFSET). When you grab at the circle, you change the radius of the entire circle. Grabbing the center point moves the circle. If there is an offset point, moving the center point changes the circle's position in relation to the offset point. Moving the offset point moves the circle, keeping the distance to the center point constant.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.bbn.openmap.omGraphics.EditableOMGraphic |
---|
EditableOMGraphic.OMGraphicUndoEvent |
Field Summary | |
---|---|
static int |
CENTER_POINT_INDEX
|
protected OMCircle |
circle
|
static int |
E_POINT_INDEX
|
protected OffsetGrabPoint |
gpc
|
protected HorizontalGrabPoint |
gpe
|
protected OffsetGrabPoint |
gpm
|
protected VerticalGrabPoint |
gpn
|
protected GrabPoint |
gpne
|
protected GrabPoint |
gpnw
|
protected OffsetGrabPoint |
gpo
|
protected GrabPoint |
gpr
|
protected VerticalGrabPoint |
gps
|
protected GrabPoint |
gpse
|
protected GrabPoint |
gpsw
|
protected HorizontalGrabPoint |
gpw
|
protected int |
lastRenderType
|
static int |
N_POINT_INDEX
|
static int |
NE_POINT_INDEX
|
static int |
NW_POINT_INDEX
|
static int |
OFFSET_POINT_INDEX
|
static int |
RADIUS_POINT_INDEX
|
static int |
S_POINT_INDEX
|
static int |
SE_POINT_INDEX
|
static int |
SW_POINT_INDEX
|
static int |
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 | |
---|---|
EditableOMCircle()
Create the EditableOMCircle, setting the state machine to create the circle off of the gestures. |
|
EditableOMCircle(GraphicAttributes ga)
Create an EditableOMCircle with the circleType and renderType parameters in the GraphicAttributes object. |
|
EditableOMCircle(OMCircle omc)
Create the EditableOMCircle with an OMCircle 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. |
boolean |
getCanGrabGraphic()
Get whether a graphic can be manipulated by its edges, rather than just by its grab points. |
OMGraphic |
getGraphic()
Get the OMGraphic being created/modified by the EditableOMCircle. |
java.awt.Component |
getGUI(GraphicAttributes graphicAttributes)
If this EditableOMGraphic has parameters that can be manipulated that are independent of other EditableOMGraphic types, then you can provide the widgets to control those parameters here. |
GrabPoint |
getMovingPoint(java.awt.event.MouseEvent e)
Given a MouseEvent, find a GrabPoint that it is touching, and set the moving point to that GrabPoint. |
void |
init()
Create and initialize the state machine that interprets the modifying gestures/commands, as well as initialize the grab points. |
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 EditableOMCircle parts into the java.awt.Graphics object. |
void |
setGrabPoints()
Take the current location of the GrabPoints, and modify the location parameters of the OMCircle with them. |
void |
setGrabPoints(OMGraphic graphic)
Set the grab points for the graphic provided, setting them on the extents of the graphic. |
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. |
protected void |
setRadius(double radius)
To be overloaded if needed when setting circle's radius. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected VerticalGrabPoint gpn
protected HorizontalGrabPoint gpw
protected VerticalGrabPoint gps
protected HorizontalGrabPoint gpe
protected GrabPoint gpnw
protected GrabPoint gpne
protected GrabPoint gpsw
protected GrabPoint gpse
protected OffsetGrabPoint gpc
protected GrabPoint gpr
protected OffsetGrabPoint gpo
protected OffsetGrabPoint gpm
protected OMCircle circle
public static final int CENTER_POINT_INDEX
public static final int NW_POINT_INDEX
public static final int N_POINT_INDEX
public static final int NE_POINT_INDEX
public static final int W_POINT_INDEX
public static final int E_POINT_INDEX
public static final int SW_POINT_INDEX
public static final int S_POINT_INDEX
public static final int SE_POINT_INDEX
public static final int RADIUS_POINT_INDEX
public static final int OFFSET_POINT_INDEX
protected int lastRenderType
Constructor Detail |
---|
public EditableOMCircle()
public EditableOMCircle(GraphicAttributes ga)
public EditableOMCircle(OMCircle omc)
omc
- OMCircle that should be edited.Method Detail |
---|
public void init()
public void setGraphic(OMGraphic graphic)
setGraphic
in class EditableOMGraphic
graphic
- OMGraphic.public void createGraphic(GraphicAttributes ga)
createGraphic
in class EditableOMGraphic
ga
- GraphicAttributes, describing the graphic to be created.public boolean getCanGrabGraphic()
getCanGrabGraphic
in class EditableOMGraphic
public OMGraphic getGraphic()
getGraphic
in class EditableOMGraphic
public void attachToMovingGrabPoint(OffsetGrabPoint gp)
attachToMovingGrabPoint
in class EditableOMGraphic
public void detachFromMovingGrabPoint(OffsetGrabPoint gp)
detachFromMovingGrabPoint
in class EditableOMGraphic
public void setMovingPoint(GrabPoint gp)
setMovingPoint
in class EditableOMGraphic
public GrabPoint getMovingPoint(java.awt.event.MouseEvent e)
getMovingPoint
in class EditableOMGraphic
e
- MouseEvent
public void assertGrabPoints()
protected void clearGrabPoints()
public void setGrabPoints(OMGraphic graphic)
public void setGrabPoints()
setGrabPoints
in class EditableOMGraphic
protected void setRadius(double radius)
radius
- in DECIMAL_DEGREESpublic void move(java.awt.event.MouseEvent e)
move
in class EditableOMGraphic
public boolean generate(Projection proj)
generate
in class EditableOMGraphic
proj
- com.bbn.openmap.proj.Projection
public void regenerate(Projection proj)
regenerate
in class EditableOMGraphic
public void render(java.awt.Graphics graphics)
render
in class EditableOMGraphic
graphics
- java.awt.Graphics.public java.awt.Component getGUI(GraphicAttributes graphicAttributes)
getGUI
in class EditableOMGraphic
graphicAttributes
- the GraphicAttributes to use to get the GUI
widget from to control those parameters for this EOMG.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |