IlvDiagrammerViewProxy

IlvObject
  |
  +--IlvPropertyStateManager
       |
       +--IlvFacesProxy
            |
            +--IlvSizedViewProxy
                 |
                 +--IlvBasicViewProxy
                      |
                      +--IlvFacesViewProxy
                           |
                           +--IlvDiagrammerViewProxy
Category:
Diagrammer JSF component
JavaScript File:
IlvDiagrammerViewProxy.js
Description:
The IlvDiagrammerViewProxy is an extension of the IlvFacesViewProxy for the JViews Diagrammer module.

Constructor Summary
IlvDiagrammerViewProxy(clientId, refNodeId, width, height, editable)

Method Summary
createLink(sourceX, sourceY, destX, destY, tag, properties)
Creates a link on the diagram from (sourceX, sourceY) position to (destX, destY) position, providing that nodes existing at that two positions.
createNode(x, y, tag, properties)
Creates a node on the diagram at the given (x, y) position.
getDataSourceId()
Returns the data source identifier.
getProject()
Returns the diagrammer project URL, if set.
getSelectionManager()
Returns the selection manager of this view.
getStyleSheets()
Returns the style sheets set on this component.
performJSFAction(mb, params, capabilities, capabilitiesParams)
Performs a predefined action that will invoke the specified method binding.
setCreateLinkInteractor(tag, oneshot, properties)
Sets an interactor on the view that allows you to create a link on the diagram with the given tag.
setCreateNodeInteractor(tag, oneshot, properties)
Sets an interactor on the view that allows you to create a node on the diagram with the given tag.
setDataSourceId(dataSourceId, update)
Sets the data source identifier.
setProject(project, update, showAll)
Sets the JViews Diagrammer Designer project URL.
setStyleSheets(css, update)
Sets the style sheets to apply to the diagrammer.

Constructor Detail

IlvDiagrammerViewProxy

IlvDiagrammerViewProxy(clientId, refNodeId, width, height, editable)
Creates an instance of IlvDiagrammerViewProxy.

Method Detail

createLink

createLink(sourceX, sourceY, destX, destY, tag, properties)
Creates a link on the diagram from (sourceX, sourceY) position to (destX, destY) position, providing that nodes existing at that two positions. It does nothing if the corresponding <jvdf:diagrammerView/> is not editable.
An example is:
 var sourceX, sourceY;
 function onmousedown(e) {
   // store position
   var e = diag_proxy.getObject().getGlassView().enhanceEvent(e);
   sourceX = e.mouseX;
   sourceY = e.mouseY; 
 }
 function onmouseclicked(e) {
   var e = diag_proxy.getObject().getGlassView().enhanceEvent(e);
   diag_proxy.createNode(sourceX, sourceY, e.mouseX, e.mouseY, "tag");
 }
 
Parameters:
x - the x coordinate where to create the node in the client-side view coordinate system.
y - the y coordinate where to create the node in the client-side view coordinate system.
tag - The tag of the created node.
properties - an object of properties to be set containing keys and values for each of the property to be set at creation time ({propertyName1:"propertyValue1", propertyName2:"propertyValue2"}). This parameter is optional.

Since:
JViews 8.1


createNode

createNode(x, y, tag, properties)
Creates a node on the diagram at the given (x, y) position. It does nothing if the corresponding <jvdf:diagrammerView/> is not editable.
An example is:
 function onmouseclicked(e) {
   var e = diag_proxy.getObject().getGlassView().enhanceEvent(e);
   diag_proxy.createNode(e.mouseX, e.mouseY, "tag");
 }
 
Parameters:
x - the x coordinate where to create the node in the client-side view coordinate system.
y - the y coordinate where to create the node in the client-side view coordinate system.
tag - The tag of the created node.
properties - an object of properties to be set containing keys and values for each of the property to be set at creation time ({propertyName1:"propertyValue1", propertyName2:"propertyValue2"}). This parameter is optional.

Since:
JViews 8.1


getDataSourceId

getDataSourceId()
Returns the data source identifier.

getProject

getProject()
Returns the diagrammer project URL, if set.
Returns:
The project.

getSelectionManager

getSelectionManager()
Returns the selection manager of this view.
Returns:
The selection manager.

getStyleSheets

getStyleSheets()
Returns the style sheets set on this component. They are, or will be, applied during the image request.
Returns:
The style sheets set on this component.

performJSFAction

performJSFAction(mb, params, capabilities, capabilitiesParams)
Performs a predefined action that will invoke the specified method binding.

This action will be executed before the image generation.
The signature of the method must be void methodName (IlvDiagrammer, String[]) where the first parameter is the IlvDiagrammer instance used to draw the diagram and the second parameter is the array of action parameters. The action must only change the IlvDiagrammer instance as only the image is refreshed (the JSF components are not). If the view is a dashboard view, simply cast the IlvDiagrammer into an IlvDashboardDiagram.

