Sleepbot.com Java Classes

com.sleepbot.WRLDtime.time
Class WRLDtime

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

public class WRLDtime
extends java.lang.Object
implements WRLDtimePiece

A generfied WRLD.time clockface generator.
 
This is the default time-piece class generated and used by both WRLDtimeApp and WRLDtimeApplet. It implements WRLDtimePiece, which provides an invokable event structure for any time-piece class.
 
The most important aspect of this time-piece is its configurability:

You may configure the time-piece via a simple text file.
Each line in the file that is not blank and not a comment denotes a configuration setting. A line can be marked as a comment by making its first character a semicolon (';').
In an applet context, you may configure the time-piece via the <PARAM /> tags.
The tags's NAME attribute is the configuration line name, and its VALUE attribute is the line to be parsed. There's really no use for comments in this context.
Configuration settings have the following general format:
 
   NAME=KEY:VALUE, KEY:VALUE, ...
 
NAME is the name of the configuration line and it is followed by an equal sign ('='). The line contains a series of key-value pairs; these are the individual settings, each separated by a comma (','). The setting's KEY is separated from its VALUE by a colon (':'). If you need to include a comma (or leading or trailing whitespace) within your setting, then enclose the entire KEY:VALUE setting in full quotes ('"').
 
There is a separate document describing WRLDcron configuration settings at Sleepbot.com. The settings are described in some detail here -- see the applicable Param* JavaDoc. However other aspects of these files -- formatting, command-line and Applet usage, examples, etc. -- are more subtle and are described in the separate document.
 
version 1.3 - 01Jan05 - Daniel M Foley
version 1.2 - 07Apr98 - Daniel M Foley
version 1.1 - XXXxx98 - Daniel M Foley
version 1.0 - 15Feb98 - Daniel M Foley


Field Summary
static java.lang.String CONFIG_ALIAS_LIST
          The alias configuration listing ('alias.list') line.
static java.lang.String CONFIG_BACKGROUND
          The background ('bg') configuration line.
static java.lang.String CONFIG_CRON
          The 'cron' configuration line.
static java.lang.String CONFIG_DIGIT_DELIMITER
          Index-number delimiter for a digit configuration line; it's a '.'.
static java.lang.String CONFIG_DIGIT_LIST
          The digit configuration listing ('d.list') line.
static java.lang.String CONFIG_DIGIT_PREFIX
          Prefix for a digit configuration line.
static java.lang.String CONFIG_DRAWORDER
          The draw order ('draworder') configuration line.
static java.lang.String CONFIG_FOREGROUND
          The foreground ('fg') configuration line.
static java.lang.String CONFIG_MARKER_ASSIGNMENT
           
static java.lang.String CONFIG_MARKER_COMMENT
           
static java.lang.String CONFIG_SEPARATOR_LIST
          The separator configuration listing ('sep.list') line.
static java.lang.String CONFIG_SEPARATOR_PREFIX
          Prefix for a separator configuration line.
static java.lang.String CONFIG_SETTING_ASSIGNMENT
           
static java.lang.String CONFIG_SETTING_DELIMITER
           
static java.lang.String CONFIG_TABLET_DELIMITER
          Index-number-range delimiter for a tablet configuration line; it's a '.'.
static java.lang.String CONFIG_TABLET_LIST
          The tablet configuration listing ('t.list') line.
static java.lang.String CONFIG_TABLET_PREFIX
          Prefix for a tablet configuration line.
static java.lang.String CONFIG_WINDOW
          The 'window' configuration line.
static java.lang.String PARAM_CONFIGFILE
          The configuration file parameter.
static java.lang.String SETTING_COLOR_HEX
          The 'color' dimension setting.
static java.lang.String SETTING_CRON_DIVISOR
          The 'divisor' WRLDcron setting.
static java.lang.String SETTING_CRON_FACTOR
          The 'factor' WRLDcron setting.
static java.lang.String SETTING_CRON_FROMGMT
          The minutes-from-GMT ('fromgmt') WRLDcron setting.
static java.lang.String SETTING_CRON_UTC_CGI
          The UTC CGI URL ('utccgi') WRLDcron setting.
