📄 myapplication.java
字号:
package com.mycompany.client;import com.google.gwt.core.client.EntryPoint;import com.google.gwt.user.client.ui.Button;import com.google.gwt.user.client.ui.ClickListener;import com.google.gwt.user.client.ui.Label;import com.google.gwt.user.client.ui.RootPanel;import com.google.gwt.user.client.ui.*;/** * Entry point classes define <code>onModuleLoad()</code>. */public class MyApplication implements EntryPoint { /** * This is the entry point method. */ public void onModuleLoad() { final Button button = new Button("Click me"); final Label label = new Label(); double[] XArray={-3,-2.5,-2,-1.75,-1.5,-1.25,-1,-0.5,0,0.5,1,1.5,2,2.5,3}; double[] YArray=new double[15]; double x=-3,y=0; double Xsmall,Xmedium,Xlarge,Ysmall,Ymedium,Ylarge; //Firing Strength String ChartSource=""; /* button.addClickListener(new ClickListener() { public void onClick(Widget sender) { if (label.getText().equals("")) label.setText("Hello World!"); else label.setText(""); } }); */ /*equation x * {Xsmall=1 x<-2 * Xsmall=-x-1 -2<=x<=-1} * {Xmedium=x+2 -2<=x<=-1 * Xmedium=1 -1<x<1 * Xmedium=-x+2 1<=x<=2} * {Xlarge=x-1 1<=x<=2 * Xlarge=1 2<x} */ /*equation y * {Ysmall=1 y<2 * Ysmall=-y+3 2<=y<=3} * {Ymedium=y-2 2<=y<=3 * Ymedium=1 3<y<4 * Ymedium=-y+5 4<=y<=5} * {Ylarge=y-4 4<=y<=5 * Ylarge=1 5<y} * */ MMCA c1=new MMCA(); // Create a Label and an HTML widget. Label lbl = new Label("qp test"+c1.GetChartSource() + "as ."); HTML html = new HTML( "This is HTML. It will be interpreted as such if you specify " + "the asHTML flag.", true); html.setHTML("<img src=\"http://chart.apis.google.com/chart?"+"chs=500x500"+"&chd=t:"+ChartSource+"&cht=lxy"+"&chxt=x,y"+"&chxl=0:|-3|-2|-1|0|1|2|3|4|5|6|7|1:|0|1|2|3|4|5|6|7|8|9|10\""+"alt=\"Sample chart\" />"); // Assume that the host HTML has elements defined whose // IDs are "slot1", "slot2". In a real app, you probably would not want // to hard-code IDs. Instead, you could, for example, search for all // elements with a particular CSS class and replace them with widgets. // RootPanel.get("slot1").add(button); RootPanel.get("slot2").add(label); // Add them to the root panel. VerticalPanel panel = new VerticalPanel(); panel.add(lbl); panel.add(html); RootPanel.get().add(panel); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -