On Jul 2, 6:36 pm, rxin <
reyno...@gmail.com> wrote:
> I realized that the Java GWT API does not expose the
> getVisibleChartRange() for AnnotatedTimeline object. I am trying to
> create a wrapper Java method so I would be able to get the range in my
> RangeChange event. The reason is the range values returned from
> RangeChange event is not accurate.
>
> In my TimeSlider class, I have a member timeline that is an instance
> of the AnnotatedTimeline object, and in TimeSlider, I also defines the
> following two methods:
>
> public native Date getVisibleChartStartDate(AnnotatedTimeLine
> timeline) /*-{
> obj =
> timeli...@com.google.gwt.visualization.client.visualizations.Visualization::jso.getV isibleChartRange
> ();
> return obj.start;
> }-*/;
>
> public native Date getVisibleChartEndDate(AnnotatedTimeLine
> timeline) /*-{
> obj =
> timeli...@com.google.gwt.visualization.client.visualizations.Visualization::jso.getV isibleChartRange
> ();
> return obj.end;
> }-*/;
Try something like this:
public static Date getVisibleChartStartDate(AnnotatedTimeLine
timeline) {
JsDate result = nativeGetVisibleChartStartDate(timeline.getJso());
return JsDate.toJava(result);
}
private static JsDate nativeGetVisibleChartStartDate
(JavaScriptObject jso) /*-{
return jso.getVisibleChartRange();
}-*/;
The JsDate class is in the latest gwt-ajaxloader SVN repo at
http://code.google.com/p/gwt-google-apis