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");
runGwtDeserialize.addMouseEventListener(new MouseEventAdapter() {
public void onClick(final MouseClickEvent event) {
final int iterationsCount = Integer.parseInt(iterations.getText());
SerializationBenchmarker.this.performGwtDeserializationTimings(iterationsCount);
}
});
panel.add(runGwtDeserialize);
final Button runGwtSerialize = new Button("Run " + GWT + " Serialize");
runGwtSerialize.addMouseEventListener(new MouseEventAdapter() {
public void onClick(final MouseClickEvent event) {
final int iterationsCount = Integer.parseInt(iterations.getText());
SerializationBenchmarker.this.performGwtSerializationTimings(iterationsCount);
}
});
panel.add(runGwtSerialize);
final Button runRocketDeserialize = new Button("Run " + ROCKET + " Deserialize");
runRocketDeserialize.addMouseEventListener(new MouseEventAdapter() {
public void onClick(final MouseClickEvent event) {
final int iterationsCount = Integer.parseInt(iterations.getText());
SerializationBenchmarker.this.performRocketDeserializationTimings(iterationsCount);
}
});
panel.add(runRocketDeserialize);
final Button runRocketSerialize = new Button("Run " + ROCKET + " Serialize");
runRocketSerialize.addMouseEventListener(new MouseEventAdapter() {
public void onClick(final MouseClickEvent event) {
final int iterationsCount = Integer.parseInt(iterations.getText());
SerializationBenchmarker.this.performRocketSerializationTimings(iterationsCount);
}
});
panel.add(runRocketSerialize);
final Button clearLog = new Button("Clear Log");
clearLog.addMouseEventListener(new MouseEventAdapter() {
public void onClick(final MouseClickEvent event) {
SerializationBenchmarker.this.clearLog();
}
});
panel.add(clearLog);