static java.lang.String SETTING_CRON_UTC_HOST
          The UTC host ('utchost') WRLDcron setting.
static java.lang.String SETTING_CRON_UTC_PORT
          The UTC port ('utcport') WRLDcron setting.
static java.lang.String SETTING_RECTANGLE_HEIGHT
          The 'height' dimension setting.
static java.lang.String SETTING_RECTANGLE_WIDTH
          The 'width' dimension setting.
static java.lang.String SETTING_RECTANGLE_X
          The 'x' position setting.
static java.lang.String SETTING_RECTANGLE_Y
          The 'y' position setting.
static java.lang.String SETTING_TEXT_FACE
          The 'face' font setting.
static java.lang.String SETTING_TEXT_SIZE
          The 'size' font setting.
static java.lang.String SETTING_TEXT_STYLE_BOLD
          The 'bold' font setting.
static java.lang.String SETTING_TEXT_STYLE_ITALIC
          The 'italic' font setting.
static java.lang.String SETTING_TEXT_STYLE_PLAIN
          The 'plain' font setting.
static java.lang.String SETTING_TYPE_ALIAS
          The 'alias' entity type setting.
static java.lang.String SETTING_TYPE_HIDE
          The 'hide' entity type setting.
static java.lang.String SETTING_TYPE_IMAGE
          The 'image' entity type setting.
static java.lang.String SETTING_TYPE_TEXT
          The 'text' entity type setting.
 
Constructor Summary
WRLDtime()
           
 
Method Summary
 void destroy()
          This routine is called by the owner just before it destroys itself.
 void init(WRLDcron cron, java.applet.Applet app)
          This routine is called during initialization by an owning applet (eg. WRLDtimeApplet).
 void init(WRLDcron cron, java.awt.Frame fme, 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 gfx, java.awt.Dimension dim)
          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
 

Field Detail

PARAM_CONFIGFILE

public static final java.lang.String PARAM_CONFIGFILE
The configuration file parameter.
 
This optional parameter contains the name of a configuration file to use. If none is provided, configuration will be derived from other locations (other parameters / arguments, etc).

See Also:
Constant Field Values

CONFIG_MARKER_COMMENT

public static final java.lang.String CONFIG_MARKER_COMMENT
See Also:
Constant Field Values

CONFIG_MARKER_ASSIGNMENT

public static final java.lang.String CONFIG_MARKER_ASSIGNMENT
See Also:
Constant Field Values

CONFIG_SETTING_DELIMITER

public static final java.lang.String CONFIG_SETTING_DELIMITER
See Also:
Constant Field Values

CONFIG_SETTING_ASSIGNMENT

public static final java.lang.String CONFIG_SETTING_ASSIGNMENT
See Also:
Constant Field Values

CONFIG_CRON

public static final java.lang.String CONFIG_CRON
The 'cron' configuration line.
 
This line provides configuration to a WRLDcron chronometer. See SETTING_CRON_FACTOR, SETTING_CRON_DIVISOR and SETTING_CRON_FROMGMT for more information.
 
This line also provides process configuration for how the time-piece. See SETTING_CRON_UTC_HOST, SETTING_CRON_UTC_PORT and SETTING_CRON_UTC_CGI for more information.
 
For examples of this line, please see the configuration documentation at Sleepbot.com.

See Also:
Constant Field Values

CONFIG_BACKGROUND

public static final java.lang.String CONFIG_BACKGROUND
The background ('bg') configuration line.
 
This line configures the background of the clock face.
 
A background color can be specified via SETTING_COLOR_HEX. If not specified, it defaults to lightGrey.
 
An optional background image can be specified via SETTING_TYPE_IMAGE. If specified, it's rendered on top of the background color.

See Also:
Constant Field Values

CONFIG_FOREGROUND

public static final java.lang.String CONFIG_FOREGROUND
The foreground ('fg') configuration line.
 
This line configures the foreground of the clock face -- which is basically all default settings.
 
The global (default) text color can be specified via SETTING_COLOR_HEX. If specified, it overrides the default setting of black.
 
