The Java API implements the
DataHubConnector class as the basic class used
to communicate with the DataHub instance. Programmers writing stand-alone applications
need only the DataHubConnector and
DataHubPoint classes.
The following classes are included in the Java API installation. They are informally arranged here to give some idea of the interrelationships:
DataHubConnector provides connectivity to the DataHub instance.
DataHubEventConsumer implements callbacks for
DataHubConnector.
DataHubEventDispatcher is an interface that extends
DataHubEventConsumer class,
and is used by the
DataHubBaseApplet class (see
below).
DataHubPoint represents DataHub point objects.
DataHubBaseApplet is the applet that makes connections to the DataHub instance. It provides
access to all the data in a single domain. There need be only one
DataHubBaseApplet per HTML page, because
indivual connections are made using
DataHubListener (see below). The following
two classes extend the DataHubBaseApplet
class:
DataHubViewer displays a table of all the data in the domain. It implements
DataHubEventConsumer.
DataHubLink is used to instantiate a
DataHubBaseApplet for supporting
DataHubListener widgets. It embeds a
small text message "Powered by Cogent" in the page, and it's
color: red, yellow, or green, indicates the status of the
link.
DataHubListener is an applet that gets data from a specific point or points in the
DataHub instance. It is a parasite in the sense that it relies on the
connection to the DataHub instance provided by a
DataHubBaseApplet. You can use any number of
DataHubListeners per HTML page, without
noticably affecting the rate of data throughput to the page. The
following three widgets are extended from
DataHubListener:
DataHubLabel displays the value of a DataHub point.
DataHubEntryField is an entry field for changing the value of a DataHub
point.
DataHubButton sends a value for a DataHub point.
DataHubToggleButton toggles a DataHub point between two values.
DataHubCheckBox toggles a DataHub point between two values.
DataHubRadioButton A special button, used in a
DataHubRadioGroup.
DataHubRadioGroup A group of DataHubRadioButtons that
provides a way to select one of several mutually-exclusive
values for a DataHub point.
DataHubSlider changes the value of a DataHub point by sliding a pointer.
DataHubSpinner sets the value of a DataHub point using up and down
arrows.
DataHubProgressBar gives a graphical representation of the value of a DataHub
point.
DataHubDummy is provided as a convenience to the HTML programmer.
DataHubRendezvous provides a meeting point for the
DataHubBaseApplet and all of the
DataHubListener widgets on the page. It is
for internal use, providing static data that gets initialized before any
applet starts, giving all the applets a means of finding one
another.
import cogent.*;
or
import cogent.DataHubConnector; import cogent.DataHubPoint;