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.BorderLayout;
027: import java.awt.Container;
028: import java.awt.Dimension;
029: import java.awt.FlowLayout;
030: import java.awt.Rectangle;
031: import java.awt.event.ActionEvent;
032: import java.awt.event.ActionListener;
033:
034: import javax.swing.BoxLayout;
035: import javax.swing.ButtonGroup;
036: import javax.swing.JButton;
037: import javax.swing.JDialog;
038: import javax.swing.JLabel;
039: import javax.swing.JPanel;
040: import javax.swing.JRadioButton;
041:
042: import org.objectweb.salome_tmf.ihm.languages.Language;
043:
044: public class ExecutionFilter extends JDialog {
045:
046: /******************************************************************************/
047: /** CONSTRUCTEUR ***/
048: /******************************************************************************/
049:
050: /**
051: * Constructeur de la vue
052: */
053: public ExecutionFilter() {
054:
055: super (SalomeTMFContext.getInstance().ptrFrame, true);
056:
057: JLabel message = new JLabel(Language.getInstance().getText(
058: "Filtrer_par_:_"));
059:
060: //Create the radio buttons.
061: JRadioButton environment = new JRadioButton(Language
062: .getInstance().getText("Environnement"));
063: environment.addActionListener(new ActionListener() {
064: public void actionPerformed(ActionEvent e) {
065:
066: }
067: });
068:
069: JRadioButton data = new JRadioButton(Language.getInstance()
070: .getText("Jeu_de_données"));
071: data.addActionListener(new ActionListener() {
072: public void actionPerformed(ActionEvent e) {
073:
074: }
075: });
076:
077: JRadioButton date = new JRadioButton(Language.getInstance()
078: .getText("Date_de_création"));
079: date.addActionListener(new ActionListener() {
080: public void actionPerformed(ActionEvent e) {
081:
082: }
083: });
084:
085: //Group the radio buttons.
086: ButtonGroup buttonGroup = new ButtonGroup();
087: buttonGroup.add(environment);
088: buttonGroup.add(data);
089: buttonGroup.add(date);
090:
091: JPanel radioButtonPanel = new JPanel();
092: radioButtonPanel.setLayout(new BoxLayout(radioButtonPanel,
093: BoxLayout.Y_AXIS));
094: radioButtonPanel.add(environment);
095: radioButtonPanel.add(data);
096: radioButtonPanel.add(date);
097:
098: JPanel radioPanel = new JPanel(
099: new FlowLayout(FlowLayout.CENTER));
100: radioPanel.add(message);
101: radioPanel.add(radioButtonPanel);
102:
103: //les boutons
104: JButton validate = new JButton(Language.getInstance().getText(
105: "Valider"));
106: validate.setToolTipText(Language.getInstance().getText(
107: "Valider"));
108: validate.addActionListener(new ActionListener() {
109: public void actionPerformed(ActionEvent e) {
110: ExecutionFilter.this .dispose();
111: }
112: });
113:
114: JButton cancel = new JButton(Language.getInstance().getText(
115: "Annuler"));
116: cancel
117: .setToolTipText(Language.getInstance().getText(
118: "Annuler"));
119: cancel.addActionListener(new ActionListener() {
120: public void actionPerformed(ActionEvent e) {
121: ExecutionFilter.this .dispose();
122: }
123: });
124:
125: JPanel buttonPanel = new JPanel(
126: new FlowLayout(FlowLayout.RIGHT));
127: buttonPanel.add(validate);
128: buttonPanel.add(cancel);
129:
130: JPanel view = new JPanel(new BorderLayout());
131: view.add(radioPanel, BorderLayout.NORTH);
132: view.add(buttonPanel, BorderLayout.SOUTH);
133:
134: Container contentPaneFrame = this .getContentPane();
135: contentPaneFrame.add(view, BorderLayout.CENTER);
136: //this.setLocation(500,400);
137: this .setTitle(Language.getInstance().getText("Filtrage"));
138: /**this.pack();
139: this.setLocationRelativeTo(this.getParent());
140: this.setVisible(true);*/
141: centerScreen();
142: } // Fin du constructeur ExecutionFilter/0
143:
144: void centerScreen() {
145: Dimension dim = getToolkit().getScreenSize();
146: this .pack();
147: Rectangle abounds = getBounds();
148: setLocation((dim.width - abounds.width) / 2,
149: (dim.height - abounds.height) / 2);
150: this .setVisible(true);
151: requestFocus();
152: }
153:
154: } // Fin de la classe ExecutionFilter
|