DE.purple_sunshine.bigbro
Class CountdownApplet

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--DE.purple_sunshine.bigbro.ParameterApplet
                                |
                                +--DE.purple_sunshine.bigbro.CountdownApplet
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.lang.Runnable, java.io.Serializable

public class CountdownApplet
extends ParameterApplet
implements java.lang.Runnable

An Applet that shows the current date and time and a countdown to a specified date. The different views on the time fade in and out and move on random paths through the applet.
By clicking on the Applet, the animation can be switched off and the date and remaining days will be shown instead. Documentation on how to use that applet in a website is available here.

Since:
JDK1.1
Version:
1.0
Author:
Holger Wagner
See Also:
CountdownCanvas, CountdownAnimator, CountdownDigits, Serialized Form

Field Summary
static int DAYS
           
static int[] DAYS_IN_MONTH
           
static int HOURS
           
static int MINUTES
           
static int MS
           
static int SECONDS
           
 
Fields inherited from class DE.purple_sunshine.bigbro.ParameterApplet
runsInMac, runsInMacNetscape, VERBOSITY
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CountdownApplet()
           
 
Method Summary
 java.lang.String currentDateString()
           
 java.lang.String currentTimeString()
           
 java.lang.String currentWeekdayString()
           
 java.lang.String daysIntoString()
           
 void destroy()
          Stops the animation.
 java.lang.String getAppletInfo()
          Shows information about this applet.
 java.lang.String[][] getParameterInfo()
          Shows which parameters are allowed.
 void init()
          Initializes the Applet.
 java.lang.String remainingDateString()
           
 java.lang.String remainingDaysString()
           
 java.lang.String remainingHoursString()
           
 java.lang.String remainingMinutesString()
           
 java.lang.String remainingMSString()
           
 java.lang.String remainingSecondsString()
           
 void run()
          This Thread tries to load the time from the server.
 void start()
          Starts the animation.
 void stop()
          Stops the animation.
 void tick()
           
 
Methods inherited from class DE.purple_sunshine.bigbro.ParameterApplet
offButtonURL, onButtonURL, runsInMac, runsInMacNetscape
 
Methods inherited from class java.applet.Applet
getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DAYS

public static final int DAYS

HOURS

public static final int HOURS

MINUTES

public static final int MINUTES

SECONDS

public static final int SECONDS

MS

public static final int MS

DAYS_IN_MONTH

public static final int[] DAYS_IN_MONTH
Constructor Detail

CountdownApplet

public CountdownApplet()
Method Detail

currentDateString

public java.lang.String currentDateString()

currentTimeString

public java.lang.String currentTimeString()

currentWeekdayString

public java.lang.String currentWeekdayString()

remainingDaysString

public java.lang.String remainingDaysString()

daysIntoString

public java.lang.String daysIntoString()

remainingHoursString

public java.lang.String remainingHoursString()

remainingMinutesString

public java.lang.String remainingMinutesString()

remainingSecondsString

public java.lang.String remainingSecondsString()

remainingMSString

public java.lang.String remainingMSString()

remainingDateString

public java.lang.String remainingDateString()

init

public void init()
Initializes the Applet. The most important responsibility is getting the time right and checking whether or not this runs on a Mac.
Overrides:
init in class ParameterApplet

run

public void run()
This Thread tries to load the time from the server. The time must be stored in a file that's accessible over the web, its URL can be specified by the parameter timefile.
Specified by:
run in interface java.lang.Runnable

tick

public void tick()

start

public void start()
Starts the animation.
Overrides:
start in class java.applet.Applet

stop

public void stop()
Stops the animation. The responsible thread finishes and is killed, thus any resources are freed.
Overrides:
stop in class java.applet.Applet

destroy

public void destroy()
Stops the animation. Since most browsers seem to never call this method, its functionality has been moved to stop() and calls to destroy() method are simply forwarded to stop().
Overrides:
destroy in class java.applet.Applet

getAppletInfo

public java.lang.String getAppletInfo()
Shows information about this applet.
Overrides:
getAppletInfo in class ParameterApplet
Returns:
name
(c) 2000 Holger Wagner, Purple Sunshine Productions
http://www.purple-sunshine.de/
mailto:holger [at] purple-sunshine [dot] de
See Also:
Component.getName()

getParameterInfo

public java.lang.String[][] getParameterInfo()
Shows which parameters are allowed. These parameters are always available, for more parameters override this and handleParams().
Overrides:
getParameterInfo in class ParameterApplet
Returns:
foreground -- RGB-Value -- foreground color, e.g. 0 0 0
background -- RGB-Value -- background color, e.g. 255 255 255
font -- String -- Font for the messages. Default = helvetica
size -- int -- Size of the messages. Default = 12
timefile -- String -- the file with the current time on the server (at startup) finaldate -- String -- the date and time which the applet should count down to fps -- integer -- the framerate of the animation in frames per second displaycount -- integer -- the number of concurrent date-sprites


© 2000, Holger Wagner, Purple Sunshine Productions.