You can customize Hitmap information to
generate specific information from the server side. For example, to
highlight a group element or change the cursor when you move the
mouse over a certain type of element. .
The server side code will generate Hitmap information in
JSON
format for the Hitmap request.
On the server side you must do the
following:
Your servlet must be a subclass of IlvDiagrammerServlet or of one of its
existing subclasses, for example IlvFacesDiagrammerServlet.
For JSF, configure the servlet using the
servlet
attribute in the JSF view component.
//Configure the servlet in the web.xml file. <servlet> <servlet-name>DiagrammerEditingServlet</servlet-name> <servlet-class>demo.editing.DiagrammerEditingServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>DiagrammerEditingServlet</servlet-name> <url-pattern>/DiagrammerEditingServlet</url-pattern> </servlet-mapping>
Set the
servlet
attribute of JSF view component. For example:
<jvdf:diagrammerView id="diagrammer" servlet="DiagrammerEditingServlet" ... />
You must extend IlvHitmapDefinition. For example:
package yourpackage; public class MyHitmapDefinition extends IlvHitmapDefinition { }
Then add, for example, the following code in the
web.xml
file and add the
hitmap
init-param
for your servlet.
<servlet-name>DiagrammerEditingServlet</servlet-name> <servlet-class>demo.editing.DiagrammerEditingServlet</servlet-class> <init-param> <param-name>hitmap</param-name> <param-value>yourpackage.MyHitmapDefinition</param-value> </init-param> </servlet>
For more information, see the <installdir> /jviews-diagrammer89/samples/js-diagrammer-editing/index.html
sample.