Show TOC Start of Content Area

Component documentation JNet Introduction for Developers Locate the document in its SAP Library structure

JNet is an editor for network graphics that can be used by any application to integrate different forms of graphic representations.

Before you start using JNet for your application, you should consider in which application environment you want to use JNet. JNet currently supports the following application environments:

      Java applets

In this area, you build the necessary framework for yourself.

·        Structure linkBSPs

JNet offers a framework for BSPs by means of the BSP extension <graphics>.

·        Structure linkWeb Dynpro ABAP

See ActiveComponent Library

·        Structure linkWeb Dynpro Java

Prerequisites

Since JNet is started as a Java applet, the user agent, such as a browser, must support Java applets.

Deliverables

To incorporate JNet into your application, the following elements are required:

·        A definition of the general design of your graph (Type Repository)

·        A definition of the JNet user interface (User Interface)

·        A definition of the graph (Data file)

You must write an application that generates the data file(s), since data files are always supplied by the application.

If your application has special requirements, you can use the following optional elements:

      Application.xml

This is required only if you want to include application-specific data in the JAR file.

      An event handler that defines the reaction of your application to JNet events (user clicks on a node, for example).

The event handler is only required if your application is designed to process user actions. If you only want to display and print a graph you do not need an event handler.

The event handler that you may need depends on your application environment. You can write your own Java code that reacts to JNet events.

Alternatively, you can use a server that reacts to events with a JNet tag. (See JNet tag in the data file.)

How to Start

If you want to integrate JNet into your application, follow the steps below:

...

       1.      Refer to the JNet demo page in SDN (see JNet/JGantt Developer Documentation) to look at the examples.

       2.      Choose the example that best suits your requirements and look at the corresponding type repository and data file.

       3.      Incorporate the chosen XML(s) into your application.
The way how to provide JNet with the required data depends on the application environment (BSP, Web Dynpro ABAP, Web Dynpro Java). Note that you can pass all the information (<TypeRepository>, <UserInterface>, <Graph>) in one single data set.

       4.      Make changes to the data according to your application's requirements.

       5.      Write the routine(s) that create the dynamic part of the data (normally the <Graph> tag).

       6.      Make changes to the existing files, and start JNet with the modified files.
Look at the result.
In this way, you can easily analyze the effects of your changes.

How to Continue

Once you have gained your first experiences with JNet, you may want to know how to incorporate JNet into your application. To do this, you must connect your application with the XML files that JNet can interpret. You can start defining new types, a layout for the user interface and the data file for your application. You can also use the types and layouts of the demo examples, and modify them. To define all elements, you can use different XML files, as was the case with the demo files above. However, you can also define all elements in one file, the data file. We recommend that you use this procedure for test purposes, since you must make changes in one file only.

Proceed as follows:

       1.      Define the types that you want to use for your graph.

For a reference of all the elements and attributes you can use to define the types, use any existing example and the documentation of the type repository as a reference.

       2.      Define the layout of the user interface.

For a reference of all the elements and attributes you can use to define the user interface, use any existing example and the documentation of the user interface as a reference.

       3.      Define the data file that represents the actual graph.

For a reference of all the elements and attributes you can use to define the data file, use any existing example and the documentation of the data file as a reference.

       4.      Write the application that generates the data file(s).

       5.      Write handlers for JNet events, if required.

 

End of Content Area