home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-08-14 | 1.9 KB | 74 lines |
- // UniteKeypad.java
- // 18.03.96
- //
- // the keypad on the unite screen
-
- package cybcerone.unite;
-
- import java.awt.Rectangle;
-
- import cybcerone.utils.Appletlike;
- import cybcerone.utils.EntryKeypad;
-
- /**
- * The keypad for the Unite screen.
- */
- class UniteKeypad extends EntryKeypad {
- private static final String id = "UniteKeypad";
- private static final String statusText = "Search for a room number";
-
- private static final String bgFile =
- UnitePanel.imagePath + "clavier_num.gif";
- private static final String activeBgFile =
- UnitePanel.imagePath + "clavier_num_rouge.gif";
-
- private static final Rectangle entryBox =
- new Rectangle (74 + 10, 219, 142 - 20, 29);
-
- UniteKeypad (Appletlike app) {
- super (id, statusText, app);
-
- setBackground (bgFile, 8);
- setActiveBackground (activeBgFile, 8);
- setEntryBox (entryBox);
-
- makeButtons ();
- }
-
- /**
- * Map out the buttons used.
- */
- private void makeButtons () {
- int x = 54;
- int y = 265;
- int xIncr = 61;
- int yIncr = 51;
-
- int x1 = x;
- int x2 = x1 + xIncr;
- int x3 = x2 + xIncr;
-
- addButton (eraseChar, x1, y, xIncr * 3, yIncr);
- addButton (backspaceChar, 0, 0, 0, 0);
-
- y += yIncr;
- addButton (new Character ('7'), x1, y, xIncr, yIncr);
- addButton (new Character ('8'), x2, y, xIncr, yIncr);
- addButton (new Character ('9'), x3, y, xIncr, yIncr);
-
- y += yIncr;
- addButton (new Character ('4'), x1, y, xIncr, yIncr);
- addButton (new Character ('5'), x2, y, xIncr, yIncr);
- addButton (new Character ('6'), x3, y, xIncr, yIncr);
-
- y += yIncr;
- addButton (new Character ('1'), x1, y, xIncr, yIncr);
- addButton (new Character ('2'), x2, y, xIncr, yIncr);
- addButton (new Character ('3'), x3, y, xIncr, yIncr);
-
- y += yIncr;
- addButton (new Character ('0'), x1, y, xIncr * 2, yIncr);
- addButton (new Character ('.'), x3, y, xIncr, yIncr);
- }
- }
-