EchoPoint
1.0

echopoint
Class HourGlass

java.lang.Object
  extended bynextapp.echo.Component
      extended byechopoint.HourGlass
All Implemented Interfaces:
ReflectionSetter, java.io.Serializable

public class HourGlass
extends nextapp.echo.Component
implements ReflectionSetter

The HourGlass class is a component that will display a centered "wait" image whenever information is being sent back to the server.

In the tradition of "the Highlander", there can be only one HourGlass on a AbstractPane at the one time. The first one added takes precendence over the others.

This is useful to make it absolutely clear to the user that a "server" request is in progress.

The delay in milliseconds is used to remove the "wait" image after a certain time. This is only useful if the server interaction results in NO screen updates. If it does result in screen updates then the "wait" image will be removed as soon as possible, ie as soon as the server replies.

See Also:
Serialized Form

Nested Class Summary
static class HourGlass.NestedStyleInfo
          Nested public static StyleInfo class.
 
Field Summary
static int CENTER
          Centre aligns the HourGlass image
static int DEFAULT_DELAY
          the default delay milliseconds
static nextapp.echo.ImageReference DEFAULT_ICON
          the default hourglass image
static java.lang.String DELAY_CHANGED_PROPERTY
          property name fired when the delay changes
static nextapp.echo.ImageReference HOURGLASS_BW_ICON
          a bacl and white hourglass image
static nextapp.echo.ImageReference HOURGLASS_CLR_ICON
          a color hourglass image
static nextapp.echo.ImageReference HOURGLASS_RUNNER_ICON
          a running man image
static java.lang.String ICON_CHANGED_PROPERTY
          property name fired when the imageReference changes
static int LEFT
          Left aligns the HourGlass image
static int RIGHT
          Right aligns the HourGlass image
static java.lang.String STYLE_ICON
          A style constant for the Icon property.
static java.lang.String X_CHANGED_PROPERTY
          property name fired when the X coord changes
static java.lang.String Y_CHANGED_PROPERTY
          property name fired when the X coord changes
 
Fields inherited from class nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, listenerList, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
HourGlass()
          Constructs a HourGlass with a default icon
HourGlass(nextapp.echo.ImageReference icon)
          Constructs a HourGlass with the specified icon
 
Method Summary
 void applyStyle(nextapp.echo.Style style)
           
 int getDelay()
           
 nextapp.echo.ImageReference getIcon()
          Returns the ImageReference within the HourGlass.
 int getX()
           
 int getY()
           
 java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue)
          Called to save the old value of a field, set in a new value and return the old value of a field.
 void setDelay(int newValue)
          Sets the HourGlass's delay, which is the delay in seconds before the hourglass image is removed.
 void setIcon(nextapp.echo.ImageReference newValue)
          Sets the ImageReference used by the HourGlass.
 void setX(int x)
          Sets the x coordinate for the HourGlass image.
 void setY(int y)
          Sets the y coordinate for the HourGlass image.
 
Methods inherited from class nextapp.echo.Component
add, add, addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getLocale, getParent, indexOf, init, isAncestorOf, isEnabled, isRegistered, isShowing, isVisible, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setEnabled, setFont, setForeground, setIdentifier, setLocale, setVisible, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CENTER

public static final int CENTER
Centre aligns the HourGlass image

See Also:
Constant Field Values

LEFT

public static final int LEFT
Left aligns the HourGlass image

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Right aligns the HourGlass image

See Also:
Constant Field Values

DEFAULT_ICON

public static nextapp.echo.ImageReference DEFAULT_ICON
the default hourglass image


DEFAULT_DELAY

public static int DEFAULT_DELAY
the default delay milliseconds


HOURGLASS_RUNNER_ICON

public static nextapp.echo.ImageReference HOURGLASS_RUNNER_ICON
a running man image


HOURGLASS_BW_ICON

public static nextapp.echo.ImageReference HOURGLASS_BW_ICON
a bacl and white hourglass image


HOURGLASS_CLR_ICON

public static nextapp.echo.ImageReference HOURGLASS_CLR_ICON
a color hourglass image


ICON_CHANGED_PROPERTY

public static final java.lang.String ICON_CHANGED_PROPERTY
property name fired when the imageReference changes

See Also:
Constant Field Values

DELAY_CHANGED_PROPERTY

public static final java.lang.String DELAY_CHANGED_PROPERTY
property name fired when the delay changes

See Also:
Constant Field Values

X_CHANGED_PROPERTY

public static final java.lang.String X_CHANGED_PROPERTY
property name fired when the X coord changes

See Also:
Constant Field Values

Y_CHANGED_PROPERTY

public static final java.lang.String Y_CHANGED_PROPERTY
property name fired when the X coord changes

See Also:
Constant Field Values

STYLE_ICON

public static final java.lang.String STYLE_ICON
A style constant for the Icon property. Values of this key must be of type nextapp.echo.ImageReference.

See Also:
Constant Field Values
Constructor Detail

HourGlass

public HourGlass()
Constructs a HourGlass with a default icon


HourGlass

public HourGlass(nextapp.echo.ImageReference icon)
Constructs a HourGlass with the specified icon

Method Detail

applyStyle

public void applyStyle(nextapp.echo.Style style)
See Also:
EchoPointComponent.applyStyle(nextapp.echo.Style)

getDelay

public int getDelay()
Returns:
The delay in milliseconds of the HourGlass before it will remove the image.

setDelay

public void setDelay(int newValue)
Sets the HourGlass's delay, which is the delay in seconds before the hourglass image is removed.


getIcon

public nextapp.echo.ImageReference getIcon()
Returns the ImageReference within the HourGlass.

Returns:
ImageReference - the ImageReference within.

setIcon

public void setIcon(nextapp.echo.ImageReference newValue)
Sets the ImageReference used by the HourGlass.

Parameters:
newValue -

getX

public int getX()
Returns:
- the x coordinate for the HourGlass image

getY

public int getY()
Returns:
- the y coordinate for the HourGlass image

setX

public void setX(int x)
Sets the x coordinate for the HourGlass image. This can also be CENTER, LEFT or RIGHT aligned by using one of the following values :

Parameters:
x - - the x coordinate for the HourGlass image

setY

public void setY(int y)
Sets the y coordinate for the HourGlass image.

Parameters:
y - - the y coordinate for the HourGlass image

set

public java.lang.Object set(java.lang.reflect.Field field,
                            java.lang.Object newValue)
                     throws java.lang.Exception
Description copied from interface: ReflectionSetter
Called to save the old value of a field, set in a new value and return the old value of a field. This interface allows a field set operation to be "delegated" back into the class that has permission to perform the field set.

 public Object set(Field f, Object newValue) throws Exception {
      Object oldValue = f.get(this);
      f.set(this,newValue);
      return oldValue;
 }
 

Specified by:
set in interface ReflectionSetter
Parameters:
field - - the field to be set
newValue - - the new value to be set
Returns:
the oldValue of the field
Throws:
java.lang.Exception
See Also:
ReflectionSetter.set(Field, Object)

EchoPoint
1.0