Parameters:
mb - The method binding to invoke.
params - A String array.
capabilities - Indicates whether the action is affecting the capabilities (like the manager bounds or the layer list, for example) or not.
capabilitiesParams - The array that contains the parameter to pass to the getCapabilities method (if the capabilities parameter is set to true).

Since:
JViews 8.0


setCreateLinkInteractor

setCreateLinkInteractor(tag, oneshot, properties)
Sets an interactor on the view that allows you to create a link on the diagram with the given tag. It does nothing if the corresponding <jvdf:diagrammerView/> is not editable.
Parameters:
tag - The tag of the created link.
oneshot - If true the previous interactor will be pushed back once a node has been created. Otherwise the interactor will not be removed until another interactor is set by the setInteractor() method.
properties - an object of properties to be set containing keys and values for each of the property to be set at creation time ({propertyName1:"propertyValue1", propertyName2:"propertyValue2"}). This parameter is optional.

Since:
JViews 8.0


setCreateNodeInteractor

setCreateNodeInteractor(tag, oneshot, properties)
Sets an interactor on the view that allows you to create a node on the diagram with the given tag. It does nothing if the corresponding <jvdf:diagrammerView/> is not editable.
Parameters:
tag - The tag of the created node.
oneshot - If true the previous interactor will be pushed back once a node has been created. Otherwise the interactor will not be removed until another interactor is set by the setInteractor() method.
properties - an object of properties to be set containing keys and values for each of the property to be set at creation time ({propertyName1:"propertyValue1", propertyName2:"propertyValue2"}). This parameter is optional.

Since:
JViews 8.0


setDataSourceId

setDataSourceId(dataSourceId, update)
Sets the data source identifier.
At the next request the data source will be set to the displayed diagrammer.
Parameters:
dataSourceId - The data source identifier.
update - A flag indicating if the view and capabilities should be updated.

setProject

setProject(project, update, showAll)
Sets the JViews Diagrammer Designer project URL.
At the next request the project will be set to the displayed diagrammer.
Parameters:
project - The project URL to set.
update - A flag indicating if the view and capabilities should be updated.
showAll - A flag indicating that the zoom level should be reset if the update parameter is set to true.

setStyleSheets

setStyleSheets(css, update)
Sets the style sheets to apply to the diagrammer.
At the next request the style sheets will be set to the displayed diagrammer.
Parameters:
css - The style sheets to apply.
update - A flag indicating if the view and capabilities should be updated.

Inherited Methods from IlvFacesViewProxy
getBackgroundColor, getErrorMessage, getGenerateImageMap, getImageFormat, getImageMapGenerator, getImageMapVisible, getInteractor, getOnCapabilitiesLoaded, getOnImageLoaded, getPanFactor, getPopupMenu, getServlet, getServletURL, getUpdateInterval, getWaitingImage, getZoomFactor, isAutoUpdateCapabilities, isConstrainedOnContents, isResizable, moveTo, panEast, panNorth, panNorthEast, panNorthWest, panSouth, panSouthEast, panSouthWest, panWest, performAction, setAutoUpdateCapabilities, setBackgroundColor, setConstrainedOnContents, setErrorMessage, setGenerateImageMap, setImageFormat, setImageMapGenerator, setImageMapVisible, setInteractor, setOnCapabilitiesLoaded, setOnImageLoaded, setPanFactor, setPopupMenu, setResizable, setServlet, setServletURL, setUpdateInterval, setWaitingImage, setZoomFactor, showAll, updateAll, updateImage, zoomBy, zoomIn, zoomOut, zoomToIdentity
Inherited Methods from IlvBasicViewProxy
getImageFormat, getMessageBox, getServletClass, getServletURL, getWaitingImage, init, setImageFormat, setMessageBox, setServletClass, setServletURL, setWaitingImage
Inherited Methods from IlvSizedViewProxy
afterLayoutHandler, getAbsoluteBounds, getBounds, getCreationSize, getHeight, getMinimumSize, getWidth, onResize, positionAfterLayout, registerResizeListener, resizeAfterLayout, setMinimumSize
Inherited Methods from IlvFacesProxy
getAbsoluteId, getJViewsDHTMLObject, getNodeCoords, getObject, getReferenceNode, setAbsoluteId, setJViewsDHTMLObject, setObject, setReferenceNode, toHTML
Inherited Methods from IlvPropertyStateManager
getClientId, notify
Inherited Methods from IlvObject
callDispose, dispose, getClassName, hashCode, inherits, instanceOf, invoke, registerDispose, removeHTML, setClassName, superConstructor, superInvoke, toString, updateVisibility