home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-08-14 | 2.9 KB | 101 lines |
- // PersonInfoPanel.java
- // 17.03.96
- //
- // a map panel for a person
-
- package cybcerone.utils;
-
- import java.awt.Graphics;
-
- import cybcerone.orient.OrientPanel;
-
- /**
- * When a Person gets mapped, this panel gives you more info
- * about them.
- */
- public class PersonInfoPanel extends MapInfoPanel {
- private static final String id = "PersonInfoPanel";
- private static final String statusText = "Selected person";
-
- private static ScrollingPanel theName;
- private static ScrollingPanel theFonction;
- private static ScrollingPanel theUnite;
- private static ScrollingPanel theFaculte;
- private static ScrollingPanel theAdresse;
- private static ScrollingPanel theBatiment;
- private static ScrollingPanel theBureau;
- private static ScrollingPanel theTelephone;
-
- private static final int x1 = scale (58);
- private static final int x2 = scale (585);
-
- private static final int y1 = 0;
- private static final int y2 = scale (27);
- private static final int y3 = scale (54);
- private static final int y4 = scale (81);
- private static final int y5 = scale (108);
-
-
- private static final int x3 = scale (7);
- private static final int x4 = scale (540);
-
- private static final int y6 = scale (22);
- private static final int y7 = scale (49);
- private static final int y8 = scale (76);
- private static final int y9 = scale (103);
- private static final int y10 = scale (130);
-
-
- public PersonInfoPanel (Person thePerson, Appletlike app) {
- super (id, statusText, app);
-
- theName = newPanel (x1, y1, false);
- theFonction = newPanel (x1, y2, true);
- theUnite = newPanel (x1, y3, true);
- theFaculte = newPanel (x1, y4, true);
- theAdresse = newPanel (x1, y5, true);
-
- theBatiment = newPanel (x2, y2, true);
- theBureau = newPanel (x2, y3, true);
- theTelephone = newPanel (x2, y4, true);
-
- setData (thePerson);
- }
-
- private ScrollingPanel newPanel (int x, int y, boolean grayed) {
- ScrollingPanel thePanel = new ScrollingPanel (id, statusText, app);
- add (thePanel);
- thePanel.reshape (x, y, scale (470), scale (25));
- if (grayed) thePanel.setColor (gray);
- return thePanel;
- }
-
- public void setData (Person thePerson) {
- theName.setText (thePerson.getPrenom () + " " + thePerson.getNom ());
- theFonction.setText (thePerson.getFonction ());
- theUnite.setText (thePerson.getUnite ());
- theFaculte.setText (thePerson.getFaculte2 ());
- theAdresse.setText (thePerson.getAdresse ());
-
- theBatiment.setText (thePerson.getBatiment1 ());
- theBureau.setText (thePerson.getBatimentUnite ());
- theTelephone.setText (thePerson.getTelephone ());
- }
-
- public void paint (Graphics g) {
- super.paint (g);
- g.setColor (blue);
- g.setFont (Fonts.bigFont);
- g.drawString ("NOM", x3, y6);
- g.drawString ("FNT", x3, y7);
- g.drawString ("UNI", x3, y8);
- g.drawString ("FAC", x3, y9);
- g.drawString ("ADR", x3, y10);
-
- g.drawString ("BAT", x4, y7);
- g.drawString ("BUR", x4, y8);
- g.drawString ("TEL", x4, y9);
- }
-
- }
-