Source Code Cross Referenced for Ordering.java in  » Test-Coverage » salome-tmf » org » objectweb » salome_tmf » ihm » main » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Test Coverage » salome tmf » org.objectweb.salome_tmf.ihm.main 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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.Color;
028:        import java.awt.Container;
029:        import java.awt.Dimension;
030:        import java.awt.FlowLayout;
031:        import java.awt.GridLayout;
032:        import java.awt.Rectangle;
033:        import java.awt.event.ActionEvent;
034:        import java.awt.event.ActionListener;
035:
036:        import javax.swing.BorderFactory;
037:        import javax.swing.Box;
038:        import javax.swing.BoxLayout;
039:        import javax.swing.ButtonGroup;
040:        import javax.swing.DefaultComboBoxModel;
041:        import javax.swing.DefaultListModel;
042:        import javax.swing.Icon;
043:        import javax.swing.JButton;
044:        import javax.swing.JComboBox;
045:        import javax.swing.JDialog;
046:        import javax.swing.JList;
047:        import javax.swing.JPanel;
048:        import javax.swing.JRadioButton;
049:        import javax.swing.JScrollPane;
050:        import javax.swing.ListSelectionModel;
051:
052:        import org.objectweb.salome_tmf.ihm.IHMConstants;
053:        import org.objectweb.salome_tmf.ihm.admin.models.UserListRenderer;
054:        import org.objectweb.salome_tmf.ihm.languages.Language;
055:        import org.objectweb.salome_tmf.ihm.tools.Tools;
056:
057:        /**
058:         * Classe qui d?finit la fen?tre pour ordonner les suites de tests
059:         */
060:        public class Ordering extends JDialog implements  IHMConstants {
061:
062:            /**
063:             * Ancien mod?le de donn?es avant organisation
064:             */
065:            DefaultListModel oldModel;
066:
067:            /**
068:             * Mod?le de donn?es pour le choix
069:             */
070:            private DefaultComboBoxModel comboModel;
071:
072:            /**
073:             * Liste d?roulante pour le choix des suites ou des tests.
074:             */
075:            JComboBox choiceComboBox;
076:
077:            /******************************************************************************/
078:            /** 							CONSTRUCTEUR								***/
079:            /******************************************************************************/
080:
081:            /**
082:             * Constructeur de la fen?tre
083:             * @param listModel le mod?le de liste
084:             */
085:            public Ordering(DefaultListModel listModel) {
086:
087:                comboModel = new DefaultComboBoxModel();
088:                choiceComboBox = new JComboBox(comboModel);
089:
090:                JRadioButton familyButton = new JRadioButton(Language
091:                        .getInstance().getText("Familles"));
092:                familyButton.addActionListener(new ActionListener() {
093:                    public void actionPerformed(ActionEvent e) {
094:                        choiceComboBox.setEnabled(false);
095:
096:                    }
097:                });
098:
099:                JRadioButton testListButton = new JRadioButton(Language
100:                        .getInstance().getText("Suites"));
101:                testListButton.addActionListener(new ActionListener() {
102:                    public void actionPerformed(ActionEvent e) {
103:                        choiceComboBox.setEnabled(true);
104:                    }
105:                });
106:
107:                JRadioButton testButton = new JRadioButton(Language
108:                        .getInstance().getText("Tests"));
109:                testButton.addActionListener(new ActionListener() {
110:                    public void actionPerformed(ActionEvent e) {
111:                        choiceComboBox.setEnabled(true);
112:                    }
113:                });
114:
115:                //Grouper les boutons radio
116:                ButtonGroup choiceGroup = new ButtonGroup();
117:                choiceGroup.add(familyButton);
118:                choiceGroup.add(testListButton);
119:                choiceGroup.add(testButton);
120:
121:                //Put the radio buttons in a column in a panel.
122:                JPanel radioPanel = new JPanel(new GridLayout(1, 0));
123:                radioPanel.add(familyButton);
124:                radioPanel.add(testListButton);
125:                radioPanel.add(testButton);
126:
127:                // Combo Panel
128:                JPanel comboPanel = new JPanel(
129:                        new FlowLayout(FlowLayout.CENTER));
130:                comboPanel.add(choiceComboBox);
131:                choiceComboBox.setEnabled(false);
132:
133:                JPanel choicePanel = new JPanel();
134:                choicePanel.setLayout(new BoxLayout(choicePanel,
135:                        BoxLayout.Y_AXIS));
136:                choicePanel.add(radioPanel);
137:                choicePanel.add(comboPanel);
138:                choicePanel.setBorder(BorderFactory
139:                        .createLineBorder(Color.BLACK));
140:
141:                JButton upButton = new JButton();
142:                Icon icon = Tools.createAppletImageIcon(PATH_TO_ARROW_UP_ICON,
143:                        "");
144:                upButton.setIcon(icon);
145:                upButton.setToolTipText(Language.getInstance().getText(
146:                        "Monter_d'un_cran"));
147:                upButton.addActionListener(new ActionListener() {
148:                    public void actionPerformed(ActionEvent e) {
149:                    }
150:                });
151:
152:                JButton downButton = new JButton();
153:                icon = Tools.createAppletImageIcon(PATH_TO_ARROW_DOWN_ICON, "");
154:                downButton.setIcon(icon);
155:                downButton.setToolTipText(Language.getInstance().getText(
156:                        "Descendre_d'un_cran"));
157:                downButton.addActionListener(new ActionListener() {
158:                    public void actionPerformed(ActionEvent e) {
159:                    }
160:                });
161:
162:                JPanel buttonSet = new JPanel();
163:                buttonSet.setLayout(new BoxLayout(buttonSet, BoxLayout.Y_AXIS));
164:                buttonSet.add(upButton);
165:                buttonSet.add(Box.createRigidArea(new Dimension(1, 25)));
166:                buttonSet.add(downButton);
167:
168:                JList list = new JList(listModel);
169:                list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
170:                list.setSelectedIndex(0);
171:                list.setCellRenderer(new UserListRenderer());
172:                list.setVisibleRowCount(15);
173:                JScrollPane usersListScrollPane = new JScrollPane(list);
174:
175:                usersListScrollPane.setBorder(BorderFactory
176:                        .createTitledBorder(""));
177:
178:                JButton validate = new JButton(Language.getInstance().getText(
179:                        "Valider"));
180:                validate.setToolTipText(Language.getInstance().getText(
181:                        "Valider"));
182:                validate.addActionListener(new ActionListener() {
183:                    public void actionPerformed(ActionEvent e) {
184:                        Ordering.this .dispose();
185:                    }
186:                });
187:
188:                JButton cancel = new JButton(Language.getInstance().getText(
189:                        "Annuler"));
190:                cancel
191:                        .setToolTipText(Language.getInstance().getText(
192:                                "Annuler"));
193:                cancel.addActionListener(new ActionListener() {
194:                    public void actionPerformed(ActionEvent e) {
195:                        Ordering.this .dispose();
196:                    }
197:                });
198:
199:                JPanel secondButtonSet = new JPanel();
200:                secondButtonSet.add(validate);
201:                secondButtonSet.add(cancel);
202:
203:                JPanel center = new JPanel();
204:                center.add(usersListScrollPane);
205:                center.add(buttonSet);
206:
207:                JPanel page = new JPanel();
208:                page.setLayout(new BoxLayout(page, BoxLayout.Y_AXIS));
209:
210:                page.add(choicePanel);
211:                page.add(Box.createRigidArea(new Dimension(1, 10)));
212:                page.add(center);
213:                page.add(secondButtonSet);
214:
215:                Container contentPaneFrame = this .getContentPane();
216:                contentPaneFrame.add(page, BorderLayout.CENTER);
217:
218:                //this.setLocation(400,400);
219:                this .setTitle(Language.getInstance().getText("Ordonner"));
220:                /*this.pack();
221:                this.setLocationRelativeTo(this.getParent()); 
222:                this.setVisible(true);
223:                 */
224:                centerScreen();
225:            } // Fin du constructeur Ordering/1
226:
227:            void centerScreen() {
228:                Dimension dim = getToolkit().getScreenSize();
229:                this .pack();
230:                Rectangle abounds = getBounds();
231:                setLocation((dim.width - abounds.width) / 2,
232:                        (dim.height - abounds.height) / 2);
233:                this .setVisible(true);
234:                requestFocus();
235:            }
236:
237:        } // Fin de la classe Ordering
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.