public class IlvDiagrammerSelectionSupport extends IlvSelectionSupport
IlvSelectionSupport
implementation dedicated
to the diagrammer.
On the client-side, the IlvSelectionManager
class
is dealing with requests to and responses from this Servlet support class.
IlvSelectionSupport.IlvSelectionResponse
Modifier and Type | Field and Description |
---|---|
static String |
DIAGRAMMER_KEY
The key to retrieve the diagrammer from the selection response object.
|
REQUEST_TYPE
Constructor and Description |
---|
IlvDiagrammerSelectionSupport(IlvDiagrammerServletSupport support)
Creates a
IlvDiagrammerSelectionSupport instance. |
Modifier and Type | Method and Description |
---|---|
protected void |
addSelectedLink(IlvGraphic obj)
Adds the
IlvGraphic object to the selected link list. |
protected void |
clearSelectedLink(IlvGraphic obj)
Clear the selected link list.
|
protected void |
deselectAll(javax.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response,
IlvDiagrammer diagrammer)
Cancels the selection of all the objects in the specified diagram
component.
|
protected void |
doGetDeselectAll(javax.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response)
Attempts to deselect all the objects that are currently selected.
|
protected void |
doGetSelectAll(javax.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response)
Attempts to select all the selectable objects.
|
protected void |
doGetSelectOne(javax.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response,
int x,
int y)
Clears the current selections and attempts to select the object at a given position
If a selectable object is found with the specified position, it is selected.
|
protected void |
doGetSelectOneById(javax.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response,
String id)
Clears the current selections and attempts to select the object with the specified identifier.
|
protected void |
doGetSelectOneMultiple(javax.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response,
int x,
int y)
Attempts to extend the selection with the object at a given position, if
any.
|
protected void |
doGetSelectOneMultipleById(javax.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response,
String id)
Attempts to extend the selection with the object with the specified identifier,
if any.
|
protected void |
doGetUpdateAll(javax.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response)
Resynchronizes the selection on the client from the server-side state of
selection.
|
protected void |
doGetUpdatedCapabilities(javax.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response)
Updates the capabilities that have changed.
|
protected void |
doPostSetProperties(javax.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response,
List list)
This method is called to manage the update on the server-side of properties
that have been changed on selected objects on the client-side.
|
protected List |
getAdditionalProperties(IlvSelectionSupport.IlvSelectionResponse response,
Object object)
Returns additional information about a selected object.
|
List<IlvLinkImage> |
getSelectedLink()
Gets the link whick is selected.
|
protected Iterator |
getSelectedObjects(javax.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response,
IlvDiagrammer diagrammer)
Returns the nodes and links currently selected in the diagram
component.
|
IlvDiagrammerServletSupport |
getSupport()
Returns the
IlvDiagrammerServletSupport instance attached to
this support. |
protected void |
initializeResponseProperties(IlvSelectionSupport.IlvSelectionResponse response,
javax.servlet.http.HttpServletRequest request)
Overrides
IlvSelectionSupport.initializeResponseProperties(ilog.views.util.servlet.IlvSelectionSupport.IlvSelectionResponse, javax.servlet.http.HttpServletRequest)
to add the diagrammer to the response properties. |
void |
installListeners()
Installs the mandatory server listeners to properly use this selection
support.
|
protected boolean |
isResizable(IlvSelectionSupport.IlvSelectionResponse response,
Object selectedObj)
Checks the selected object whether is resizable or not.
|
protected boolean |
isSelectable(javax.servlet.http.HttpServletRequest request,
IlvManagerServletSupport support,
IlvSDMView view,
IlvGraphic obj)
Returns whether this object can be selected or not.
|
protected boolean |
isSelected(javax.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response,
IlvDiagrammer diagrammer,
IlvGraphic obj)
Tests if the specified object is selected.
|
void |
removeListeners()
Removes listeners previously installed by
installListeners . |
protected void |
selectAll(javax.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response,
IlvDiagrammer diagrammer)
Selects all the objects in the specified diagrammer.
|
protected void |
setSelected(javax.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response,
IlvDiagrammer diagrammer,
IlvGraphic obj,
boolean selected)
Selects the specified object.
|
getLastSelectedObject, handleRequest, setAdditionalProperties, setLastSelectedObject
public static final String DIAGRAMMER_KEY
public IlvDiagrammerSelectionSupport(IlvDiagrammerServletSupport support)
IlvDiagrammerSelectionSupport
instance.support
- The image servlet support.public IlvDiagrammerServletSupport getSupport()
IlvDiagrammerServletSupport
instance attached to
this support.public void installListeners()
installListeners
in class IlvSelectionSupport
public void removeListeners()
installListeners
.removeListeners
in class IlvSelectionSupport
protected void initializeResponseProperties(IlvSelectionSupport.IlvSelectionResponse response, javax.servlet.http.HttpServletRequest request) throws javax.servlet.ServletException
IlvSelectionSupport.initializeResponseProperties(ilog.views.util.servlet.IlvSelectionSupport.IlvSelectionResponse, javax.servlet.http.HttpServletRequest)
to add the diagrammer to the response properties.
To retrieve the diagrammer from the response object:
IlvDiagrammer diagrammer = (IlvDiagrammer) response.getProperty(DIAGRAMMER_KEY);
initializeResponseProperties
in class IlvSelectionSupport
response
- The selection response object.request
- The HTTP request.javax.servlet.ServletException
protected void doGetUpdateAll(javax.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response) throws IOException, javax.servlet.ServletException
doGetUpdateAll
in class IlvSelectionSupport
request
- The HTTP request.response
- The response object.IOException
javax.servlet.ServletException
protected void doGetSelectOne(javax.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response, int x, int y) throws IOException, javax.servlet.ServletException
doGetSelectOne
in class IlvSelectionSupport
request
- The HTTP request.response
- The response object.x
- The x coordinate of the point in view coordinates.y
- The y coordinate of the point in view coordinatesIOException
javax.servlet.ServletException
protected void doGetSelectOneMultiple(javax.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response, int x, int y) throws IOException, javax.servlet.ServletException
doGetSelectOneMultiple
in class IlvSelectionSupport
request
- The HTTP request.response
- The response object.x
- The x coordinate of the point in view coordinates.y
- The y coordinate of the point in view coordinates.IOException
javax.servlet.ServletException
protected void doGetDeselectAll(javax.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response) throws IOException, javax.servlet.ServletException
doGetDeselectAll
in class IlvSelectionSupport
request
- The HTTP request.response
- The response object.IOException
javax.servlet.ServletException
protected void doGetSelectAll(javax.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response) throws IOException, javax.servlet.ServletException
doGetSelectAll
in class IlvSelectionSupport
request
- The HTTP request.response
- The response object.IOException
javax.servlet.ServletException
protected void doGetSelectOneById(javax.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response, String id) throws IOException, javax.servlet.ServletException
doGetSelectOneById
in class IlvSelectionSupport
request
- The HTTP request.response
- The response object.id
- The identifier of the object to select.IOException
javax.servlet.ServletException
protected void doGetSelectOneMultipleById(javax.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response, String id) throws IOException, javax.servlet.ServletException
doGetSelectOneMultipleById
in class IlvSelectionSupport
request
- The HTTP request.response
- The response object.id
- The identifier of the object to select.IOException
javax.servlet.ServletException
protected boolean isSelected(javax.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response, IlvDiagrammer diagrammer, IlvGraphic obj)
request
- The http request.response
- The response object.diagrammer
- The diagrammer.obj
- The object.obj
is selected, true
is returned.protected void setSelected(javax.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response, IlvDiagrammer diagrammer, IlvGraphic obj, boolean selected)
This method implementation calls
IlvManager.setSelected(IlvGraphic, boolean, boolean)
to select
objects.
request
- The http request.response
- The response object.diagrammer
- The diagrammer.obj
- The object to select.selected
- If true
the object will be selected.protected void addSelectedLink(IlvGraphic obj)
IlvGraphic
object to the selected link list.protected void clearSelectedLink(IlvGraphic obj)
protected void selectAll(javax.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response, IlvDiagrammer diagrammer)
This method implementation calls
IlvManager.selectAll(boolean, boolean)
to select objects.
request
- The http request.response
- The response object.diagrammer
- The diagrammer.protected void deselectAll(javax.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response, IlvDiagrammer diagrammer)
Note: this method must not be called directly. It can be overridden to change the selection behavior.
This method implementation calls
IlvManager.deSelectAll(boolean,boolean)
to cancel object
selection.
request
- The HTTP request.response
- The response object.diagrammer
- The diagram component.protected Iterator getSelectedObjects(javax.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response, IlvDiagrammer diagrammer)
This method implementation calls
IlvDiagrammer.getSelectedObjects()
to return the selected
objects.
request
- The http request.response
- The response object.diagrammer
- The diagrammer.remove
operation.protected void doGetUpdatedCapabilities(javax.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response) throws javax.servlet.ServletException
doGetUpdatedCapabilities
in class IlvSelectionSupport
request
- The HTTP request.response
- The response object.javax.servlet.ServletException
protected void doPostSetProperties(javax.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response, List list) throws IOException
doPostSetProperties
in class IlvSelectionSupport
request
- The HTTP request.response
- The response object.list
- The List
of additional information on a selected
objects. Each item of this list is itself an List
that corresponds to properties a selected object.
Note that the first object of each of these sub lists is the unique identifier
of the selected object.IOException
protected List getAdditionalProperties(IlvSelectionSupport.IlvSelectionResponse response, Object object)
The overridden version adds the Tag property in addition to the properties
mandated by IlvSelectionSupport.getAdditionalProperties(IlvSelectionResponse, Object)
.
getAdditionalProperties
in class IlvSelectionSupport
response
- The selection response object.object
- The object selected or deselected.String
, an
array, a List
or Map
.
List
and arrays are rendered as JSON arrays on the
client and Map
are rendered as JSON objects on the
client.
Note that the two first objects must be:
ID
-- A unique identifier of the selected object.Movable
-- true
if this object is
movable, false
otherwise.Type
-- the type of the selected object.
protected boolean isResizable(IlvSelectionSupport.IlvSelectionResponse response, Object selectedObj)
isResizable
in class IlvSelectionSupport
response
- The selection response object.selectedObj
- the object that was selected.true
if object is resizable,false
otherwise. The default value is false
protected boolean isSelectable(javax.servlet.http.HttpServletRequest request, IlvManagerServletSupport support, IlvSDMView view, IlvGraphic obj)
manager.isSelectable(obj)
returns true
.
Where manager is the direct manager of this object.IlvManagerServletSupport.getDynamicLayers(HttpServletRequest, IlvManagerView)
.request
- The HTTP request.support
- The servlet support.view
- The SDM view.obj
- The graphic object.true
if the object is selectable, false
otherwise.public List<IlvLinkImage> getSelectedLink()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.