Statistics
| Revision:

root / branches / v2_0_0_prep / extensions / extEditing / src / org / gvsig / editing / TestJWizard.java @ 38539

History | View | Annotate | Download (3.66 KB)

1 29616 jpiera
package org.gvsig.editing;
2 4416 fjp
3
import javax.swing.ImageIcon;
4
import javax.swing.JFrame;
5
import javax.swing.SwingUtilities;
6
import javax.swing.UIManager;
7
8 29685 jpiera
import jwizardcomponent.Utilities;
9
import jwizardcomponent.frame.SimpleLogoJWizardFrame;
10
11 29616 jpiera
import org.gvsig.editing.gui.cad.MyFinishAction;
12
import org.gvsig.editing.gui.cad.panels.ChooseGeometryType;
13
import org.gvsig.editing.gui.cad.panels.JPanelFieldDefinition;
14
15 4416 fjp
16
/**
17
 * <p>Title: JWizardComponent</p>
18
 * <p>Description: Swing-Based Wizard Framework for Wizards</p>
19
 * <p>Copyright (C) 2003 William Ready
20 4584 caballero
 *
21 4416 fjp
 * <br>This library is free software; you can redistribute it and/or
22
 * <br>modify it under the terms of the GNU Lesser General Public
23
 * <br>License as published by the Free Software Foundation; either
24
 * <br>version 2.1 of the License, or (at your option) any later version.
25
 *
26
 * <br>This library is distributed in the hope that it will be useful,
27
 * <br>but WITHOUT ANY WARRANTY; without even the implied warranty of
28 4584 caballero
 * <br>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
29 4416 fjp
 * <br>See the GNU Lesser General Public License for more details.
30
 *
31 4584 caballero
 * <br>To receive a copy of the GNU Lesser General Public License
32
 * <br>write to:  The Free Software Foundation, Inc.,
33
 * <br>59 Temple Place, Suite 330
34 4416 fjp
 * <br>Boston, MA 02111-1307 USA</p>
35
 * @author William Ready
36
 * @version 1.0
37
 */
38
39
public class TestJWizard {
40
41
  static ImageIcon LOGO;
42
43 4584 caballero
44 4416 fjp
  public static void main(String [] args) {
45
    try {
46 4584 caballero
47 4416 fjp
            LOGO = new javax.swing.ImageIcon("images/package_graphics.png");
48
                        // new ImageIcon(DefaultJWizardComponents.class.getResource("images/logo.jpeg"));
49
50
      SimpleLogoJWizardFrame wizardFrame = new SimpleLogoJWizardFrame(
51
          LOGO);
52
      wizardFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
53
54
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
55
      SwingUtilities.updateComponentTreeUI(wizardFrame);
56 4584 caballero
57 4416 fjp
      wizardFrame.setTitle("Nuevo tema");
58 4584 caballero
59
      MyFinishAction myFinish = new MyFinishAction(wizardFrame.getWizardComponents(), null, "SHP");
60
61 4416 fjp
          wizardFrame.getWizardComponents().setFinishAction(myFinish);
62
63 4584 caballero
64 4416 fjp
      /* wizardFrame.getWizardComponents().addWizardPanel(
65
          new SimpleLabelWizardPanel(wizardFrame.getWizardComponents(),
66
          new JLabel("Dynamic Test"))); */
67
      /* LayerFactory.setDriversPath("d:/Eclipse/workspace/_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/drivers");
68 4584 caballero

69
      DriverManager writerManager = LayerFactory.getDM();
70 4416 fjp
      ArrayList spatialDrivers = new ArrayList();
71
      String[] writerNames = writerManager.getDriverNames();
72
      for (int i=0; i<writerNames.length; i++)
73
      {
74
              Driver drv = writerManager.getDriver(writerNames[i]);
75
              if (drv instanceof ISpatialWriter)
76
                      spatialDrivers.add(drv.getName());
77
      }
78

79 4584 caballero

80

81 4416 fjp
      wizardFrame.getWizardComponents().addWizardPanel(
82
                      new ChooseWriteDriver(wizardFrame.getWizardComponents(),
83 4584 caballero
              "Dynamic Test", (String[]) spatialDrivers.toArray(new String[0])));
84 4416 fjp
      */
85
                ChooseGeometryType panelChoose = new ChooseGeometryType(wizardFrame.getWizardComponents());
86 4584 caballero
                JPanelFieldDefinition panelFields = new JPanelFieldDefinition(wizardFrame.getWizardComponents());
87 4416 fjp
                wizardFrame.getWizardComponents().addWizardPanel(panelChoose);
88
89
                wizardFrame.getWizardComponents().addWizardPanel(panelFields);
90
91
      /* wizardFrame.getWizardComponents().addWizardPanel(
92
          new SimpleLabelWizardPanel(wizardFrame.getWizardComponents(),
93
          new JLabel("Done!"))); */
94
      wizardFrame.setSize(540, 350);
95
      Utilities.centerComponentOnScreen(wizardFrame);
96
      wizardFrame.show();
97 4584 caballero
98 4416 fjp
            // System.out.println("Salgo con " + panelChoose.getLayerName());
99 4584 caballero
100 4416 fjp
    } catch (Exception e) {
101
      e.printStackTrace();
102
    }
103
  }
104
105
}