svn-gvsig-desktop / tags / v1_1_Build_1001 / extensions / extCAD / src / com / iver / cit / gvsig / TestJWizard.java @ 11984
History | View | Annotate | Download (3.66 KB)
1 | 4416 | fjp | 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 | 4584 | caballero | *
|
20 | 4416 | fjp | * <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 | 4584 | caballero | * <br>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
28 | 4416 | fjp | * <br>See the GNU Lesser General Public License for more details.
|
29 | *
|
||
30 | 4584 | caballero | * <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 | 4416 | fjp | * <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 | 4584 | caballero | |
43 | 4416 | fjp | public static void main(String [] args) { |
44 | try {
|
||
45 | 4584 | caballero | |
46 | 4416 | fjp | 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 | 4584 | caballero | |
56 | 4416 | fjp | wizardFrame.setTitle("Nuevo tema");
|
57 | 4584 | caballero | |
58 | MyFinishAction myFinish = new MyFinishAction(wizardFrame.getWizardComponents(), null, "SHP"); |
||
59 | |||
60 | 4416 | fjp | wizardFrame.getWizardComponents().setFinishAction(myFinish); |
61 | |||
62 | 4584 | caballero | |
63 | 4416 | fjp | /* 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 | 4584 | caballero | |
68 | DriverManager writerManager = LayerFactory.getDM();
|
||
69 | 4416 | fjp | 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 | 4584 | caballero | |
79 | |||
80 | 4416 | fjp | wizardFrame.getWizardComponents().addWizardPanel(
|
81 | new ChooseWriteDriver(wizardFrame.getWizardComponents(),
|
||
82 | 4584 | caballero | "Dynamic Test", (String[]) spatialDrivers.toArray(new String[0])));
|
83 | 4416 | fjp | */
|
84 | ChooseGeometryType panelChoose = new ChooseGeometryType(wizardFrame.getWizardComponents());
|
||
85 | 4584 | caballero | JPanelFieldDefinition panelFields = new JPanelFieldDefinition(wizardFrame.getWizardComponents());
|
86 | 4416 | fjp | 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 | 4584 | caballero | |
97 | 4416 | fjp | // System.out.println("Salgo con " + panelChoose.getLayerName());
|
98 | 4584 | caballero | |
99 | 4416 | fjp | } catch (Exception e) { |
100 | e.printStackTrace(); |
||
101 | } |
||
102 | } |
||
103 | |||
104 | } |