From: Ben Soares Date: Sat, 29 Jun 2019 00:52:43 +0000 (+0100) Subject: JAL-3333 Title text now appears instantly. Altering speed of rotating logo depending... X-Git-Tag: Release_2_11_0~2^2~21 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6da8d6719f9cce1221134697277c3cdc7d560d0b;p=jalview.git JAL-3333 Title text now appears instantly. Altering speed of rotating logo depending on queuing or running status. Rotating logo now 'parks' rather than jumps at completion. --- diff --git a/src/jalview/gui/WebserviceInfo.java b/src/jalview/gui/WebserviceInfo.java index 801e3da..2b85141 100644 --- a/src/jalview/gui/WebserviceInfo.java +++ b/src/jalview/gui/WebserviceInfo.java @@ -346,6 +346,7 @@ public class WebserviceInfo extends GWebserviceInfo ap.setPreferredSize(new Dimension(60, 60)); titlePanel.add(ap, BorderLayout.WEST); titlePanel.add(titleText, BorderLayout.CENTER); + setStatus(currentStatus); Thread thread = new Thread(ap); thread.start(); @@ -792,24 +793,34 @@ protected void cancel_actionPerformed(ActionEvent e) BufferedImage offscreen; @Override - public void run() + public void run() { startTime = System.currentTimeMillis(); + float invSpeed = 30f; while (currentStatus < STATE_STOPPED_OK) { + if (currentStatus == STATE_QUEUING) + { + invSpeed = 25f; + } + else if (currentStatus == STATE_RUNNING) + { + invSpeed = 10f; + } try { Thread.sleep(50); int units = (int) ((System.currentTimeMillis() - startTime) - / 10f); + / invSpeed); angle += units; angle %= 360; startTime = System.currentTimeMillis(); if (currentStatus >= STATE_STOPPED_OK) { + park(); angle = 0; } @@ -822,6 +833,34 @@ protected void cancel_actionPerformed(ActionEvent e) cancel.setEnabled(false); } + public void park() + { + startTime = System.currentTimeMillis(); + + while (angle < 360) + { + try + { + Thread.sleep(25); + + int units = (int) ((System.currentTimeMillis() - startTime) + / 5f); + angle += units; + startTime = System.currentTimeMillis(); + + if (angle >= 360) + { + angle = 360; + } + + repaint(); + } catch (Exception ex) + { + } + } + + } + void drawPanel() { if (offscreen == null || offscreen.getWidth(this) != getWidth()