final RootPanel rootPanel = RootPanel.get();
final VerticalPanel panel = new VerticalPanel();
rootPanel.add(panel);
panel.add(new Label("Array elements"));
final TextBox arrayElementCount = new TextBox();
arrayElementCount.setText("1");
panel.add(arrayElementCount);
final Button createInstance = new Button("Create instance");
createInstance.addMouseEventListener(new MouseEventAdapter() {
public void onClick(final MouseClickEvent event) {
final int elementCount = Integer.parseInt(arrayElementCount.getText());
SerializationBenchmarker.this.setObject(createTree(elementCount));
SerializationBenchmarker.this.log("", "Created instance that will be serialized, with " + elementCount + " elements.");
}
});
panel.add(createInstance);
final Button prepareGwtStream = new Button("Prepare " + GWT + " Stream");
prepareGwtStream.addMouseEventListener(new MouseEventAdapter() {
public void onClick(final MouseClickEvent event) {
SerializationBenchmarker.this.prepareGwtStream();
}
});
panel.add(prepareGwtStream);
final Button prepareRocketStream = new Button("Prepare " + ROCKET + " Stream");
prepareRocketStream.addMouseEventListener(new MouseEventAdapter() {
public void onClick(final MouseClickEvent event) {
SerializationBenchmarker.this.prepareRocketStream();
}
});
panel.add(prepareRocketStream);
panel.add(new Label("Iterations"));
final TextBox iterations = new TextBox();
iterations.setText("1");
panel.add(iterations);
final Button runGwtDeserialize = new Button("Run " + GWT + " Deserialize");