Class TLcdGXYTouchSelectEditController
- All Implemented Interfaces:
ILcdUndoableSource
,ILcdAWTEventListener
,ILcdStatusSource
,ILcdGXYChainableController
,ILcdGXYController
,Serializable
A touch controller combining selection and editing behaviour.
This controller uses two controller models: TLcdGXYSelectControllerModel2
for
selection and TLcdGXYMultiPointEditControllerModel
for editing. The default constructor
configures the controller for single-touch editing. Refer to the other constructors for how to
set up multi-touch editing.
Besides select and edit behaviour it also has support for touch-and-hold detection. When a touch-and-hold is detected, the touch-and-hold action is triggered. When the input point causing the touch-and-hold is removed, the post touch-and-hold action is triggered.
A typical use case for the touch-and-hold action is to display a context menu.
This controller only tries to handle TLcdTouchPoint
s which are not-consumed, and marks the
TLcdTouchPoint
s it uses as consumed, similar to the ALcdGXYTouchChainableController
.
- Since:
- 10.0
- See Also:
-
Constructor Summary
ConstructorDescriptionDefault constructor supporting selecting and single-touch editing for a standard selection model and edit model.TLcdGXYTouchSelectEditController
(int aMaximalNumberOfInputPoints) Creates a controller capable of editing with multiple points.TLcdGXYTouchSelectEditController
(TLcdGXYSelectControllerModel2 aSelectControllerModel, TLcdGXYMultiPointEditControllerModel aEditControllerModel, int aMaximalNumberOfEditPoints) Creates a new controller which supports selecting and editing, using the given select and edit controller models. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addUndoableListener
(ILcdUndoableListener aUndoableListener) Adds a listener to this source, so this listener is notified when something undoable has happened.void
This method will append the passed controller to the end of the chain.protected int
editHowMode
(List<Point> aFrom, List<Point> aTo) Returns the edit-how mode.protected int
editWhatMode
(List<Point> aFrom, List<Point> aTo, int aEditHow) Returns the edit-what mode.Returns theTLcdGXYMultiPointEditControllerModel
used for the editing operations.Returns theILcdGXYView
the controller is interacting with.Returns the color used to paint the halo around the selection rectangle.int
Returns the thickness of the halo drawn around the selection rectangle.int
Returns the current threshold for move events.Returns a reference to the controller that is located after this one in a chain, or null if this controller is the last element of the chain.Returns the action which will be triggered when the input point which caused a touch-and-hold is removed.Returns the color used to paint the selection rectangle.int
Returns the line width used to draw the selection rectangle.Returns theTLcdGXYSelectControllerModel2
used for the selection operations.Returns the snappables.Returns the action which is triggered when a touch-and-hold is detected.int
Returns the time a touch must remain immobile (within the move threshold) to cause a touch and hold.Returns the icon used to indicate the touch-and-hold.void
handleAWTEvent
(AWTEvent aEvent) This is method is called when the target of the listener has a new AWTEvent available.boolean
This method indicates whether or not this controller will drag a rectangle and select all objects, interacting with the rectangle, or select objects on a TOUCH_DOWN event.boolean
Returns whether or not the selection rectangle (when in drag rectangle mode) will be drawn with a halo.boolean
This method indicates whether the object being edited is painted in a temporary state and only changed when a touch point is removed or created, or whether the object is instantly edited while the touch point(s) are moved.void
Enables the controller to give visual feedback on the current user interactions.protected void
The specific implementation ofpaint
for this controller.void
removeUndoableListener
(ILcdUndoableListener aUndoableListener) Removes the specified listener so it is no longer notified.protected ILcdGXYViewXYWorldTransformation
Convenience method to retrieve theILcdGXYViewXYWorldTransformation
for theILcdGXYView
this controller interacts with.protected int
selectByWhatMode
(Rectangle aSelectionBounds, int aInputMode) Returns the mode that defines by what objects can be selected: by their bodies, their labels, ...protected int
selectHowMode
(Rectangle aSelectionBounds, int aInputMode, int aSelectByWhatMode) Returns the mode that defines how the objects involved in the selection should interact with the existing selection, for example add them, remove them, toggle their selection state, etc.void
setDragRectangle
(boolean aDrag) This method can be used to toggle between selecting by dragging a rectangle, and selecting by a single touch.void
setEditControllerModel
(TLcdGXYMultiPointEditControllerModel aEditControllerModel) Sets theTLcdGXYMultiPointEditControllerModel
used for the edit operations.protected void
setGXYView
(ILcdGXYView aGXYView) Sets theILcdGXYView
the controller is interacting with.void
setHaloColor
(Color aHaloColor) Sets the color used to paint the halo around the selection rectangle.void
setHaloEnabled
(boolean aHaloEnabled) Enables or disables the halo effect when drawing the selection rectangle.void
setHaloThickness
(int aHaloThickness) Sets the thickness of the halo drawn around the selection rectangle.void
setInstantEditing
(boolean aInstantEditing) The method can be used to activate or deactivate instant editing.void
setMoveThreshold
(int aMoveThreshold) Sets the threshold for move events.void
This method sets the next controller in the chain for this controller.void
setPostTouchAndHoldAction
(ILcdAction aPostTouchAndHoldAction) Sets the action which will be triggered when the input point which caused a touch-and-hold is removed.void
setRectangleColor
(Color aRectangleColor) Sets the color used to paint the selection rectangle.void
setRectangleLineWidth
(int aRectangleLineWidth) Sets the line width used to draw the selection rectangle.void
setSelectControllerModel
(TLcdGXYSelectControllerModel2 aSelectControllerModel) Sets theTLcdGXYSelectControllerModel2
.void
setSnappables
(ILcdGXYLayerSubsetList aSnappables) Sets the set of objects that are used as candidates-to-snap-to while editing other objects.void
setTouchAndHoldAction
(ILcdAction aTouchAndHoldAction) Sets the action which is triggered when a touch-and-hold is detected.void
setTouchAndHoldDelay
(int aTouchAndHoldDelay) Sets the time a touch must remain immobile (within the move threshold) to cause a touch and hold.void
setTouchAndHoldIcon
(ILcdIcon aTouchAndHoldIcon) Sets the icon which will be used to indicate a touch-and-hold.void
startInteraction
(ILcdGXYView aGXYView) Sets up the controller to receive input through the view passed.protected void
startInteractionImpl
(ILcdGXYView aGXYView) The specific implementation ofstartInteraction
for this controller.void
terminateInteraction
(ILcdGXYView aGXYView) Releases a few items.protected void
terminateInteractionImpl
(ILcdGXYView aGXYView) The specific implementation ofterminateInteraction
for this controller.Methods inherited from class com.luciad.view.gxy.controller.ALcdGXYChainableController
addStatusListener, removeStatusListener
Methods inherited from class com.luciad.view.gxy.controller.ALcdGXYController
asGXYController, fireStatusEvent, getCursor, getIcon, getName, getShortDescription, isTraceOn, registerInstance, setClassTraceOn, setCursor, setIcon, setName, setShortDescription, setTraceOn, 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
getCursor, getIcon, getLayered, getName, getShortDescription, viewRepaint
-
Constructor Details
-
TLcdGXYTouchSelectEditController
public TLcdGXYTouchSelectEditController()Default constructor supporting selecting and single-touch editing for a standard selection model and edit model.- See Also:
-
TLcdGXYTouchSelectEditController
public TLcdGXYTouchSelectEditController(int aMaximalNumberOfInputPoints) Creates a controller capable of editing with multiple points. It will use a standard selection model and edit model.- Parameters:
aMaximalNumberOfInputPoints
- the maximal number of input points that will be used to edit- See Also:
-
TLcdGXYTouchSelectEditController
public TLcdGXYTouchSelectEditController(TLcdGXYSelectControllerModel2 aSelectControllerModel, TLcdGXYMultiPointEditControllerModel aEditControllerModel, int aMaximalNumberOfEditPoints) Creates a new controller which supports selecting and editing, using the given select and edit controller models.- Parameters:
aSelectControllerModel
- the selection model. Must not benull
.aEditControllerModel
- the edit model. May benull
. When set tonull
, this controller will no longer try to edit and only perform selection.aMaximalNumberOfEditPoints
- the maximal number of input points that will be used to edit
-
-
Method Details
-
isHaloEnabled
public boolean isHaloEnabled()Returns whether or not the selection rectangle (when in drag rectangle mode) will be drawn with a halo.- Returns:
- true is the halo is enabled, false otherwise
- See Also:
-
setHaloEnabled
public void setHaloEnabled(boolean aHaloEnabled) Enables or disables the halo effect when drawing the selection rectangle.- Parameters:
aHaloEnabled
- if true the halo will be enabled, if false disabled.- See Also:
-
getRectangleLineWidth
public int getRectangleLineWidth()Returns the line width used to draw the selection rectangle.- Returns:
- the width used to paint the selection rectangle.
- See Also:
-
setRectangleLineWidth
public void setRectangleLineWidth(int aRectangleLineWidth) Sets the line width used to draw the selection rectangle.- Parameters:
aRectangleLineWidth
- the line width that will be used to draw the selection rectangle.- See Also:
-
getRectangleColor
Returns the color used to paint the selection rectangle.- Returns:
- the color used to paint the selection rectangle.
- See Also:
-
setRectangleColor
Sets the color used to paint the selection rectangle.- Parameters:
aRectangleColor
- the color that will be used to paint the selection rectangle.- See Also:
-
getHaloColor
Returns the color used to paint the halo around the selection rectangle.- Returns:
- the color used to paint the halo around the selection rectangle.
- See Also:
-
setHaloColor
Sets the color used to paint the halo around the selection rectangle.- Parameters:
aHaloColor
- the color that will be used to paint the halo around the selection rectangle.- See Also:
-
getHaloThickness
public int getHaloThickness()Returns the thickness of the halo drawn around the selection rectangle.- Returns:
- the thickness of the halo drawn around the selection rectangle.
- See Also:
-
setHaloThickness
public void setHaloThickness(int aHaloThickness) Sets the thickness of the halo drawn around the selection rectangle.- Parameters:
aHaloThickness
- the thickness of the halo that will be drawn around the selection rectangle.- See Also:
-
handleAWTEvent
Description copied from interface:ILcdAWTEventListener
This is method is called when the target of the listener has a new AWTEvent available.- Specified by:
handleAWTEvent
in interfaceILcdAWTEventListener
- Parameters:
aEvent
- The event to be handled.
-
getGXYView
Description copied from class:ALcdGXYController
Returns theILcdGXYView
the controller is interacting with.- Overrides:
getGXYView
in classALcdGXYController
- Returns:
- the
ILcdGXYView
the controller is interacting with, or null if the view is not interacting with a view
-
setGXYView
Description copied from class:ALcdGXYController
Sets theILcdGXYView
the controller is interacting with.This method is called when
ILcdGXYView.setGXYController
is used to set anILcdGXYController
active on anILcdGXYView
.- Overrides:
setGXYView
in classALcdGXYController
- Parameters:
aGXYView
- the view the controller is interacting with- See Also:
-
retrieveGXYViewXYWorldTransformation
Description copied from class:ALcdGXYController
Convenience method to retrieve theILcdGXYViewXYWorldTransformation
for theILcdGXYView
this controller interacts with. The default implementation returns the view's own transformation.- Overrides:
retrieveGXYViewXYWorldTransformation
in classALcdGXYController
- Returns:
- a
ILcdGXYViewXYWorldTransformation
for theILcdGXYView
this controller interacts with.
-
startInteraction
Description copied from class:ALcdGXYChainableController
Sets up the controller to receive input through the view passed.All
ILcdGXYView
implementations that support interaction call this method when the controller has been made active withsetGXYController
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
.This method also calls
ALcdGXYChainableController.startInteraction(com.luciad.view.gxy.ILcdGXYView)
on the next controller. OverrideALcdGXYChainableController.startInteractionImpl(com.luciad.view.gxy.ILcdGXYView)
if you want to add your own behavior to this controller.- Specified by:
startInteraction
in interfaceILcdGXYController
- Overrides:
startInteraction
in classALcdGXYChainableController
- Parameters:
aGXYView
- theILcdGXYView
thisILcdGXYController
will interact with.- See Also:
-
startInteractionImpl
Description copied from class:ALcdGXYChainableController
The specific implementation ofstartInteraction
for this controller.- Overrides:
startInteractionImpl
in classALcdGXYChainableController
- Parameters:
aGXYView
- the view to start interaction with.
-
terminateInteraction
Description copied from class:ALcdGXYChainableController
Releases a few items. Can be redefined but this 'super' method should be called too.This method also calls
ALcdGXYChainableController.terminateInteraction(com.luciad.view.gxy.ILcdGXYView)
on the next controller. OverrideALcdGXYChainableController.terminateInteractionImpl(com.luciad.view.gxy.ILcdGXYView)
if you want to add your own behavior to this controller.- Specified by:
terminateInteraction
in interfaceILcdGXYController
- Overrides:
terminateInteraction
in classALcdGXYChainableController
- Parameters:
aGXYView
- theILcdGXYView
thisILcdGXYController
interacted with.- See Also:
-
terminateInteractionImpl
Description copied from class:ALcdGXYChainableController
The specific implementation ofterminateInteraction
for this controller.- Overrides:
terminateInteractionImpl
in classALcdGXYChainableController
- Parameters:
aGXYView
- the view to terminate interaction with.
-
paint
Description copied from class:ALcdGXYChainableController
Enables the controller to give visual feedback on the current user interactions. Note that the controller is responsible for repainting the view.Empty implementation. Redefine this method to render on the Graphics on which the view is rendered.
This method also calls
ALcdGXYChainableController.paint(java.awt.Graphics)
on the next controller. OverrideALcdGXYChainableController.paintImpl(java.awt.Graphics)
if you want to add your own behavior to this controller.- Specified by:
paint
in interfaceILcdGXYController
- Overrides:
paint
in classALcdGXYChainableController
- Parameters:
aGraphics
- the Graphics on which the view was rendered.- See Also:
-
paintImpl
Description copied from class:ALcdGXYChainableController
The specific implementation ofpaint
for this controller.- Overrides:
paintImpl
in classALcdGXYChainableController
- Parameters:
aGraphics
- the graphics to be used for painting.
-
setNextGXYController
Description copied from interface:ILcdGXYChainableController
This method sets the next controller in the chain for this controller. You can set null if you want the chain to end. This method does not start or terminate any interaction. If you need to replace a controller while it's being used you are responsible for properly terminating and starting it yourself.- Specified by:
setNextGXYController
in interfaceILcdGXYChainableController
- Overrides:
setNextGXYController
in classALcdGXYChainableController
- Parameters:
aNext
- the reference to the controller that will be the next element in the chain- See Also:
-
getNextGXYController
Description copied from interface:ILcdGXYChainableController
Returns a reference to the controller that is located after this one in a chain, or null if this controller is the last element of the chain.- Specified by:
getNextGXYController
in interfaceILcdGXYChainableController
- Overrides:
getNextGXYController
in classALcdGXYChainableController
- Returns:
- a reference to the next controller.
- See Also:
-
appendGXYController
Description copied from interface:ILcdGXYChainableController
This method will append the passed controller to the end of the chain. The controller will be the stored as the next controller in the last element of the current chain.- Specified by:
appendGXYController
in interfaceILcdGXYChainableController
- Overrides:
appendGXYController
in classALcdGXYChainableController
- Parameters:
aEnd
- the controller to be appended to the end of the chain.
-
addUndoableListener
Description copied from interface:ILcdUndoableSource
Adds a listener to this source, so this listener is notified when something undoable has happened.- Specified by:
addUndoableListener
in interfaceILcdUndoableSource
- Parameters:
aUndoableListener
- The listener to be notified when something undoable has happened.
-
removeUndoableListener
Description copied from interface:ILcdUndoableSource
Removes the specified listener so it is no longer notified.- Specified by:
removeUndoableListener
in interfaceILcdUndoableSource
- Parameters:
aUndoableListener
- The listener to remove.
-
selectByWhatMode
Returns the mode that defines by what objects can be selected: by their bodies, their labels, ...
The default value is a bit-wise or of
TLcdGXYSelectControllerModel2.SELECT_BY_WHAT_BODIES_ON_CLICK
,TLcdGXYSelectControllerModel2.SELECT_BY_WHAT_BODIES_ON_DRAG_CONTAINS
,TLcdGXYSelectControllerModel2.SELECT_BY_WHAT_LABELS_ON_CLICK
andTLcdGXYSelectControllerModel2.SELECT_BY_WHAT_LABELS_ON_DRAG_CONTAINS
.- Parameters:
aSelectionBounds
- The selection rectangle, in view coordinates (pixels). This could for example be the rectangle the user dragged on the map, or a one pixel wide rectangle for a click.aInputMode
- EitherTLcdGXYSelectControllerModel2.INPUT_MODE_POINT
orTLcdGXYSelectControllerModel2.INPUT_MODE_RECTANGLE
, indicating if this selection change originated from a click or from a drag.- Returns:
- The select-by-what mode, a bit-wise or of the constants defined in the TLcdGXYSelectControllerModel2 class that start with
SELECT_BY
.
-
selectHowMode
Returns the mode that defines how the objects involved in the selection should interact with the existing selection, for example add them, remove them, toggle their selection state, etc.
The default implementation returns
TLcdGXYSelectControllerModel2.SELECT_HOW_FIRST_TOUCHED
.- Parameters:
aSelectionBounds
- The selection rectangle, in view coordinates (pixels). This could for example be the rectangle the user dragged on the map, or a one pixel wide rectangle for a touch.aInputMode
- EitherTLcdGXYSelectControllerModel2.INPUT_MODE_POINT
orTLcdGXYSelectControllerModel2.INPUT_MODE_RECTANGLE
, indicating if this selection change originated from a click or from a drag.aSelectByWhatMode
- The select-by-what mode, for example the result of the methodselectByWhatMode
. It is a bit-wise or of the constants in the TLcdGXYSelectControllerModel2 class that start withSELECT_BY
.- Returns:
- The select-how mode, a bit-wise or of the constants in the TLcdGXYSelectControllerModel2 class that start with
SELECT_HOW
.
-
editWhatMode
Returns the edit-what mode. This mode indicates what the edit should do: should the labels be edited, or the objects themselves?
This method returns
TLcdGXYMultiPointEditControllerModel.EDIT_WHAT_LABELS
if one or more labels are touched. If none of the labels is touched, it will check whether an object is touched, and returnTLcdGXYMultiPointEditControllerModel.EDIT_WHAT_OBJECTS
if this is the case. If none of the previous conditions is met, it will returnTLcdGXYMultiPointEditControllerModel.EDIT_WHAT_NO_CHANGE
.This method calls the editingCandidates method with all the input points of
aFrom
andaTo
.Touched is defined as returning true when calling
ILcdGXYPainter.isTouched(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
orILcdGXYLabelPainter2.isLabelTouched(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
for every input point.A possible customization of this method is to return
TLcdGXYMultiPointEditControllerModel.EDIT_WHAT_FIRST_TOUCHED_LABEL
instead ofTLcdGXYMultiPointEditControllerModel.EDIT_WHAT_LABELS
when a label is touched.- Parameters:
aFrom
- A list with point(s) where the edit originated. Should have the same length asaTo
, and the order of the points in both lists should be the same, e.g. the location of the first point ofaFrom
when the edit terminated should be passed as the first point inaTo
.aTo
- A list with point(s) where the edit terminated (so far). Should have the same length asaFrom
, and the order of the points in both list should be the same, e.g. the location of the first point ofaFrom
when the edit terminated should be passed as the first point inaTo
.aEditHow
- The edit-how mode: one of the constants in the TLcdGXYMultiPointEditControllerModel class that start withEDIT_HOW
.- Returns:
- one of the constants in the TLcdGXYMultiPointEditControllerModel class that start with
EDIT_WHAT
.
-
editHowMode
Returns the edit-how mode. This mode indicates how the edit should behave: should the editing candidates be translated or reshaped? This method should be overridden if a different behaviour is desired.
The default implementation returns
Please note that the actual meaning of reshaping and translating is defined by the implementation ofTLcdGXYMultiPointEditControllerModel.EDIT_HOW_TRANSLATING
.ILcdGXYPainter/ILcdGXYEditor
that is used.- Parameters:
aFrom
- A list with point(s) where the edit originated. Should have the same length asaTo
, and the order of the points in both lists should be the same, e.g. the location of the first point ofaFrom
when the edit terminated should be passed as the first point inaTo
.aTo
- A list with point(s) where the edit terminated (so far). Should have the same length asaFrom
, and the order of the points in both list should be the same, e.g. the location of the first point ofaFrom
when the edit terminated should be passed as the first point inaTo
.- Returns:
- One of the constants in
TLcdGXYMultiPointEditControllerModel
that start withEDIT_HOW
.
-
getSelectControllerModel
Returns theTLcdGXYSelectControllerModel2
used for the selection operations.- Returns:
- the
TLcdGXYSelectControllerModel2
. - See Also:
-
setSelectControllerModel
Sets theTLcdGXYSelectControllerModel2
. This allows for instance to disable selection by touching labels etc... Please refer toTLcdGXYSelectControllerModel2
for more information.- Parameters:
aSelectControllerModel
- The select controller model to set. Must not benull
- See Also:
-
getEditControllerModel
Returns the
TLcdGXYMultiPointEditControllerModel
used for the editing operations.- Returns:
- the
TLcdGXYMultiPointEditControllerModel
- See Also:
-
setEditControllerModel
Sets theTLcdGXYMultiPointEditControllerModel
used for the edit operations. This allows to customize the editing logic, such as which objects should be edited, etc. . Please refer toTLcdGXYMultiPointEditControllerModel
for more information.- Parameters:
aEditControllerModel
- The edit controller model to set. May benull
. When set tonull
, this controller will no longer try to edit and only perform selection.- See Also:
-
setSnappables
Sets the set of objects that are used as candidates-to-snap-to while editing other objects. Set to
Please refer to the developer guide for more information about snapping.null
to disable snapping.- Parameters:
aSnappables
- the list of objects that are candidates to snap to.- See Also:
-
getSnappables
Returns the snappables.
- Returns:
- the snappables.
- See Also:
-
setMoveThreshold
public void setMoveThreshold(int aMoveThreshold) Sets the threshold for move events.
Only MOVED events describing a move of the point to a location further then the threshold in either the X or Y direction from its previous location should be considered by this controller.
For example, when the threshold is set to 5, and the point is currently located at location (A,B), all move events should not be considered by this controller until the point is moved to a new location (A+x, B+y) where the absolute value of x and/or y must at least be 5.
The new value of the threshold will not affect any events which arrived at the controller prior to the change in threshold.
The default value for this property is 0, which means every move of a tracked input point will be handled.
- Parameters:
aMoveThreshold
- the threshold for move events. Must be positive.- See Also:
-
getMoveThreshold
public int getMoveThreshold()Returns the current threshold for move events.
Only TOUCH_POINT_MOVED events describing a move of the point to a location further then the threshold in either the X or Y direction from its previous location should be considered by this controller.
For example, when the threshold is set to 5, and the point is currently located at location (A,B), all move events should not be considered by this controller until the point is moved to a new location (A+x, B+y) where the absolute value of x and/or y must at least be 5.
The default value for this property is 10.
- Returns:
- the current threshold for move events
- See Also:
-
isDragRectangle
public boolean isDragRectangle()This method indicates whether or not this controller will drag a rectangle and select all objects, interacting with the rectangle, or select objects on a TOUCH_DOWN event.- Returns:
- true if drag rectangle mode is active, and false if object are selected by a touch.
-
setDragRectangle
public void setDragRectangle(boolean aDrag) This method can be used to toggle between selecting by dragging a rectangle, and selecting by a single touch.- Parameters:
aDrag
- true indicates selecting by dragging a rectangle, false indicates selecting the object you touch.
-
getTouchAndHoldAction
Returns the action which is triggered when a touch-and-hold is detected.- Returns:
- the action which is triggered when a touch-and-hold is detected. The default value is
null
- See Also:
-
setTouchAndHoldAction
Sets the action which is triggered when a touch-and-hold is detected.
A typical use case is to display a context-menu on a touch-and-hold.
- Parameters:
aTouchAndHoldAction
- the action to trigger when a touch-and-hold is detected. May benull
- See Also:
-
getTouchAndHoldIcon
Returns the icon used to indicate the touch-and-hold.- Returns:
- the icon used to indicate the touch-and-hold. The default value is
null
- See Also:
-
setTouchAndHoldIcon
Sets the icon which will be used to indicate a touch-and-hold. It is painted at the input location from the moment the touch-and-hold action is executed until the post touch-and-hold action is executed.
When the view is an instance of
Component
, it is passed to theILcdIcon.paintIcon(java.awt.Component, java.awt.Graphics, int, int)
method. This allows for animated icons. In such case, the animated icon should callComponent.repaint()
every time it changes.- Parameters:
aTouchAndHoldIcon
- the icon. May benull
.- See Also:
-
getPostTouchAndHoldAction
Returns the action which will be triggered when the input point which caused a touch-and-hold is removed.- Returns:
- the action which will be triggered when the input point which caused a touch-and-hold
is removed. The default value is
null
- See Also:
-
setPostTouchAndHoldAction
Sets the action which will be triggered when the input point which caused a touch-and-hold is removed.- Parameters:
aPostTouchAndHoldAction
- the action which will be triggered when the input point which caused a touch-and-hold is removed. May benull
-
getTouchAndHoldDelay
public int getTouchAndHoldDelay()Returns the time a touch must remain immobile (within the move threshold) to cause a touch and hold.- Returns:
- the time it takes for a touch and hold to occur.
- See Also:
-
setTouchAndHoldDelay
public void setTouchAndHoldDelay(int aTouchAndHoldDelay) Sets the time a touch must remain immobile (within the move threshold) to cause a touch and hold. The default value is 1000.- Parameters:
aTouchAndHoldDelay
- the time it will take for a touch and hold to occur.- See Also:
-
isInstantEditing
public boolean isInstantEditing()This method indicates whether the object being edited is painted in a temporary state and only changed when a touch point is removed or created, or whether the object is instantly edited while the touch point(s) are moved.
The default value for this property is
false
.- Returns:
true
if this controller instantly edits objects, without painting them in a temporary state,false
otherwise.- See Also:
-
setInstantEditing
public void setInstantEditing(boolean aInstantEditing) The method can be used to activate or deactivate instant editing. When instant editing is enabled objects will be edited whenever a touch point is moved. When it is disabled, objects will be edited only when the touch points are removed or created, and will be painted in a temporary state. When enabling instant editing, take into account:- performance may suffer, the view invalidates the layer that is edited, and as a result this layer has to be repainted.
- no snap targets will be visible, snapping will still work but with less feedback.
- when dragging a handle over another handle, it's possible that the second handle is edited instead of the first
The recommended value for multi-editing is
true
.- Parameters:
aInstantEditing
- when true instant editing will be enabled, when false disabled.- See Also:
-