|
Sleepbot.com Java Classes | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sleepbot.WRLDtime.time.WRLDtimePieceNoOp
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 |
public WRLDtimePieceNoOp()
Method Detail |
public void init(WRLDcron cron, java.applet.Applet a)
WRLDtimePiece
WRLDtimeApplet
).
init()
routine).
This is a good time to set up instance variables, allocate dynamic storage, etc.
init
in interface WRLDtimePiece
cron
- a WRLDcron
object which is maintained by the owner.a
- the owning Applet
itselfpublic void init(WRLDcron cron, java.awt.Frame f, java.lang.String[] args)
WRLDtimePiece
WRLDtimeApp
) which has constructed a Frame.
init
in interface WRLDtimePiece
cron
- a WRLDcron
object which is maintained by the owner.f
- the Frame
into which the time-piece will be renderedargs
- the raw command line arguments from the application, in case you want thempublic void init(WRLDcron cron, java.lang.String[] args)
WRLDtimePiece
stdout
.
Even though WRLDtimeNow
does not invoke this method, it's a viable consideration.
init
in interface WRLDtimePiece
cron
- a WRLDcron
object which is maintained by the owner.args
- the raw command line arguments from the application, in case you want thempublic void destroy()
WRLDtimePiece
destroy
in interface WRLDtimePiece
public void start(WRLDcron cron)
WRLDtimePiece
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.
start
in interface WRLDtimePiece
cron
- a WRLDcron
object which is maintained by the owner.public void stop(WRLDcron cron)
WRLDtimePiece
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.
stop
in interface WRLDtimePiece
cron
- a WRLDcron
object which is maintained by the owner.public void waiting(WRLDcron cron)
WRLDtimePiece
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.
waiting
in interface WRLDtimePiece
cron
- a WRLDcron
object which is maintained by the owner.public void tick(WRLDcron cron)
WRLDtimePiece
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.
tick
in interface WRLDtimePiece
cron
- a WRLDcron
object which is maintained by the owner.public void paint(java.awt.Graphics g, java.awt.Dimension d)
WRLDtimePiece
WRLDtimePiece.tick(WRLDcron)
event.
paint
in interface WRLDtimePiece
g
- a Graphics
object for drawingd
- the Dimension
of the display areapublic boolean isPaintable()
WRLDtimePiece
false
, the owner will display the standard "WRLDtime" logo instead.
isPaintable
in interface WRLDtimePiece
true
if this class is ready to handle paint requests, false
otherwisepublic boolean isLoaded()
WRLDtimePiece
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.
isLoaded
in interface WRLDtimePiece
true
if this class has loaded all of its resources, false
otherwise
|
Sleepbot.com Java Classes | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |