Package com.luciad.view.gxy.controller
Class TLcdGXYSelectController
java.lang.Object
com.luciad.view.gxy.controller.ALcdGXYController
com.luciad.view.gxy.controller.ALcdGXYSmartController
com.luciad.view.gxy.controller.TLcdGXYDragRectangleController
com.luciad.view.gxy.controller.TLcdGXYSelectController
- All Implemented Interfaces:
ILcdUndoableSource
,ILcdStatusSource
,ILcdGXYController
,KeyListener
,MouseListener
,MouseMotionListener
,Serializable
,EventListener
- Direct Known Subclasses:
TLcdGXYEditController
public class TLcdGXYSelectController
extends TLcdGXYDragRectangleController
implements MouseListener
Deprecated.
The
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
.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected Rectangle
Deprecated.protected Rectangle
Deprecated.protected TLcdGXYLayerSubsetList
Deprecated.protected TLcdGXYContext
Deprecated.protected TLcdXYBounds
Deprecated.Fields inherited from class com.luciad.view.gxy.controller.TLcdGXYDragRectangleController
fXPressed, fXReleased, fYPressed, fYReleased
-
Constructor Summary
ConstructorDescriptionDeprecated.Constructs aILcdGXYController
which enables selecting objects in the view using the mouse.TLcdGXYSelectController
(boolean aRegisterInstance) Deprecated.use the constructor without parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
Deprecated.Deprecated.Gets theActionListener
to be triggered on a mouse double click.Deprecated.Gets theActionListener
to be triggered on a right mouse button pressed.Deprecated.Deprecated.Retrieves the last MouseEvent received on a mousePressed.Deprecated.Retrieves the last MouseEvent received on a mouseReleased.int
Deprecated.Returns the dimension of the square around the mouse pointer taken into account when selecting using a mouse click.Deprecated.Deprecated.protected int
Deprecated.Counts the number of Objects currently selected.int
Deprecated.This method returns the sensitivity that will be used when selecting objects or labels.protected boolean
Deprecated.Tells if theILcdAction
to be triggered on a right mouse button pressed has been performed or not.boolean
Deprecated.Indicates whether objects that were selected and are selected again dragging a rectangle in ALTERNATE mode should be removed from the selection.boolean
Deprecated.boolean
Deprecated.Returns whether interaction with the select clip should be strict.boolean
Deprecated.This method has been deprecated.Deprecated.void
Deprecated.void
Deprecated.void
Deprecated.Implements mouseReleased.protected void
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 aILcdGXYView
.void
selectInBounds
(Rectangle aRectangle) Deprecated.Deprecated.protected boolean
selectOnLayer
(ILcdGXYContext aGXYContext, int aSelectionMode) Deprecated.Processes a selection update on anILcdGXYLayer
(aGXYContext.getGXYLayer()) at the AWT location [ aGXYContext.getX(), aGXYContext.getY() ], taking into aSelectionMode.void
setActionOnDoubleClick
(ActionListener aActionOnDoubleClick) Deprecated.Sets anActionListener
to be triggered on a mouse double click.void
setActionOnRightMouseButtonPressed
(ActionListener aActionOnRightMouseButtonPressed) Deprecated.Sets anActionListener
to be triggered on a right mouse button pressed.void
setGXYSelectControllerModel
(ILcdGXYSelectControllerModel aGXYSelectControllerModel) Deprecated.Customizes how thisTLcdGXYSelectController
performs the selection on aILcdGXYView
.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.void
startInteraction
(ILcdGXYView aGXYView) Deprecated.ImplementsILcdGXYController.startInteraction
.void
terminateInteraction
(ILcdGXYView aGXYView) Deprecated.ImplementsILcdGXYController.terminateInteraction
.void
undo()
Deprecated.Methods inherited from class com.luciad.view.gxy.controller.TLcdGXYDragRectangleController
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
Methods inherited from class com.luciad.view.gxy.controller.ALcdGXYSmartController
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
Methods inherited from class com.luciad.view.gxy.controller.ALcdGXYController
addStatusListener, asGXYController, fireStatusEvent, getCursor, getGXYView, getIcon, getName, getShortDescription, registerInstance, removeStatusListener, retrieveGXYViewXYWorldTransformation, setClassTraceOn, setCursor, setGXYView, setIcon, setName, setShortDescription, viewRepaint
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.view.gxy.ILcdGXYController
getLayered
Methods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExited
-
Field Details
-
fWorkContext
Deprecated. -
fLastSelectionClip
Deprecated. -
fSelection
Deprecated. -
fAWTWorkBounds
Deprecated. -
fXYWorkBounds
Deprecated.
-
-
Constructor Details
-
TLcdGXYSelectController
public TLcdGXYSelectController()Deprecated.Constructs aILcdGXYController
which enables selecting objects in the view using the mouse. -
TLcdGXYSelectController
public TLcdGXYSelectController(boolean aRegisterInstance) Deprecated.use the constructor without parameters.
-
-
Method Details
-
setTraceOn
public void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrue
orfalse
as argument automatically turns off tracing for all other class instances for whichsetTraceOn
has not been called. If the argument isfalse
then only the informative, warning and error log messages are recorded.- Overrides:
setTraceOn
in classTLcdGXYDragRectangleController
- Parameters:
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.
-
isTraceOn
public boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrue
if tracing is enabled for this class.- Overrides:
isTraceOn
in classTLcdGXYDragRectangleController
- Returns:
- true if tracing is enabled for this class, false otherwise.
-
selection
Deprecated.- Returns:
- all the
Object
currently selected - See Also:
-
getLastMousePressedEvent
Deprecated.Retrieves the last MouseEvent received on a mousePressed. -
getLastMouseReleasedEvent
Deprecated.Retrieves the last MouseEvent received on a mouseReleased. -
lastSelected
Deprecated.- Returns:
- only the
Object
that have been selected during the last mouse interaction. It is a subset of selection(). - See Also:
-
setActionOnRightMouseButtonPressed
Deprecated.Sets anActionListener
to be triggered on a right mouse button pressed.null
means noActionListener
to trigger. -
getActionOnRightMouseButtonPressed
Deprecated.Gets theActionListener
to be triggered on a right mouse button pressed.null
means noActionListener
to trigger. -
isStrictInteraction
public boolean isStrictInteraction()Deprecated.Returns whether interaction with the select clip should be strict.- Returns:
- whether interaction with the select clip should be strict. Default value is false.
- See Also:
-
setStrictInteraction
public void setStrictInteraction(boolean aStrictInteraction) Deprecated.Sets whether interaction with the select clip should be strict.- Parameters:
aStrictInteraction
- iftrue
, selection shall be applied only to the Objects interacting with the given clip. Iffalse
it can be applied to the same Objects plus others. In general, the retrieval of theObject
interacting with the given clip will be faster when aStrictInteraction=false.- See Also:
-
getSensitivity
public int getSensitivity()Deprecated.This method returns the sensitivity that will be used when selecting objects or labels. It indicates how far (in screen coordinates) the input location (mouse cursor, etc...) can be from the visual representation of an object on the screen and still interact with it. This value will be passed to all created instances ofTLcdGXYContext
passed to the painters.- Returns:
- the sensitivity to be used for selecting objects.
- See Also:
-
setSensitivity
public 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).- Parameters:
aSensitivity
- the sensitivity that will be used for selecting objects.- See Also:
-
setActionOnDoubleClick
Deprecated.Sets anActionListener
to be triggered on a mouse double click.null
means noActionListener
to trigger. -
getActionOnDoubleClick
Deprecated.Gets theActionListener
to be triggered on a mouse double click.null
means noActionListener
to trigger. -
setSelectInBoundsAllowed
public void setSelectInBoundsAllowed(boolean aSelectInBoundsAllowed) Deprecated.Sets if selection can be performed by dragging a Rectangle on the ILcdGXYView. -
isInvertSelectionOnAlternateModeDrag
public 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. Default value is false for backwards compatibility, i.e. dragging a rectangle on top of selected objects will not influence the selected objects. Note that this only applies for selection with a rectangle, not for selection with a click.- Returns:
- whether objects that were selected and are selected again dragging a rectangle in ALTERNATE mode should be removed from the selection.
- See Also:
-
setInvertSelectionOnAlternateModeDrag
public 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.- Parameters:
aInvertSelectionOnAlternateModeDrag
- true to have a more consistent behavior, as consecutive clicks also remove objects from the selection.- See Also:
-
isSelectInBoundsAllowed
public boolean isSelectInBoundsAllowed()Deprecated.- See Also:
-
isActionOnRightMouseButtonPerformed
protected boolean isActionOnRightMouseButtonPerformed()Deprecated.Tells if theILcdAction
to be triggered on a right mouse button pressed has been performed or not. -
setGXYSelectControllerModel
Deprecated.Customizes how thisTLcdGXYSelectController
performs the selection on aILcdGXYView
.- Parameters:
aGXYSelectControllerModel
- the ILcdGXYSelectControllerModel to set.null
is a valid argument.- See Also:
-
getGXYSelectControllerModel
Deprecated.- See Also:
-
setMousePressedSensitivity
public 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.- Parameters:
aMousePressedSensitivity
- the size of (one side of) the square that is taken into account for selection when clicking the mouse.- See Also:
-
getMousePressedSensitivity
public int getMousePressedSensitivity()Deprecated.Returns the dimension of the square around the mouse pointer taken into account when selecting using a mouse click.- See Also:
-
startInteraction
Deprecated.ImplementsILcdGXYController.startInteraction
.- Specified by:
startInteraction
in interfaceILcdGXYController
- Overrides:
startInteraction
in classALcdGXYSmartController
- Parameters:
aGXYView
- theILcdGXYView
thisILcdGXYController
will interact with.- See Also:
-
terminateInteraction
Deprecated.ImplementsILcdGXYController.terminateInteraction
. Its restores the original painting mode of aGXYView.- Specified by:
terminateInteraction
in interfaceILcdGXYController
- Overrides:
terminateInteraction
in classALcdGXYSmartController
- Parameters:
aGXYView
- theILcdGXYView
thisILcdGXYController
interacted with.- See Also:
-
getSelectionClip
Deprecated.- Returns:
- the clip of the current selection
-
getPreviousSelectionClip
Deprecated.- Returns:
- the clip of the previous selection
-
getSelectionCount
protected int getSelectionCount()Deprecated.Counts the number of Objects currently selected. -
mouseDragged
Deprecated.- Specified by:
mouseDragged
in interfaceMouseMotionListener
- Overrides:
mouseDragged
in classTLcdGXYDragRectangleController
-
mousePressed
Deprecated.- Specified by:
mousePressed
in interfaceMouseListener
- Overrides:
mousePressed
in classTLcdGXYDragRectangleController
-
processRightMouseButtonPressed
Deprecated.Processes a right mouse pressed. This implementation triggers theILcdAction
set with setActionOnRightMouseButtonPressed, if suchILcdAction
has been set. It creates an ActionEvent with "RightMouseButtonPressed" as command field. This method can be redefined. -
mouseReleased
Deprecated.Implements mouseReleased. This method can be redefined to implement a behavior after processing a new selection. Do not forget to start this redefinition by calling super.mouseReleased(me).- Specified by:
mouseReleased
in interfaceMouseListener
- Overrides:
mouseReleased
in classTLcdGXYDragRectangleController
-
deselectAll
protected void deselectAll(boolean updateView) Deprecated.Deselects all Objects previously selected. -
addInSelection
protected void addInSelection(Object aObject, ILcdGXYPainter aGXYPainter, ILcdGXYContext aGXYContext) Deprecated.This method is called in the selection process to add aObject in the selection.- Parameters:
aObject
- the Object to add in the selectionaGXYPainter
- theILcdGXYPainter
used to test that aObject has been touched.aGXYContext
- theILcdGXYContext
used to perform the test
-
removeFromSelection
protected void removeFromSelection(Object aObject, ILcdGXYPainter aGXYPainter, ILcdGXYContext aGXYContext) Deprecated.This method is called in the selection process to remove aObject from the selection.- Parameters:
aObject
- the Object to add in the selectionaGXYPainter
- a validILcdGXYPainter
for aObjectaGXYContext
- a validILcdGXYContext
to use theILcdGXYPainter
-
selectAt
Deprecated.This method performs a selection update when the mouse hit at (x,y) in aILcdGXYView
.- Parameters:
aSelectionMode
- one of TLcdGXYSelectController.FIRST_TOUCHED, TLcdGXYSelectController.ALTERNATE. On a mousePressed(MouseEvent me), aSelectionMode is the one returned by selectionMode(me).
-
selectOnLayer
Deprecated.Processes a selection update on anILcdGXYLayer
(aGXYContext.getGXYLayer()) at the AWT location [ aGXYContext.getX(), aGXYContext.getY() ], taking into aSelectionMode.- Parameters:
aSelectionMode
- one of TLcdGXYSelectController.FIRST_TOUCHED, TLcdGXYSelectController.ALTERNATE. On a mousePressed(MouseEvent me), aSelectionMode is the one returned by selectionMode(me)
-
selectInBounds
Deprecated. -
fireAllLayerCollectedSelectionChanges
protected void fireAllLayerCollectedSelectionChanges()Deprecated. -
undo
public void undo()Deprecated.- Overrides:
undo
in classTLcdGXYDragRectangleController
-
TLcdGXYSelectController2
instead. The functionality of this class will remain present as is.