Revision 43126 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/java/org/gvsig/gui/beans/wizard/WizardPanelWithLogo.java
WizardPanelWithLogo.java | ||
---|---|---|
38 | 38 |
|
39 | 39 |
import org.gvsig.gui.beans.wizard.panel.OptionPanel; |
40 | 40 |
import org.gvsig.gui.beans.wizard.panel.OptionPanelContainer; |
41 |
import org.slf4j.Logger; |
|
42 |
import org.slf4j.LoggerFactory; |
|
41 | 43 |
|
42 | 44 |
public class WizardPanelWithLogo extends JPanel { |
43 | 45 |
|
46 |
private static final Logger LOG = LoggerFactory.getLogger(WizardPanelWithLogo.class); |
|
47 |
|
|
44 | 48 |
private static final long serialVersionUID = 7506729926181935234L; |
45 | 49 |
public final static int ACTION_PREVIOUS = 0; |
46 | 50 |
public final static int ACTION_NEXT = 1; |
... | ... | |
53 | 57 |
JLabel statusLabel = new JLabel(); |
54 | 58 |
|
55 | 59 |
ImageIcon logo; |
60 |
private int direction = WizardPanelWithLogo.ACTION_NEXT; |
|
56 | 61 |
|
57 | 62 |
public WizardPanelWithLogo(ImageIcon logo) { |
58 | 63 |
this.logo = logo; |
... | ... | |
88 | 93 |
|
89 | 94 |
wizardComponents.setFinishAction(new FinishAction(wizardComponents) { |
90 | 95 |
|
96 |
@Override |
|
91 | 97 |
public void performAction() { |
92 | 98 |
// dispose(); |
93 | 99 |
} |
94 | 100 |
}); |
95 | 101 |
wizardComponents.setCancelAction(new CancelAction(wizardComponents) { |
96 | 102 |
|
103 |
@Override |
|
97 | 104 |
public void performAction() { |
98 | 105 |
// dispose(); |
99 | 106 |
} |
... | ... | |
126 | 133 |
wizardComponents.updateComponents(); |
127 | 134 |
super.setVisible(true); |
128 | 135 |
} |
136 |
|
|
137 |
public void updatePanel() { |
|
138 |
try { |
|
139 |
OptionPanelContainer page = (OptionPanelContainer) getWizardComponents().getCurrentPanel(); |
|
140 |
page.update(); |
|
141 |
} catch (Exception ex) { |
|
129 | 142 |
|
143 |
} |
|
144 |
} |
|
145 |
|
|
130 | 146 |
public void addOptionPanel(OptionPanel optionPanel) { |
131 | 147 |
getWizardComponents().addWizardPanel( |
132 |
new OptionPanelContainer(getWizardComponents(), optionPanel)); |
|
148 |
new OptionPanelContainer(this, optionPanel) |
|
149 |
); |
|
133 | 150 |
} |
134 | 151 |
|
135 | 152 |
public void setNextButtonEnabled(boolean isEnabled) { |
... | ... | |
162 | 179 |
public void setBackButtonEnabled(boolean isEnabled) { |
163 | 180 |
getWizardComponents().getBackButton().setEnabled(isEnabled); |
164 | 181 |
} |
182 |
|
|
183 |
public int getDirection() { |
|
184 |
return this.direction; |
|
185 |
} |
|
186 |
|
|
187 |
public void setDirection(int direction) { |
|
188 |
this.direction = direction; |
|
189 |
} |
|
190 |
|
|
191 |
public void skip() { |
|
192 |
int index = -1; |
|
193 |
try { |
|
194 |
this.doAction(this.getDirection()); |
|
195 |
} catch (Exception ex) { |
|
196 |
LOG.warn("Can't skip current panel ("+index+").",ex); |
|
197 |
} |
|
198 |
} |
|
165 | 199 |
} |
Also available in: Unified diff