TLcdGXYEditController2
instead. The
functionality of this class will remain present as is.public class TLcdGXYEditController extends TLcdGXYSelectController implements MouseListener, MouseMotionListener, KeyListener, ILcdUndoableSource
TLcdGXYEditController
is an extension of
TLcdGXYSelectController
that can be used for selecting Objects in
an ILcdGXYView
and editing one or more selected Object
(s) with
the mouse (sequence of mousePressed, mouseDragged and mouseReleased).
The
editing with the mouse of an Object
on the ILcdGXYView
is
delegated to one ILcdGXYEditor
. This ILcdGXYEditor
is returned by the ILcdGXYLayer
the Object
belongs to.
The actual edit operation is only called on mouseReleased.
While the edit process is ongoing (e.g., the user is performing a drag), the
objects are not edited all the time, they are just painted in their temporary
state.
Furthermore this controller is an ILcdUndoableSource
. When editing objects using
their corresponding ILcdGXYEditor
s, all the undoables generated by the editors are
collected and combined in a single ILcdUndoable
. The listeners that have registered
themselves using the ALcdGXYSmartController.addUndoableListener(com.luciad.gui.ILcdUndoableListener)
will then
be notified of this single ILcdUndoable
. For this controller to be able to collect
the undoables generated by the editors, these editors need to implement
ILcdUndoableSource
.
TLcdGXYEditController2
,
Serialized FormfAWTWorkBounds, fLastSelectionClip, fSelection, fWorkContext, fXYWorkBounds
fXPressed, fXReleased, fYPressed, fYReleased
Constructor and Description |
---|
TLcdGXYEditController()
Deprecated.
Constructs a TLcdGXYEditController object.
|
TLcdGXYEditController(boolean aRegisterInstance)
Deprecated.
use the constructor without parameters.
|
Modifier and Type | Method and Description |
---|---|
protected TLcdCompositeUndoable |
createCompositeUndoable()
Deprecated.
Creates the composite undoable that will wrap all undoables generated by the used
ILcdGXYEditors . |
protected TLcdCompositeUndoable |
createSingleObjectUndoable(Object aDomainObject,
ILcdGXYLayer aGXYLayer)
Deprecated.
Creates the composite undoable that will wrap all the undoables generated by a single
ILcdGXYEditor for a single domain object. |
protected void |
doPanGXYView(int aDeltaX,
int aDeltaY)
Deprecated.
Performs the pan of this
ILcdGXYController
ILcdGXYView |
protected void |
doZoomGXYView(double aDoubleFactor)
Deprecated.
Performs the zoom of this
ILcdGXYController
ILcdGXYView |
int |
editorModeOnMouseEvent(MouseEvent aMouseEvent)
Deprecated.
Returns editor mode to use for a specific mouse event.
|
int |
getEditingBoundsForRepaintMargin()
Deprecated.
Returns the margin to extend the dirty region when repainting only part of the view.
|
ILcdGXYLayerSubsetList |
getSnappables()
Deprecated.
Returns the Objects to snap to when editing Objects:
null is a valid returned value. |
boolean |
isInvalidateAllGXYLayersOnEdit()
Deprecated.
Returns if all gxy layers will be invalidated or only the ones that
have been edited.
|
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
boolean |
isUseEditingBoundsForRepaint()
Deprecated.
Returns whether the edit controller repaints only part of the ILcdGXYView
while editing.
|
void |
mouseDragged(MouseEvent me)
Deprecated.
|
void |
mouseMoved(MouseEvent me)
Deprecated.
No operation
|
void |
mousePressed(MouseEvent me)
Deprecated.
This implementation calls super.mousePressed(), caches the mouse event (for future use in other mouseXXX methods)
and sets the cursor.
|
void |
mouseReleased(MouseEvent me)
Deprecated.
Implements mouseReleased.
|
void |
paint(Graphics aGraphics)
Deprecated.
Draws a rectangle on the given graphics if
ALcdGXYSmartController.isDragging() returns true and
if the rectangle is larger as TLcdGXYDragRectangleController.getMouseDraggedSensitivity() . |
int |
painterModeOnMouseEvent(MouseEvent aMouseEvent)
Deprecated.
Returns the painter mode to use for a specific mouse event.
|
protected void |
paintMovedSelection(Graphics aGraphics,
int aGXYPainterMode,
MouseEvent aMouseEvent,
int aDeltaX,
int aDeltaY)
Deprecated.
Paints the selection being edited on a mouseDragged.
|
protected boolean |
retrieveSnaptargetSFCT(Object aObjectToSnap,
ILcdGXYLayer aObjectToSnapGXYLayer,
MouseEvent aMouseEvent,
ILcdAssoc aAssoc,
int aDeltaX,
int aDeltaY)
Deprecated.
Tries to retrieve a snap target and puts it in the given assoc.
|
void |
setCursor(Cursor aCursor)
Deprecated.
|
void |
setEditingBoundsForRepaintMargin(int aEditingBoundsForRepaintMargin)
Deprecated.
Sets the margin to extend the dirty region when repainting only part of the view.
|
protected void |
setGXYViewCursorFromTouchedGXYPainter(MouseEvent aMouseEvent)
Deprecated.
Changes the
ILcdGXYView Cursor when moving the mouse on top
of selected Objects using the ILcdGXYPainter.getCursor method. |
void |
setInvalidateAllGXYLayersOnEdit(boolean aInvalidateAllGXYLayersOnEdit)
Deprecated.
Sets the value of the property
invalidateAllGXYLayersOnEdit . |
void |
setSnappables(ILcdGXYLayerSubsetList aNewSnappables)
Deprecated.
Sets the Objects to snap to when editing Objects:
null is a valid argument. |
void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setUseEditingBoundsForRepaint(boolean aUseEditingBoundsForRepaint)
Deprecated.
Sets whether the edit controller should repaint only part of the ILcdGXYView
while editing.
|
addInSelection, deselectAll, fireAllLayerCollectedSelectionChanges, getActionOnDoubleClick, getActionOnRightMouseButtonPressed, getGXYSelectControllerModel, getLastMousePressedEvent, getLastMouseReleasedEvent, getMousePressedSensitivity, getPreviousSelectionClip, getSelectionClip, getSelectionCount, getSensitivity, isActionOnRightMouseButtonPerformed, isInvertSelectionOnAlternateModeDrag, isSelectInBoundsAllowed, isStrictInteraction, lastSelected, processRightMouseButtonPressed, removeFromSelection, selectAt, selectInBounds, selection, selectOnLayer, setActionOnDoubleClick, setActionOnRightMouseButtonPressed, setGXYSelectControllerModel, setInvertSelectionOnAlternateModeDrag, setMousePressedSensitivity, setSelectInBoundsAllowed, setSensitivity, setStrictInteraction, startInteraction, terminateInteraction, undo
adaptRectangle, drawGhost, getCurrentRectangle, getGhostColor, getGhostLineWidth, getHaloColor, getHaloThickness, getMouseDraggedSensitivity, getXORModelColor, isDragCentered, isForceToSquare, isHaloEnabled, isRepaintOnReleased, isXORMode, lastXPressed, lastXReleased, lastYPressed, lastYReleased, setDragCentered, setForceToSquare, setGhostColor, setGhostLineWidth, setHaloColor, setHaloEnabled, setHaloThickness, setMouseDraggedSensitivity, setRepaintOnReleased, setXORMode, setXORModeColor, trigger
addUndoableListener, fireUndoableEvent, getDownPanChars, getDownPanCodes, getLeftPanChars, getLeftPanCodes, getPanAbsDelta, getPanAbsDelta, getRightPanChars, getRightPanCodes, getUndoableListenerCount, getUpPanChars, getUpPanCodes, getZoomInChars, getZoomInCodes, getZoomOutChars, getZoomOutCodes, isDragging, isPanOnMouseDragExit, isPanOnMouseMoveExit, isPanUndoable, isRequestFocusOnMouseEntered, isRequestFocusOnMousePressed, isZoomUndoable, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, removeUndoableListener, setDownPanChars, setDownPanCodes, setIsDragging, setLeftPanChars, setLeftPanCodes, setPanAbsDelta, setPanOnMouseDragExit, setPanOnMouseMoveExit, setPanUndoable, setRequestFocusOnMouseEntered, setRequestFocusOnMousePressed, setRightPanChars, setRightPanCodes, setUpPanChars, setUpPanCodes, setZoomInChars, setZoomInCodes, setZoomOutChars, setZoomOutCodes, setZoomUndoable, updateViewLocationAfterZoomSFCT
addStatusListener, asGXYController, fireStatusEvent, getCursor, getGXYView, getIcon, getName, getShortDescription, registerInstance, removeStatusListener, retrieveGXYViewXYWorldTransformation, setClassTraceOn, setGXYView, setIcon, setName, setShortDescription, viewRepaint
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
mouseClicked, mouseEntered, mouseExited
keyPressed, keyReleased, keyTyped
addUndoableListener, removeUndoableListener
getLayered
public TLcdGXYEditController()
public TLcdGXYEditController(boolean aRegisterInstance)
public void setTraceOn(boolean aTraceOn)
true
or false
as argument automatically turns
off tracing for all other class instances for which
setTraceOn
has not been called.
If the argument is false
then only the informative, warning
and error log messages are recorded.setTraceOn
in class TLcdGXYSelectController
aTraceOn
- if true then all log messages are recorded for this
instance. If false, then only the informative, warning and
error log messages are recorded.public boolean isTraceOn()
true
if tracing is enabled for this class.isTraceOn
in class TLcdGXYSelectController
public int painterModeOnMouseEvent(MouseEvent aMouseEvent)
ILcdGXYPainter
while editing the object.
If aMouseEvent.isControlDown()(isMetaDown() on Mac OS)
, it
returns ( ILcdGXYPainter.RESHAPING
| ILcdGXYPainter.BODY
|
ILcdGXYPainter.HANDLES
| ILcdGXYPainter.SELECTED
),
else it returns
( ILcdGXYPainter.TRANSLATING
| ILcdGXYPainter.BODY
| ILcdGXYPainter.HANDLES
| ILcdGXYPainter.SELECTED
).aMouseEvent
- the current mouse event.ILcdGXYPainter.paint
method
depending on the MouseEvent
received.public int editorModeOnMouseEvent(MouseEvent aMouseEvent)
ILcdGXYEditor
to edit the object.
It returns ILcdGXYEditor.RESHAPED
if
aMouseEvent.isControlDown() (isMetaDown() in Mac OS)
and not
aMouseEvent.isAltDown()
and not
aMouseEvent.isShiftDown()
,
, ILcdGXYEditor.TRANSLATED
otherwise.aMouseEvent
- the mouse event on release of the mouse.ILcdGXYEditor.paint
method
depending on the MouseEvent
received.public void mouseMoved(MouseEvent me)
TLcdGXYDragRectangleController
mouseMoved
in interface MouseMotionListener
mouseMoved
in class TLcdGXYDragRectangleController
protected void doPanGXYView(int aDeltaX, int aDeltaY)
ALcdGXYSmartController
ILcdGXYController
ILcdGXYView
doPanGXYView
in class TLcdGXYDragRectangleController
aDeltaX
- delta along the X axis, in AWT pixelsaDeltaY
- delta along the Y axis, in AWT pixelsprotected void doZoomGXYView(double aDoubleFactor)
ALcdGXYSmartController
ILcdGXYController
ILcdGXYView
doZoomGXYView
in class TLcdGXYDragRectangleController
aDoubleFactor
- zoom factor with which to multiply the view's scalepublic void mousePressed(MouseEvent me)
mousePressed
in interface MouseListener
mousePressed
in class TLcdGXYSelectController
me
- the current mouse event.protected void setGXYViewCursorFromTouchedGXYPainter(MouseEvent aMouseEvent)
ILcdGXYView
Cursor
when moving the mouse on top
of selected Objects using the ILcdGXYPainter.getCursor
method.
This method is called from mouseMoved, mousePressed and mouseDragged.aMouseEvent
- the mouse event on the method mouseMoved.public void setCursor(Cursor aCursor)
setCursor
in class ALcdGXYController
aCursor
- the Cursor
to use when a user interacts with this
ILcdGXYController
on a ILcdGXYView
.public void paint(Graphics aGraphics)
TLcdGXYDragRectangleController
ALcdGXYSmartController.isDragging()
returns true and
if the rectangle is larger as TLcdGXYDragRectangleController.getMouseDraggedSensitivity()
.paint
in interface ILcdGXYController
paint
in class TLcdGXYDragRectangleController
aGraphics
- The graphics to draw on.public void mouseDragged(MouseEvent me)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class TLcdGXYSelectController
protected void paintMovedSelection(Graphics aGraphics, int aGXYPainterMode, MouseEvent aMouseEvent, int aDeltaX, int aDeltaY)
aGraphics
- the Graphics on which to paint the 'edited' selection.aGXYPainterMode
- the painter mode to pass to the ILcdGXYPainter objects.aMouseEvent
- the last mouse event (drag) for which this method is invoked.aDeltaX
- the delta x of the current mouse event to the last mouse pressed event.aDeltaY
- the delta y of the current mouse event to the last mouse pressed event.public void mouseReleased(MouseEvent me)
TLcdGXYSelectController
mouseReleased
in interface MouseListener
mouseReleased
in class TLcdGXYSelectController
protected TLcdCompositeUndoable createSingleObjectUndoable(Object aDomainObject, ILcdGXYLayer aGXYLayer)
Creates the composite undoable that will wrap all the undoables generated by a single
ILcdGXYEditor
for a single domain object. This method is called from the
applyEdit
method.
The default implementation returns a TLcdCompositeUndoable
that selects
the given domain object in the given layer on undo and redo. Its display name is
"Edit " + String.valueOf(aDomainObject)
.
aDomainObject
- The domain object from the model which is being edited.aGXYLayer
- The layer of the domain object which is being edited.null
.protected TLcdCompositeUndoable createCompositeUndoable()
Creates the composite undoable that will wrap all undoables generated by the used
ILcdGXYEditors
.
This default implementation returns a TLcdCompositeUndoable that clears the selection of the view on undo and redo. Its display name is "Edit Objects". Override this method if you want to disable this selection behaviour or want another name.
null
.protected boolean retrieveSnaptargetSFCT(Object aObjectToSnap, ILcdGXYLayer aObjectToSnapGXYLayer, MouseEvent aMouseEvent, ILcdAssoc aAssoc, int aDeltaX, int aDeltaY)
getSnappables()
) in
all layers of the current view (ALcdGXYController.getGXYView()
)aObjectToSnap
- the object that is being editedaObjectToSnapGXYLayer
- the layer whose model contains the edited objectaMouseEvent
- the mouse event triggering the editaAssoc
- the assoc to put the snap target in. The key is the layer that contains the snap
target and the value is the snap target itself.aDeltaX
- the number of pixels the mouse has moved in the X direction since it was pressed.aDeltaY
- the number of pixels the mouse has moved in the Y direction since it was pressed.getSnappables()
,
ALcdGXYController.getGXYView()
public void setSnappables(ILcdGXYLayerSubsetList aNewSnappables)
null
is a valid argument.aNewSnappables
- the new list of snappable objects.getSnappables()
public ILcdGXYLayerSubsetList getSnappables()
null
is a valid returned value.null
is a valid returned value.setSnappables(com.luciad.view.gxy.ILcdGXYLayerSubsetList)
public void setInvalidateAllGXYLayersOnEdit(boolean aInvalidateAllGXYLayersOnEdit)
invalidateAllGXYLayersOnEdit
.
The default is false
.
If true
, this ILcdGXYController
will invalidate
and repaint all the ILcdGXYLayer
, even if changes have occurred
on only one.
If false
, it will call ILcdGXYView.invalidateGXYLayer for each
ILcdGXYLayer
which has been edited.aInvalidateAllGXYLayersOnEdit
- the new invalidateAllGXYLayersOnEdit
property value.ILcdGXYView.invalidateGXYLayer(com.luciad.view.gxy.ILcdGXYLayer, boolean, java.lang.Object, java.lang.String)
,
isInvalidateAllGXYLayersOnEdit()
public boolean isInvalidateAllGXYLayersOnEdit()
setInvalidateAllGXYLayersOnEdit(boolean)
public boolean isUseEditingBoundsForRepaint()
setUseEditingBoundsForRepaint(boolean)
public void setUseEditingBoundsForRepaint(boolean aUseEditingBoundsForRepaint)
false
.
ILcdGXYPainter
implementations of
the selection should properly implements the method ILcdGXYPainter.boundsSFCT
, i.c.,
they should take the modes ILcdGXYPainter.CREATING
, ILcdGXYPainter.TRANSLATING
,
and ILcdGXYPainter.RESHAPING
into account.aUseEditingBoundsForRepaint
- the new useClip value.isUseEditingBoundsForRepaint()
public int getEditingBoundsForRepaintMargin()
useEditingBoundsForRepaint
is true.
It is expressed in screen pixels.setEditingBoundsForRepaintMargin(int)
,
isUseEditingBoundsForRepaint()
public void setEditingBoundsForRepaintMargin(int aEditingBoundsForRepaintMargin)
useEditingBoundsForRepaint
is true.
It is expressed in screen pixels.aEditingBoundsForRepaintMargin
- the new editingBoundsForRepaintMargin
value (screen pixels).getEditingBoundsForRepaintMargin()
,
isUseEditingBoundsForRepaint()