| PREV CLASS Documentation homepage NEXT CLASS |
IlvObject | +--IlvAbstractSelectionManager
IlvAbstractSelectionManager class manages the selection of
objects with or without querying an image update.
The selection is rendered as an updated image or by a rectangle that encloses the selected object on top of the view.
Additional information on selection is available in the
properties property of each selection rectangle.
| Constructor Summary | |
|---|---|
IlvAbstractSelectionManager(init, moveActionName, selectionActionName, deleteActionName)
|
|
| Method Summary | |
|---|---|
abortDragging(e)
Abort dragging of the selection. |
|
addSelectionChangedListener(listener)
Add a listener called when the selection has changed. |
|
applyToAll(f)
Applies a function to all rectangles. |
|
clipAll()
Reset the clip rectangle of all selection rectangles to match the new size of the view. |
|
commitSelectionProperties(updateImage, oncompleted, onfailed)
Commits potential modifications of the selection objects properties to the server. |
|
deleteSelection()
Fires an action that is in charge of deleting the selected objects. |
|
deselectAll()
Queries a deselection of all the selected objects. |
|
doSelect(e)
Performs a selection at the specified mouse click. |
|
findById(id)
Returns the selection rectangle that corresponds to the selected object with the given id, null if none is found. |
|
getLineColor()
Returns the current color of the selection rectangles. |
|
getLineWidth()
Returns the line width of the selection rectangles. |
|
getMultipleSelectionKey()
Returns the modifier key used to perform multiple selections. |
|
getScrollPosition()
Returns the scroll position of this IlvRectangle. |
|
getSelection()
Returns the current selection. |
|
getViewPosition()
Returns the position of the attached view. |
|
hideAll()
Hides all the selection rectangles. |
|
hideNotMovable()
Hides the selection for objects that cannot be moved. |
|
isFillOn()
Returns whether the selection rectangles are filled or hollow. |
|
isHiddenWhenDragging(r)
Returns whether a selection rectangle should be hidden while the current selection is dragged. |
|
isImageMode()
Returns true when the selection manager is in image mode,
false otherwise. |
|
isMovable(r)
Returns true |
|
isMoveAllowed()
Returns true when the elements in the view can be moved. |
|
isMultipleSelection(e)
Returns true if the event is a multiple selection event, false
otherwise. |
|
isSelectionMovable()
Returns true if the current selection contains at least
one movable object, false otherwise. |
|
onSelectionLoaded(context)
Callback to process the response of the server after an update of the selection. |
|
performUpdateImage()
Query a new image. |
|
performUpdateImageMode()
Updates the server with the new image mode value. |
|
recycle(id)
Recycles the rectangle identified by the ID passed as parameter. |
|
recycleAll()
Recycles all the selection rectangles. |
|
removeSelectionChangedListener(listener)
Removes a listener installed with addSelectionChangedListener. |
|
selectAll()
Queries a selection of all the objects. |
|
selectById(id, extend)
Queries an update of the selection for a simple selection. |
|
selectMulti(x, y)
Queries an update of the selection for an extension of the selection. |
|
selectOne(x, y, mouseUp)
Queries an update of the selection for a simple selection. |
|
sendRequest(request)
Sends a selection request to the server. |
|
setFillOn(fillOn)
Defines whether the selection rectangles are filled or hollow. |
|
setForceUpdateProperties(force)
Sets whether the selection manager should query the server for the current selection and the properties of the selected objects. |
|
setImageMode(imageMode)
Activates or deactivates the image selection mode. |
|
setLineColor(color)
Sets the color of the rectangles representing the current selection. |
|
setLineWidth(lineWidth)
Sets the line width of the selection rectangles. |
|
setMoveAllowed(moveAllowed)
Allows or forbids to move elements in the view. |
|
setMultipleSelectionKey(key)
Sets the modifier key used to perform multiple selections. |
|
setScrollPosition(x, y)
Sets the scroll position of the selection rectangles. |
|
showAll()
Shows all the selection rectangles. |
|
showMovable()
Shows the selection rectangles for objects that are moveable, and hides the others. |
|
startDragging(e)
Initializes the dragging of the selection. |
|
stopDragging(e)
Complete dragging of the selection and performs a server action if needed. |
|
updateAll()
Queries a full selection update. |
|
updateCapabilities(context, view)
Updates capabilities that have changed. |
|
updateSelectionProperties()
Queries the server for the selected objects and their properties. |
|
whileDragging(e)
Performs the dragging of the selection. |
|
| Constructor Detail |
IlvAbstractSelectionManager(init, moveActionName, selectionActionName, deleteActionName)
| Method Detail |
abortDragging(e)
e - The event.addSelectionChangedListener(listener)
listener - The listener function, which must have the following
parameter:
rectangleList: The list of rectangles
representing the current selection.applyToAll(f)
f - The function, which must have the following parameters:
selectionManager: The selection manager.rectangle: The current rectangle.clipAll()
commitSelectionProperties(updateImage, oncompleted, onfailed)
IlvSelectionSupport handles such requests. updateImage - When true update the view image once
the properties have been updated.oncompleted - An optional handler that will be executed when the
the commit response has been sent back by the server.
The handler can take as parameter an array
of IlvSelectionPropertiesError objects.
The this value is the
IlvAbstractSelectionManager. No error is send
if the model is not editable.onfailed - An optional handler that will be executed when the
commit did not occur because of network problems, in which
case you might consider re-submitting the commit. The
this value is the IlvAbstractSelectionManager.
deleteSelection()
deselectAll()
To use this method, the server side selection support must support this selection type.
doSelect(e)
This methods handles multiple selections (using multiple selection key).
e - The MouseEvent that triggers the selection.
#setMultipleSelectionKeyfindById(id)
id, null if none is found. getLineColor()
getLineWidth()
getMultipleSelectionKey()
getScrollPosition()
IlvRectangle.
Note: You are not allowed to modify the object returned by this method. To
modify the scroll position of a panel, use the setScrollPosition
method. x and y.getSelection()
IlvSelectionRectangle instances. When additional
properties are defined they can be retrieved using the
getProperties() method.
The selection could be null.
IlvSelectionRectangle#getProperties()getViewPosition()
hideAll()
hideNotMovable()
isFillOn()
true when the selection rectangles are filled.isHiddenWhenDragging(r)
false, redefine this method when necessary.
isImageMode()
true when the selection manager is in image mode,
false otherwise.
See setImageMode for more details on image mode.
isMovable(r)
true if the rectangle is movable,
false otherwise. r - The selection rectangle.isMoveAllowed()
true when the elements in the view can be moved. isMultipleSelection(e)
true if the event is a multiple selection event, false
otherwise. isSelectionMovable()
true if the current selection contains at least
one movable object, false otherwise. onSelectionLoaded(context)
context - the context containing JavaScript variables send by the server.performUpdateImage()
performUpdateImageMode()
recycle(id)
recycleAll()
removeSelectionChangedListener(listener)
addSelectionChangedListener. listener - The listener to remove.selectAll()
To use this method, the server side selection support must support this selection type.
selectById(id, extend)
extend parameter value:
false (default value): the current selection is cleared and the object specified by the id
identifier is selected, if found.true: the current selection is kept and
id
identifier is already selected, it is removed from the current selection.To use this method, the server side selection support must support this selection type.
id - The identifier of the object to select or deselect.extend - Whether extend/reduce the selection with the object specified by the identifier.
The default value is false if this parameter is omitted.
selectMulti(x, y)
x - The x coordinate of the clicked point in image coordinates.y - The x coordinate of the clicked point in image coordinates.selectOne(x, y, mouseUp)
x - The x coordinate of the clicked point in image coordinates.y - The x coordinate of the clicked point in image coordinates.sendRequest(request)
setFillOn(fillOn)
true -- the selection rectangles are
filled. The fill color is the line color with an transparency of 50%. fillOn - true when the selection rectangles are filled.setForceUpdateProperties(force)
force - true to have the selection objects and their
properties uploaded from the server in image mode.
false, the default, to reduce the number of
requests to the server when you don't need to manipulate the
selection or the properties of the selected objects on the
client.
setImageMode(imageMode)
When the image selection mode is active, the selection is rendered by the server as an updated image. Each change in the selection results in a query for an updated image. Additional information and selection listener are disabled until updateAll() is invoked.
When the image selection mode is inactive, the selection is rendered as rectangles around the selected objects. Changes in the selection result in queries for the bouding box of objects and additional informations.
The image selection mode is active by default.
imageMode - true to activate the image selection mode;
false to deactivate it.setLineColor(color)
black. color - The color to set.setLineWidth(lineWidth)
setMoveAllowed(moveAllowed)
moveNodeAction to handle moving elements. setMultipleSelectionKey(key)
'ctrl' and 'shift'. key - The modifier key to activate the multiple selection.setScrollPosition(x, y)
x - The scroll position along the x-axis, relative to the top of the
panel.y - The scroll position along the y-axis, relative to the left side of
the panel.
showAll()
showMovable()
startDragging(e)
e - The event.stopDragging(e)
e - The event.updateAll()
updateCapabilities(context, view)
updateSelectionProperties()
The selection listener will be triggered when the information is available.
This method should be used in image mode.
whileDragging(e)
e - The event.| Inherited Methods from IlvObject |
| PREV CLASS Documentation homepage NEXT CLASS |