TLcdGXYSelectController2
instead. The functionality of this class will
remain present as is.public class TLcdGXYSelectController extends TLcdGXYDragRectangleController implements MouseListener
TLcdGXYSelectController
can be used for selecting Objects in
an ILcdGXYView
, and put them in the selection of their respective
ILcdGXYLayer
. The selection can be performed by clicking or
dragging a rectangle on the ILcdGXYView
.
An ILcdAction
to be triggered on a right mouse
button pressed can be set using setActionOnRightMouseButtonPressed if the selection mode
is equal to ILcdGXYSelectControllerModel.FIRST_TOUCHED
.
An ILcdAction
to be triggered on a double click
can be set using setActionOnDoubleClick.
New selection can be retrieved ILcdGXYLayer by ILcdGXYLayer (see ILcdGXYLayer.selectedObjects)
The way selection is performed can be changing the GXYSelectControllerModel property (see setGXYSelectControllerModel, selectionMode(MouseEvent) ).
Note: For new code, it is advised to use TLcdGXYSelectController2
.
TLcdGXYSelectController2
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected Rectangle |
fAWTWorkBounds
Deprecated.
|
protected Rectangle |
fLastSelectionClip
Deprecated.
|
protected TLcdGXYLayerSubsetList |
fSelection
Deprecated.
|
protected TLcdGXYContext |
fWorkContext
Deprecated.
|
protected TLcdXYBounds |
fXYWorkBounds
Deprecated.
|
fXPressed, fXReleased, fYPressed, fYReleased
Constructor and Description |
---|
TLcdGXYSelectController()
Deprecated.
Constructs a
ILcdGXYController which enables selecting objects in the
view using the mouse. |
TLcdGXYSelectController(boolean aRegisterInstance)
Deprecated.
use the constructor without parameters.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addInSelection(Object aObject,
ILcdGXYPainter aGXYPainter,
ILcdGXYContext aGXYContext)
Deprecated.
This method is called in the selection process to add aObject in the selection.
|
protected void |
deselectAll(boolean updateView)
Deprecated.
Deselects all Objects previously selected.
|
protected void |
fireAllLayerCollectedSelectionChanges()
Deprecated.
|
ActionListener |
getActionOnDoubleClick()
Deprecated.
Gets the
ActionListener to be triggered on a mouse
double click. |
ActionListener |
getActionOnRightMouseButtonPressed()
Deprecated.
Gets the
ActionListener to be triggered on a right mouse
button pressed. |
ILcdGXYSelectControllerModel |
getGXYSelectControllerModel()
Deprecated.
|
MouseEvent |
getLastMousePressedEvent()
Deprecated.
Retrieves the last MouseEvent received on a mousePressed.
|
MouseEvent |
getLastMouseReleasedEvent()
Deprecated.
Retrieves the last MouseEvent received on a mouseReleased.
|
int |
getMousePressedSensitivity()
Deprecated.
Returns the dimension of the square around the mouse pointer taken into account when
selecting using a mouse click.
|
Rectangle |
getPreviousSelectionClip()
Deprecated.
|
Rectangle |
getSelectionClip()
Deprecated.
|
protected int |
getSelectionCount()
Deprecated.
Counts the number of Objects currently selected.
|
int |
getSensitivity()
Deprecated.
This method returns the sensitivity that will be used when selecting objects or labels.
|
protected boolean |
isActionOnRightMouseButtonPerformed()
Deprecated.
Tells if the
ILcdAction to be triggered on a right mouse
button pressed has been performed or not. |
boolean |
isInvertSelectionOnAlternateModeDrag()
Deprecated.
Indicates whether objects that were selected and are selected again dragging a rectangle
in ALTERNATE mode should be removed from the selection.
|
boolean |
isSelectInBoundsAllowed()
Deprecated.
|
boolean |
isStrictInteraction()
Deprecated.
Returns whether interaction with the select clip should be strict.
|
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
ILcdGXYLayerSubsetList |
lastSelected()
Deprecated.
|
void |
mouseDragged(MouseEvent me)
Deprecated.
|
void |
mousePressed(MouseEvent me)
Deprecated.
|
void |
mouseReleased(MouseEvent me)
Deprecated.
Implements mouseReleased.
|
protected void |
processRightMouseButtonPressed(MouseEvent e)
Deprecated.
Processes a right mouse pressed.
|
protected void |
removeFromSelection(Object aObject,
ILcdGXYPainter aGXYPainter,
ILcdGXYContext aGXYContext)
Deprecated.
This method is called in the selection process to remove aObject from the selection.
|
void |
selectAt(MouseEvent aMouseEvent,
int aSelectionMode)
Deprecated.
This method performs a selection update when the mouse hit at (x,y) in
a
ILcdGXYView . |
void |
selectInBounds(Rectangle aRectangle)
Deprecated.
|
ILcdGXYLayerSubsetList |
selection()
Deprecated.
|
protected boolean |
selectOnLayer(ILcdGXYContext aGXYContext,
int aSelectionMode)
Deprecated.
Processes a selection update on an
ILcdGXYLayer
(aGXYContext.getGXYLayer()) at the AWT location
[ aGXYContext.getX(), aGXYContext.getY() ], taking
into aSelectionMode. |
void |
setActionOnDoubleClick(ActionListener aActionOnDoubleClick)
Deprecated.
Sets an
ActionListener to be triggered on a mouse
double click. |
void |
setActionOnRightMouseButtonPressed(ActionListener aActionOnRightMouseButtonPressed)
Deprecated.
Sets an
ActionListener to be triggered on a right mouse
button pressed. |
void |
setGXYSelectControllerModel(ILcdGXYSelectControllerModel aGXYSelectControllerModel)
Deprecated.
Customizes how this
TLcdGXYSelectController
performs the selection on a ILcdGXYView . |
void |
setInvertSelectionOnAlternateModeDrag(boolean aInvertSelectionOnAlternateModeDrag)
Deprecated.
Sets whether currently selected objects should be removed from the selection when they are
selected again in the current operation dragging a rectangle in ALTERNATE mode.
|
void |
setMousePressedSensitivity(int aMousePressedSensitivity)
Deprecated.
Sets the size in pixels of (one side of) the square around the mouse that is taken into
account for selection when clicking the mouse.
|
void |
setSelectInBoundsAllowed(boolean aSelectInBoundsAllowed)
Deprecated.
Sets if selection can be performed by dragging a Rectangle on the ILcdGXYView.
|
void |
setSensitivity(int aSensitivity)
Deprecated.
This method sets the sensitivity that should be used by painters to determine which
object is selected by the input device (usually the mouse).
|
void |
setStrictInteraction(boolean aStrictInteraction)
Deprecated.
Sets whether interaction with the select clip should be strict.
|
void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
startInteraction(ILcdGXYView aGXYView)
Deprecated.
Implements
ILcdGXYController.startInteraction . |
void |
terminateInteraction(ILcdGXYView aGXYView)
Deprecated.
Implements
ILcdGXYController.terminateInteraction . |
void |
undo()
Deprecated.
|
adaptRectangle, doPanGXYView, doZoomGXYView, drawGhost, getCurrentRectangle, getGhostColor, getGhostLineWidth, getHaloColor, getHaloThickness, getMouseDraggedSensitivity, getXORModelColor, isDragCentered, isForceToSquare, isHaloEnabled, isRepaintOnReleased, isXORMode, lastXPressed, lastXReleased, lastYPressed, lastYReleased, mouseMoved, paint, 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, setCursor, setGXYView, setIcon, setName, setShortDescription, viewRepaint
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
mouseClicked, mouseEntered, mouseExited
getLayered
protected TLcdGXYContext fWorkContext
protected Rectangle fLastSelectionClip
protected TLcdGXYLayerSubsetList fSelection
protected Rectangle fAWTWorkBounds
protected TLcdXYBounds fXYWorkBounds
public TLcdGXYSelectController()
ILcdGXYController
which enables selecting objects in the
view using the mouse.public TLcdGXYSelectController(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 TLcdGXYDragRectangleController
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 TLcdGXYDragRectangleController
public ILcdGXYLayerSubsetList selection()
Object
currently selectedTLcdGXYLayerSubsetList
public MouseEvent getLastMousePressedEvent()
public MouseEvent getLastMouseReleasedEvent()
public ILcdGXYLayerSubsetList lastSelected()
Object
that have been selected during the
last mouse interaction. It is a subset of selection().selection()
,
TLcdGXYLayerSubsetList
public void setActionOnRightMouseButtonPressed(ActionListener aActionOnRightMouseButtonPressed)
ActionListener
to be triggered on a right mouse
button pressed. null
means no ActionListener
to trigger.public ActionListener getActionOnRightMouseButtonPressed()
ActionListener
to be triggered on a right mouse
button pressed. null
means no ActionListener
to trigger.public boolean isStrictInteraction()
setStrictInteraction(boolean)
public void setStrictInteraction(boolean aStrictInteraction)
aStrictInteraction
- if true
, selection shall be
applied only to the Objects interacting with the given clip. If false
it can be applied to the same Objects plus others. In general, the retrieval
of the Object
interacting with the given clip will be faster when
aStrictInteraction=false.isStrictInteraction()
public int getSensitivity()
TLcdGXYContext
passed to the painters.setSensitivity(int)
,
TLcdGXYContext.getSensitivity()
public void setSensitivity(int aSensitivity)
aSensitivity
- the sensitivity that will be used for selecting objects.getSensitivity()
public void setActionOnDoubleClick(ActionListener aActionOnDoubleClick)
ActionListener
to be triggered on a mouse
double click. null
means no ActionListener
to trigger.public ActionListener getActionOnDoubleClick()
ActionListener
to be triggered on a mouse
double click. null
means no ActionListener
to trigger.public void setSelectInBoundsAllowed(boolean aSelectInBoundsAllowed)
public boolean isInvertSelectionOnAlternateModeDrag()
setInvertSelectionOnAlternateModeDrag(boolean)
public void setInvertSelectionOnAlternateModeDrag(boolean aInvertSelectionOnAlternateModeDrag)
aInvertSelectionOnAlternateModeDrag
- true to have a more consistent behavior, as consecutive clicks
also remove objects from the selection.isInvertSelectionOnAlternateModeDrag()
public boolean isSelectInBoundsAllowed()
setSelectInBoundsAllowed(boolean)
protected boolean isActionOnRightMouseButtonPerformed()
ILcdAction
to be triggered on a right mouse
button pressed has been performed or not.public void setGXYSelectControllerModel(ILcdGXYSelectControllerModel aGXYSelectControllerModel)
TLcdGXYSelectController
performs the selection on a ILcdGXYView
.aGXYSelectControllerModel
- the ILcdGXYSelectControllerModel to set. null
is a valid argument.ILcdGXYSelectControllerModel
public ILcdGXYSelectControllerModel getGXYSelectControllerModel()
public void setMousePressedSensitivity(int aMousePressedSensitivity)
aMousePressedSensitivity
- the size of (one side of) the square that is taken into
account for selection when clicking the mouse.getMousePressedSensitivity()
public int getMousePressedSensitivity()
setMousePressedSensitivity(int)
public void startInteraction(ILcdGXYView aGXYView)
ILcdGXYController.startInteraction
.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)
ILcdGXYController.terminateInteraction
. Its restores
the original painting mode of aGXYView.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)
public Rectangle getSelectionClip()
public Rectangle getPreviousSelectionClip()
protected int getSelectionCount()
public void mouseDragged(MouseEvent me)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class TLcdGXYDragRectangleController
public void mousePressed(MouseEvent me)
mousePressed
in interface MouseListener
mousePressed
in class TLcdGXYDragRectangleController
protected void processRightMouseButtonPressed(MouseEvent e)
ILcdAction
set with setActionOnRightMouseButtonPressed, if
such ILcdAction
has been set. It creates an ActionEvent
with "RightMouseButtonPressed" as command field. This method can be
redefined.public void mouseReleased(MouseEvent me)
mouseReleased
in interface MouseListener
mouseReleased
in class TLcdGXYDragRectangleController
protected void deselectAll(boolean updateView)
protected void addInSelection(Object aObject, ILcdGXYPainter aGXYPainter, ILcdGXYContext aGXYContext)
aObject
- the Object to add in the selectionaGXYPainter
- the ILcdGXYPainter
used to test that aObject
has been touched.aGXYContext
- the ILcdGXYContext
used to perform the testprotected void removeFromSelection(Object aObject, ILcdGXYPainter aGXYPainter, ILcdGXYContext aGXYContext)
aObject
- the Object to add in the selectionaGXYPainter
- a valid ILcdGXYPainter
for aObjectaGXYContext
- a valid ILcdGXYContext
to use the
ILcdGXYPainter
public void selectAt(MouseEvent aMouseEvent, int aSelectionMode)
ILcdGXYView
.aSelectionMode
- one of TLcdGXYSelectController.FIRST_TOUCHED,
TLcdGXYSelectController.ALTERNATE. On a mousePressed(MouseEvent me),
aSelectionMode is the one returned by selectionMode(me).protected boolean selectOnLayer(ILcdGXYContext aGXYContext, int aSelectionMode)
ILcdGXYLayer
(aGXYContext.getGXYLayer()) at the AWT location
[ aGXYContext.getX(), aGXYContext.getY() ], taking
into aSelectionMode.aSelectionMode
- one of TLcdGXYSelectController.FIRST_TOUCHED,
TLcdGXYSelectController.ALTERNATE. On a mousePressed(MouseEvent me),
aSelectionMode is the one returned by selectionMode(me)public void selectInBounds(Rectangle aRectangle)
protected void fireAllLayerCollectedSelectionChanges()
public void undo()
undo
in class TLcdGXYDragRectangleController