Sleepbot.com Java Classes

com.sleepbot.WRLDtime.time
Class WRLDtimePieceNoOp

java.lang.Object
  extended bycom.sleepbot.WRLDtime.time.WRLDtimePieceNoOp
All Implemented Interfaces:
WRLDtimePiece

public class WRLDtimePieceNoOp
extends java.lang.Object
implements WRLDtimePiece

A no-op class for a WRLDtimePiece.
 
It implements all the required methods, but does nothing. Just extend the methods you want.
 
version 1.3 - 02Jan05 - Daniel M Foley


Constructor Summary
WRLDtimePieceNoOp()
           
 
Method Summary
 void destroy()
          This routine is called by the owner just before it destroys itself.
 void init(WRLDcron cron, java.applet.Applet a)
          This routine is called during initialization by an owning applet (eg. WRLDtimeApplet).
 void init(WRLDcron cron, java.awt.Frame f, java.lang.String[] args)
          This routine is called during initialization by an owning application (eg. WRLDtimeApp) which has constructed a Frame.
 void init(WRLDcron cron, java.lang.String[] args)
          This routine is called during initialization by a simple owning application.
 boolean isLoaded()
          This routine is called when the owner needs to know if all resources (images, configuration files, etc) have been loaded.
 boolean isPaintable()
          This routine is called when the owner needs to know if this class is ready to paint itself or not.
 void paint(java.awt.Graphics g, java.awt.Dimension d)
          This routine is called when the owner wants you to paint yourself.
 void start(WRLDcron cron)
          This routine is called by the owner just before its thread starts up.
 void stop(WRLDcron cron)
          This routine is called by the owner just before its thread stops.
 void tick(WRLDcron cron)
          This routine is called when the owner's chronometer has been incremented.
 void waiting(WRLDcron cron)
          This routine is called within the owner's inner time-keeping loop.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WRLDtimePieceNoOp

public WRLDtimePieceNoOp()
Method Detail

init

public void init(WRLDcron cron,
                 java.applet.Applet a)
Description copied from interface: WRLDtimePiece
This routine is called during initialization by an owning applet (eg. WRLDtimeApplet).
 
This generally that happens once, when the applet is first loaded into the browser (eg. during its own init() routine). This is a good time to set up instance variables, allocate dynamic storage, etc.
 

Specified by:
init in interface WRLDtimePiece
Parameters:
cron - a WRLDcron object which is maintained by the owner.
a - the owning Applet itself

init

public void init(WRLDcron cron,
                 java.awt.Frame f,
                 java.lang.String[] args)
Description copied from interface: WRLDtimePiece
This routine is called during initialization by an owning application (eg. WRLDtimeApp) which has constructed a Frame.
 
This generally that happens once, when the application first starts. This is a good time to set up instance variables, allocate dynamic storage, etc.
 

Specified by:
init in interface WRLDtimePiece
Parameters:
cron - a WRLDcron object which is maintained by the owner.
f - the Frame into which the time-piece will be rendered
args - the raw command line arguments from the application, in case you want them

init

public void init(WRLDcron cron,
                 java.lang.String[] args)
Description copied from interface: WRLDtimePiece
This routine is called during initialization by a simple owning application.
 
This method would be called by an application that does NOT have a display Frame. Most likely, we're talking about a command-line app that just dumps to stdout. Even though WRLDtimeNow does not invoke this method, it's a viable consideration.
 
This generally that happens once, when the application first starts. This is a good time to set up instance variables, allocate dynamic storage, etc.
 

Specified by:
init in interface WRLDtimePiece
Parameters:
cron - a WRLDcron object which is maintained by the owner.
args - the raw command line arguments from the application, in case you want them

destroy

public void destroy()
Description copied from interface: WRLDtimePiece
This routine is called by the owner just before it destroys itself.
 
This is a good time to clean up after yourself

Specified by:
destroy in interface WRLDtimePiece

start

public void start(WRLDcron cron)
Description copied from interface: WRLDtimePiece
This routine is called by the owner just before its thread starts up.
 
This method is always called at some time after the appropriate init() method has completed. In an application, it is called once, just after start-up. In an applet, it's called every time you refresh the page. This is a good time to complete your pre-run preparations.
 

Specified by:
start in interface WRLDtimePiece
Parameters:
cron - a WRLDcron object which is maintained by the owner.

stop

public void stop(WRLDcron cron)
Description copied from interface: WRLDtimePiece
This routine is called by the owner just before its thread stops.
 
This method is always called shortly before the WRLDtimePiece.destroy() method is invoked. In an application, it's called once, just before termination. In an applet, it's called every time you refresh the page. Basically, just stop everything you were doing to keep time.
 

Specified by:
stop in interface WRLDtimePiece
Parameters:
cron - a WRLDcron object which is maintained by the owner.

waiting

public void waiting(WRLDcron cron)
Description copied from interface: WRLDtimePiece
This routine is called within the owner's inner time-keeping loop.
 
The chronometer has not changed since the last WRLDtimePiece.tick(WRLDcron); the owner is just keeping time. If there's anything you need to do while waiting, here's where to do it.
 

Specified by:
waiting in interface WRLDtimePiece
Parameters:
cron - a WRLDcron object which is maintained by the owner.

tick

public void tick(WRLDcron cron)
Description copied from interface: WRLDtimePiece
This routine is called when the owner's chronometer has been incremented.
 
All of the owner's WRLDtimePiece.waiting(WRLDcron) has paid off and there's a new WRLDtime code to be leveraged. The WRLDtimePiece.paint(Graphics, Dimension) does NOT receive a WRLDcron object, so this is your opportunity to take a snapshot (eg. WRLDcronTick) of the current time code. This is an intentional optimization; paint requests and new time codes are completely asynchronous events.
 

Specified by:
tick in interface WRLDtimePiece
Parameters:
cron - a WRLDcron object which is maintained by the owner.

paint

public void paint(java.awt.Graphics g,
                  java.awt.Dimension d)
Description copied from interface: WRLDtimePiece
This routine is called when the owner wants you to paint yourself.
 
This event happens whenever the owner's render model chooses to fire it off. This is the time to render the current WRLDtime code, as remembered from the last WRLDtimePiece.tick(WRLDcron) event.
 

Specified by:
paint in interface WRLDtimePiece
Parameters:
g - a Graphics object for drawing
d - the Dimension of the display area

isPaintable

public boolean isPaintable()
Description copied from interface: WRLDtimePiece
This routine is called when the owner needs to know if this class is ready to paint itself or not.
 
If this method returns false, the owner will display the standard "WRLDtime" logo instead.
 

Specified by:
isPaintable in interface WRLDtimePiece
Returns:
true if this class is ready to handle paint requests, false otherwise

isLoaded

public boolean isLoaded()
Description copied from interface: WRLDtimePiece
This routine is called when the owner needs to know if all resources (images, configuration files, etc) have been loaded.
 
If this method returns false, the owner will perform patient ticks rather than dedicated ones (ie. less accuracy) That in turn will increase the performance of the loading process.
 

Specified by:
isLoaded in interface WRLDtimePiece
Returns:
true if this class has loaded all of its resources, false otherwise

Sleepbot.com Java Classes

Copyright 1995-..   Lookit the Cat Productions