public boolean isBusy() { return busyLabel != null && busyLabel.isBusy(); }
public boolean isBusy() { return busyLabel != null && busyLabel.isBusy(); }
@Override public Point computeSize(int wHint, int hHint, boolean changed) { // checkWidget(); Point size = new Point(0, 0); if (image != null) { Rectangle ibounds = image.getBounds(); size.x = ibounds.width; size.y = ibounds.height; } if (isBusy()) { Rectangle bounds = getImage(0).getBounds(); size.x = Math.max(size.x, bounds.width); size.y = Math.max(size.y, bounds.height); } size.x += MARGIN + MARGIN; size.y += MARGIN + MARGIN; return size; }
@Override public Point computeSize(int wHint, int hHint, boolean changed) { // checkWidget(); Point size = new Point(0, 0); if (image != null) { Rectangle ibounds = image.getBounds(); size.x = ibounds.width; size.y = ibounds.height; } if (isBusy()) { Rectangle bounds = getImage(0).getBounds(); size.x = Math.max(size.x, bounds.width); size.y = Math.max(size.y, bounds.height); } size.x += MARGIN + MARGIN; size.y += MARGIN + MARGIN; return size; }
public void updateImage(Image newImage, boolean doLayout) { Image theImage = newImage != null ? newImage : this.image; if (theImage != null) { ensureBusyLabelExists(); } else if (busyLabel != null) { if (!busyLabel.isBusy()) { busyLabel.dispose(); busyLabel = null; } } if (busyLabel != null) { busyLabel.setImage(theImage); } if (doLayout) layout(); }
public void updateImage(Image newImage, boolean doLayout) { Image theImage = newImage != null ? newImage : this.image; if (theImage != null) { ensureBusyLabelExists(); } else if (busyLabel != null) { if (!busyLabel.isBusy()) { busyLabel.dispose(); busyLabel = null; } } if (busyLabel != null) { busyLabel.setImage(theImage); } if (doLayout) layout(); }
/** * Sets the form's busy state. Busy form will display 'busy' animation in * the area of the title image. * * @param busy * the form's busy state */ public boolean setBusy(boolean busy) { if (busy) ensureBusyLabelExists(); else if (busyLabel == null) return false; if (busy == busyLabel.isBusy()) return false; busyLabel.setBusy(busy); if (busyLabel.getImage() == null) { layout(); return true; } return false; }
/** * Sets the form's busy state. Busy form will display 'busy' animation in * the area of the title image. * * @param busy * the form's busy state */ public boolean setBusy(boolean busy) { if (busy) ensureBusyLabelExists(); else if (busyLabel == null) return false; if (busy == busyLabel.isBusy()) return false; busyLabel.setBusy(busy); if (busyLabel.getImage() == null) { layout(); return true; } return false; }
void onPaint(PaintEvent event) { Rectangle rect = getClientArea(); if (rect.width == 0 || rect.height == 0) return; Image activeImage; if (isBusy()) { activeImage = getImage(imageIndex); } else { clearImages(); activeImage = image; } if (activeImage != null) { GC gc = event.gc; Rectangle ibounds = activeImage.getBounds(); gc.drawImage(activeImage, rect.width / 2 - ibounds.width / 2, rect.height / 2 - ibounds.height / 2); } }
void onPaint(PaintEvent event) { Rectangle rect = getClientArea(); if (rect.width == 0 || rect.height == 0) return; Image activeImage; if (isBusy()) { activeImage = getImage(imageIndex); } else { clearImages(); activeImage = image; } if (activeImage != null) { GC gc = event.gc; Rectangle ibounds = activeImage.getBounds(); gc.drawImage(activeImage, rect.width / 2 - ibounds.width / 2, rect.height / 2 - ibounds.height / 2); } }