My Widgets
|
Disclaimer/Warning: I'm providing access to my Java code only for educational purposes. No warranty implied or expressed. (YMMV. The check's in the mail...) I'll try to clean them up a tad before posting here, but no promises and some will be rougher than others. Feel free to peruse the sources to see what neat tricks I've learned, but don't expect them to have any sort of 'commercial grade' quality; this is essentially a dump from my hard drive w/minimal additional effort for presentation or usability by anyone else on the planet. This code will have flaws, make assumptions and be poorly documented (to say the least). If you're interested in some snippet and have questions, feel free to ask, but don't assume they're "black-box ready" or you'll be rudely surprised. And in the event you do make some bucks off this stuff, be fair and remember the source...
|
|
CountDown
|
A running clock (applet) showing the time remaining until a specified date in the future.
Source: CountDown.java, DateDelta.java
Examples: TestCountDown.html
Known Problems
|
1.
|
Intermittent flicker during update
|
|
|
Need to change the implementation to use 'double-buffering' to "fix" the feature, uh, problem. Thanks to the Dippy-Bird's Java Documentation for an example.
|
|
2.
|
Unit tags not configurable
|
|
|
Need to change the implementation to (optionally) pull these from parameter info ("Unit tags" = fixed text displayed, e.g. "min").
|
|
3.
|
Past Dates Not Supported
|
|
|
The comparison logic only handles dates in the future (displays a message if the date is past). Should display a message (optionally user-defined) or display a running total (negative).
|
|
4.
|
No 'AutoFit' Option
|
|
|
The applet should (optional) resize itself to the size of the text.
|
|
5.
|
Text Always Left Jusified
|
|
|
The text should support Align=Left|Center|Right.
|
|
6.
|
Transparent Background
|
|
|
The background should (optionally) be transparent (just paint the text).
|
|
|
Timers
|
A 1-shot timer and a repeating timer. These classes fire methods of the provided object, which must implement the defined interface.
Java has no native 'timer' support, but this functionality was surprisingly easy to implement given Java's rich multi-threading support.
Source: HskTimer.java, HskTimerRepeating.java, HskTimerAction.java
Examples: TestTimer.java, TestTimerRepeating.java, TestTimerAction.java
|