スタックパネルを使用しているクラスがあり、それが別のクラス内で呼び出されてから、エントリポイントクラス内で呼び出されます。私の質問は、Stackpanel内にGChartを表示するにはどうすればよいですか(3つのパネルのうちの1つのみ)。
package net.gui.client.content;
import net.gui.client.chart.ChartTuple;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.StackLayoutPanel;
import com.google.gwt.user.client.ui.Widget;
/*
author Kenny Watts
since July 10, 2012
This class creates the stacked panels that
display the data in the main screen of the gui
*/
public class StackPanel extends StackLayoutPanel {
static int index = 0;
public static final String PANEL0NAME = "Critical Data:";
public static final String PANEL1NAME = "Supporting Data:";
public static final String PANEL2NAME = "Other Data:";
ChartTuple chartTest = new ChartTuple();
public StackPanel(int numTabs) {
super(Unit.PX);
// for (int i = 0; i < numTabs; i++) {
add(stackContent(0), PANEL0NAME, 25);
add(stackContent(1), PANEL1NAME, 25);
add(stackContent(2), PANEL2NAME, 25);
// }
showWidget(numTabs - 1);
addStyleName("body");
setAnimationDuration(500);
}
private Widget stackContent(int index) {
// String content = "This is data set numebr: " + index + ""
// + PanelUtils.randomText() + PanelUtils.randomText();
ScrollPanel p = new ScrollPanel(chartTest);
return (p);
}
}
これが私のスタックパネルで、これが私のチャートクラスです。
package net.gui.client.chart;
import com.googlecode.gchart.client.GChart;
/**
* Defines a bar-chart of x*x vs. x, with gridlines.
*/
public class ChartTuple extends GChart {
public ChartTuple() {
setChartTitle("<b>x<sup>2</sup> vs x</b>");
setChartSize(150, 150);
addCurve();
for (int i = 0; i < 10; i++)
getCurve().addPoint(i, i * i);
getCurve().setLegendLabel("x<sup>2</sup>");
getCurve().getSymbol().setSymbolType(SymbolType.VBAR_SOUTH);
getCurve().getSymbol().setBackgroundColor("red");
getCurve().getSymbol().setBorderColor("black");
getCurve().getSymbol().setModelWidth(1.0);
getXAxis().setAxisLabel("<b>x</b>");
getXAxis().setHasGridlines(true);
getYAxis().setAxisLabel("<b>x<sup>2</sup></b>");
getYAxis().setHasGridlines(true);
}
}
そして最後に、これが私のエントリポイントクラスです。
package net.gui.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootLayoutPanel;
/**
* Main entry point class for the ISCI gui. this just add's the BasePanel to the
* rootlayoutpanel so it can be put into the HTML file.
*/
public class ISCI implements EntryPoint {
@Override
public void onModuleLoad() {
BasePanel basePanel = new BasePanel();
RootLayoutPanel.get().add(basePanel);
}
}
実行すると、次のエラーが発生します。「[ERROR] [ISCI]-16行目:com.googlecode.gchart.client.GChart.SymbolTypeタイプのソースコードがありません。必要なモジュールを継承するのを忘れましたか?」