ilog.views.diagrammer.servlet
Class IlvDiagrammerSelectionSupport

java.lang.Object
  extended by ilog.views.util.servlet.IlvSelectionSupport
      extended by ilog.views.diagrammer.servlet.IlvDiagrammerSelectionSupport
Direct Known Subclasses:
IlvFacesDiagrammerSelectionSupport

public class IlvDiagrammerSelectionSupport
extends IlvSelectionSupport

This class is the 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.

Since:
JViews 7.5

Nested Class Summary
 
Nested classes/interfaces inherited from class ilog.views.util.servlet.IlvSelectionSupport
IlvSelectionSupport.IlvSelectionResponse
 
Field Summary
static String DIAGRAMMER_KEY
          The key to retrieve the diagrammer from the selection response object.
 
Fields inherited from class ilog.views.util.servlet.IlvSelectionSupport
REQUEST_TYPE
 
Constructor Summary
IlvDiagrammerSelectionSupport(IlvDiagrammerServletSupport support)
          Creates a IlvDiagrammerSelectionSupport instance.
 
Method Summary
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. The overridden version adds the Tag property in addition to the properties mandated by IlvSelectionSupport.getAdditionalProperties(IlvSelectionResponse, Object).
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.getAdditionalProperties(ilog.views.util.servlet.IlvSelectionSupport.IlvSelectionResponse, java.lang.Object) to add the diagrammer to the response properties.
 void installListeners()
          Installs the mandatory server listeners to properly use this selection support.
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.
 
Methods inherited from class ilog.views.util.servlet.IlvSelectionSupport
getLastSelectedObject, handleRequest, setAdditionalProperties, setLastSelectedObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIAGRAMMER_KEY

public static final String DIAGRAMMER_KEY
The key to retrieve the diagrammer from the selection response object.

See Also:
Constant Field Values
Constructor Detail

IlvDiagrammerSelectionSupport

public IlvDiagrammerSelectionSupport(IlvDiagrammerServletSupport support)
Creates a IlvDiagrammerSelectionSupport instance.

Parameters:
support - The image servlet support.
Method Detail

getSupport

public IlvDiagrammerServletSupport getSupport()
Returns the IlvDiagrammerServletSupport instance attached to this support.

Returns:
The image servlet support.

installListeners

public void installListeners()
Installs the mandatory server listeners to properly use this selection support.

Specified by:
installListeners in class IlvSelectionSupport

removeListeners

public void removeListeners()
Removes listeners previously installed by installListeners.

Specified by:
removeListeners in class IlvSelectionSupport

initializeResponseProperties

protected void initializeResponseProperties(IlvSelectionSupport.IlvSelectionResponse response,
                                            javax.servlet.http.HttpServletRequest request)
                                     throws javax.servlet.ServletException
Overrides IlvSelectionSupport.getAdditionalProperties(ilog.views.util.servlet.IlvSelectionSupport.IlvSelectionResponse, java.lang.Object) to add the diagrammer to the response properties. To retrieve the diagrammer from the response object:
 
 IlvDiagrammer diagrammer = (IlvDiagrammer) response.getProperty(DIAGRAMMER_KEY);
 

Overrides:
initializeResponseProperties in class IlvSelectionSupport
Parameters:
response - The selection response object.
request - The HTTP request.
Throws:
javax.servlet.ServletException

doGetUpdateAll

protected void doGetUpdateAll(javax.servlet.http.HttpServletRequest request,
                              IlvSelectionSupport.IlvSelectionResponse response)
                       throws IOException,
                              javax.servlet.ServletException
Resynchronizes the selection on the client from the server-side state of selection.

Specified by:
doGetUpdateAll in class IlvSelectionSupport
Parameters:
request - The HTTP request.
response - The response object.
Throws:
IOException
javax.servlet.ServletException

doGetSelectOne

protected void doGetSelectOne(javax.servlet.http.HttpServletRequest request,
                              IlvSelectionSupport.IlvSelectionResponse response,
                              int x,
                              int y)
                       throws IOException,
                              javax.servlet.ServletException
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. The response updates the client-side selection accordingly.

Specified by:
doGetSelectOne in class IlvSelectionSupport
Parameters:
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
Throws:
IOException
javax.servlet.ServletException

doGetSelectOneMultiple

protected void doGetSelectOneMultiple(javax.servlet.http.HttpServletRequest request,
                                      IlvSelectionSupport.IlvSelectionResponse response,
                                      int x,
                                      int y)
                               throws IOException,
                                      javax.servlet.ServletException
Attempts to extend the selection with the object at a given position, if any. The response updates the client-side selection accordingly. If a selectable object is found at the specified position it is added or removed to the selection: an already selected object is deselected; an unselected object is selected. Otherwise (there was no selectable object), the selection is unchanged.

Specified by:
doGetSelectOneMultiple in class IlvSelectionSupport
Parameters:
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.
Throws:
IOException
javax.servlet.ServletException

doGetDeselectAll

protected void doGetDeselectAll(javax.servlet.http.HttpServletRequest request,
                                IlvSelectionSupport.IlvSelectionResponse response)
                         throws IOException,
                                javax.servlet.ServletException
Attempts to deselect all the objects that are currently selected. The response updates the client-side selection accordingly.

Overrides:
doGetDeselectAll in class IlvSelectionSupport
Parameters:
request - The HTTP request.
response - The response object.
Throws:
IOException
javax.servlet.ServletException
Since:
JViews 8.1

doGetSelectAll

