use of com.google.gwt.visualization.client.visualizations.AnnotatedTimeLine in project opennms by OpenNMS.
the class Application method onModuleLoad.
/**
* This is the entry point method.
*/
public void onModuleLoad() {
m_chartService = new DefaultChartService();
Image img = new Image();
img.setUrl("../images/logo.png");
img.getElement().getStyle().setPaddingTop(14, Unit.PX);
img.getElement().getStyle().setPaddingLeft(14, Unit.PX);
FlowPanel header = new FlowPanel();
header.getElement().setId("header");
header.add(img);
final DockLayoutPanel dockLayoutPanel = new DockLayoutPanel(Unit.PX);
dockLayoutPanel.addNorth(header, 75.00);
RootLayoutPanel.get().add(dockLayoutPanel);
m_nav = new Navigation();
m_nav.addLocationUpdateEventHandler(this);
m_nav.addHostUpdateEventHandler(this);
m_flowPanel = new FlowPanel();
Runnable timelineCallback = new Runnable() {
public void run() {
m_chartService.getAllLocationsAvailability(new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
if (response.getStatusCode() == 200) {
m_timeline = new AnnotatedTimeLine(ChartUtils.convertJSONToDataTable(response.getText()), createTimelineOptions(), "440px", "250px");
m_flowPanel.add(m_timeline);
m_flowPanel.add(m_nav);
dockLayoutPanel.add(m_flowPanel);
}
}
@Override
public void onError(Request request, Throwable exception) {
Window.alert("Error Initializing Chart");
}
});
}
};
VisualizationUtils.loadVisualizationApi(timelineCallback, AnnotatedTimeLine.PACKAGE);
initializeNav();
}
Aggregations