home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-08-14 | 1.8 KB | 67 lines |
- // FaculteInfoPanel.java
- // 17.03.96
- //
- // a map panel for a faculte
-
- package cybcerone.utils;
-
- import java.awt.Image;
-
- import cybcerone.orient.OrientPanel;
-
- /**
- * This is what a Faculte creates when it gets mapped.
- */
- public class FaculteInfoPanel extends MapInfoPanel {
- private static final String id = "FaculteInfoPanel";
- private static final String statusText = "Selected faculty or service";
-
- private static final String imageFile = "pictoInfoFaculte.gif";
-
- private static ScrollingPanel theName;
- private static ScrollingPanel thePlace;
- private static ScrollingPanel theTelephone;
- private static ScrollingPanel theFax;
- private static ScrollingPanel theContact;
-
- private static final int x = scale (49);
- private static final int y1 = scale (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);
-
-
- public FaculteInfoPanel (Appletlike app) {
- super (id, statusText, app);
-
- setBackground (OrientPanel.imagePath + imageFile, 3);
-
- theName = newPanel (x, y1);
- thePlace = newPanel (x, y2);
- theTelephone = newPanel (x, y3);
- theFax = newPanel (x, y4);
- theContact = newPanel (x, y5);
-
- thePlace.setColor (gray);
- theTelephone.setColor (gray);
- theFax.setColor (gray);
- theContact.setColor (gray);
- }
-
- private ScrollingPanel newPanel (int x, int y) {
- ScrollingPanel thePanel = new ScrollingPanel (id, statusText, app);
- add (thePanel);
- thePanel.reshape (x, y, size().width - x, scale (25));
- return thePanel;
- }
-
- public void setData (Faculte theFac) {
- theName.setText (theFac.getName ());
- thePlace.setText (theFac.getBatiment ());
- theTelephone.setText (theFac.getTelephone ());
- theFax.setText (theFac.getFax ());
- theContact.setText (theFac.getContact ());
- }
- }
-