Source Code Cross Referenced for GUISelectionGeometrie.java in  » GIS » GeOxygene-1.3 » fr » ign » cogit » geoxygene » util » loader » gui » 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 » GIS » GeOxygene 1.3 » fr.ign.cogit.geoxygene.util.loader.gui 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package fr.ign.cogit.geoxygene.util.loader.gui;
002:
003:        import java.awt.Color;
004:        import java.awt.Container;
005:        import java.awt.Dialog;
006:        import java.awt.Dimension;
007:        import java.awt.FlowLayout;
008:        import java.awt.Toolkit;
009:        import java.awt.event.ActionEvent;
010:        import java.awt.event.ActionListener;
011:        import java.awt.event.ItemEvent;
012:        import java.awt.event.ItemListener;
013:
014:        import javax.swing.BorderFactory;
015:        import javax.swing.Box;
016:        import javax.swing.BoxLayout;
017:        import javax.swing.ButtonGroup;
018:        import javax.swing.JButton;
019:        import javax.swing.JCheckBox;
020:        import javax.swing.JDialog;
021:        import javax.swing.JFrame;
022:        import javax.swing.JPanel;
023:        import javax.swing.JScrollPane;
024:
025:        /**
026:         * Choix des paramètres géométriques lors de la création de tables postgis
027:         * et du fichier de mapping à partir d'une classe java (le problème ne se
028:         * pose pas avec Oracle)
029:         *  
030:         * @author Eric Grosso - IGN / Laboratoire COGIT
031:         * @version 1.0
032:         */
033:
034:        public class GUISelectionGeometrie extends JDialog {
035:
036:            private static Dialog frame = new JDialog();
037:            private final GUISelectionGeometrie selectionGeometrie;
038:            private Color bluegray = new Color(197, 197, 232);
039:            private JPanel panneauType, panneauDimension, jPanelBoutton;
040:            private JScrollPane scrollChargement, scrollStockage;
041:            private Box boxType, boxDimension;
042:            private int selectionType = 0, selectionDimension = 0;
043:            private JButton jButtonOK;
044:            private Box boxe = Box.createVerticalBox();
045:            private static String[] stringsChoixType = new String[4];
046:            private static String[] stringsChoixDimension = new String[2];
047:            private String titreType = "";
048:            private String titreDimension = "";
049:
050:            private int typeGeometrie;
051:
052:            public int getTypeGeometrie() {
053:                return typeGeometrie;
054:            }
055:
056:            public void setTypeGeometrie(int typeGeometrie) {
057:                this .typeGeometrie = typeGeometrie;
058:            }
059:
060:            private int dimensionGeometrie;
061:
062:            public int getDimensionGeometrie() {
063:                return dimensionGeometrie;
064:            }
065:
066:            public void setDimensionGeometrie(int dimensionGeometrie) {
067:                this .dimensionGeometrie = dimensionGeometrie;
068:            }
069:
070:            /** Constructeur de l'interface **/
071:            public GUISelectionGeometrie() {
072:                super (frame, "Choix de la géométrie", true);
073:                selectionGeometrie = this ;
074:                setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
075:                setPreferredSize(new Dimension(430, 270));
076:                setSize(430, 270);
077:                setResizable(false);
078:                setBackground(Color.white);
079:                setAlwaysOnTop(true);
080:
081:                Dimension tailleEcran = Toolkit.getDefaultToolkit()
082:                        .getScreenSize();
083:                this .setLocation((tailleEcran.width - this .getWidth()) / 2,
084:                        (tailleEcran.height - this .getHeight()) / 2);
085:
086:                Container contentPane = this .getContentPane();
087:                contentPane.setLayout(new BoxLayout(contentPane,
088:                        BoxLayout.Y_AXIS));
089:
090:                //initialisation des différents composants et variables
091:                stringsChoixType[0] = "Point";
092:                stringsChoixType[1] = "LineString";
093:                stringsChoixType[2] = "Polygon";
094:                stringsChoixType[3] = "Geometry collection";
095:
096:                stringsChoixDimension[0] = "2D";
097:                stringsChoixDimension[1] = "3D";
098:
099:                titreType = "Quel est le type de votre géométrie ?";
100:                titreDimension = "Quel est la dimension de votre géométrie ?";
101:                initBoxTypeGeom();
102:                initBoxDimensionGeom();
103:                initJPanelType(true);
104:                initJPanelDimension(true);
105:                initJPanelBoutton();
106:
107:                boxe.setBackground(Color.white);
108:                boxe.add(panneauType);
109:                boxe.add(panneauDimension);
110:
111:                boxe.add(jPanelBoutton);
112:
113:                //Association des panneaux au conteneur
114:                this .setContentPane(boxe);
115:
116:                //Visualisation
117:                this .pack();
118:                this .setVisible(true);
119:            }
120:
121:            /**initialise le panel principal**/
122:            private void initJPanelType(boolean flag) {
123:                panneauType = new JPanel(new java.awt.BorderLayout());
124:                panneauType.setPreferredSize(new Dimension(820, 300));
125:                panneauType.setMaximumSize(new Dimension(820, 300));
126:                panneauType.setBackground(Color.white);
127:                panneauType.setBorder(BorderFactory.createTitledBorder(
128:                        BorderFactory.createEtchedBorder(bluegray, bluegray),
129:                        titreType));
130:                panneauType.add(boxType);
131:            }
132:
133:            /**initialise le panel principal**/
134:            private void initJPanelDimension(boolean flag) {
135:                panneauDimension = new JPanel(new java.awt.BorderLayout());
136:                panneauDimension.setPreferredSize(new Dimension(820, 300));
137:                panneauDimension.setMaximumSize(new Dimension(820, 300));
138:                panneauDimension.setBackground(Color.white);
139:                panneauDimension.setBorder(BorderFactory.createTitledBorder(
140:                        BorderFactory.createEtchedBorder(bluegray, bluegray),
141:                        titreDimension));
142:                panneauDimension.add(boxDimension);
143:            }
144:
145:            private void initBoxTypeGeom() {
146:                boxType = Box.createVerticalBox();
147:                ButtonGroup choix = new ButtonGroup();
148:                JCheckBox checkBox;
149:                final int t = stringsChoixType.length;
150:                for (int i = 0; i < t; i++) {
151:                    checkBox = new JCheckBox((String) stringsChoixType[i]);
152:                    checkBox.setBackground(Color.white);
153:                    if (i == 0) {
154:                        checkBox.setSelected(true);
155:                        setTypeGeometrie(0);
156:                    }
157:                    checkBox.addItemListener(new ItemListener() {
158:                        public void itemStateChanged(ItemEvent e) {
159:                            if (e.getStateChange() == 1) {
160:                                Object source = e.getItemSelectable();
161:                                for (int i = 0; i < t; i++) {
162:                                    if (((JCheckBox) source).getText().equals(
163:                                            stringsChoixType[i])) {
164:                                        setTypeGeometrie(i);
165:                                    }
166:                                }
167:                            }
168:                        }
169:                    });
170:                    choix.add(checkBox);
171:                    boxType.add(checkBox);
172:                }
173:            }
174:
175:            private void initBoxDimensionGeom() {
176:                boxDimension = Box.createVerticalBox();
177:                ButtonGroup choix = new ButtonGroup();
178:                JCheckBox checkBox;
179:                final int t = stringsChoixDimension.length;
180:                for (int i = 0; i < t; i++) {
181:                    checkBox = new JCheckBox((String) stringsChoixDimension[i]);
182:                    checkBox.setBackground(Color.white);
183:                    if (i == 0) {
184:                        checkBox.setSelected(true);
185:                        setDimensionGeometrie(2);
186:                    }
187:                    checkBox.addItemListener(new ItemListener() {
188:                        public void itemStateChanged(ItemEvent e) {
189:                            if (e.getStateChange() == 1) {
190:                                Object source = e.getItemSelectable();
191:                                for (int i = 0; i < t; i++) {
192:                                    if (((JCheckBox) source).getText().equals(
193:                                            stringsChoixDimension[i])) {
194:                                        setDimensionGeometrie(i + 2);
195:                                    }
196:                                }
197:                            }
198:                        }
199:                    });
200:                    choix.add(checkBox);
201:                    boxDimension.add(checkBox);
202:                }
203:            }
204:
205:            /** initialisation de jPanelBoutton*/
206:            private void initJPanelBoutton() {
207:                initJButtonOK();
208:
209:                jPanelBoutton = new JPanel();
210:                jPanelBoutton.setLayout(new FlowLayout());
211:                jPanelBoutton.add(jButtonOK);
212:                jPanelBoutton.setBackground(Color.white);
213:            }
214:
215:            /** This method initializes jButtonChargement */
216:            private void initJButtonOK() {
217:                jButtonOK = new JButton();
218:                jButtonOK.setPreferredSize(new java.awt.Dimension(80, 30));
219:                jButtonOK.setSize(new java.awt.Dimension(80, 30));
220:                jButtonOK.setText("Ok");
221:                jButtonOK.setVisible(true);
222:
223:                jButtonOK.addActionListener(new ActionListener() {
224:                    public void actionPerformed(ActionEvent e) {
225:                        selectionGeometrie.dispose();
226:                    }
227:                });
228:            }
229:        }
w__w__w_.__ja_va_2__s___.co_m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.