com.getsnappy.w20
Class ContextAnimatedGifLoadingIndicator

java.lang.Object
  extended by com.getsnappy.w20.JavaScriptLoadingIndicator
      extended by com.getsnappy.w20.ContextAnimatedGifLoadingIndicator
Direct Known Subclasses:
CalendarLoadingIndicator, GraphLoadingIndicator

public class ContextAnimatedGifLoadingIndicator
extends JavaScriptLoadingIndicator

This loading indicator will apply the opaque png "/images/grey.png" screenwide and then load /images/loadingBox.png and attempt to keep it centered in the screen

Author:
brian

Constructor Summary
ContextAnimatedGifLoadingIndicator(java.lang.String contextId)
          Creates an loading image with the default imageUri /images/loadingBox.png
ContextAnimatedGifLoadingIndicator(java.lang.String contextId, java.lang.String imageUri, int imageWidth, int imageHeight)
          Will display the following image with the specified width and height in the center of the context if possible.
ContextAnimatedGifLoadingIndicator(java.lang.String contextId, java.lang.String imageUri, int imageWidth, int imageHeight, int distanceFromTop, int distanceFromLeft)
          Will display the following image with the specified width and height.
 
Method Summary
 void jsFinish(java.io.Writer out)
          Called immediately before replacing the contents of the page.
 void jsStart(java.io.Writer out)
          This function will apply the opaque png "/images/grey.png" screenwide and then load /images/loadingBox.png and attempt to keep centered in the screen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextAnimatedGifLoadingIndicator

public ContextAnimatedGifLoadingIndicator(java.lang.String contextId)
Creates an loading image with the default imageUri /images/loadingBox.png

Parameters:
contextId -

ContextAnimatedGifLoadingIndicator

public ContextAnimatedGifLoadingIndicator(java.lang.String contextId,
                                          java.lang.String imageUri,
                                          int imageWidth,
                                          int imageHeight)
Will display the following image with the specified width and height in the center of the context if possible. If the height of the image is larger then the context they are aligned at top edges. If the width of the image is larger then the context width, the image should be aligned with the left edge of the context.

Parameters:
contextId - - the id of an html element
imageUri - - the uri for an image
imageWidth - - the width of the image
imageHeight - - the height of the image

ContextAnimatedGifLoadingIndicator

public ContextAnimatedGifLoadingIndicator(java.lang.String contextId,
                                          java.lang.String imageUri,
                                          int imageWidth,
                                          int imageHeight,
                                          int distanceFromTop,
                                          int distanceFromLeft)
Will display the following image with the specified width and height. Placement of the Loading Indicator gif is controlled by the distanceFromTop and distanceFromLeft parameters

Parameters:
contextId - - the id of an html element
imageUri - - the uri for an image
imageWidth - - the width of the image
imageHeight - - the height of the image
top - - the value used for absolute positioning css attribute top. null will result in this attribute not being set
Method Detail

jsStart

public void jsStart(java.io.Writer out)
             throws java.io.IOException
This function will apply the opaque png "/images/grey.png" screenwide and then load /images/loadingBox.png and attempt to keep centered in the screen

Specified by:
jsStart in class JavaScriptLoadingIndicator
Throws:
java.io.IOException
See Also:
DoNothingLoadingIndicator

jsFinish

public void jsFinish(java.io.Writer out)
              throws java.io.IOException
Description copied from class: JavaScriptLoadingIndicator
Called immediately before replacing the contents of the page. One use is for for displaying 100% on a progress. Another concept is too allow browsers to load all images and/or other external resources before showing the contents. It must output the JavaScript definition of a function (everything BETWEEN the braces).

Overrides:
jsFinish in class JavaScriptLoadingIndicator
Throws:
java.io.IOException