Revision 35971 branches/v2_0_0_prep/libraries/libUIComponent/src/org/gvsig/gui/beans/wizard/WizardPanelWithLogo.java
WizardPanelWithLogo.java | ||
---|---|---|
18 | 18 |
|
19 | 19 |
public class WizardPanelWithLogo extends JPanel { |
20 | 20 |
|
21 |
private static final long serialVersionUID = 7506729926181935234L; |
|
21 | 22 |
public final static int ACTION_PREVIOUS = 0; |
22 | 23 |
public final static int ACTION_NEXT = 1; |
23 | 24 |
public final static int ACTION_CANCEL = 2; |
... | ... | |
25 | 26 |
|
26 | 27 |
DefaultJWizardComponents wizardComponents; |
27 | 28 |
|
28 |
JPanel buttonPanel;
|
|
29 |
JLabel statusLabel = new JLabel();
|
|
29 |
JPanel buttonPanel;
|
|
30 |
JLabel statusLabel = new JLabel();
|
|
30 | 31 |
|
31 |
ImageIcon logo;
|
|
32 |
ImageIcon logo;
|
|
32 | 33 |
|
33 |
public WizardPanelWithLogo(ImageIcon logo) {
|
|
34 |
this.logo = logo;
|
|
35 |
wizardComponents = new DefaultJWizardComponents();
|
|
36 |
init();
|
|
37 |
}
|
|
34 |
public WizardPanelWithLogo(ImageIcon logo) {
|
|
35 |
this.logo = logo;
|
|
36 |
wizardComponents = new DefaultJWizardComponents();
|
|
37 |
init();
|
|
38 |
}
|
|
38 | 39 |
|
39 |
private void init() {
|
|
40 |
JPanel logoPanel = new JPanel();
|
|
40 |
private void init() {
|
|
41 |
JPanel logoPanel = new JPanel();
|
|
41 | 42 |
|
42 |
logoPanel.add(new JLabel(logo));
|
|
43 |
logoPanel.setBackground(Color.WHITE);
|
|
44 |
this.setLayout(new BorderLayout());
|
|
45 |
this.add(logoPanel, BorderLayout.WEST);
|
|
46 |
this.add(wizardComponents.getWizardPanelsContainer(),
|
|
47 |
BorderLayout.CENTER);
|
|
43 |
logoPanel.add(new JLabel(logo));
|
|
44 |
logoPanel.setBackground(Color.WHITE);
|
|
45 |
this.setLayout(new BorderLayout());
|
|
46 |
this.add(logoPanel, BorderLayout.WEST);
|
|
47 |
this.add(wizardComponents.getWizardPanelsContainer(),
|
|
48 |
BorderLayout.CENTER);
|
|
48 | 49 |
|
49 |
JPanel auxPanel = new JPanel(new BorderLayout());
|
|
50 |
auxPanel.add(new JSeparator(), BorderLayout.NORTH);
|
|
50 |
JPanel auxPanel = new JPanel(new BorderLayout());
|
|
51 |
auxPanel.add(new JSeparator(), BorderLayout.NORTH);
|
|
51 | 52 |
|
52 |
buttonPanel = new SimpleButtonPanel(wizardComponents);
|
|
53 |
auxPanel.add(buttonPanel);
|
|
54 |
this.add(auxPanel, BorderLayout.SOUTH);
|
|
53 |
buttonPanel = new SimpleButtonPanel(wizardComponents);
|
|
54 |
auxPanel.add(buttonPanel);
|
|
55 |
this.add(auxPanel, BorderLayout.SOUTH);
|
|
55 | 56 |
|
57 |
wizardComponents.setFinishAction(new FinishAction(wizardComponents) { |
|
56 | 58 |
|
57 |
wizardComponents.setFinishAction(new FinishAction(wizardComponents) { |
|
58 |
public void performAction() { |
|
59 |
// dispose(); |
|
60 |
} |
|
61 |
}); |
|
62 |
wizardComponents.setCancelAction(new CancelAction(wizardComponents) { |
|
63 |
public void performAction() { |
|
64 |
// dispose(); |
|
65 |
} |
|
66 |
}); |
|
67 |
} |
|
59 |
public void performAction() { |
|
60 |
// dispose(); |
|
61 |
} |
|
62 |
}); |
|
63 |
wizardComponents.setCancelAction(new CancelAction(wizardComponents) { |
|
68 | 64 |
|
65 |
public void performAction() { |
|
66 |
// dispose(); |
|
67 |
} |
|
68 |
}); |
|
69 |
} |
|
70 |
|
|
69 | 71 |
public void doAction(int action) { |
70 | 72 |
switch (action) { |
71 | 73 |
case ACTION_NEXT: |
... | ... | |
78 | 80 |
break; |
79 | 81 |
} |
80 | 82 |
} |
81 |
|
|
82 |
public DefaultJWizardComponents getWizardComponents(){ |
|
83 |
return wizardComponents; |
|
84 |
} |
|
85 | 83 |
|
86 |
public void setWizardComponents(DefaultJWizardComponents aWizardComponents){
|
|
87 |
wizardComponents = aWizardComponents;
|
|
88 |
}
|
|
84 |
public DefaultJWizardComponents getWizardComponents() {
|
|
85 |
return wizardComponents;
|
|
86 |
}
|
|
89 | 87 |
|
90 |
public void show() { |
|
91 |
wizardComponents.updateComponents(); |
|
92 |
super.setVisible(true); |
|
93 |
} |
|
88 |
public void setWizardComponents(DefaultJWizardComponents aWizardComponents) { |
|
89 |
wizardComponents = aWizardComponents; |
|
90 |
} |
|
94 | 91 |
|
95 |
public void addOptionPanel(OptionPanel optionPanel){
|
|
96 |
getWizardComponents().addWizardPanel(
|
|
97 |
new OptionPanelContainer(getWizardComponents(),
|
|
98 |
optionPanel));
|
|
99 |
}
|
|
92 |
@Override
|
|
93 |
public void show() {
|
|
94 |
wizardComponents.updateComponents();
|
|
95 |
super.setVisible(true);
|
|
96 |
}
|
|
100 | 97 |
|
101 |
public void setNextButtonEnabled(boolean isEnabled){ |
|
102 |
getWizardComponents().getNextButton().setEnabled(isEnabled); |
|
103 |
} |
|
104 |
|
|
105 |
public void setFinishButtonEnabled(boolean isVisible){ |
|
106 |
getWizardComponents().getFinishButton().setEnabled(isVisible); |
|
107 |
} |
|
108 |
|
|
109 |
public void setCancelButtonEnabled(boolean isVisible){ |
|
110 |
getWizardComponents().getCancelButton().setEnabled(isVisible); |
|
111 |
} |
|
112 |
|
|
113 |
private void setFinishAction(FinishAction finishAction){ |
|
114 |
getWizardComponents().setFinishAction(finishAction); |
|
115 |
} |
|
116 |
|
|
117 |
private void setCancelAction(CancelAction cancelAction){ |
|
118 |
getWizardComponents().setCancelAction(cancelAction); |
|
119 |
} |
|
98 |
public void addOptionPanel(OptionPanel optionPanel) { |
|
99 |
getWizardComponents().addWizardPanel( |
|
100 |
new OptionPanelContainer(getWizardComponents(), optionPanel)); |
|
101 |
} |
|
120 | 102 |
|
121 |
public void setWizardListener(WizardPanel wizardPanel) { |
|
122 |
setFinishAction(new WizardPanelFinishAction(getWizardComponents(), wizardPanel)); |
|
123 |
setCancelAction(new WizardPanelCancelAction(getWizardComponents(), wizardPanel)); |
|
124 |
} |
|
103 |
public void setNextButtonEnabled(boolean isEnabled) { |
|
104 |
getWizardComponents().getNextButton().setEnabled(isEnabled); |
|
105 |
} |
|
125 | 106 |
|
107 |
public void setFinishButtonEnabled(boolean isVisible) { |
|
108 |
getWizardComponents().getFinishButton().setEnabled(isVisible); |
|
109 |
} |
|
110 |
|
|
111 |
public void setCancelButtonEnabled(boolean isVisible) { |
|
112 |
getWizardComponents().getCancelButton().setEnabled(isVisible); |
|
113 |
} |
|
114 |
|
|
115 |
private void setFinishAction(FinishAction finishAction) { |
|
116 |
getWizardComponents().setFinishAction(finishAction); |
|
117 |
} |
|
118 |
|
|
119 |
private void setCancelAction(CancelAction cancelAction) { |
|
120 |
getWizardComponents().setCancelAction(cancelAction); |
|
121 |
} |
|
122 |
|
|
123 |
public void setWizardListener(WizardPanel wizardPanel) { |
|
124 |
setFinishAction(new WizardPanelFinishAction(getWizardComponents(), |
|
125 |
wizardPanel)); |
|
126 |
setCancelAction(new WizardPanelCancelAction(getWizardComponents(), |
|
127 |
wizardPanel)); |
|
128 |
} |
|
129 |
|
|
126 | 130 |
public void setBackButtonEnabled(boolean isEnabled) { |
127 |
getWizardComponents().getBackButton().setEnabled(isEnabled);
|
|
131 |
getWizardComponents().getBackButton().setEnabled(isEnabled); |
|
128 | 132 |
} |
129 | 133 |
} |
Also available in: Unified diff