svn-gvsig-desktop / tags / v1_0_2_Build_902 / applications / appgvSIG / src / com / iver / cit / gvsig / gui / simpleWizard / SimpleWizard.java @ 10681
History | View | Annotate | Download (1.8 KB)
1 | 5456 | jmvivo | package com.iver.cit.gvsig.gui.simpleWizard; |
---|---|---|---|
2 | |||
3 | import java.awt.BorderLayout; |
||
4 | |||
5 | import javax.swing.ImageIcon; |
||
6 | import javax.swing.JPanel; |
||
7 | |||
8 | import jwizardcomponent.CancelAction; |
||
9 | import jwizardcomponent.DefaultJWizardComponents; |
||
10 | import jwizardcomponent.FinishAction; |
||
11 | |||
12 | import com.iver.andami.PluginServices; |
||
13 | 6877 | cesar | import com.iver.andami.ui.mdiManager.IWindow; |
14 | 6880 | cesar | import com.iver.andami.ui.mdiManager.WindowInfo; |
15 | 5456 | jmvivo | |
16 | 6877 | cesar | public class SimpleWizard extends JPanel implements IWindow { |
17 | 6880 | cesar | WindowInfo viewInfo = null;
|
18 | 5456 | jmvivo | WizardPanelWithLogo wizardPanel; |
19 | |||
20 | // No deber?an necesitarse un FinishAction y un CancelAction, pero bueno,
|
||
21 | // lo mantengo por ahora.
|
||
22 | private class CloseAction extends FinishAction |
||
23 | { |
||
24 | 6877 | cesar | IWindow v; |
25 | public CloseAction(IWindow view)
|
||
26 | 5456 | jmvivo | { |
27 | super(wizardPanel.getWizardComponents());
|
||
28 | v = view; |
||
29 | } |
||
30 | public void performAction() { |
||
31 | 6880 | cesar | PluginServices.getMDIManager().closeWindow(v); |
32 | 5456 | jmvivo | } |
33 | |||
34 | } |
||
35 | private class CloseAction2 extends CancelAction |
||
36 | { |
||
37 | |||
38 | 6877 | cesar | IWindow v; |
39 | public CloseAction2(IWindow view)
|
||
40 | 5456 | jmvivo | { |
41 | super(wizardPanel.getWizardComponents());
|
||
42 | v = view; |
||
43 | } |
||
44 | public void performAction() { |
||
45 | 6880 | cesar | PluginServices.getMDIManager().closeWindow(v); |
46 | 5456 | jmvivo | } |
47 | |||
48 | } |
||
49 | |||
50 | |||
51 | public SimpleWizard(ImageIcon logo) |
||
52 | { |
||
53 | wizardPanel = new WizardPanelWithLogo(logo);
|
||
54 | CloseAction closeAction = new CloseAction(this); |
||
55 | CloseAction2 closeAction2 = new CloseAction2(this); |
||
56 | wizardPanel.getWizardComponents().setFinishAction(closeAction); |
||
57 | wizardPanel.getWizardComponents().setCancelAction(closeAction2); |
||
58 | |||
59 | this.setLayout(new BorderLayout()); |
||
60 | this.add(wizardPanel, BorderLayout.CENTER); |
||
61 | } |
||
62 | |||
63 | public DefaultJWizardComponents getWizardComponents()
|
||
64 | { |
||
65 | return wizardPanel.getWizardComponents();
|
||
66 | } |
||
67 | |||
68 | |||
69 | 6880 | cesar | public WindowInfo getWindowInfo() {
|
70 | 5456 | jmvivo | if (viewInfo == null) |
71 | { |
||
72 | 6880 | cesar | viewInfo = new WindowInfo(WindowInfo.MODALDIALOG|WindowInfo.RESIZABLE);
|
73 | 5456 | jmvivo | } |
74 | return viewInfo;
|
||
75 | } |
||
76 | |||
77 | } |