NetAcquire Publish/Subscribe Drag-and-Drop Example
Remote temperature data acquisition
For the ultimate in publish/subscribe drag-and-drop display without programming, see MissionView.
One of the main advantages of NetAcquire Publish/Subscribe JavaBeans is that they allow interactive drag-and-drop screen development little or no programming (see Java Toolkit). This is sometimes referred to as “Rapid Application Development” (RAD). This example illustrates just how easy it is to develop entire applications based on NetAcquire Publish/Subscribe. The example uses WebGain VisualCaf™, a popular Java development environment.
In this example applet a named subscription is configured and its value is graphed. The subscription is represented by a NetAcquire Subscription JavaBean and the graph by a NetAcquire Graph JavaBean. In the center of this screen is the application (an applet in this case) being constructed. The visual layout area is the grid-like panel (the “palette”) in the “Form Designer ” window. The icon just below this panel represents the Subscription object and as it is highlighted its properties are displayed in the property list on the left of the screen. The “SubscriptionName” property is used to specify the named subscription that is to be graphed (in this case the subscription is “Reactor 1”).
As with the Subscription object, adding the NetAcquire Graph component to the screen is as simple as dragging and dropping the Graph icon onto the palette in the Form Designer.
JavaBeans communicate with each other by sending and receiving “events.” In an environment like VisualCaf this is done by drawing a line between the source of an event and the destination. In this example the Subscription object is the source and the Graph component is the destination.
In VisualCaf the binding of events is done via the “Interaction Wizard”. Several dialog boxes appear to help with setting up the interaction. The first of these identifies the types of events that the data source can send. The Subscription object is capable of sending one type of event (a NetAcquire DataEvent). This event is compatible with all NetAcquire visual JavaBeans.
The following dialog box is used to specify the action to take after sending this event. In this example the event is sent to the Graph component’s “handleValue()” method.
After the Interaction Wizard completes a line connects the source component to the destination component indicating the interaction relationship.
This application represents an end to end NetAcquire Publish/Subscribe application. When it is run “Reactor 1” subscription values will be graphed in the strip chart. Note that subscription values are only graphed when a subscription changes.