|
 |
Creating a new
component in JavaWe
saw previously that any combination of components, configurations or dgsl scripts can be
used as an RView component. But at the bottom of all that, we found some Java components.
With the package is delivered a set of useful components such as the dgsl interpreter
(SynopticView), the CompoundView, the ChartView and so on. Though, it is quite easy to
create a new Java component which will suit your needs and which will interact with RView.
To do so, your component must implement the TagsView interface or extend one of the base
classes given to you in the package (CanvasSTagsView.java, CanvasMTagsView.java,
PanelSTagsView or PanelMTagsView). The code and the documentation of these classes are
available in the package. We also present two simple examples of components with their
Java code. Lets look to the MyTestView component. The code is very simple, this component
displaying only the value of the variable as a string.
It is very simple to use this new class in RView. After compiling it,
the only thing to do is to put MyTestView.class on your Web server in the RView folder (as
it is done for you in the package). From the applet, you can now insert this component in
a CompoundView for example. To do so, enter a Tagname in the input field of the menu bar
(for example level1) and click on the insert button of the menu bar. MyTestView is
not in the pull down list of possible component types but you can nevertheless load it by
entering its name (MyTestView) in the field labeled "Type of the component".
Look into the developer guide to have a detailed description of the
TagsView interface. |