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(jakarta.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response,
IlvDiagrammer diagrammer)
Cancels the selection of all the objects in the specified diagram
component.
|
protected void |
doGetDeselectAll(jakarta.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response)
Attempts to deselect all the objects that are currently selected.
|
protected void |
doGetSelectAll(jakarta.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response)
Attempts to select all the selectable objects.
|
protected void |
doGetSelectOne(jakarta.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(jakarta.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(jakarta.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(jakarta.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(jakarta.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response)
Resynchronizes the selection on the client from the server-side state of
selection.
|
protected void |
doGetUpdatedCapabilities(jakarta.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response)
Updates the capabilities that have changed.
|
protected void |
doPostSetProperties(jakarta.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(jakarta.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,
jakarta.servlet.http.HttpServletRequest request)
Overrides
IlvSelectionSupport.initializeResponseProperties(ilog.views.util.servlet.IlvSelectionSupport.IlvSelectionResponse, jakarta.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(jakarta.servlet.http.HttpServletRequest request,
IlvManagerServletSupport support,
IlvSDMView view,
IlvGraphic obj)
Returns whether this object can be selected or not.
|
protected boolean |
isSelected(jakarta.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(jakarta.servlet.http.HttpServletRequest request,
IlvSelectionSupport.IlvSelectionResponse response,
IlvDiagrammer diagrammer)
Selects all the objects in the specified diagrammer.
|
protected void |
setSelected(jakarta.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, jakarta.servlet.http.HttpServletRequest request) throws jakarta.servlet.ServletException
IlvSelectionSupport.initializeResponseProperties(ilog.views.util.servlet.IlvSelectionSupport.IlvSelectionResponse, jakarta.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.jakarta.servlet.ServletException
protected void doGetUpdateAll(jakarta.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response) throws IOException, jakarta.servlet.ServletException
doGetUpdateAll
in class IlvSelectionSupport
request
- The HTTP request.response
- The response object.IOException
jakarta.servlet.ServletException
protected void doGetSelectOne(jakarta.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response, int x, int y) throws IOException, jakarta.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
jakarta.servlet.ServletException
protected void doGetSelectOneMultiple(jakarta.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response, int x, int y) throws IOException, jakarta.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
jakarta.servlet.ServletException
protected void doGetDeselectAll(jakarta.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response) throws IOException, jakarta.servlet.ServletException
doGetDeselectAll
in class IlvSelectionSupport
request
- The HTTP request.response
- The response object.IOException
jakarta.servlet.ServletException
protected void doGetSelectAll(jakarta.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response) throws IOException, jakarta.servlet.ServletException
doGetSelectAll
in class IlvSelectionSupport
request
- The HTTP request.response
- The response object.IOException
jakarta.servlet.ServletException
protected void doGetSelectOneById(jakarta.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response, String id) throws IOException, jakarta.servlet.ServletException
doGetSelectOneById
in class IlvSelectionSupport
request
- The HTTP request.response
- The response object.id
- The identifier of the object to select.IOException
jakarta.servlet.ServletException
protected void doGetSelectOneMultipleById(jakarta.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response, String id) throws IOException, jakarta.servlet.ServletException
doGetSelectOneMultipleById
in class IlvSelectionSupport
request
- The HTTP request.response
- The response object.id
- The identifier of the object to select.IOException
jakarta.servlet.ServletException
protected boolean isSelected(jakarta.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(jakarta.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(jakarta.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(jakarta.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(jakarta.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(jakarta.servlet.http.HttpServletRequest request, IlvSelectionSupport.IlvSelectionResponse response) throws jakarta.servlet.ServletException
doGetUpdatedCapabilities
in class IlvSelectionSupport
request
- The HTTP request.response
- The response object.jakarta.servlet.ServletException
protected void doPostSetProperties(jakarta.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(jakarta.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 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.