one.toys
Class Clock
java.lang.Object
|
+--one.world.core.Component
|
+--one.gui.Application
|
+--one.toys.Clock
- All Implemented Interfaces:
- Serializable
- public final class Clock
- extends Application
Implementation of a simple clock.
Usage:
Clock [font-size [style]]
where the font size must be a number between 1 and 7
(inclusive) and the style must be either "short", "medium", "long",
or "full".
Imported and Exported Event Handlers
Exported event handlers:
- main
- Handles environment events, linked to an environment's
main imported event handler.
Imported event handlers:
- request
- Handles environment events and REP requests, linked to
an environment's request exported event handler.
- Version:
- $Revision: 1.4 $
- See Also:
- Serialized Form
| Fields inherited from class one.gui.Application |
ACTIVATING, ACTIVE, appName, height, INACTIVE, locationX, locationY, lock, main, mainWindow, operation, request, status, timer, width |
|
Constructor Summary |
Clock(Environment env,
int style,
int fontSize)
Create a new instance of Clock. |
| Methods inherited from class one.world.core.Component |
declareExported, declareImported, equals, eventHandlers, getDescriptor, getEnvironment, getLinkedHandlers, getLinkedNumber, getTimer, hasEventHandler, hashCode, isFullyLinked, isLinked, isSealed, link, link, run, seal, unbox, undeclare, unlink, wrap |
Clock
public Clock(Environment env,
int style,
int fontSize)
- Create a new instance of
Clock.
- Parameters:
env - The environment for the new instance.style - The style for the time.fontSize - The font size for the time.- Throws:
IllegalArgumentException - Signals that style is not a valid
style constant or that fontSize
is not a valid font size.
acquire
public void acquire()
- Acquire the resources needed by the clock application.
- Overrides:
acquire in class Application
release
public void release()
- Release the resources used by the clock application.
- Overrides:
release in class Application
createMainWindow
public Application.Window createMainWindow()
- Create the clock's main window.
- Overrides:
createMainWindow in class Application
- Following copied from class:
one.gui.Application
- Returns:
- The application's main window, or
null
if the application does not have a main window.
init
public static void init(Environment env,
Object closure)
- Initialize the clock.
- Parameters:
env - The environment.closure - The closure.- Throws:
IllegalArgumentException - Signals that the closure is not a string array
or a string array with illegal arguments.
(C) Copyright 2001 UW CSE