public class EditableOMText extends EditableOMGraphic implements java.awt.event.ActionListener
EditableOMGraphic.OMGraphicUndoEvent
Modifier and Type | Field and Description |
---|---|
static int |
CENTER_POINT_INDEX |
protected GrabPoint |
gpc |
protected OffsetGrabPoint |
gpo |
protected int |
lastRenderType |
static int |
OFFSET_POINT_INDEX |
protected OMText |
text |
static java.lang.String |
TextFieldCommand
Command for text string adjustments.
|
static java.lang.String |
TextFontCommand |
static java.lang.String |
TextRotationCommand |
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 |
---|
EditableOMText()
Create the EditableOMText, setting the state machine to create the point
off of the gestures.
|
EditableOMText(GraphicAttributes ga)
Create an EditableOMText with the pointType and renderType parameters in
the GraphicAttributes object.
|
EditableOMText(OMText omc)
Create the EditableOMText with an OMText already defined, ready for
editing.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
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 EditableOMText.
|
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.
|
protected javax.swing.JComponent |
getTextGUI() |
protected javax.swing.JComponent |
getTextGUI(int orientation,
javax.swing.JComponent guiComp)
Get the GUI associated with changing the Text.
|
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 EditableOMtext parts into the java.awt.Graphics object.
|
void |
setGrabPoints()
Take the current location of the GrabPoints, and modify the location
parameters of the OMPoint 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.
|
_getMovingPoint, addEOMGListener, cleanMap, createAttributePanel, createUndoEventForCurrentState, finalize, fireEvent, fireEvent, fireEvent, fireEvent, getActionMask, getGrabPoint, getGrabPoints, 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, setProjection, setShowGUI, setStateMachine, setUndoStack, setXorRendering, updateCurrentState
protected GrabPoint gpc
protected OffsetGrabPoint gpo
protected OMText text
public static final int CENTER_POINT_INDEX
public static final int OFFSET_POINT_INDEX
protected int lastRenderType
public static final java.lang.String TextFieldCommand
public static final java.lang.String TextFontCommand
public static final java.lang.String TextRotationCommand
public EditableOMText()
public EditableOMText(GraphicAttributes ga)
public EditableOMText(OMText omc)
omc
- OMText that should be edited.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 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 GrabPoint getMovingPoint(java.awt.event.MouseEvent e)
getMovingPoint
in class EditableOMGraphic
e
- MouseEventpublic void assertGrabPoints()
protected void clearGrabPoints()
public void setGrabPoints(OMGraphic graphic)
public void setGrabPoints()
setGrabPoints
in class EditableOMGraphic
public boolean getCanGrabGraphic()
getCanGrabGraphic
in class EditableOMGraphic
public 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.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.protected javax.swing.JComponent getTextGUI()
protected javax.swing.JComponent getTextGUI(int orientation, javax.swing.JComponent guiComp)
orientation
- SwingConstants.HORIZONTAL/VERTICALguiComp
- 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.public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details