SOURCE CODE
| Java | AppleScript | 4D |
| Java |
| My Java source code (Zipped, 50K) | My Java Links | My Java classes (Zipped, 41K) |
SmartTextField
|
NumberTextField
|
DoubleTextField
|
PosIntTextField
|
UByteTextField
|
PercentTextField
|
DegreeTextField
|
RetroFocusable
|
RFContainer
|
RF
|
Assert
|
Maths
|
ComplexNumber
|
ClassPreloadThread
|
SMARTTEXTFIELD 1.2java.awt.TextField,
implementing standard tabbing behaviour
for enterable-text fields in a GUI.
Components
it will give the focus to (any that implement RetroFocusable),
and fully exception-protected. Utilises the RF
utility class.
SmartTextFields in action.
Use this class suite in real-world conditions, and see for yourself
how SmartTextFields differ from standard TextFields.
NUMBERTEXTFIELD 1.2SmartTextField,
making a TextField behave like both a Number
and a TextField.
DOUBLETEXTFIELD 1.2NumberTextField,
providing general number-format text-entry/display constraints.
DoubleTextFields (not used in the demo)
provide the widest, least constrained range of numeric-text entry and display:
either positive or negative (the other three field types are for positive
and 0 only), decimal fractions as well as integers (the others are for
integers only), and the enormous range of values of Java's 64-bit double-precision
floating-point double datatype.
POSINTTEXTFIELD 1.1NumberTextField,
constraining the field's Number value and text display to positive-or-zero
integer values.
UBYTETEXTFIELD 1.2,
PERCENTTEXTFIELD 1.2,
DEGREETEXTFIELD 1.2PosIntTextField,
providing specific integer text-entry/display constraints.
SmartTextField demo
uses all three of these classes: UByteTextField for the RGB
colors, DegreeTextField for the Hue, and PercentTextField
for the Saturation and Brightness. Try typing first "255" into
the Red field, then backspace and type "256". Similarly, try
"360" and "361" in the Hue field, and "100"
and "101" in the Saturation field. In each case, the first entry
is allowed, but the second is not.
RETROFOCUSABLE 1.2java.awt.Component descendants which
would like to have Shift-Tab functionality, i.e. the ability to send or
receive the focus in the reverse of the tab order.
SmartTextField.
RFCONTAINER 1.2java.awt.Container descendants which
would like to assist in determining Shift-Tab functionality, i.e. the ability
to send or receive the focus in the reverse of the tab order.
SmartTextField demo Applet
and both its nested Panels.
RF 1.0final)
search methods for determining which RetroFocusable-implementing
Component should receive the focus next.
Container subclasses which implement RFContainer
can co-operate with RF by implementing replacements, accelerations
or callbacks for RF's default search algorithms.
SmartTextField.
ASSERT 1.2Assert utility class provides inline (final)
methods for testing conditions which you expect to be true in the course
of your program, and for giving you context-specific information if they
prove to be false at runtime. Especially useful for catching those conditions
which "obviously" cannot ever be false but nevertheless somehow
turn out to be.
Assert to test every "obviously true" condition
in your program's flow of control and gasp at the number that turn out
to be false!
Assert._() in if
blocks:
if
( __DEBUGGING__ )
{
Assert._( such_and_such == mustBeTrue(),
"Hey! It wasn't true after all!"
);
}
__DEBUGGING__ is a private static final boolean, so the compiler can skip it in your
shipping code. Just set __DEBUGGING__ to true
while developing, and false for
release.
MATHS 1.1java.lang.Math.
factorial() method. (When did you
last need one of those?)
COMPLEXNUMBER 1.0a1CLASSPRELOADTHREAD 1.0a1
Compile the source files in the following order, making sure that each
one can see the ".class" output files resulting from
compiling the earlier one(s):
RetroFocusable.java
Assert.java
RFContainer.java
RF.java
SmartTextField.java
NumberTextField.java
DoubleTextField.java
PosIntTextField.java
UByteTextField.java
PercentTextField.java
DegreeTextField.java
ClassPreloadThread.java
ColorTest2.java and ColorControls2.java (the
second demo applet)
Maths.java (optional -- interest only)
ComplexNumber.java (ditto)
Use a SmartTextField anywhere you would use an ordinary TextField.
To add SmartTextField's tabbing behaviour to another Component
subclass (eg Button, Checkbox or List):
RetroFocusable,
e.g.:public class SmartButton extends java.awt.Button implements RetroFocusable
{
// class code...
}
prevComponent(), nextComponent(),
keyDown() and prevFocus() methods from SmartTextField.java.
| AppleScript |
FOLDER
OBJECT
1.0.1
HTML
TAG
MERGER
1.0
QUIT
ALL
APPLICATIONS
1.0
| 4D |
EXPORT ALL
|
|
|
|