Statistics
| Revision:

root / trunk / extensions / extCAD / src / com / iver / cit / gvsig / NewTheme.java @ 4364

History | View | Annotate | Download (2.51 KB)

1
package com.iver.cit.gvsig;
2

    
3
import javax.swing.ImageIcon;
4
import javax.swing.JFrame;
5
import javax.swing.JLabel;
6
import javax.swing.SwingUtilities;
7

    
8
import jwizardcomponent.Utilities;
9
import jwizardcomponent.example.SimpleDynamicWizardPanel;
10
import jwizardcomponent.example.SimpleLabelWizardPanel;
11
import jwizardcomponent.frame.SimpleLogoJWizardFrame;
12

    
13
import com.iver.andami.PluginServices;
14
import com.iver.andami.plugins.Extension;
15
import com.iver.cit.gvsig.gui.View;
16

    
17
/**
18
 * DOCUMENT ME!
19
 * 
20
 * @author Vicente Caballero Navarro
21
 */
22
public class NewTheme implements Extension {
23
        static ImageIcon LOGO;
24

    
25
        /**
26
         * @see com.iver.andami.plugins.Extension#inicializar()
27
         */
28
        public void inicializar() {
29
        }
30

    
31
        /**
32
         * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
33
         */
34
        public void execute(String actionCommand) {
35
                com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager()
36
                                .getActiveView();
37

    
38
                if (f instanceof View) {
39
                        View vista = (View) f;
40

    
41
                        LOGO = new javax.swing.ImageIcon(this.getClass().
42
                                        getClassLoader().getResource("images/package_graphics.png"));
43
                        // new
44
                        // ImageIcon(DefaultJWizardComponents.class.getResource("images/logo.jpeg"));
45

    
46
                        SimpleLogoJWizardFrame wizardFrame = new SimpleLogoJWizardFrame(
47
                                        LOGO);
48
                        wizardFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
49

    
50
                        SwingUtilities.updateComponentTreeUI(wizardFrame);
51

    
52
                        wizardFrame.setTitle("Creaci?n de un nuevo Tema");
53

    
54
                        wizardFrame.getWizardComponents()
55
                                        .addWizardPanel(
56
                                                        new SimpleLabelWizardPanel(wizardFrame
57
                                                                        .getWizardComponents(), new JLabel(
58
                                                                        "Dynamic Test")));
59

    
60
                        wizardFrame.getWizardComponents().addWizardPanel(
61
                                        new SimpleDynamicWizardPanel(wizardFrame
62
                                                        .getWizardComponents()));
63

    
64
                        wizardFrame.getWizardComponents().addWizardPanel(
65
                                        new SimpleLabelWizardPanel(wizardFrame
66
                                                        .getWizardComponents(), new JLabel("Done!")));
67
                        wizardFrame.setSize(500, 300);
68
                        Utilities.centerComponentOnScreen(wizardFrame);
69
                        wizardFrame.show();
70
                }
71
        }
72

    
73
        /**
74
         * @see com.iver.andami.plugins.Extension#isEnabled()
75
         */
76
        public boolean isEnabled() {
77
                View f = (View) PluginServices.getMDIManager().getActiveView();
78

    
79
                if (f == null) {
80
                        return false;
81
                } else
82
                        return true;
83
        }
84

    
85
        /**
86
         * @see com.iver.andami.plugins.Extension#isVisible()
87
         */
88
        public boolean isVisible() {
89
                com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager()
90
                                .getActiveView();
91

    
92
                if (f == null) {
93
                        return false;
94
                }
95

    
96
                if (f.getClass() == View.class) {
97
                        return true;
98
                } else {
99
                        return false;
100
                }
101

    
102
        }
103
}