mtarantini
15 May 2009, 4:19 AM
Hi,
It seems where is an issue when you add a chart within a Windows,
Here a snippet of my Test :
//All needed imported...
import....
public class Test implements EntryPoint
{
/**
* This is the entry point method.
*/
public void onModuleLoad()
{
Window win = new Window();
win.setSize(400, 400);
win.setLayout(new FitLayout());
ContentPanel cp = new ContentPanel();
cp.setHeading("Pie chart");
cp.setLayout(new FitLayout());
final Chart chart = new Chart("../res/chart/open-flash-chart.swf");
chart.setBorders(true);
chart.setChartModel(getPieChartData());
cp.add(chart);
win.add(cp);
RootPanel.get().add(win);
}
private ChartListener listener = new ChartListener()
{
public void chartClick(ChartEvent ce)
{
Info.display("Chart Clicked", "You selected {0}.", "" + ce.getValue());
}
};
private ChartModel getPieChartData()
{
ChartModel cm = new ChartModel("Sales by Region", "font-size: 14px; font-family: Verdana; text-align: center;");
cm.setBackgroundColour("#fffff5");
Legend lg = new Legend(Position.RIGHT, true);
lg.setPadding(10);
cm.setLegend(lg);
PieChart pie = new PieChart();
pie.setAlpha(0.5f);
pie.setNoLabels(true);
pie.setTooltip("#label# $#val#M<br>#percent#");
pie.setColours("#ff0000", "#00aa00", "#0000ff", "#ff9900", "#ff00ff");
pie.addSlices(new PieChart.Slice(100, "Australia"));
pie.addSlices(new PieChart.Slice(200, "USA"));
pie.addSlices(new PieChart.Slice(150, "Japan"));
pie.addSlices(new PieChart.Slice(120, "Germany"));
pie.addSlices(new PieChart.Slice(60, "United Kingdom"));
pie.addChartListener(listener);
cm.addChartConfig(pie);
return cm;
}
}
The problem is that you can't move the windows anymore, but the resizing is working.
This bug append when running under the shell or a WebKit browser (tested on Chrome), FF3 is working well.
also, when resizing the windows, a null point exception occurs in the shell
java.lang.NullPointerException: null
at com.extjs.gxt.ui.client.core.El.isStyleAttribute(El.java:1778)
at com.extjs.gxt.ui.client.core.El.isVisible(El.java:1760)
at com.extjs.gxt.ui.client.core.El.isVisible(El.java:1744)
at com.extjs.gxt.ui.client.widget.Layer.sync(Layer.java:324)
at com.extjs.gxt.ui.client.widget.Layer.setWidth(Layer.java:275)
at com.extjs.gxt.ui.client.core.El.setSize(El.java:2447)
at com.extjs.gxt.ui.client.core.El.setSize(El.java:2433)
at com.extjs.gxt.ui.client.widget.Layer.setSize(Layer.java:224)
at com.extjs.gxt.ui.client.widget.Shim.createShim(Shim.java:84)
at com.extjs.gxt.ui.client.widget.Shim.cover(Shim.java:52)
at com.extjs.gxt.ui.client.fx.Resizable.handleMouseDown(Resizable.java:495)
at com.extjs.gxt.ui.client.fx.Resizable.access$0(Resizable.java:461)
at com.extjs.gxt.ui.client.fx.Resizable$ResizeHandle.onBrowserEvent(Resizable.java:96)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1320)
at com.google.gwt.user.client.DOM.dispatchEventAndCatch(DOM.java:1299)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1262)
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:126)
at com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java:155)
at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1925)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
at com.google.gwt.dev.SwtHostedModeBase.processEvents(SwtHostedModeBase.java:235)
at com.google.gwt.dev.HostedModeBase.pumpEventLoop(HostedModeBase.java:558)
at com.google.gwt.dev.HostedModeBase.run(HostedModeBase.java:405)
at com.google.gwt.dev.HostedMode.main(HostedMode.java:232)
Any Idea of what cause this problem ?
Thanks in advance.
It seems where is an issue when you add a chart within a Windows,
Here a snippet of my Test :
//All needed imported...
import....
public class Test implements EntryPoint
{
/**
* This is the entry point method.
*/
public void onModuleLoad()
{
Window win = new Window();
win.setSize(400, 400);
win.setLayout(new FitLayout());
ContentPanel cp = new ContentPanel();
cp.setHeading("Pie chart");
cp.setLayout(new FitLayout());
final Chart chart = new Chart("../res/chart/open-flash-chart.swf");
chart.setBorders(true);
chart.setChartModel(getPieChartData());
cp.add(chart);
win.add(cp);
RootPanel.get().add(win);
}
private ChartListener listener = new ChartListener()
{
public void chartClick(ChartEvent ce)
{
Info.display("Chart Clicked", "You selected {0}.", "" + ce.getValue());
}
};
private ChartModel getPieChartData()
{
ChartModel cm = new ChartModel("Sales by Region", "font-size: 14px; font-family: Verdana; text-align: center;");
cm.setBackgroundColour("#fffff5");
Legend lg = new Legend(Position.RIGHT, true);
lg.setPadding(10);
cm.setLegend(lg);
PieChart pie = new PieChart();
pie.setAlpha(0.5f);
pie.setNoLabels(true);
pie.setTooltip("#label# $#val#M<br>#percent#");
pie.setColours("#ff0000", "#00aa00", "#0000ff", "#ff9900", "#ff00ff");
pie.addSlices(new PieChart.Slice(100, "Australia"));
pie.addSlices(new PieChart.Slice(200, "USA"));
pie.addSlices(new PieChart.Slice(150, "Japan"));
pie.addSlices(new PieChart.Slice(120, "Germany"));
pie.addSlices(new PieChart.Slice(60, "United Kingdom"));
pie.addChartListener(listener);
cm.addChartConfig(pie);
return cm;
}
}
The problem is that you can't move the windows anymore, but the resizing is working.
This bug append when running under the shell or a WebKit browser (tested on Chrome), FF3 is working well.
also, when resizing the windows, a null point exception occurs in the shell
java.lang.NullPointerException: null
at com.extjs.gxt.ui.client.core.El.isStyleAttribute(El.java:1778)
at com.extjs.gxt.ui.client.core.El.isVisible(El.java:1760)
at com.extjs.gxt.ui.client.core.El.isVisible(El.java:1744)
at com.extjs.gxt.ui.client.widget.Layer.sync(Layer.java:324)
at com.extjs.gxt.ui.client.widget.Layer.setWidth(Layer.java:275)
at com.extjs.gxt.ui.client.core.El.setSize(El.java:2447)
at com.extjs.gxt.ui.client.core.El.setSize(El.java:2433)
at com.extjs.gxt.ui.client.widget.Layer.setSize(Layer.java:224)
at com.extjs.gxt.ui.client.widget.Shim.createShim(Shim.java:84)
at com.extjs.gxt.ui.client.widget.Shim.cover(Shim.java:52)
at com.extjs.gxt.ui.client.fx.Resizable.handleMouseDown(Resizable.java:495)
at com.extjs.gxt.ui.client.fx.Resizable.access$0(Resizable.java:461)
at com.extjs.gxt.ui.client.fx.Resizable$ResizeHandle.onBrowserEvent(Resizable.java:96)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1320)
at com.google.gwt.user.client.DOM.dispatchEventAndCatch(DOM.java:1299)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1262)
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:126)
at com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java:155)
at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1925)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
at com.google.gwt.dev.SwtHostedModeBase.processEvents(SwtHostedModeBase.java:235)
at com.google.gwt.dev.HostedModeBase.pumpEventLoop(HostedModeBase.java:558)
at com.google.gwt.dev.HostedModeBase.run(HostedModeBase.java:405)
at com.google.gwt.dev.HostedMode.main(HostedMode.java:232)
Any Idea of what cause this problem ?
Thanks in advance.