home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-08-14 | 1.6 KB | 72 lines |
- // PersonPanel.java
- // 28.02.96
- //
- // the personne screen
-
- package cybcerone.person;
-
- import java.awt.Event;
- import java.util.Vector;
-
- import cybcerone.utils.Appletlike;
- import cybcerone.utils.SuperPanel;
- import cybcerone.utils.PaintableVector;
- import cybcerone.utils.Person;
-
- /**
- * The SuperPanel for the person screen.
- */
- public class PersonPanel extends SuperPanel {
- public static final String id = "personPanel";
- public static final String imagePath = "personnes/";
- public static final String dataPath = "personnes/";
- private static final String statusText = "";
- private static final String dataFile = dataPath + "liste";
-
- private static PersonPaper thePaper;
- private static PersonKeypad theKeypad;
-
- public PersonPanel (Appletlike app) {
- super (id, statusText, app);
-
- add (thePaper = new PersonPaper (this));
- add (theKeypad = new PersonKeypad (this));
-
- getData (dataFile, new Person (), this);
- }
-
- /**
- * This is the name we want to search for.
- */
- protected void update (String name) {
- thePaper.update (name);
- }
-
- /**
- * This is the data for the paper.
- */
- protected void update (Vector data) {
- thePaper.setData (new PaintableVector (data));
- }
-
- /**
- * I want the keypad to accept keystrokes even when the mouse is
- * anywhere in the person screen.
- */
- public boolean keyDown (Event evt, int key) {
- return theKeypad.keyDown (evt, key);
- }
-
- /**
- * Ditto on the above.
- */
- public boolean keyUp (Event evt, int key) {
- return theKeypad.keyUp (evt, key);
- }
-
- public void reset () {
- theKeypad.reset ();
- }
- }
-
-