The global (default) text font can be specified via SETTING_TEXT_FACE, SETTING_TEXT_SIZE, SETTING_TEXT_STYLE_PLAIN, SETTING_TEXT_STYLE_BOLD and SETTING_TEXT_STYLE_ITALIC. Where not specified -- face, size and style are handled separately -- it overrides the default setting of 16-point Courier Bold.
 
The default (reference) position can be specified via SETTING_RECTANGLE_X and SETTING_RECTANGLE_Y. Where specified -- the coordinates are handled separately -- it overrides the default of (0, 0). Now... this may sound strange, but if you don't supply either coordinate, it actually defaults to (5, -2) so that the generic clock will look right.

See Also:
Constant Field Values

CONFIG_WINDOW

public static final java.lang.String CONFIG_WINDOW
The 'window' configuration line.
 
This line configures the dimensions of a newly-generated clock window. The dimensions are specified via SETTING_RECTANGLE_X, SETTING_RECTANGLE_Y, SETTING_RECTANGLE_WIDTH and SETTING_RECTANGLE_HEIGHT.
 
This configuration has no purpose in an a applet context. The dimensions are specified in that context via the <APPLET /> tag. Where specified -- the coordinates are handled separately -- it overrides the default of ((30, 0) - (50, 50)).

See Also:
Constant Field Values

CONFIG_DRAWORDER

public static final java.lang.String CONFIG_DRAWORDER
The draw order ('draworder') configuration line.
 
This line configures the sequence in which the individual clock face components are rendered. It is a comma-delimited list of digit and separator names.
 
It can accept the following names: Though accurate, those descriptions are pretty obtuse... see the CONFIG_DIGIT_PREFIX and CONFIG_SEPARATOR_PREFIX configuration lines for more details.
 
Basically, you're describing the order in which its core entities (tablets, digits and separators) should be rendered. This would probably only be useful if your images overlapped strangely. All tablets are rendered first (in specified draw-order by digit), followed by the digits and separators in the specified draw-order.
 
By default, the draw order is; all separators (from lowest to highest), then all digits (from lowest to highest). Any clock component not specified in this line is rendered in its default order. For instance, if the line contained "d1, sep", then the second digit would be rendered, followed by the first separator; everything else would be rendered normally.
 
For examples of this line, please see the configuration documentation at Sleepbot.com.

See Also:
Constant Field Values

CONFIG_DIGIT_PREFIX

public static final java.lang.String CONFIG_DIGIT_PREFIX
Prefix for a digit configuration line.
 
The formats of a digit configuration line are:
    'd' + digit index     'd' + digit index + '.' + a number from 0 to 9
 
The 1st format above is called a 'digit group'. Indexes for digit groups range from 0 to as many digits as there are in the clock, based on its precision. For example, when a default WRLD.time clock displays "12:34", the highest digit (d3) = 1 and the lowest digit (d0) = 4. A digit group setting allows you to generally over-ride the global settings for all digits in the group.
 
A group's color can be specified via SETTING_COLOR_HEX. If specified, it overrides the previous color in the heirarchy (most likely the global color).
 
A group's font can be specified via SETTING_TEXT_FACE, SETTING_TEXT_SIZE, SETTING_TEXT_STYLE_PLAIN, SETTING_TEXT_STYLE_BOLD and SETTING_TEXT_STYLE_ITALIC. Where not specified -- face, size and style are handled separately -- it overrides the previous setting in the heirarchy (most likely the global text).
 
A group's position can be specified via SETTING_RECTANGLE_X and SETTING_RECTANGLE_Y. Where specified -- the coordinates are handled separately -- it overrides the previous position in the heirarchy (most likely the global position). Be aware that the text font's inner spacing (etc.) will have a significant effect on string positioning.
 
