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;
025:
026: import java.awt.BorderLayout;
027: import java.awt.Container;
028: import java.awt.Dimension;
029: import java.awt.FlowLayout;
030: import java.awt.event.ActionEvent;
031: import java.awt.event.ActionListener;
032: import java.util.Properties;
033:
034: import javax.swing.Box;
035: import javax.swing.BoxLayout;
036: import javax.swing.JButton;
037: import javax.swing.JCheckBox;
038: import javax.swing.JDialog;
039: import javax.swing.JLabel;
040: import javax.swing.JPanel;
041:
042: import org.objectweb.salome_tmf.ihm.datawrapper.DataModel;
043: import org.objectweb.salome_tmf.ihm.languages.Language;
044: import org.objectweb.salome_tmf.ihm.tools.Tools;
045:
046: /**
047: * @author teaml039
048: */
049: public class BadDirectoryView extends JDialog implements IHMConstants {
050:
051: JCheckBox box;
052:
053: public BadDirectoryView() {
054: super (SalomeTMF.ptrFrame, true);
055:
056: JLabel firstLine = new JLabel(
057: Language
058: .getInstance()
059: .getText(
060: "Une_copie_temporaire_du_fichier_a_été_copiée_dans_le_répertoire_:"));
061: firstLine.setIcon(Tools.createAppletImageIcon(
062: PATH_TO_CAUTION_ICON, ""));
063: Properties sys = System.getProperties();
064: JLabel dirName = new JLabel(sys.getProperty("java.io.tmpdir"));
065:
066: JLabel lastLine = new JLabel(
067: Language
068: .getInstance()
069: .getText(
070: "Vérifiez_bien_que_l'application_qui_permet_de_visualiser_ce_fichier_pointe_sur_le_bon_répertoire."));
071:
072: box = new JCheckBox(Language.getInstance().getText(
073: "Ne_plus_afficher_cette_fenêtre"));
074: box.addActionListener(new ActionListener() {
075: public void actionPerformed(ActionEvent e) {
076: if (box.isSelected()) {
077: DataModel.setBadDirectoryView(false);
078: } else {
079: DataModel.setBadDirectoryView(true);
080: }
081: }
082: });
083:
084: JButton endButton = new JButton(Language.getInstance().getText(
085: "Terminer"));
086: endButton.addActionListener(new ActionListener() {
087: public void actionPerformed(ActionEvent e) {
088: BadDirectoryView.this .dispose();
089: }
090: });
091:
092: JPanel firstLinePanel = new JPanel(new FlowLayout(
093: FlowLayout.CENTER));
094: firstLinePanel.add(firstLine);
095:
096: JPanel dirPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
097: dirPanel.add(dirName);
098:
099: JPanel lastLinePanel = new JPanel(new FlowLayout(
100: FlowLayout.CENTER));
101: lastLinePanel.add(lastLine);
102:
103: JPanel boxPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
104: boxPanel.add(box);
105:
106: JPanel buttonPanel = new JPanel(new FlowLayout(
107: FlowLayout.CENTER));
108: buttonPanel.add(endButton);
109:
110: JPanel page = new JPanel();
111: page.setLayout(new BoxLayout(page, BoxLayout.Y_AXIS));
112: page.add(firstLinePanel);
113: page.add(dirPanel);
114: page.add(Box.createRigidArea(new Dimension(1, 20)));
115: page.add(lastLinePanel);
116: page.add(Box.createRigidArea(new Dimension(1, 20)));
117: page.add(buttonPanel);
118: page.add(Box.createRigidArea(new Dimension(1, 10)));
119: page.add(boxPanel);
120:
121: Container contentPaneFrame = this .getContentPane();
122: contentPaneFrame.add(page, BorderLayout.CENTER);
123:
124: this .setResizable(false);
125: this .setLocation(400, 300);
126: this .setTitle(Language.getInstance().getText("Attention_!"));
127: this .pack();
128: this .setVisible(true);
129:
130: }
131:
132: } // Fin de la classe BadDirectoryView
|