|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Panel
com.google.gwt.user.client.ui.ComplexPanel
com.google.gwt.user.client.ui.FlowPanel
org.cafesip.gwtcomp.client.ui.charting.LiveDataPanel
public class LiveDataPanel
Enables GWT application to display live data in the form of charts and
tables. The chart display dynamic data that is updated from the server side
at a pre-defined intervals. Such panels are useful for displaying changing
information such as stock values, temperature, etc. In order to display live
charts, GWT applications have to instantiate an object of this type and add
it to a panel of the GWT application you are developing. In addition, you
need to provide a server-side class that contains the logic to provides the
chart configuration and the data needed to populate the chart periodically.
The GWTCOMP server-side framework will instantiate this class and invoke
methods on this class periodically to fetch the data. The fetched data is
then transferred to the client-side which displays the data on the panel.
Note that the communication between the client and the server components is
transparent and your application will not have to deal with it. The data
source class must implement the
LiveDataSource interface or extend a
convenience class like
SimpleLiveDataSource (more such classes
will be added in future releases). A GWT application may contain multiple
live data panels. Each data panel is identified by there parameters:
In order for this to work, you will need to add the following elements to the web.xml file for your application:
<servlet> <servlet-name>LiveDataService</servlet-name> <servlet-class> org.cafesip.gwtcomp.server.LiveDataServiceImpl </servlet-class> <init-param> <param-name>data-source-class</param-name> <param-value>org.cafesip.gwtcomp.examples.server.LiveDataSourceSample</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>LiveDataService</servlet-name> <url-pattern>/gwtcomp/liveDataService</url-pattern> </servlet-mapping>Replace the value of the init-param, data-source-class with the fully qualified class name of your data source class. This class must be present in the server package.
The following jars must be present in your classpath in order to compile the client-side of the GWT application. These jars must be in the classpath regardless of whether you are using LiveDataPanel or not because of the way the GWT compiler works.
Examples:
CSS Style Rules:
Screen-Shots:
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
| Field Summary | |
|---|---|
static double |
GOLDEN_RATIO
|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
LiveDataPanel(java.lang.String identifier,
java.lang.String instance,
java.lang.String param)
A constructor for this class. |
|
LiveDataPanel(java.lang.String identifier,
java.lang.String instance,
java.lang.String param,
int width)
A constructor for this class. |
|
LiveDataPanel(java.lang.String identifier,
java.lang.String instance,
java.lang.String param,
int width,
int height)
A constructor for this class. |
|
| Method Summary | |
|---|---|
TimeSeriesChartPanel |
getChartPanel()
|
java.lang.String |
getIdentifier()
|
java.lang.String |
getParam()
|
protected void |
onAttach()
|
protected void |
onDetach()
|
void |
setChartPanel(TimeSeriesChartPanel chartPanel)
|
void |
setIdentifier(java.lang.String identifier)
|
void |
setParam(java.lang.String param)
|
void |
startRefresh()
Start (restart) screen refresh. |
void |
stopRefresh()
Stop refreshing the screen with new data. |
| Methods inherited from class com.google.gwt.user.client.ui.FlowPanel |
|---|
add, insert |
| Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel |
|---|
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, insert, insert, iterator, remove, remove |
| Methods inherited from class com.google.gwt.user.client.ui.Panel |
|---|
adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, onLoad, onUnload, orphan |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
getParent, isAttached, onBrowserEvent, removeFromParent |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final double GOLDEN_RATIO
| Constructor Detail |
|---|
public LiveDataPanel(java.lang.String identifier,
java.lang.String instance,
java.lang.String param)
identifier - see aboveinstance - see aboveparam - see above
public LiveDataPanel(java.lang.String identifier,
java.lang.String instance,
java.lang.String param,
int width,
int height)
identifier - see aboveinstance - see aboveparam - see abovewidth - width of the panelheight - height of the panel
public LiveDataPanel(java.lang.String identifier,
java.lang.String instance,
java.lang.String param,
int width)
identifier - see aboveinstance - see aboveparam - see abovewidth - the width of the panel. The height is calculated using the
GOLDEN_RATIO.| Method Detail |
|---|
public java.lang.String getIdentifier()
public void setIdentifier(java.lang.String identifier)
identifier - The identifier to set.public java.lang.String getParam()
public void setParam(java.lang.String param)
param - The param to set.public void stopRefresh()
public void startRefresh()
protected void onDetach()
onDetach in class com.google.gwt.user.client.ui.Widgetprotected void onAttach()
onAttach in class com.google.gwt.user.client.ui.Widgetpublic TimeSeriesChartPanel getChartPanel()
public void setChartPanel(TimeSeriesChartPanel chartPanel)
chartPanel - The chartPanel to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||