The 2nd format above is called a 'digit setting'. Each digit group has ten different digits... 0 thru 9. So, when a standard WRLD.time clock displays "98:76", the settings named d3.9, d2.8, d1.7 and d0.6 are displayed. Any digit setting which is not explicitly specified will not be displayed (eg. it's assumed to be hidden).
 
The digit setting's entity type is specified via one of the following; SETTING_TYPE_HIDE, SETTING_TYPE_TEXT, SETTING_TYPE_IMAGE or SETTING_TYPE_ALIAS.
 
For examples of this line, please see the configuration documentation at Sleepbot.com.

See Also:
Constant Field Values

CONFIG_DIGIT_DELIMITER

public static final java.lang.String CONFIG_DIGIT_DELIMITER
Index-number delimiter for a digit configuration line; it's a '.'.

See Also:
Constant Field Values

CONFIG_DIGIT_LIST

public static final java.lang.String CONFIG_DIGIT_LIST
The digit configuration listing ('d.list') line.
 
This line calls out all of the digit configuration. It's simply a comma-delimited list of all of your CONFIG_DIGIT_PREFIX line names. Fortunately, you only need this line when you're configuring via <APPLET /> parameters.
 
In a configuration file context -- or virtually any context -- all lines are parsed. The code recognizes each digit configuration when it sees it. Thus, no need to explicitly list them.
 
However, in an Applet, there's no way to get all of your <APPLET /> parameters. You have to explicitly ask for them by name. So, this line tells the time-piece about all the digit lines to be parsed. Remember to keep your list up-to-date... if it doesn't contain a new (or modified) digit line name, the applet won't parse it!

See Also:
Constant Field Values

CONFIG_TABLET_PREFIX

public static final java.lang.String CONFIG_TABLET_PREFIX
Prefix for a tablet configuration line.
 
The formats of a tablet configuration line are:
    't' + digit index     't' + digit index + '.' + tablet number     't' + digit index + '.' + range start + '.' + range end
 
A tablet is a basically a 'composite' digit, a sequence of digits to be handled together, an exception case handler. They were added to the config file to support a 12-hour old-style clock.
 
The 1st format above is called a 'tablet group'. Indexes for tablet groups range from 0 to as many digits as there are in the clock (same as with digit groups). For a clarification of this, please see CONFIG_DIGIT_PREFIX.
 
A group's color can be specified via SETTING_COLOR_HEX. If specified, it overrides the previous color in the heirarchy (most likely the global color).
 
A group's font can be specified via SETTING_TEXT_FACE, SETTING_TEXT_SIZE, SETTING_TEXT_STYLE_PLAIN, SETTING_TEXT_STYLE_BOLD and SETTING_TEXT_STYLE_ITALIC. Where not specified -- face, size and style are handled separately -- it overrides the previous setting in the heirarchy (most likely the global text).
 
A group's position can be specified via SETTING_RECTANGLE_X and SETTING_RECTANGLE_Y. Where specified -- the coordinates are handled separately -- it overrides the previous position in the heirarchy (most likely the global position). Be aware that the text font's inner spacing (etc.) will have a significant effect on string positioning.
 
The 2nd and 3rd formats above are both called 'tablet settings'. Each digit group has ten different digits... 0 thru 9. For a clarification of this, please see CONFIG_DIGIT_PREFIX.
 
The tablet setting's entity type is specified via one of the following; SETTING_TYPE_HIDE, SETTING_TYPE_TEXT, SETTING_TYPE_IMAGE or SETTING_TYPE_ALIAS.
 
For examples of this line, please see the configuration documentation at Sleepbot.com.

See Also:
Constant Field Values

CONFIG_TABLET_DELIMITER

public static final java.lang.String CONFIG_TABLET_DELIMITER
Index-number-range delimiter for a tablet configuration line; it's a '.'.

See Also:
Constant Field Values

CONFIG_TABLET_LIST

public static final java.lang.String CONFIG_TABLET_LIST
The tablet configuration listing ('t.list') line.
 
This line calls out all of the tablet configuration. It's simply a comma-delimited list of all of your CONFIG_TABLET_PREFIX line names. Fortunately, you only need this line when you're configuring via <APPLET /> parameters.
 
In a configuration file context -- or virtually any context -- all lines are parsed. The code recognizes each digit configuration when it sees it. Thus, no need to explicitly list them.
 
However, in an Applet, there's no way to get all of your <APPLET /> parameters. You have to explicitly ask for them by name. So, this line tells the time-piece about all the tablet lines to be parsed. Remember to keep your list up-to-date... if it doesn't contain a new (or modified) tablet line name, the applet won't parse it!

See Also:
Constant Field Values

CONFIG_SEPARATOR_PREFIX

public static final java.lang.String CONFIG_SEPARATOR_PREFIX
Prefix for a separator configuration line.
 
The formats of a separator configuration line are:
    'sep'   (an old-style format, which is interpreted as 'sep0')     'sep' + separator index
 
Indexes for separators range from 0 to... well, as many as you want. The 'sep' and 'sep0' settings are identical, and either one is recognized. If you want more than one separator, then create settings named 'sep1', 'sep2', etc. until you've done. The indexes must be in sequence; if you have a 'sep2' without a 'sep1', you'll never see it.
 
The separator's entity type is specified via one of the following; SETTING_TYPE_HIDE, SETTING_TYPE_TEXT, SETTING_TYPE_IMAGE or SETTING_TYPE_ALIAS.
 
For examples of this line, please see the configuration documentation at Sleepbot.com.

See Also:
Constant Field Values

CONFIG_SEPARATOR_LIST

public static final java.lang.String CONFIG_SEPARATOR_LIST
The separator configuration listing ('sep.list') line.
 
This line calls out all of the separator configuration. It's simply a comma-delimited list of all of your CONFIG_SEPARATOR_PREFIX line names. Fortunately, you only need this line when you're configuring via <APPLET /> parameters.
 
In a configuration file context -- or virtually any context -- all lines are parsed. The code recognizes each digit configuration when it sees it. Thus, no need to explicitly list them.
 
However, in an Applet, there's no way to get all of your <APPLET /> parameters. You have to explicitly ask for them by name. So, this line tells the time-piece about all the separator lines to be parsed. Remember to keep your list up-to-date... if it doesn't contain a new (or modified) separator line name, the applet won't parse it!

See Also:
Constant Field Values

CONFIG_ALIAS_LIST

public static final java.lang.String CONFIG_ALIAS_LIST
The alias configuration listing ('alias.list') line.
 
This line calls out all of the alias configuration. It's simply a comma-delimited list of all of your SETTING_TYPE_ALIAS settings (which define your alias line names). Fortunately, you only need this line when you're configuring via <APPLET /> parameters.
 
In a configuration file context -- or virtually any context -- all lines are parsed. The code recognizes each digit configuration when it sees it. Thus, no need to explicitly list them.
 
However, in an Applet, there's no way to get all of your <APPLET /> parameters. You have to explicitly ask for them by name. So, this line tells the time-piece about all the alias lines to be parsed. Remember to keep your list up-to-date... if it doesn't contain a new (or re-named) alias setting, the applet won't parse it!

See Also:
Constant Field Values

SETTING_TYPE_HIDE

public static final java.lang.String SETTING_TYPE_HIDE
The 'hide' entity type setting.
 
Nothing is rendered. This explicitly states that the entity (digit, tablet, separator, etc.) should not be displayed.

See Also:
Constant Field Values

SETTING_TYPE_TEXT

public static final java.lang.String SETTING_TYPE_TEXT
The 'text' entity type setting.
 
This indicates that this particular entity (digit, tablet, separator, etc.) is a text string. Simply provide the text string to be displayed. If the string contains any leading or trailing spaces, you may want to wrap the entire setting (key and value) in full-quotes.
 
The text's color can be specified via SETTING_COLOR_HEX. If specified, it overrides the previous color in the heirarchy.
 
The text's font can be specified via SETTING_TEXT_FACE, SETTING_TEXT_SIZE, SETTING_TEXT_STYLE_PLAIN, SETTING_TEXT_STYLE_BOLD and SETTING_TEXT_STYLE_ITALIC. Where not specified -- face, size and style are handled separately -- it overrides the previous setting in the heirarchy.
 
The text's position can be specified via SETTING_RECTANGLE_X and SETTING_RECTANGLE_Y. Where specified -- the coordinates are handled separately -- it overrides the previous position in the heirarchy (most likely the global position). Be aware that the text font's inner spacing (etc.) will have a significant effect on string positioning.
 
For examples of this line, please see the configuration documentation at Sleepbot.com.

See Also:
Constant Field Values

SETTING_TYPE_IMAGE

public static final java.lang.String SETTING_TYPE_IMAGE
The 'image' entity type setting.
 
This indicates that this particular entity (digit, tablet, separator, etc.) is an image. Simply provide the URL to the image file. If you don't specify a protocol'd URL, it's assumed to be within the document's address and port. If the filename starts with "/", it's assumed to be an absolute reference from the root of your web server. If not, then it's assumed to be relative to the directory in which the page containing the applet tag resides, or the directory where the class files reside if you're running it from the command line.
 
The image's position can be specified via SETTING_RECTANGLE_X and SETTING_RECTANGLE_Y. Where specified -- the coordinates are handled separately -- it overrides the previous position in the heirarchy.
 
For examples of this line, please see the configuration documentation at Sleepbot.com.

See Also:
Constant Field Values

SETTING_TYPE_ALIAS

public static final java.lang.String SETTING_TYPE_ALIAS
The 'alias' entity type setting.
 
This indicates that this particular entity (digit, tablet, separator, etc.) is configured via an alias. The value of this setting is the name of your alias. Simply create another configuration line with the name of this alias and put your settings there.
 
The name of your alias can be anything you want, such as one or my_logo. You can even reference another 'reserved' entity, such as d3.1 or sep2. Your entities can freely share your aliases (assuming that you make them generic enough for sizing and positioning). Of course, aliases are not required... but they make the file a little more legible and provide for re-usability.
 
The alias's color can be specified via SETTING_COLOR_HEX. If specified, it overrides the previous color in the heirarchy.
 
The alias's font can be specified via SETTING_TEXT_FACE, SETTING_TEXT_SIZE, SETTING_TEXT_STYLE_PLAIN, SETTING_TEXT_STYLE_BOLD and SETTING_TEXT_STYLE_ITALIC. Where not specified -- face, size and style are handled separately -- it overrides the previous setting in the heirarchy.
 
The alias's position can be specified via SETTING_RECTANGLE_X and SETTING_RECTANGLE_Y. Where specified -- the coordinates are handled separately -- it overrides the previous position in the heirarchy. Be aware that the text font's inner spacing (etc.) will have a significant effect on string positioning.
 
The alias's real entity type is specified via one of the following; SETTING_TYPE_HIDE, SETTING_TYPE_TEXT or SETTING_TYPE_IMAGE Yes, its entity type cannot be another alias -- they don't cascade.
 
For examples of this line, please see the configuration documentation at Sleepbot.com.

See Also:
Constant Field Values

SETTING_RECTANGLE_X

public static final java.lang.String SETTING_RECTANGLE_X
The 'x' position setting.
 
This indicates either the x coordinate (of a position) or the left side (of a dimension). It is a numeric value.
 
A position can be either absolute, or relative to the value it is overriding. For example, 'x:10' sets the horizontal position to 10, whereas 'x:+10' sets the horizontal position to 10 pixels to the right of the point it is overriding.
 
A dimension can only be absolute.
 
For examples of how to override settings, please see the configuration documentation at Sleepbot.com.

See Also:
Constant Field Values

SETTING_RECTANGLE_Y

public static final java.lang.String SETTING_RECTANGLE_Y
The 'y' position setting.
 
This indicates either the y coordinate (of a position) or the top side (of a dimension). It is a numeric value.
 
A position can be either absolute, or relative to the value it is overriding. For example, 'y:5' sets the vertical position to 5, whereas 'y:-5' sets the vertical position to 5 pixels above the point it is overriding.
 
A dimension can only be absolute.
 
For examples of how to override settings, please see the configuration documentation at Sleepbot.com.

See Also:
Constant Field Values

SETTING_RECTANGLE_WIDTH

public static final java.lang.String SETTING_RECTANGLE_WIDTH
The 'width' dimension setting.
 
This indicates the width of a dimension. It is a numeric value, and it is always absolute (eg. not relative).

See Also:
Constant Field Values

SETTING_RECTANGLE_HEIGHT

public static final java.lang.String SETTING_RECTANGLE_HEIGHT
The 'height' dimension setting.
 
This indicates the height of a dimension. It is a numeric value, and it is always absolute (eg. not relative).

See Also:
Constant Field Values

SETTING_COLOR_HEX

public static final java.lang.String SETTING_COLOR_HEX
The 'color' dimension setting.
 
This is a 6-digit hexidecimal representation of an RGB color value. For example, '000000' is black, 'FF0000' is bright red and '000080' is dark green.

See Also:
Constant Field Values

SETTING_TEXT_FACE

public static final java.lang.String SETTING_TEXT_FACE
The 'face' font setting.
 
This is the name of the font face to be used. Unfortunately, I don't have a full list of font names to give you. All I know is that 'Courier' and 'Times' are the standard fixed and proportional fonts (respectively) for Java.

See Also:
Constant Field Values

SETTING_TEXT_SIZE

public static final java.lang.String SETTING_TEXT_SIZE
The 'size' font setting.
 
This is the size of the font face to be used. This value can be either absolute, or relative to the value it is overriding. For example, 'size:8' sets the font size to 8, whereas 'size:+8' sets the font size to 8 points larger than the font it is overriding.
 
For examples of how to override settings, please see the configuration documentation at Sleepbot.com.

See Also:
Constant Field Values

SETTING_TEXT_STYLE_PLAIN

public static final java.lang.String SETTING_TEXT_STYLE_PLAIN
The 'plain' font setting.
 
This setting indicates plain font; it's just a KEY with no associated VALUE. The setting eliminates all existing style from the font. If you want to guarantee that you wont get extra bolds and italics from the font style you're overriding, specify the plain key.
 
For examples of how to override settings, please see the configuration documentation at Sleepbot.com.

See Also:
Constant Field Values

SETTING_TEXT_STYLE_BOLD

public static final java.lang.String SETTING_TEXT_STYLE_BOLD
The 'bold' font setting.
 
This setting indicates bold style font; it's just a KEY with no associated VALUE. The setting makes the font bold. It is always used relative to the font style you're overriding (unless the plain key is specified).
 
For examples of how to override settings, please see the configuration documentation at Sleepbot.com.

See Also:
Constant Field Values

SETTING_TEXT_STYLE_ITALIC

public static final java.lang.String SETTING_TEXT_STYLE_ITALIC
The 'italic' font setting.
 
This setting indicates italic style font; it's just a KEY with no associated VALUE. The setting makes the font italic. It is always used relative to the font style you're overriding (unless the plain key is specified).
 
For examples of how to override settings, please see the configuration documentation at Sleepbot.com.

See Also:
Constant Field Values

SETTING_CRON_FACTOR

public static final java.lang.String SETTING_CRON_FACTOR
The 'factor' WRLDcron setting.
 
This setting is applied to a WRLDcron chronometer instance. For more information, see WRLDcron.getFactor().

See Also:
Constant Field Values

SETTING_CRON_DIVISOR

public static final java.lang.String SETTING_CRON_DIVISOR
The 'divisor' WRLDcron setting.
 
This setting is applied to a WRLDcron chronometer instance. For more information, see WRLDcron.getDivisor().

See Also:
Constant Field Values

SETTING_CRON_FROMGMT

public static final java.lang.String SETTING_CRON_FROMGMT
The minutes-from-GMT ('fromgmt') WRLDcron setting.
 
This setting is applied to a WRLDcron chronometer instance. For more information, see WRLDcron.getFromGMT().

See Also:
Constant Field Values

SETTING_CRON_UTC_HOST

public static final java.lang.String SETTING_CRON_UTC_HOST
The UTC host ('utchost') WRLDcron setting.
 
This setting is the hostname of a UTC (Universal Time Code) server. The resulting UTC code is used to align the chronometer. For more information, see WRLDcron.setAdjustByUTC(String, int).

See Also:
Constant Field Values

SETTING_CRON_UTC_PORT

public static final java.lang.String SETTING_CRON_UTC_PORT
The UTC port ('utcport') WRLDcron setting.
 
This setting is the port number of a UTC (Universal Time Code) server. The resulting UTC code is used to align the chronometer. For more information, see WRLDcron.setAdjustByUTC(String, int).

See Also:
Constant Field Values

SETTING_CRON_UTC_CGI

public static final java.lang.String SETTING_CRON_UTC_CGI
The UTC CGI URL ('utccgi') WRLDcron setting.
 
Yes, that's a lot of TLAs for one setting. This setting is the URL to a CGI application which will return a UTC (Universal Time Code). The resulting UTC code is used to align the chronometer. For more information, see WRLDcron.setAdjustByUTC(URL).
 
It turns out that SETTING_CRON_UTC_HOST and SETTING_CRON_UTC_PORT don't work in an applet context. That's due to security hobbling in Java... the applet isn't allowed to go off to another site and make a request. However, you can use this setting to reference a local CGI script which will proxy the response from a UTC server. If the configuration contains both a SETTING_CRON_UTC_CGI and a SETTING_CRON_UTC_HOST setting, the script is referenced first, and if it fails, the host is referenced.

See Also:
Constant Field Values
Constructor Detail

WRLDtime

public WRLDtime()
Method Detail

init

public void init(WRLDcron cron,
                 java.applet.Applet app)
This routine is called during initialization by an owning applet (eg. WRLDtimeApplet).
 
This method:

Specified by:
init in interface WRLDtimePiece
Parameters:
cron - a WRLDcron object which is maintained by the owner.
app - the owning Applet itself
See Also:
WRLDtimePiece.init(WRLDcron, Applet)

init

public void init(WRLDcron cron,
                 java.awt.Frame fme,
                 java.lang.String[] args)
This routine is called during initialization by an owning application (eg. WRLDtimeApp) which has constructed a Frame.
 
This method:

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

init

public void init(WRLDcron cron,
                 java.lang.String[] args)
This routine is called during initialization by a simple owning application.
 
This method:

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
See Also:
WRLDtimePiece.init(WRLDcron, String[])

destroy

public void destroy()
This routine is called by the owner just before it destroys itself.
 
This method:

Specified by:
destroy in interface WRLDtimePiece
See Also:
WRLDtimePiece.destroy()

start

public void start(WRLDcron cron)
This routine is called by the owner just before its thread starts up.
 
This method:

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

stop

public void stop(WRLDcron cron)
This routine is called by the owner just before its thread stops.
 
This method does nothing; it's a no-op.
 

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

waiting

public void waiting(WRLDcron cron)
This routine is called within the owner's inner time-keeping loop.
 
This method:

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

tick

public void tick(WRLDcron cron)
This routine is called when the owner's chronometer has been incremented.
 
This method:

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

paint

public void paint(java.awt.Graphics gfx,
                  java.awt.Dimension dim)
This routine is called when the owner wants you to paint yourself.
 
This method: *  The rendering order for digits, tablets and separators is specified by CONFIG_DRAWORDER. However, all tablets are rendered first (in specified draw-order by digit), followed by the digits and separators in the specified draw-order. Defaults are specified by CONFIG_FOREGROUND and are overridden heirarchically, where specified.
 
**  The chronometer snapshot used is the last one taken by tick(WRLDcron).
 

Specified by:
paint in interface WRLDtimePiece
Parameters:
gfx - a Graphics object for drawing
dim - the Dimension of the display area
See Also:
WRLDtimePiece.paint(Graphics, Dimension)

isPaintable

public boolean isPaintable()
This routine is called when the owner needs to know if this class is ready to paint itself or not.
 
This method returns true once configuration has been applied. Initial configuration is applied via the start(WRLDcron) method.
 

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

isLoaded

public boolean isLoaded()
This routine is called when the owner needs to know if all resources (images, configuration files, etc) have been loaded.
 
This method returns true once all resources have been loaded. That's largely dependent upon the asynchronous MediaTracker as leveraged by the waiting(WRLDcron) method.
 

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

Sleepbot.com Java Classes

Copyright 1995-..   Lookit the Cat Productions