public class EditableOMGraphicList extends EditableOMGraphic
EditableOMGraphic.OMGraphicUndoEvent
Modifier and Type | Field and Description |
---|---|
protected java.util.List<EditableOMGraphic> |
editables
The list of editables wrapping the list contents.
|
protected OffsetGrabPoint |
gpm
For grabbing the list objects and moving them.
|
protected OMGraphicList |
list
The list of OMGraphics being selected and moved.
|
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 and Description |
---|
EditableOMGraphicList()
Create an empty EditableOMGraphicList, ready to have OMGraphics
added to it.
|
EditableOMGraphicList(OMGraphicList oml)
Create the EditableOMGraphicList with an OMGraphicList already
defined, ready for editing.
|
Modifier and Type | Method and Description |
---|---|
void |
add(EditableOMGraphic editable)
Add the EditableOMGraphic to the list.
|
void |
add(OMGraphicList list,
OMDrawingTool drawingTool) |
EditableOMGraphic |
add(OMGraphic omg,
OMDrawingTool drawingTool)
Create an EditableOMGraphic and add it to the list.
|
void |
clear()
Remove all EditableOMGraphics and clear out.
|
void |
createGraphic(GraphicAttributes ga)
Create and set the graphic within the state machine.
|
boolean |
generate(Projection proj)
Use the current projection to place the graphics on the screen.
|
java.util.List<EditableOMGraphic> |
getEditables() |
GrabPoint[] |
getGrabPoints()
Get the array of grab points used for the EditableOMGraphic.
|
OMGraphic |
getGraphic()
Get the OMGraphic being created/modified by the
EditableOMGraphicList.
|
GrabPoint |
getMovingPoint(java.awt.event.MouseEvent me)
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 |
init(OMDrawingTool drawingTool)
Must be called on a EditableOMGraphicList that is created from
an OMGraphicList containing OMGraphics.
|
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.
|
boolean |
remove(EditableOMGraphic editable)
Remove the EditableOMGraphic from the list.
|
void |
remove(OMGraphic omg)
Remove an OMGraphic from being moved.
|
void |
render(java.awt.Graphics graphics)
Draw the EditableOMGraphicList parts into the java.awt.Graphics
object.
|
void |
setGrabPoints()
Take the current location of the GrabPoints, and modify the
location parameters of the OMLine with them.
|
void |
setGraphic(OMGraphic graphic)
Set the graphic within the state machine.
|
void |
setProjection(Projection proj)
Set the current projection.
|
_getMovingPoint, addEOMGListener, attachToMovingGrabPoint, cleanMap, createAttributePanel, createUndoEventForCurrentState, detachFromMovingGrabPoint, finalize, fireEvent, fireEvent, fireEvent, fireEvent, getActionMask, getCanGrabGraphic, getGrabPoint, getGUI, getGUI, getMouseModeServiceList, getMovingPoint, getProjection, getProjectionPoint, getShowGUI, getStateMachine, getUndoStack, handleInitialMouseEvent, isMouseEventTouching, isMouseEventTouchingTheEdge, isPopupIsUp, isXorRendering, modifyOMGraphicForEditRender, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseMoved, mousePressed, mouseReleased, redraw, redraw, redraw, removeEOMGListener, repaint, repaintRender, reset, resetOMGraphicAfterEditRender, setActionMask, setCanGrabGraphic, setGrabPoint, setGrabPoints, setMouseModeServiceList, setMovingPoint, setPopupIsUp, setShowGUI, setStateMachine, setUndoStack, setXorRendering, updateCurrentState
protected OffsetGrabPoint gpm
protected OMGraphicList list
protected java.util.List<EditableOMGraphic> editables
public EditableOMGraphicList()
public EditableOMGraphicList(OMGraphicList oml)
oml
- OMGraphicList that should be handled.public java.util.List<EditableOMGraphic> getEditables()
public void init()
public void init(OMDrawingTool drawingTool)
drawingTool
- OMDrawingTool used to create
EditableOMGraphics for other OMGraphics on the list,
which will in turn be managed by this
EditableOMGraphicList. If this is null, nothing will get
done. If this drawing tool doesn't know how to create an
EditableOMGraphic for anything on the list, those things
will not be managed.public GrabPoint[] getGrabPoints()
EditableOMGraphic
getGrabPoints
in class EditableOMGraphic
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 OMGraphic getGraphic()
getGraphic
in class EditableOMGraphic
public void add(OMGraphicList list, OMDrawingTool drawingTool)
public EditableOMGraphic add(OMGraphic omg, OMDrawingTool drawingTool)
omg
- OMGraphic to add.drawingTool
- to use to figure out what EditableOMGraphic
to use for the OMGraphic.public void add(EditableOMGraphic editable)
public void remove(OMGraphic omg)
public boolean remove(EditableOMGraphic editable)
public void clear()
public void setProjection(Projection proj)
setProjection
in class EditableOMGraphic
public void setGrabPoints()
setGrabPoints
in class EditableOMGraphic
public GrabPoint getMovingPoint(java.awt.event.MouseEvent me)
EditableOMGraphic
getMovingPoint
in class EditableOMGraphic
me
- MouseEventpublic 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.Projectionpublic void regenerate(Projection proj)
regenerate
in class EditableOMGraphic
public void render(java.awt.Graphics graphics)
render
in class EditableOMGraphic
graphics
- java.awt.Graphics.Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details