Statistics
| Revision:

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

History | View | Annotate | Download (3.66 KB)

1
package org.gvsig.editing;
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 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

    
16
/**
17
 * <p>Title: JWizardComponent</p>
18
 * <p>Description: Swing-Based Wizard Framework for Wizards</p>
19
 * <p>Copyright (C) 2003 William Ready
20
 *
21
 * <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
 * <br>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
29
 * <br>See the GNU Lesser General Public License for more details.
30
 *
31
 * <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
 * <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

    
44
  public static void main(String [] args) {
45
    try {
46

    
47
            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

    
57
      wizardFrame.setTitle("Nuevo tema");
58

    
59
      MyFinishAction myFinish = new MyFinishAction(wizardFrame.getWizardComponents(), null, "SHP");
60

    
61
          wizardFrame.getWizardComponents().setFinishAction(myFinish);
62

    
63

    
64
      /* 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

69
      DriverManager writerManager = LayerFactory.getDM();
70
      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

80

81
      wizardFrame.getWizardComponents().addWizardPanel(
82
                      new ChooseWriteDriver(wizardFrame.getWizardComponents(),
83
              "Dynamic Test", (String[]) spatialDrivers.toArray(new String[0])));
84
      */
85
                ChooseGeometryType panelChoose = new ChooseGeometryType(wizardFrame.getWizardComponents());
86
                JPanelFieldDefinition panelFields = new JPanelFieldDefinition(wizardFrame.getWizardComponents());
87
                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

    
98
            // System.out.println("Salgo con " + panelChoose.getLayerName());
99

    
100
    } catch (Exception e) {
101
      e.printStackTrace();
102
    }
103
  }
104

    
105
}