uk.ac.kcl.cch.jb.pliny.browser
Class BusyIndicator

java.lang.Object
  extended byorg.eclipse.swt.widgets.Widget
      extended byorg.eclipse.swt.widgets.Control
          extended byorg.eclipse.swt.widgets.Scrollable
              extended byorg.eclipse.swt.widgets.Composite
                  extended byorg.eclipse.swt.widgets.Canvas
                      extended byuk.ac.kcl.cch.jb.pliny.browser.BusyIndicator
All Implemented Interfaces:
org.eclipse.swt.dnd.DragSourceListener, org.eclipse.swt.graphics.Drawable, EventListener, org.eclipse.swt.internal.SWTEventListener

public class BusyIndicator
extends org.eclipse.swt.widgets.Canvas
implements org.eclipse.swt.dnd.DragSourceListener

Code borrowed directly from org.eclipse.ui.internal.browser.


Field Summary
protected  Thread busyThread
           
protected  org.eclipse.swt.graphics.Image image
           
protected static org.eclipse.swt.graphics.Image[] images
           
protected  boolean stop
           
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
BusyIndicator(org.eclipse.swt.widgets.Composite parent, int style)
          BusyWidget constructor comment.
 
Method Summary
 org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint, boolean changed)
           
protected  void createBusyThread()
          Creates a thread to animate the image.
 void dispose()
           
 void dragFinished(org.eclipse.swt.dnd.DragSourceEvent event)
           
 void dragSetData(org.eclipse.swt.dnd.DragSourceEvent event)
           
 void dragStart(org.eclipse.swt.dnd.DragSourceEvent event)
           
 org.eclipse.swt.graphics.Image getImage()
          Return the image or null.
 Resource getResource()
           
 boolean isBusy()
          Returns true if it is currently busy.
protected  void onPaint(org.eclipse.swt.events.PaintEvent event)
           
 void setBusy(boolean busy)
          Sets the indicators busy count up (true) or down (false) one.
 void setImage(org.eclipse.swt.graphics.Image image)
          Set the image.
 void setResource(Resource resource)
           
 
Methods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, scroll, setCaret, setFont
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

images

protected static org.eclipse.swt.graphics.Image[] images

image

protected org.eclipse.swt.graphics.Image image

busyThread

protected Thread busyThread

stop

protected boolean stop
Constructor Detail

BusyIndicator

public BusyIndicator(org.eclipse.swt.widgets.Composite parent,
                     int style)
BusyWidget constructor comment.

Parameters:
parent - org.eclipse.swt.widgets.Composite
style - int
Method Detail

computeSize

public org.eclipse.swt.graphics.Point computeSize(int wHint,
                                                  int hHint,
                                                  boolean changed)

createBusyThread

protected void createBusyThread()
Creates a thread to animate the image.


dispose

public void dispose()

getImage

public org.eclipse.swt.graphics.Image getImage()
Return the image or null.


isBusy

public boolean isBusy()
Returns true if it is currently busy.

Returns:
boolean

onPaint

protected void onPaint(org.eclipse.swt.events.PaintEvent event)

setBusy

public void setBusy(boolean busy)
Sets the indicators busy count up (true) or down (false) one.

Parameters:
busy - boolean

setImage

public void setImage(org.eclipse.swt.graphics.Image image)
Set the image. The value null clears it.


getResource

public Resource getResource()

setResource

public void setResource(Resource resource)

dragStart

public void dragStart(org.eclipse.swt.dnd.DragSourceEvent event)
Specified by:
dragStart in interface org.eclipse.swt.dnd.DragSourceListener

dragSetData

public void dragSetData(org.eclipse.swt.dnd.DragSourceEvent event)
Specified by:
dragSetData in interface org.eclipse.swt.dnd.DragSourceListener

dragFinished

public void dragFinished(org.eclipse.swt.dnd.DragSourceEvent event)
Specified by:
dragFinished in interface org.eclipse.swt.dnd.DragSourceListener