From 0ee9d8f14d7f367cbd3d875a19ec8c50c12da47e Mon Sep 17 00:00:00 2001 From: valot <valot@b8ef2a07-7df7-436f-90b9-41648038564b> Date: Sun, 1 May 2011 06:52:48 +0000 Subject: [PATCH] finition animation git-svn-id: https://subversion.renater.fr/xtandempipeline/trunk@83 b8ef2a07-7df7-436f-90b9-41648038564b --- .../xtandempipeline/ui/swt/Running.java | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/xtandempipeline/src/fr/inra/pappso/xtandempipeline/ui/swt/Running.java b/xtandempipeline/src/fr/inra/pappso/xtandempipeline/ui/swt/Running.java index 7a56ab7af..3c6e92d0f 100644 --- a/xtandempipeline/src/fr/inra/pappso/xtandempipeline/ui/swt/Running.java +++ b/xtandempipeline/src/fr/inra/pappso/xtandempipeline/ui/swt/Running.java @@ -96,7 +96,7 @@ public class Running { this.actualised(); // on demarre le process - final int time = 500; + final int time = 150; t.setDaemon(true); t.start(); final Runnable timer = new Runnable() { @@ -119,20 +119,23 @@ public class Running { } protected void actualised() { + //animation de l'image currentAnim++; if (currentAnim == 8) { currentAnim = 0; } anim.setImage(animatedImage[currentAnim]); - - Runtime run = Runtime.getRuntime(); - long used = (run.totalMemory() - run.freeMemory()) / 1000000; - long total = run.totalMemory() / 1000000; - String S = used + "/" + total + "Mo"; - memory.setText(S); - text.setText(t.getView()); - this.progress.setMaximum(t.get_max_progress()); - this.progress.setSelection(t.get_current_progress()); - + + //on ne met à jour l'interface complete que toute les 150*4=550ms + if (currentAnim == 0 || currentAnim == 4) { + Runtime run = Runtime.getRuntime(); + long used = (run.totalMemory() - run.freeMemory()) / 1000000; + long total = run.totalMemory() / 1000000; + String S = used + "/" + total + "Mo"; + memory.setText(S); + text.setText(t.getView()); + this.progress.setMaximum(t.get_max_progress()); + this.progress.setSelection(t.get_current_progress()); + } } } -- GitLab