Changed the SimpleBusyIndicator, so that it is scalable now

This commit is contained in:
Lennart Hensler committed 2012-02-07 12:36:13 +01:00
1 parent 51975cba9c
commit 0f4c4b9b75
2 files changed
+10 -4

No files matched your search

@@ -860,7 +860,7 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
contentPanel = new VerticalPanel();
headerPanel = new DockPanel();
DockPanel toolbarPanel = new DockPanel();
busyIndicator = new SimpleBusyIndicator();
busyIndicator = new SimpleBusyIndicator(false, 0.8f);
if (!isEmbedded) {
toolbarPanel.add(busyIndicator, DockPanel.WEST);
}
@@ -1,5 +1,6 @@
package com.sap.sailing.gwt.ui.shared.panels;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.user.client.ui.Image;
public class SimpleBusyIndicator extends BusyIndicator {
@@ -11,16 +12,21 @@ public class SimpleBusyIndicator extends BusyIndicator {
* The busy indicator component is a circling GIF.
*/
public SimpleBusyIndicator() {
this(false);
this(false, 1.0f);
}
/**
* Creates a new SimpleBusyIndicator with a custom <code>busy</code> state.<br />
* The busy indicator component is a circling GIF.
*
* @param busy Sets the busy state of the BusyIndicator
* @param scale Scales the displayed image. 1.0 is 100%, 0.50 is 50%, ...
*/
public SimpleBusyIndicator(boolean busy) {
busyIndicator = new Image(RESOURCES.busyIndicatorCircle());
public SimpleBusyIndicator(boolean busy, float scale) {
ImageResource resource = RESOURCES.busyIndicatorCircle();
busyIndicator = new Image(resource.getSafeUri());
busyIndicator.setStyleName(STYLE_NAME_PREFIX + "busyIndicatorCircle");
busyIndicator.setPixelSize((int) (resource.getWidth() * scale), (int) (resource.getHeight() * scale));
add(busyIndicator);
setBusy(busy);
}