001: /*
002: * SalomeTMF is a Test Management Framework
003: * Copyright (C) 2005 France Telecom R&D
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: *
019: * @author Fayçal SOUGRATI, Vincent Pautret, Marche Mikael
020: *
021: * Contact: mikael.marche@rd.francetelecom.com
022: */
023:
024: package org.objectweb.salome_tmf.ihm.main;
025:
026: import java.awt.Color;
027: import java.awt.Container;
028: import java.awt.Dimension;
029: import java.awt.Font;
030: import java.awt.GraphicsConfiguration;
031: import java.awt.GraphicsDevice;
032: import java.awt.GraphicsEnvironment;
033: import java.awt.Image;
034: import java.awt.Point;
035: import java.awt.Rectangle;
036:
037: import javax.swing.JFrame;
038: import javax.swing.JLabel;
039: import javax.swing.JPanel;
040:
041: import org.objectweb.salome_tmf.ihm.languages.Language;
042: import org.objectweb.salome_tmf.ihm.tools.Tools;
043:
044: /**
045: * Classe qui définit l'écran d'attente lors du chargement de la base
046: */
047: public class WaitView extends JFrame {
048:
049: /**
050: * Un tableau d'image ? afficher
051: */
052: Image[] img;
053:
054: /******************************************************************************/
055: /** CONSTRUCTEUR ***/
056: /******************************************************************************/
057:
058: /**
059: * Constructeur de la vue
060: */
061: public WaitView() {
062: super ();
063: setSize(500, 300);
064: setUndecorated(true);
065: setFocusable(false);
066: setEnabled(false);
067:
068: // On charge l'image de fond
069: img = new Image[1];
070: img[0] = Tools.loadImages(this , ".//salome_intro.jpg");
071: JPanel panel = new PanelAvecFond(img[0]);
072: panel.setPreferredSize(new Dimension(500, 300));
073:
074: // Le texte ? afficher
075: JLabel label = new JLabel(Language.getInstance().getText(
076: "Chargement_de_Salomé_TMF..."));
077: label.setFont(new Font(null, Font.BOLD, 40));
078: label.setForeground(Color.WHITE);
079: panel.add(label);
080:
081: // le conteneur
082: Container contentPaneFrame = this .getContentPane();
083: contentPaneFrame.add(panel);
084:
085: GraphicsEnvironment ge = GraphicsEnvironment
086: .getLocalGraphicsEnvironment();
087: GraphicsDevice[] gs = ge.getScreenDevices();
088: GraphicsDevice gd = gs[0];
089: GraphicsConfiguration[] gc = gd.getConfigurations();
090:
091: // On place la fen?tre au milieu de l'?cran
092: /*Rectangle r = gc[0].getBounds();
093: Point pt = new Point( r.width/2, r.height/2 );
094: Point loc = new Point( pt.x - 200, pt.y - 150 );
095:
096: // Affichage
097: //this.setLocation(loc);*/
098: this .setLocationRelativeTo(this .getParent());
099: this .pack();
100: this .setVisible(true);
101: } // Fin du constructeur WaitView/0
102: } // Fin de la classe WaitView
|