|
|||||||||||
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
The EditableOMGraphic is a shell that controls actions to edit or create a graphic. This class contains a state machine that defines how mouse events will be interpreted to modify the OMGraphic contained within. Any class that extends this one is responsible for assigning the appropriate state machine and OMGraphic to itself. Also, an EditableOMGraphic has a notion of a list of GrabPoints, which can be used as handles to the OMGraphic to provide controlled modifications.
Field Summary | |
protected int |
actionMask
Action mask for this graphic. |
protected boolean |
canGrabGraphic
Flag to let states know if the edges of the graphic can be grabbed directly, for movement or manipulation, as opposed to just allowing those actions through the grab points. |
protected boolean |
DEBUG
|
protected boolean |
DEBUG_DETAIL
|
protected GrabPoint[] |
gPoints
The array of GrabPoints. |
protected DrawingAttributes |
holder
A DrawingAttributes object used to hold OMGraphic settings while it is being moved. |
protected java.awt.event.MouseEvent |
lastMouseEvent
|
protected EOMGListenerSupport |
listeners
|
protected java.lang.String[] |
mouseModeServiceList
This is here for the MapMouseListener interface. |
protected GrabPoint |
movingPoint
This GrabPoint is one that has been grabbed by the mouse, and is being moved. |
protected Projection |
projection
The projection of the map. |
protected boolean |
showGUI
Flag to indicate whether a GUI for this EOMG should be presented to allow edits to it's attributes. |
protected EOMGStateMachine |
stateMachine
The state machine that interprets the mouse events (and other events) and modifies the OMGraphics accordingly. |
Constructor Summary | |
protected |
EditableOMGraphic()
|
Method Summary | |
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 |
addEOMGListener(EOMGListener l)
Add a EOMGListener. |
void |
attachToMovingGrabPoint(OffsetGrabPoint gp)
Attach to the Moving OffsetGrabPoint so if it moves, it will move this EditableOMGraphic with it. |
void |
cleanMap(java.awt.event.MouseEvent e)
Clean the surface all the painting is taking place over. |
abstract void |
createGraphic(GraphicAttributes ga)
Create the OMGraphic that is to be modified by the EditableOMGraphic. |
void |
detachFromMovingGrabPoint(OffsetGrabPoint gp)
Detach from a Moving OffsetGrabPoint. |
void |
finalize()
|
void |
fireEvent()
Create the event with no cursor change or message to be displayed. |
void |
fireEvent(java.awt.Cursor cursor,
java.lang.String message)
Create the event with a Cursor and/or message, and then fire it. |
void |
fireEvent(java.awt.Cursor cursor,
java.lang.String message,
java.awt.event.MouseEvent mouseEvent)
Create the event with the Cursor, message and/or MouseEvent. |
void |
fireEvent(EOMGEvent event)
The method to call if you want to let listeners know that the state has changed. |
abstract boolean |
generate(Projection proj)
Use the current projection to place the graphics on the screen. |
int |
getActionMask()
Get the OMAction mask for this graphic. |
boolean |
getCanGrabGraphic()
Get whether a graphic can be manipulated by its edges, rather than just by its grab points. |
GrabPoint |
getGrabPoint(int index)
Return a particular GrabPoint at a particular point in the array. |
GrabPoint[] |
getGrabPoints()
Get the array of grab points used for the EditableOMGraphic. |
abstract OMGraphic |
getGraphic()
Get the OMGraphic that is being created/modified by the EditableOMGraphic. |
java.awt.Component |
getGUI()
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. |
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. |
java.lang.String[] |
getMouseModeServiceList()
Get the list of MouseMode names that this EditableOMGraphic will respond to, if it is dealing directly with a MouseDelegator. |
GrabPoint |
getMovingPoint()
Get the GrabPoint that is being moved. |
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. |
Projection |
getProjection()
Get the current projection. |
boolean |
getShowGUI()
|
EOMGStateMachine |
getStateMachine()
Get the state machine for this EditableOMGraphic. |
void |
handleInitialMouseEvent(java.awt.event.MouseEvent e)
Notification that a MouseEvent was used to trigger creation or edit of this EditableOMGraphic, and this is the first MouseEvent received. |
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. |
boolean |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked on a component. |
boolean |
mouseDragged(java.awt.event.MouseEvent e)
Invoked when a mouse button is pressed on a component and then dragged. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component. |
void |
mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component. |
void |
mouseMoved()
Handle a mouse cursor moving without the button being pressed. |
boolean |
mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse button has been moved on a component (with no buttons down). |
boolean |
mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component. |
boolean |
mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component. |
abstract 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 |
redraw(java.awt.event.MouseEvent e)
Same as redraw(e, false) |
void |
redraw(java.awt.event.MouseEvent e,
boolean firmPaint)
|
void |
redraw(java.awt.event.MouseEvent e,
boolean firmPaint,
boolean drawXOR)
Given a MouseEvent, check the source, and if it's a MapBean, then grab the projection and java.awt.Graphics from it to use for generation and rendering of the EditableOMGraphic objects. |
abstract void |
regenerate(Projection proj)
Given a new projection, the grab points may need to be repositioned off the current position of the graphic. |
void |
removeEOMGListener(EOMGListener l)
Remove a EOMGListener. |
abstract void |
render(java.awt.Graphics g)
|
void |
repaint()
|
void |
repaintRender(java.awt.Graphics g)
|
void |
reset()
Remove all changes and put graphic as it was before modifications. |
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. |
void |
setActionMask(int mask)
Method to allow objects to set OMAction masks on this editable graphic. |
void |
setCanGrabGraphic(boolean set)
Set whether a graphic can be manipulated by its edges, rather than just by its grab points. |
boolean |
setGrabPoint(GrabPoint gb,
int index)
Set the GrabPoint at a particule index of the array. |
abstract void |
setGrabPoints()
Tells the EditableOMGraphic that the locations of the grab points have been modified, and that the parameters of the OMGraphic need to be modified accordingly. |
boolean |
setGrabPoints(GrabPoint[] points)
Set the grab point objects within the EditableOMGraphic array. |
abstract void |
setGraphic(OMGraphic graphic)
Set the OMGraphic that is being modified by the EditableOMGraphic. |
void |
setMouseModeServiceList(java.lang.String[] list)
Set the list of MouseMode names that this EditableOMGraphic will respond to, if it is dealing directly with a MouseDelegator. |
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. |
void |
setProjection(Projection proj)
Set the current projection. |
void |
setShowGUI(boolean set)
Set whether this EOMG should provide a user interface to have the attributes modified. |
void |
setStateMachine(EOMGStateMachine sm)
Set the StateMachine for this EditableOMGraphic. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected EOMGStateMachine stateMachine
StateMachine
protected java.lang.String[] mouseModeServiceList
protected GrabPoint[] gPoints
protected Projection projection
protected GrabPoint movingPoint
protected EOMGListenerSupport listeners
protected boolean showGUI
protected boolean canGrabGraphic
protected int actionMask
protected boolean DEBUG
protected boolean DEBUG_DETAIL
protected DrawingAttributes holder
protected java.awt.event.MouseEvent lastMouseEvent
Constructor Detail |
protected EditableOMGraphic()
Method Detail |
public void setStateMachine(EOMGStateMachine sm)
sm
- StateMachine.StateMachine
public EOMGStateMachine getStateMachine()
public void setMouseModeServiceList(java.lang.String[] list)
public java.lang.String[] getMouseModeServiceList()
getMouseModeServiceList
in interface MapMouseListener
getMouseModeServiceList
in class MapMouseAdapter
public void setShowGUI(boolean set)
set
- true if the GUI should be shown.public boolean getShowGUI()
public void setCanGrabGraphic(boolean set)
public boolean getCanGrabGraphic()
public abstract void setGraphic(OMGraphic graphic)
graphic
- OMGraphic.public abstract void createGraphic(GraphicAttributes ga)
ga
- GraphicAttributes, describing the graphic to be
created.public abstract OMGraphic getGraphic()
public void reset()
public boolean setGrabPoints(GrabPoint[] points)
points
- a GrabPoint[]
public void setActionMask(int mask)
public int getActionMask()
public abstract void setGrabPoints()
public GrabPoint[] getGrabPoints()
public boolean setGrabPoint(GrabPoint gb, int index)
gb
- GrabPoint to assign within array.index
- the index of the array to put the GrabPoint. The
EditableOMGraphic should be able to provide the
description of the proper placement indexes.
public GrabPoint getGrabPoint(int index)
public void attachToMovingGrabPoint(OffsetGrabPoint gp)
public void detachFromMovingGrabPoint(OffsetGrabPoint gp)
public void setMovingPoint(GrabPoint gp)
public GrabPoint getMovingPoint()
public void handleInitialMouseEvent(java.awt.event.MouseEvent e)
public GrabPoint getMovingPoint(java.awt.event.MouseEvent e)
e
- MouseEvent
public GrabPoint _getMovingPoint(java.awt.event.MouseEvent e)
e
- MouseEvent that the GrabPoint should attach to.getMovingPoint(MouseEvent)
public abstract void move(java.awt.event.MouseEvent e)
public void cleanMap(java.awt.event.MouseEvent e)
public void redraw(java.awt.event.MouseEvent e)
public void redraw(java.awt.event.MouseEvent e, boolean firmPaint)
public void redraw(java.awt.event.MouseEvent e, boolean firmPaint, boolean drawXOR)
e
- MouseEventfirmPaint
- true if the graphic is being rendered at rest,
with fill colors and true colors, with the grab point if
the state allows it. If false, then the fill color will
not be used, and just the graphic will be drawn. Use
false for graphics that are moving.protected void modifyOMGraphicForEditRender()
protected void resetOMGraphicAfterEditRender()
public void repaint()
public void finalize()
public abstract boolean generate(Projection proj)
proj
- com.bbn.openmap.proj.Projection
public abstract void regenerate(Projection proj)
public void repaintRender(java.awt.Graphics g)
public abstract void render(java.awt.Graphics g)
public void setProjection(Projection proj)
public Projection getProjection()
public boolean mousePressed(java.awt.event.MouseEvent e)
MapMouseAdapter
mousePressed
in interface MapMouseListener
mousePressed
in class MapMouseAdapter
e
- MouseEvent
public boolean mouseReleased(java.awt.event.MouseEvent e)
MapMouseAdapter
mouseReleased
in interface MapMouseListener
mouseReleased
in class MapMouseAdapter
e
- MouseEvent
public boolean mouseClicked(java.awt.event.MouseEvent e)
MapMouseAdapter
mouseClicked
in interface MapMouseListener
mouseClicked
in class MapMouseAdapter
e
- MouseEvent
public void mouseEntered(java.awt.event.MouseEvent e)
MapMouseAdapter
mouseEntered
in interface MapMouseListener
mouseEntered
in class MapMouseAdapter
e
- MouseEventpublic void mouseExited(java.awt.event.MouseEvent e)
MapMouseAdapter
mouseExited
in interface MapMouseListener
mouseExited
in class MapMouseAdapter
e
- MouseEventpublic boolean mouseDragged(java.awt.event.MouseEvent e)
MapMouseAdapter
mouseDragged
in interface MapMouseListener
mouseDragged
in class MapMouseAdapter
e
- MouseEvent
public boolean mouseMoved(java.awt.event.MouseEvent e)
MapMouseAdapter
mouseMoved
in interface MapMouseListener
mouseMoved
in class MapMouseAdapter
e
- MouseEvent
public void mouseMoved()
MapMouseAdapter
mouseMoved
in interface MapMouseListener
mouseMoved
in class MapMouseAdapter
public void addEOMGListener(EOMGListener l)
l
- EOMGListenerpublic void removeEOMGListener(EOMGListener l)
l
- EOMGListenerpublic void fireEvent(EOMGEvent event)
public void fireEvent(java.awt.Cursor cursor, java.lang.String message)
cursor
- Cursor to be used.message
- an instruction/error to be displayed to the
user.public void fireEvent(java.awt.Cursor cursor, java.lang.String message, java.awt.event.MouseEvent mouseEvent)
cursor
- Cursor to be used.message
- an instruction/error to be displayed to the
user.mouseEvent
- where that caused the EOMGEvent. May be null.public void fireEvent()
public java.awt.Component getGUI()
public java.awt.Component getGUI(GraphicAttributes graphicAttributes)
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 |