svn-gvsig-desktop / tags / v1_0_2_RELEASE / frameworks / _fwAndami / src / com / iver / andami / ui / wizard / WizardAndami.java @ 11432
History | View | Annotate | Download (1.78 KB)
1 | 9051 | jmvivo | package com.iver.andami.ui.wizard; |
---|---|---|---|
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 | import com.iver.andami.ui.mdiManager.IWindow; |
||
14 | import com.iver.andami.ui.mdiManager.WindowInfo; |
||
15 | |||
16 | public class WizardAndami extends JPanel implements IWindow { |
||
17 | WindowInfo viewInfo = null;
|
||
18 | 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 | IWindow v; |
||
25 | public CloseAction(IWindow view)
|
||
26 | { |
||
27 | super(wizardPanel.getWizardComponents());
|
||
28 | v = view; |
||
29 | } |
||
30 | public void performAction() { |
||
31 | PluginServices.getMDIManager().closeWindow(v); |
||
32 | } |
||
33 | |||
34 | } |
||
35 | private class CloseAction2 extends CancelAction |
||
36 | { |
||
37 | |||
38 | IWindow v; |
||
39 | public CloseAction2(IWindow view)
|
||
40 | { |
||
41 | super(wizardPanel.getWizardComponents());
|
||
42 | v = view; |
||
43 | } |
||
44 | public void performAction() { |
||
45 | PluginServices.getMDIManager().closeWindow(v); |
||
46 | } |
||
47 | |||
48 | } |
||
49 | |||
50 | |||
51 | public WizardAndami(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 | public WindowInfo getWindowInfo() {
|
||
70 | if (viewInfo == null) |
||
71 | { |
||
72 | viewInfo = new WindowInfo(WindowInfo.MODALDIALOG|WindowInfo.RESIZABLE);
|
||
73 | } |
||
74 | return viewInfo;
|
||
75 | } |
||
76 | |||
77 | } |