root / tags / v1_1_Build_1000 / extensions / extCAD / src / com / iver / cit / gvsig / TestJWizard.java @ 11885
History | View | Annotate | Download (3.66 KB)
1 |
package com.iver.cit.gvsig; |
---|---|
2 |
|
3 |
import javax.swing.ImageIcon; |
4 |
import javax.swing.JFrame; |
5 |
import javax.swing.SwingUtilities; |
6 |
import javax.swing.UIManager; |
7 |
|
8 |
import jwizardcomponent.Utilities; |
9 |
import jwizardcomponent.frame.SimpleLogoJWizardFrame; |
10 |
|
11 |
import com.iver.cit.gvsig.gui.cad.MyFinishAction; |
12 |
import com.iver.cit.gvsig.gui.cad.panels.ChooseGeometryType; |
13 |
import com.iver.cit.gvsig.gui.cad.panels.JPanelFieldDefinition; |
14 |
|
15 |
/**
|
16 |
* <p>Title: JWizardComponent</p>
|
17 |
* <p>Description: Swing-Based Wizard Framework for Wizards</p>
|
18 |
* <p>Copyright (C) 2003 William Ready
|
19 |
*
|
20 |
* <br>This library is free software; you can redistribute it and/or
|
21 |
* <br>modify it under the terms of the GNU Lesser General Public
|
22 |
* <br>License as published by the Free Software Foundation; either
|
23 |
* <br>version 2.1 of the License, or (at your option) any later version.
|
24 |
*
|
25 |
* <br>This library is distributed in the hope that it will be useful,
|
26 |
* <br>but WITHOUT ANY WARRANTY; without even the implied warranty of
|
27 |
* <br>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
28 |
* <br>See the GNU Lesser General Public License for more details.
|
29 |
*
|
30 |
* <br>To receive a copy of the GNU Lesser General Public License
|
31 |
* <br>write to: The Free Software Foundation, Inc.,
|
32 |
* <br>59 Temple Place, Suite 330
|
33 |
* <br>Boston, MA 02111-1307 USA</p>
|
34 |
* @author William Ready
|
35 |
* @version 1.0
|
36 |
*/
|
37 |
|
38 |
public class TestJWizard { |
39 |
|
40 |
static ImageIcon LOGO; |
41 |
|
42 |
|
43 |
public static void main(String [] args) { |
44 |
try {
|
45 |
|
46 |
LOGO = new javax.swing.ImageIcon("images/package_graphics.png"); |
47 |
// new ImageIcon(DefaultJWizardComponents.class.getResource("images/logo.jpeg"));
|
48 |
|
49 |
SimpleLogoJWizardFrame wizardFrame = new SimpleLogoJWizardFrame(
|
50 |
LOGO); |
51 |
wizardFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
52 |
|
53 |
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); |
54 |
SwingUtilities.updateComponentTreeUI(wizardFrame);
|
55 |
|
56 |
wizardFrame.setTitle("Nuevo tema");
|
57 |
|
58 |
MyFinishAction myFinish = new MyFinishAction(wizardFrame.getWizardComponents(), null, "SHP"); |
59 |
|
60 |
wizardFrame.getWizardComponents().setFinishAction(myFinish); |
61 |
|
62 |
|
63 |
/* wizardFrame.getWizardComponents().addWizardPanel(
|
64 |
new SimpleLabelWizardPanel(wizardFrame.getWizardComponents(),
|
65 |
new JLabel("Dynamic Test"))); */
|
66 |
/* LayerFactory.setDriversPath("d:/Eclipse/workspace/_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/drivers");
|
67 |
|
68 |
DriverManager writerManager = LayerFactory.getDM();
|
69 |
ArrayList spatialDrivers = new ArrayList();
|
70 |
String[] writerNames = writerManager.getDriverNames();
|
71 |
for (int i=0; i<writerNames.length; i++)
|
72 |
{
|
73 |
Driver drv = writerManager.getDriver(writerNames[i]);
|
74 |
if (drv instanceof ISpatialWriter)
|
75 |
spatialDrivers.add(drv.getName());
|
76 |
}
|
77 |
|
78 |
|
79 |
|
80 |
wizardFrame.getWizardComponents().addWizardPanel(
|
81 |
new ChooseWriteDriver(wizardFrame.getWizardComponents(),
|
82 |
"Dynamic Test", (String[]) spatialDrivers.toArray(new String[0])));
|
83 |
*/
|
84 |
ChooseGeometryType panelChoose = new ChooseGeometryType(wizardFrame.getWizardComponents());
|
85 |
JPanelFieldDefinition panelFields = new JPanelFieldDefinition(wizardFrame.getWizardComponents());
|
86 |
wizardFrame.getWizardComponents().addWizardPanel(panelChoose); |
87 |
|
88 |
wizardFrame.getWizardComponents().addWizardPanel(panelFields); |
89 |
|
90 |
/* wizardFrame.getWizardComponents().addWizardPanel(
|
91 |
new SimpleLabelWizardPanel(wizardFrame.getWizardComponents(),
|
92 |
new JLabel("Done!"))); */
|
93 |
wizardFrame.setSize(540, 350); |
94 |
Utilities.centerComponentOnScreen(wizardFrame);
|
95 |
wizardFrame.show(); |
96 |
|
97 |
// System.out.println("Salgo con " + panelChoose.getLayerName());
|
98 |
|
99 |
} catch (Exception e) { |
100 |
e.printStackTrace(); |
101 |
} |
102 |
} |
103 |
|
104 |
} |