Commit Graph

48 Commits

Author SHA1 Message Date
Walter Korman dea46e4cc0 Assume the keyboard focus, or relinquish it, when we're enabled or
disabled respectively.  Sanity-check before adding ourselves as a window
focus listener when enabled to make sure we don't add ourselves more than
once.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1890 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-04 22:28:58 +00:00
Walter Korman 7b9f0332f1 Cleaned things up so that a single keyboard manager is to be constructed
and used throughout an application that cares to make use of its
functionality.  Allow registering key observers that are notified of all
key presses while the keyboard manager is active.  Clear things out
properly when the keyboard manager is disabled or reset.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1884 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-02 00:59:00 +00:00
Michael Bayne b07fef8396 Added support for a global message bundle to which other bundles fall back
if they can't find a message in their own list of strings.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1876 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-01 00:01:37 +00:00
Ray Greenwell 316634eb58 report idle / disconnected times when whispering.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1865 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-30 01:47:12 +00:00
Michael Bayne 4bababc95e Removed smoothing for the time being. Now a key up registers immediately,
but we are saddled with the key repeat delay for rapid sideways movement.
This will eventually all change when we have native libraries for turning
off key repeat.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1797 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-09 08:17:02 +00:00
Michael Bayne e8c7ba6084 Not to freak out if some unruly caller sends us null arguments.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1648 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-08-16 19:31:39 +00:00
Michael Bayne eb0f92fcef Brought things into line with new streaming world order.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1607 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-07-23 05:54:53 +00:00
Walter Korman 627ee5a1db Javadoc fixes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1557 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-07-02 23:15:53 +00:00
Michael Bayne e75ae89f22 Various and sundry modifications to clean up orientation handling and add
support for 16 orientations in situations where it is merited.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1548 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-26 23:53:07 +00:00
Michael Bayne c3bbaa3e40 Modified getDirection() to use arc tangent so that it maps angles smoothly
to their nearest compass direction instead of the wacky way it did before.
Also added getFineDirection() along with rotateCW() and rotateCCW() to
rotate through (fine) directions (though coarse directions can be rotated
as well, simply by always requesting two ticks of rotation). Also wrote
some test code to make sure everything works.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1545 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-26 02:54:56 +00:00
Michael Bayne 5124b68339 Added fine compass directions (NNW, ENE, etc.).
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1544 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-26 02:37:18 +00:00
Michael Bayne b07fbe123b Added mechanism for fetching resource strings that doesn't complain when
they don't exist.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1390 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-24 20:33:30 +00:00
Michael Bayne 9bb8f1b524 Moved routines to calculate orientation from point a toward point b into
DirectionUtil.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1373 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-17 21:12:14 +00:00
Walter Korman f0ebe247e4 Fixed javadoc typo.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1349 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-08 21:15:26 +00:00
Ray Greenwell 9503d37d90 added getResourceString() which actually gets the business from
the ResourceBundle, making this class easy to extend...


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1323 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-01 03:39:13 +00:00
Michael Bayne e13f354672 Oops, forgot that ResourceBundle throws a MissingResourceException rather
than returning null. Whee!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1322 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-01 02:47:18 +00:00
Michael Bayne 3f91aed3aa Added code to allow the creation of custom message bundles to go along
with a particular bundle's translation files. Mainly so Ray can do his
funny business with the pirate message translations.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1321 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-01 02:45:00 +00:00
Michael Bayne d026daa466 Not to choke if we can't resolve a resource bundle.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1320 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-30 17:45:27 +00:00
Michael Bayne 06f8a68b56 Moved RandomUtil from media.util to util.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1248 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-15 18:18:20 +00:00
Michael Bayne c078f34cef Code and documentation reparations, per Mr. Greenwell.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1242 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-15 17:13:38 +00:00
Michael Bayne 8a36a11a1d Moved CompiledConfig stuff into narya because it's generally useful.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1173 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-02 01:55:26 +00:00
Michael Bayne 95ed4b001d Minor edit.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1164 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-27 21:52:41 +00:00
Walter Korman a76d37cc27 Added a variant of tcompose() that takes an array of string arguments.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1156 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-27 07:09:04 +00:00
Walter Korman de0a6b70a8 Added codes for left/right, clockwise/counter-clockwise, and
horizontal/vertical.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1148 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-26 01:31:15 +00:00
Michael Bayne 974d0ebccb Wrap the ClassNotFoundException in an IOException.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1103 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-08 08:30:05 +00:00
Michael Bayne c2baccf5ba Abstracted code that parses XML configuration definitions into Java
objects which are then serialized for rapid loading and simple utilization
by the client and server; created serialized config services for our
character component constraints (what components are available at
character creation time, etc.).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1101 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-08 06:15:21 +00:00
Walter Korman 001932b5a5 Added tcompose() that calls the various permutations of compose() whilst
automatically tainting the arguments for yon intrepid programmer.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1082 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-01 17:10:30 +00:00
Michael Bayne d3e5912ef5 Javadoc edits.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1080 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-28 23:16:42 +00:00
Michael Bayne 6c8f613050 Fixed up xlate() to support recursive composed translations by providing a
method for composing a translation key and arguments into a single string
which is later decoded by the call to xlate(). This also requires that
unsafe strings (those entered by the user which should not be translated)
be marked with the new taint() method so that xlate() knows not to try to
translate those when it is recursively translating everything in sight.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1079 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-28 23:13:54 +00:00
Michael Bayne 2c50369bd3 Comment reformatting; added xlate() which is like the get() variants
except that it extracts the translation string key and arguments from a
compound key which is a tab-separated list of strings.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@976 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-09 01:35:26 +00:00
Michael Bayne 617d0e8cb0 Initial revision of localization support classes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@893 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-29 20:44:35 +00:00
Walter Korman 4653b0b0a7 Absorb key-typed events and be more cautious about when to dispatch key
events.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@880 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-19 06:07:20 +00:00
Walter Korman e2fbfdf38c Reworked focus handling so that the keyboard manager only loses focus when
(a) the target component is removed, or (b) the window containing the
target component loses focus.  Moreover, the keyboard manager now steals
keys from any other components (explicitly irrespective of the AWT or
Swing notion of keyboard focus) via the KeyboardFocusManager as long as
it's enabled and has the focus as previously defined.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@875 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-19 01:19:56 +00:00
Walter Korman 2f4ef45546 Initial version.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@874 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-18 23:58:27 +00:00
Walter Korman 0f27719f0e Repackaged keyboard manager related classes for their new location in
com.threerings.util.  Moved RobotPlayer into util package from yohoho.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@873 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-18 23:32:15 +00:00
Walter Korman bbce846874 Whitespace changes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@872 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-18 23:12:09 +00:00
Walter Korman 5deda8b1f8 Added getFloat().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@855 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-15 18:05:01 +00:00
Walter Korman 4e3d7d9ece Properly handle a key press followed by seemingly-impossibly-fast,
night-instant key release.  Added optional debug logging of key events at
the KeyboardFocusManager level for good measure.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@853 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-12 02:37:57 +00:00
Walter Korman 04cc7acdb3 Disable debug logging by default.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@841 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-19 23:33:02 +00:00
Walter Korman e76c0975ca Clean-up and easier toggling of debug logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@825 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-17 22:13:19 +00:00
Michael Bayne 5407731257 Add brackets around a toString()ed array of directions.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@822 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-17 03:51:35 +00:00
Michael Bayne 5f16f988b2 Added a method for obtaining the direction names array.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@821 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-17 03:43:54 +00:00
Michael Bayne f51a2e0d0c Created utility classes that unify our direction constant handling so that
we can interchange direction constants without requiring conversion and so
that we only have to define this stuff once.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@817 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-17 03:32:32 +00:00
Walter Korman 17ad791035 Oops, _rnd should be protected.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@780 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-14 16:46:01 +00:00
Walter Korman b9b0d9cd69 Revised counter piece placement and end game determination.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@775 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-14 01:14:50 +00:00
Walter Korman d31ebd2b54 Added facilities for a simple robot player to optionally run rampant in
the sword game.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@756 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-12 18:09:20 +00:00
Walter Korman 0432219e99 Added row at top of board to show floating block entry and killing piece
placement.  Went back to not allowing the player to be killed by shaft
pieces.  Initial work on improved keyboard input.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@755 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-12 16:55:06 +00:00
Walter Korman 53426bc5c4 Initial version.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@524 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-23 02:01:29 +00:00