protected void doGetSelectAll(javax.servlet.http.HttpServletRequest request,
                              IlvSelectionSupport.IlvSelectionResponse response)
                       throws IOException,
                              javax.servlet.ServletException
Attempts to select all the selectable objects. The response updates the client-side selection accordingly.

Overrides:
doGetSelectAll in class IlvSelectionSupport
Parameters:
request - The HTTP request.
response - The response object.
Throws:
IOException
javax.servlet.ServletException
Since:
JViews 8.1

doGetSelectOneById

protected void doGetSelectOneById(javax.servlet.http.HttpServletRequest request,
                                  IlvSelectionSupport.IlvSelectionResponse response,
                                  String id)
                           throws IOException,
                                  javax.servlet.ServletException
Clears the current selections and attempts to select the object with the specified identifier. If a selectable object is found with the specified identifier, it is selected. The response updates the client-side selection accordingly.

Overrides:
doGetSelectOneById in class IlvSelectionSupport
Parameters:
request - The HTTP request.
response - The response object.
id - The identifier of the object to select.
Throws:
IOException
javax.servlet.ServletException
Since:
JViews 8.1

doGetSelectOneMultipleById

protected void doGetSelectOneMultipleById(javax.servlet.http.HttpServletRequest request,
                                          IlvSelectionSupport.IlvSelectionResponse response,
                                          String id)
                                   throws IOException,
                                          javax.servlet.ServletException
Attempts to extend the selection with the object with the specified identifier, if any. The response updates the client-side selection accordingly. If a selectable object is found with the specified identifier, it is added or removed to the selection: an already selected object is deselected; an unselected object is selected. Otherwise (there was no selectable object), the selection is unchanged.

Overrides:
doGetSelectOneMultipleById in class IlvSelectionSupport
Parameters:
request - The HTTP request.
response - The response object.
id - The identifier of the object to select.
Throws:
IOException
javax.servlet.ServletException
Since:
JViews 8.1

isSelected

protected boolean isSelected(javax.servlet.http.HttpServletRequest request,
                             IlvSelectionSupport.IlvSelectionResponse response,
                             IlvDiagrammer diagrammer,
                             IlvGraphic obj)
Tests if the specified object is selected. This method must not be called directly. It can be overridden to change the selection behavior.

Parameters:
request - The http request.
response - The response object.
diagrammer - The diagrammer.
obj - The object.
Returns:
If obj is selected, true is returned.
Since:
JViews 8.1

setSelected

protected void setSelected(javax.servlet.http.HttpServletRequest request,
                           IlvSelectionSupport.IlvSelectionResponse response,
                           IlvDiagrammer diagrammer,
                           IlvGraphic obj,
                           boolean selected)
Selects the specified object. This method must not be called directly. It can be overridden to change the selection behavior.

This method implementation calls IlvManager.setSelected(IlvGraphic, boolean, boolean) to select objects.

Parameters:
request - The http request.
response - The response object.
diagrammer - The diagrammer.
obj - The object to select.
selected - If true the object will be selected.
Since:
JViews 8.1

selectAll

protected void selectAll(javax.servlet.http.HttpServletRequest request,
                         IlvSelectionSupport.IlvSelectionResponse response,
                         IlvDiagrammer diagrammer)
Selects all the objects in the specified diagrammer. This method must not be called directly. It can be overridden to change the selection behavior.

This method implementation calls IlvManager.selectAll(boolean, boolean) to select objects.

Parameters:
request - The http request.
response - The response object.
diagrammer - The diagrammer.
Since:
JViews 8.1

deselectAll

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.

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.

Parameters:
request - The HTTP request.
response - The response object.
diagrammer - The diagram component.
Since:
JViews 8.1

getSelectedObjects

protected Iterator getSelectedObjects(javax.servlet.http.HttpServletRequest request,
                                      IlvSelectionSupport.IlvSelectionResponse response,
                                      IlvDiagrammer diagrammer)
Returns the nodes and links currently selected in the diagram component. This method must not be called directly. It can be overridden to change the selection behavior.

This method implementation calls IlvDiagrammer.getSelectedObjects() to return the selected objects.

Parameters:
request - The http request.
response - The response object.
diagrammer - The diagrammer.
Returns:
An iterator over the selected node or link objects. This iterator does not support the remove operation.
Since:
JViews 8.1

doGetUpdatedCapabilities

protected void doGetUpdatedCapabilities(javax.servlet.http.HttpServletRequest request,
                                        IlvSelectionSupport.IlvSelectionResponse response)
                                 throws javax.servlet.ServletException
Updates the capabilities that have changed.

Overrides:
doGetUpdatedCapabilities in class IlvSelectionSupport
Parameters:
request - The HTTP request.
response - The response object.
Throws:
javax.servlet.ServletException

doPostSetProperties

protected void doPostSetProperties(javax.servlet.http.HttpServletRequest request,
                                   IlvSelectionSupport.IlvSelectionResponse response,
                                   List list)
                            throws IOException
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.

Overrides:
doPostSetProperties in class IlvSelectionSupport
Parameters:
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.
Throws:
IOException
Since:
JViews 8.0

getAdditionalProperties

protected List getAdditionalProperties(IlvSelectionSupport.IlvSelectionResponse response,
                                       Object object)
Returns additional information about a selected object.

The overridden version adds the Tag property in addition to the properties mandated by IlvSelectionSupport.getAdditionalProperties(IlvSelectionResponse, Object).

Specified by:
getAdditionalProperties in class IlvSelectionSupport
Parameters:
response - The selection response object.
object - The object selected or deselected.
Returns:
An array list of additional information on a selected/deselected object. Each item of the list could be a 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.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.