summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2009-10-27 07:57:12 +0000
committerArtur Signell <artur.signell@itmill.com>2009-10-27 07:57:12 +0000
commit6a3c715dae922edd723c9423b4308d5d7948b74e (patch)
tree46a007274681a9803afccf135ace5554f3e01e3a /src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java
parent931d75fef69deb9b738fad97001cf5621de9f43e (diff)
downloadvaadin-framework-6a3c715dae922edd723c9423b4308d5d7948b74e.tar.gz
vaadin-framework-6a3c715dae922edd723c9423b4308d5d7948b74e.zip
Split demo and tests files to own source folders, for #3298
svn changeset:9390/svn branch:6.2
Diffstat (limited to 'src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java')
-rw-r--r--src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java78
1 files changed, 0 insertions, 78 deletions
diff --git a/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java b/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java
deleted file mode 100644
index 6b5f271dbe..0000000000
--- a/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.tests;
-
-import java.util.Date;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.OrderedLayout;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
-
-public class PerformanceTestLabelsAndOrderedLayouts extends CustomComponent {
- private final OrderedLayout main;
-
- private final OrderedLayout testContainer;
-
- private Date startTime;
-
- private final Label result;
-
- private static final String DESCRIPTION = "Simple test that renders n labels into ordered layout.";
-
- private static final int INITIAL_COMPONENTS = 1000;
-
- public PerformanceTestLabelsAndOrderedLayouts() {
- main = new OrderedLayout();
- setCompositionRoot(main);
- addInfo();
-
- result = new Label();
- main.addComponent(result);
-
- main.addComponent(new Button("click when rendered",
- new ClickListener() {
-
- public void buttonClick(ClickEvent event) {
- endTest();
- }
- }));
-
- main.addComponent(new Button(
- "Click for layout repaint (cached components)",
- new ClickListener() {
- public void buttonClick(ClickEvent event) {
- testContainer.requestRepaint();
- }
- }));
-
- testContainer = new OrderedLayout();
-
- for (int i = 0; i < INITIAL_COMPONENTS; i++) {
- Label l = new Label("foo" + i);
- testContainer.addComponent(l);
- }
-
- main.addComponent(testContainer);
- startTest();
- }
-
- public void startTest() {
- startTime = new Date();
- }
-
- public void endTest() {
- final long millis = (new Date()).getTime() - startTime.getTime();
- final Float f = new Float(millis / 1000.0);
- result.setValue("Test completed in " + f + " seconds");
- }
-
- private void addInfo() {
- main.addComponent(new Label(DESCRIPTION, Label.CONTENT_XHTML));
- }
-
-}