TLcdGXYNewController2
.
The functionality of this class will remain present as is.public class TLcdGXYNewController extends ALcdGXYSmartController implements MouseListener, MouseMotionListener
ILcdGXYLayer
,
Object
in the chosen ILcdGXYLayer
Before this controller can be used on a view, the controller model has to be set.
Please refer to ALcdGXYNewControllerModel
for undo/redo support.
Constructor and Description |
---|
TLcdGXYNewController()
Deprecated.
Constructs a controller to create and initialize new objects via mouse interaction.
|
TLcdGXYNewController(boolean aRegisterInstance)
Deprecated.
use the constructor without parameters.
|
TLcdGXYNewController(ILcdGXYNewControllerModel aControllerModel)
Deprecated.
Constructs a controller to create and initialize new objects via mouse interaction.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
Deprecated.
|
void |
cancelEdit(MouseEvent aMouseEvent)
Deprecated.
Cancels the creation of the 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 |
void |
finishEdit(MouseEvent aMouseEvent)
Deprecated.
Finishes creation of the object.
|
ILcdAction |
getActionToTriggerAfterCreation()
Deprecated.
Returns the
ILcdAction that will be will be triggered just after this
ILcdGXYController has created a new Object ,
initialized it and added it to an ILcdModel . |
ILcdGXYNewControllerModel |
getControllerModel()
Deprecated.
Returns the
ILcdGXYNewControllerModel this
TLcdGXYNewController delegates to. |
int |
getEditingBoundsForRepaintMargin()
Deprecated.
Returns the margin to extend the dirty region when repainting only part of the view.
|
protected Object |
getObject()
Deprecated.
Returns the object that the NewController is creating.
|
int |
getRedoLeft()
Deprecated.
Use
ALcdGXYNewControllerModel.addUndoableListener(com.luciad.gui.ILcdUndoableListener)
for undo/redo support. |
ILcdGXYLayerSubsetList |
getSnappables()
Deprecated.
Returns the Objects to snap to when initializing a new created Object:
null
is a valid returned value. |
int |
getUndoLeft()
Deprecated.
Use
ALcdGXYNewControllerModel.addUndoableListener(com.luciad.gui.ILcdUndoableListener)
for undo/redo support. |
protected boolean |
isContinueEdit(int aPointCount,
MouseEvent aMouseEvent)
Deprecated.
Returns
true if creation is not yet finished, false otherwise. |
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 new controller repaints only part of the ILcdGXYView
while creating.
|
void |
mouseDragged(MouseEvent aMouseEvent)
Deprecated.
|
void |
mouseExited(MouseEvent me)
Deprecated.
Only pans the view when an object is actively being created.
|
void |
mouseMoved(MouseEvent aMouseEvent)
Deprecated.
|
protected void |
mouseMovedOrDragged(MouseEvent aMouseEvent)
Deprecated.
Handles what should be done to visualize the creation of the object.
|
void |
mouseReleased(MouseEvent aMouseEvent)
Deprecated.
|
void |
paint(Graphics aGraphics)
Deprecated.
Enables the controller to give visual feedback on the current user interactions.
|
void |
redo()
Deprecated.
Use
ALcdGXYNewControllerModel.addUndoableListener(com.luciad.gui.ILcdUndoableListener)
for undo/redo support. |
void |
removePropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
Deprecated.
|
void |
resetUndoHistory()
Deprecated.
Use
ALcdGXYNewControllerModel.addUndoableListener(com.luciad.gui.ILcdUndoableListener)
for undo/redo support. |
void |
setActionToTriggerAfterCreation(ILcdAction aNewActionToTriggerAfterCreation)
Deprecated.
Sets the
ILcdAction that will be triggered just after this
ILcdGXYController has created a new Object and
added it to an ILcdModel . |
void |
setControllerModel(ILcdGXYNewControllerModel aControllerModel)
Deprecated.
Sets the
ILcdGXYNewControllerModel to delegate to. |
void |
setEditingBoundsForRepaintMargin(int aEditingBoundsForRepaintMargin)
Deprecated.
Sets the margin to extend the dirty region when repainting only part of the view.
|
void |
setSnappables(ILcdGXYLayerSubsetList aNewSnappables)
Deprecated.
Sets the Objects to snap to when initializing a new created Object:
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 new controller should repaint only part of the ILcdGXYView
while creating.
|
void |
startInteraction(ILcdGXYView aGXYView)
Deprecated.
Sets up the controller to receive input through the view passed.
|
void |
terminateInteraction(ILcdGXYView aGXYView)
Deprecated.
Releases a few items.
|
void |
undo()
Deprecated.
Use
ALcdGXYNewControllerModel.addUndoableListener(com.luciad.gui.ILcdUndoableListener)
for undo/redo support. |
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, mousePressed, 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, setCursor, setGXYView, setIcon, setName, setShortDescription, viewRepaint
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
mouseClicked, mouseEntered, mousePressed
getLayered
public TLcdGXYNewController()
public TLcdGXYNewController(ILcdGXYNewControllerModel aControllerModel)
aControllerModel
- the model that defines what type of object will be created and how and where it will be
displayed in the view.public TLcdGXYNewController(boolean aRegisterInstance)
aRegisterInstance
- whether to register this controller as a Bean.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 ALcdGXYSmartController
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 ALcdGXYSmartController
public void startInteraction(ILcdGXYView aGXYView)
ALcdGXYController
All ILcdGXYView
implementations that support interaction call this method when the controller
has been made active with setGXYController
on the view,
so this method shouldn't normally be called directly.
Note that most view implementations add the controller as listener if appropriate before calling
this method.
Sets the cursor on the view and sets the view for which this controller is now active.
Sends out a status event based on the short description
.
startInteraction
in interface ILcdGXYController
startInteraction
in class ALcdGXYSmartController
aGXYView
- the ILcdGXYView
this ILcdGXYController
will interact with.ILcdGXYView.setGXYController(com.luciad.view.gxy.ILcdGXYController)
,
ILcdGXYController.terminateInteraction(com.luciad.view.gxy.ILcdGXYView)
public void terminateInteraction(ILcdGXYView aGXYView)
ALcdGXYController
terminateInteraction
in interface ILcdGXYController
terminateInteraction
in class ALcdGXYSmartController
aGXYView
- the ILcdGXYView
this ILcdGXYController
interacted with.ILcdGXYView.setGXYController(com.luciad.view.gxy.ILcdGXYController)
,
ILcdGXYController.startInteraction(com.luciad.view.gxy.ILcdGXYView)
protected boolean isContinueEdit(int aPointCount, MouseEvent aMouseEvent)
true
if creation is not yet finished, false
otherwise.aPointCount
- the number of points created until nowaMouseEvent
- the current mouse eventILcdGXYEditor.getCreationClickCount()
,
getControllerModel()
protected void doPanGXYView(int aDeltaX, int aDeltaY)
ALcdGXYSmartController
ILcdGXYController
ILcdGXYView
doPanGXYView
in class ALcdGXYSmartController
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 ALcdGXYSmartController
aDoubleFactor
- zoom factor with which to multiply the view's scalepublic void mouseDragged(MouseEvent aMouseEvent)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class ALcdGXYSmartController
public void mouseMoved(MouseEvent aMouseEvent)
mouseMoved
in interface MouseMotionListener
mouseMoved
in class ALcdGXYSmartController
protected void mouseMovedOrDragged(MouseEvent aMouseEvent)
aMouseEvent
- the current mouse event.public void paint(Graphics aGraphics)
ALcdGXYController
Empty implementation. Redefine this method to render on the Graphics on which the view is rendered.
paint
in interface ILcdGXYController
paint
in class ALcdGXYController
aGraphics
- the Graphics on which the view was rendered.public void finishEdit(MouseEvent aMouseEvent)
aMouseEvent
- the last mouse event.public void cancelEdit(MouseEvent aMouseEvent)
aMouseEvent
- the current mouse event.public void mouseReleased(MouseEvent aMouseEvent)
mouseReleased
in interface MouseListener
mouseReleased
in class ALcdGXYSmartController
public void setControllerModel(ILcdGXYNewControllerModel aControllerModel)
ILcdGXYNewControllerModel
to delegate to.aControllerModel
- the ILcdGXYNewControllerModel
to delegate to.getControllerModel()
public ILcdGXYNewControllerModel getControllerModel()
ILcdGXYNewControllerModel
this
TLcdGXYNewController
delegates to.ILcdGXYNewControllerModel
this
TLcdGXYNewController
delegates to.setControllerModel(com.luciad.view.gxy.controller.ILcdGXYNewControllerModel)
public int getUndoLeft()
ALcdGXYNewControllerModel.addUndoableListener(com.luciad.gui.ILcdUndoableListener)
for undo/redo support.public int getRedoLeft()
ALcdGXYNewControllerModel.addUndoableListener(com.luciad.gui.ILcdUndoableListener)
for undo/redo support.public void resetUndoHistory()
ALcdGXYNewControllerModel.addUndoableListener(com.luciad.gui.ILcdUndoableListener)
for undo/redo support.public void undo()
ALcdGXYNewControllerModel.addUndoableListener(com.luciad.gui.ILcdUndoableListener)
for undo/redo support.public void redo()
ALcdGXYNewControllerModel.addUndoableListener(com.luciad.gui.ILcdUndoableListener)
for undo/redo support.public void addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
public void setActionToTriggerAfterCreation(ILcdAction aNewActionToTriggerAfterCreation)
ILcdAction
that will be triggered just after this
ILcdGXYController
has created a new Object
and
added it to an ILcdModel
.
It might be interesting for example to set an ILcdGXYController
( using
a TLcdGXYSetControllerAction
) that
can edit the new Object
, just after this one has been created
and initialized.
When no action is set, the new controller model will be requested for an object and a layer when creation
has been finished or has been canceled.aNewActionToTriggerAfterCreation
- the ILcdAction
to be triggered or null
if no ILcdAction
has to be triggered.TLcdGXYSetControllerAction
,
getActionToTriggerAfterCreation()
public ILcdAction getActionToTriggerAfterCreation()
ILcdAction
that will be will be triggered just after this
ILcdGXYController
has created a new Object
,
initialized it and added it to an ILcdModel
.ILcdAction
to be triggered after creation of a new Object.setActionToTriggerAfterCreation(com.luciad.gui.ILcdAction)
public void setSnappables(ILcdGXYLayerSubsetList aNewSnappables)
null
is a valid argument.aNewSnappables
- the new value for the snappables property. null
is a valid argument.getSnappables()
public ILcdGXYLayerSubsetList getSnappables()
null
is a valid returned value.null
is a valid returned value.setSnappables(com.luciad.view.gxy.ILcdGXYLayerSubsetList)
protected Object getObject()
public boolean isUseEditingBoundsForRepaint()
setUseEditingBoundsForRepaint(boolean)
public void setUseEditingBoundsForRepaint(boolean aUseEditingBoundsForRepaint)
false
.
ILcdGXYPainter
of
the object under creation should properly implement 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()
public void mouseExited(MouseEvent me)
mouseExited
in interface MouseListener
mouseExited
in class ALcdGXYSmartController
me
- the mouse event indicating that the mouse has left the view.ALcdGXYSmartController.isPanOnMouseDragExit()
,
ALcdGXYSmartController.isPanOnMouseMoveExit()