svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.ui / src / main / java / org / gvsig / gui / beans / panelGroup / AbstractPanelGroup.java @ 40561
History | View | Annotate | Download (19.6 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.gui.beans.panelGroup; |
25 |
|
26 |
import java.awt.BorderLayout; |
27 |
import java.util.ArrayList; |
28 |
import java.util.Collection; |
29 |
import java.util.Hashtable; |
30 |
import java.util.Iterator; |
31 |
|
32 |
import javax.swing.JPanel; |
33 |
import javax.swing.event.ChangeEvent; |
34 |
import javax.swing.event.ChangeListener; |
35 |
|
36 |
import org.gvsig.tools.exception.BaseException; |
37 |
import org.gvsig.gui.beans.Messages; |
38 |
import org.gvsig.gui.beans.buttonspanel.IButtonsPanel; |
39 |
import org.gvsig.gui.beans.panelGroup.exceptions.EmptyPanelGroupException; |
40 |
import org.gvsig.gui.beans.panelGroup.exceptions.EmptyPanelGroupGUIException; |
41 |
import org.gvsig.gui.beans.panelGroup.exceptions.ListCouldntAddPanelException; |
42 |
import org.gvsig.gui.beans.panelGroup.exceptions.PanelBaseException; |
43 |
import org.gvsig.gui.beans.panelGroup.exceptions.PanelWithNoPreferredSizeDefinedException; |
44 |
import org.gvsig.gui.beans.panelGroup.loaders.IPanelGroupLoader; |
45 |
import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel; |
46 |
import org.gvsig.gui.beans.panelGroup.panels.IPanel; |
47 |
import org.slf4j.Logger; |
48 |
import org.slf4j.LoggerFactory; |
49 |
|
50 |
/**
|
51 |
* <p>Represents a {@link JPanel JPanel} adapted to work with as a group of {@link IPanel IPanel}'s.</p>
|
52 |
*
|
53 |
* @see IPanelGroup
|
54 |
*
|
55 |
* @version 15/10/2007
|
56 |
* @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es)
|
57 |
*/
|
58 |
public abstract class AbstractPanelGroup extends JPanel implements ChangeListener, IPanelGroup, IButtonsPanel { |
59 |
final static private Logger logger = LoggerFactory.getLogger(AbstractPanelGroup.class); |
60 |
|
61 |
/**
|
62 |
* <p>If the last notification received has been {@linkplain AbstractPanelGroup#accept()}.</p>
|
63 |
*
|
64 |
* @see #accept()
|
65 |
*/
|
66 |
protected boolean accepted; |
67 |
|
68 |
/**
|
69 |
* <p>Properties associated to this group of panels.</p>
|
70 |
*
|
71 |
* @see #getProperties()
|
72 |
*/
|
73 |
private Hashtable properties; |
74 |
|
75 |
/**
|
76 |
* <p>Object that has a a ''semantically'' or ''conceptually'' relation to this panel.</p>
|
77 |
*
|
78 |
* @see #getReference()
|
79 |
*/
|
80 |
protected Object reference; |
81 |
|
82 |
/**
|
83 |
* <p>Array list with all {@link IPanel IPanel} of this group.</p>
|
84 |
*
|
85 |
* @see #loadPanels(IPanelGroupLoader)
|
86 |
* @see #addPanel(IPanel)
|
87 |
* @see #values()
|
88 |
*/
|
89 |
protected ArrayList<IPanel> registeredPanels = null; |
90 |
|
91 |
/**
|
92 |
* <p>Accept action identifier.</p>
|
93 |
*/
|
94 |
protected final byte ACCEPT_ACTION = 0; |
95 |
|
96 |
/**
|
97 |
* <p>Apply action identifier.</p>
|
98 |
*/
|
99 |
protected final byte APPLY_ACTION = 1; |
100 |
|
101 |
/**
|
102 |
* <p>Cancel action identifier.</p>
|
103 |
*/
|
104 |
protected final byte CANCEL_ACTION = 2; |
105 |
|
106 |
/**
|
107 |
* <p>Reference to another <code>IPanelGroup</code> component which contains this one.</p>
|
108 |
*/
|
109 |
protected IPanelGroup parentPanelGroup;
|
110 |
|
111 |
/**
|
112 |
* <p>Default constructor of a group of {@link IPanel IPanel}.</p>
|
113 |
*
|
114 |
* @param reference object that is ''semantically' or 'contextually' related to the group of panels
|
115 |
*/
|
116 |
public AbstractPanelGroup(Object reference) { |
117 |
this.reference = reference;
|
118 |
|
119 |
initialize(); |
120 |
} |
121 |
|
122 |
/**
|
123 |
* <p>Returns all panels of this group.</p>
|
124 |
*
|
125 |
* @return panels of this group
|
126 |
*
|
127 |
* @see #loadPanels(IPanelGroupLoader)
|
128 |
* @see #addPanel(IPanel)
|
129 |
*/
|
130 |
public final Collection<IPanel> values() { |
131 |
return registeredPanels;
|
132 |
} |
133 |
|
134 |
/**
|
135 |
* <p>This method is used by each concrete implementation of <code>AbstractPanelGroup</code> to
|
136 |
* execute its particular initialization tasks.</p>
|
137 |
*/
|
138 |
protected void initialize() { |
139 |
accepted = false;
|
140 |
parentPanelGroup = null;
|
141 |
properties = new Hashtable(); |
142 |
|
143 |
// Resizes automatically this and its components, and when a new panel is added, gets adjust to
|
144 |
// the new component could be displayed at least with its preferred size
|
145 |
setLayout(new BorderLayout()); |
146 |
registeredPanels = new ArrayList<IPanel>(); |
147 |
} |
148 |
|
149 |
/*
|
150 |
* (non-Javadoc)
|
151 |
* @see org.gvsig.gui.beans.panelGroup.IPanelGroup#loadPanels(org.gvsig.gui.beans.panelGroup.loaders.IPanelGroupLoader)
|
152 |
*/
|
153 |
public void loadPanels(IPanelGroupLoader loader) throws ListCouldntAddPanelException, EmptyPanelGroupException, EmptyPanelGroupGUIException { |
154 |
ArrayList<IPanel> panels = new ArrayList<IPanel>(); |
155 |
ListCouldntAddPanelException listBaseException = null;
|
156 |
|
157 |
// Don't reload the panels
|
158 |
if (registeredPanels.size() > 0) |
159 |
return;
|
160 |
|
161 |
try {
|
162 |
// Tries to load as most as possible panels
|
163 |
loader.loadPanels(panels); |
164 |
} catch (Exception e) { |
165 |
listBaseException = addCouldntAddPanelException(listBaseException, e); |
166 |
} |
167 |
|
168 |
if (panels.size() == 0) { |
169 |
if (listBaseException == null) |
170 |
throw new EmptyPanelGroupException(); |
171 |
else {
|
172 |
// If there were other exceptions, launch all them with the 'EmptyPanelGroupException' as the first of them.
|
173 |
listBaseException.add(new EmptyPanelGroupException());
|
174 |
throw listBaseException;
|
175 |
} |
176 |
} |
177 |
|
178 |
Iterator<IPanel> iterator = panels.iterator();
|
179 |
IPanel panel; |
180 |
PanelWithNoPreferredSizeDefinedException exception; |
181 |
|
182 |
while (iterator.hasNext()) {
|
183 |
panel = iterator.next(); |
184 |
|
185 |
try {
|
186 |
if (panel.remainsWithItsDefaultPreferredSize()) {
|
187 |
exception = new PanelWithNoPreferredSizeDefinedException(panel.getLabel());
|
188 |
|
189 |
throw exception;
|
190 |
} |
191 |
else {
|
192 |
loadPanel(panel); |
193 |
} |
194 |
} catch( PanelWithNoPreferredSizeDefinedException e ) {
|
195 |
logger.debug(Messages.getText("panel_adding_exception"), e);
|
196 |
listBaseException = addCouldntAddPanelException(listBaseException, e); |
197 |
} catch (Exception e) { |
198 |
logger.debug(Messages.getText("panel_adding_exception"), e);
|
199 |
|
200 |
if (panel == null) |
201 |
listBaseException = addCouldntAddPanelException(listBaseException, new PanelBaseException(e, "")); |
202 |
else
|
203 |
listBaseException = addCouldntAddPanelException(listBaseException, new PanelBaseException(e, panel.getLabel()));
|
204 |
} |
205 |
} |
206 |
|
207 |
if (getPanelCount() == 0) { |
208 |
if (listBaseException != null) { |
209 |
// If there were other exceptions, launch all them with the 'EmptyPanelGroupException' as the first of them.
|
210 |
listBaseException = addCouldntAddPanelException(listBaseException, new EmptyPanelGroupException());
|
211 |
throw listBaseException;
|
212 |
} |
213 |
else {
|
214 |
throw new EmptyPanelGroupException(); |
215 |
} |
216 |
} |
217 |
|
218 |
if (getPanelInGUICount() == 0) { |
219 |
if (listBaseException != null) { |
220 |
// If there were other exceptions, launch all them with the 'EmptyPanelGroupGUIException' as the first of them.
|
221 |
listBaseException = addCouldntAddPanelException(listBaseException, new EmptyPanelGroupGUIException());
|
222 |
throw listBaseException;
|
223 |
} |
224 |
else {
|
225 |
throw new EmptyPanelGroupGUIException(); |
226 |
} |
227 |
} |
228 |
|
229 |
if (listBaseException != null) |
230 |
throw listBaseException;
|
231 |
} |
232 |
|
233 |
private ListCouldntAddPanelException addCouldntAddPanelException(ListCouldntAddPanelException l, Exception e) { |
234 |
if( l == null ) { |
235 |
l = new ListCouldntAddPanelException();
|
236 |
} |
237 |
|
238 |
l.add(e); |
239 |
|
240 |
return l;
|
241 |
} |
242 |
|
243 |
/**
|
244 |
* <p>Loads a particular panel. It's supposed that this panel is valid.</p>
|
245 |
*
|
246 |
* @param panel the panel to add
|
247 |
*
|
248 |
* @see #addPanel(IPanel)
|
249 |
* @see #loadPanels(IPanelGroupLoader)
|
250 |
*/
|
251 |
protected void loadPanel(IPanel panel) { |
252 |
panel.setPanelGroup(this);
|
253 |
panel.setReference(reference); |
254 |
registeredPanels.add(panel); |
255 |
} |
256 |
|
257 |
/**
|
258 |
* <p>Validates if the panel as parameter belongs this panel group.</p>
|
259 |
* <p>One panel belongs this panel group if have the same references, or
|
260 |
* both references are <code>null</code>. </p>
|
261 |
*
|
262 |
* @param panel the panel to validate
|
263 |
* @return <code>true</code> if belong to this group; otherwise <code>false</code>
|
264 |
*/
|
265 |
protected boolean belongsThisGroup(IPanel panel) { |
266 |
if (panel == null) |
267 |
return false; |
268 |
|
269 |
if (getReference() == null) { |
270 |
if (panel.getReference() == null) |
271 |
return true; |
272 |
else
|
273 |
return false; |
274 |
} |
275 |
else {
|
276 |
if (panel.getReference() == null) |
277 |
return false; |
278 |
else {
|
279 |
if (getReference().equals(panel.getReference()))
|
280 |
return true; |
281 |
else
|
282 |
return false; |
283 |
} |
284 |
} |
285 |
} |
286 |
|
287 |
/*
|
288 |
* (non-Javadoc)
|
289 |
* @see org.gvsig.gui.beans.panelGroup.IPanelGroup#isAccepted()
|
290 |
*/
|
291 |
public boolean isAccepted() { |
292 |
return accepted;
|
293 |
} |
294 |
|
295 |
/*
|
296 |
* (non-Javadoc)
|
297 |
* @see org.gvsig.gui.beans.panelGroup.IPanelGroup#getProperties()
|
298 |
*/
|
299 |
public Hashtable getProperties() { |
300 |
return this.properties; |
301 |
} |
302 |
|
303 |
/*
|
304 |
* (non-Javadoc)
|
305 |
* @see org.gvsig.gui.beans.panelGroup.IPanelGroup#getReference()
|
306 |
*/
|
307 |
public Object getReference() { |
308 |
return reference;
|
309 |
} |
310 |
|
311 |
/*
|
312 |
* (non-Javadoc)
|
313 |
* @see org.gvsig.gui.beans.panelGroup.IPanelGroup#updateReference(java.lang.Object)
|
314 |
*/
|
315 |
public void updateReference(Object reference) { |
316 |
this.reference = reference;
|
317 |
|
318 |
for (Object panel : values().toArray()) { |
319 |
((AbstractPanel)panel).setReference(reference); |
320 |
} |
321 |
} |
322 |
|
323 |
/*
|
324 |
* (non-Javadoc)
|
325 |
* @see org.gvsig.gui.beans.panelGroup.IPanelGroup#accept()
|
326 |
*/
|
327 |
public void accept() { |
328 |
this.executeAction(ACCEPT_ACTION);
|
329 |
} |
330 |
|
331 |
/*
|
332 |
* (non-Javadoc)
|
333 |
* @see org.gvsig.gui.beans.panelGroup.IPanelGroup#apply()
|
334 |
*/
|
335 |
public void apply() { |
336 |
this.executeAction(APPLY_ACTION);
|
337 |
} |
338 |
|
339 |
/*
|
340 |
* (non-Javadoc)
|
341 |
* @see org.gvsig.gui.beans.panelGroup.IPanelGroup#cancel()
|
342 |
*/
|
343 |
public void cancel() { |
344 |
this.executeAction(CANCEL_ACTION);
|
345 |
} |
346 |
|
347 |
/*
|
348 |
* (non-Javadoc)
|
349 |
* @see javax.swing.event.ChangeListener#stateChanged(javax.swing.event.ChangeEvent)
|
350 |
*/
|
351 |
public abstract void stateChanged(ChangeEvent e); |
352 |
|
353 |
/*
|
354 |
* (non-Javadoc)
|
355 |
* @see org.gvsig.gui.beans.panelGroup.IPanelGroup#addPanel(org.gvsig.gui.beans.panelGroup.panels.IPanel)
|
356 |
*/
|
357 |
public void addPanel(IPanel panel) throws BaseException { |
358 |
BaseException baseException = null;
|
359 |
ListCouldntAddPanelException listBaseException = null;
|
360 |
|
361 |
if (panel.remainsWithItsDefaultPreferredSize()) {
|
362 |
baseException = new PanelWithNoPreferredSizeDefinedException(panel.getLabel());
|
363 |
} |
364 |
else {
|
365 |
try {
|
366 |
if ((panel.getLabel() != null) && (belongsThisGroup(panel))) { |
367 |
// Load the panel
|
368 |
loadPanel(panel); |
369 |
} |
370 |
} |
371 |
catch (Exception e) { |
372 |
logger.debug(Messages.getText("panel_adding_exception"), e);
|
373 |
|
374 |
if (panel == null) |
375 |
baseException = new PanelBaseException(e, ""); |
376 |
else
|
377 |
baseException = new PanelBaseException(e, panel.getLabel());
|
378 |
} |
379 |
} |
380 |
|
381 |
if (registeredPanels.size() == 0) { |
382 |
if (baseException == null) { |
383 |
throw new EmptyPanelGroupException(); |
384 |
} |
385 |
else {
|
386 |
listBaseException = new ListCouldntAddPanelException();
|
387 |
listBaseException.add(baseException); |
388 |
listBaseException.add(new EmptyPanelGroupException());
|
389 |
} |
390 |
} |
391 |
|
392 |
if (getPanelInGUICount() == 0) { |
393 |
if (listBaseException == null) { |
394 |
if (baseException == null) |
395 |
throw new EmptyPanelGroupGUIException(); |
396 |
else {
|
397 |
listBaseException = new ListCouldntAddPanelException();
|
398 |
listBaseException.add(baseException); |
399 |
listBaseException.add(new EmptyPanelGroupGUIException());
|
400 |
} |
401 |
} |
402 |
else {
|
403 |
listBaseException.add(new EmptyPanelGroupGUIException());
|
404 |
} |
405 |
} |
406 |
|
407 |
if (listBaseException != null) |
408 |
throw listBaseException;
|
409 |
else {
|
410 |
if (baseException != null) |
411 |
throw baseException;
|
412 |
} |
413 |
} |
414 |
|
415 |
/*
|
416 |
* (non-Javadoc)
|
417 |
* @see org.gvsig.gui.beans.panelGroup.IPanelGroup#removePanel(org.gvsig.gui.beans.panelGroup.panels.AbstractPanel)
|
418 |
*/
|
419 |
public void removePanel(IPanel panel) { |
420 |
if ((belongsThisGroup(panel)) && (panel.getLabel() != null)) { |
421 |
unLoadPanel(panel); |
422 |
} |
423 |
} |
424 |
|
425 |
/**
|
426 |
* <p>Unloads a particular panel. It's supposed that this panel is valid.</p>
|
427 |
*
|
428 |
* @param panel the panel to add
|
429 |
*
|
430 |
* @see #removePanel(IPanel)
|
431 |
* @see #loadPanel(IPanel)
|
432 |
* @see #loadPanels(IPanelGroupLoader)
|
433 |
*/
|
434 |
protected void unLoadPanel(IPanel panel) { |
435 |
registeredPanels.remove(panel); |
436 |
} |
437 |
|
438 |
/*
|
439 |
* (non-Javadoc)
|
440 |
* @see org.gvsig.gui.beans.panelGroup.IPanelGroup#getPanelCount()
|
441 |
*/
|
442 |
public int getPanelCount() { |
443 |
return registeredPanels.size();
|
444 |
} |
445 |
|
446 |
/**
|
447 |
* <p>Executes an <i>accept</i>, <i>apply</i>, or <i>cancel</i> action. This implies notify that action
|
448 |
* to all panels of the group.</p>
|
449 |
*
|
450 |
* @param action the action to execute
|
451 |
*
|
452 |
* @see IPanel#accept()
|
453 |
* @see IPanel#apply()
|
454 |
* @see IPanel#cancel()
|
455 |
*/
|
456 |
private void executeAction(byte action) { |
457 |
Iterator<IPanel> iterator = this.registeredPanels.iterator(); |
458 |
|
459 |
while (iterator.hasNext()) {
|
460 |
IPanel panel = iterator.next(); |
461 |
|
462 |
if ((panel.hasChanged()) || ((!panel.hasChanged()) && (panel.isAlwaysApplicable()))) {
|
463 |
switch (action) {
|
464 |
case ACCEPT_ACTION:
|
465 |
accepted = true;
|
466 |
panel.accept(); |
467 |
panel.resetChangedStatus(); |
468 |
break;
|
469 |
case APPLY_ACTION:
|
470 |
accepted = false;
|
471 |
panel.apply(); |
472 |
panel.resetChangedStatus(); |
473 |
break;
|
474 |
case CANCEL_ACTION:
|
475 |
accepted = false;
|
476 |
panel.cancel(); |
477 |
panel.resetChangedStatus(); |
478 |
break;
|
479 |
} |
480 |
} |
481 |
} |
482 |
} |
483 |
|
484 |
/*
|
485 |
* (non-Javadoc)
|
486 |
* @see org.gvsig.gui.beans.panelGroup.IPanelGroup#setParentPanelGroup(org.gvsig.gui.beans.panelGroup.IPanelGroup)
|
487 |
*/
|
488 |
public void setParentPanelGroup(IPanelGroup parent) { |
489 |
parentPanelGroup = parent; |
490 |
} |
491 |
|
492 |
///// BEGIN: Buttons Enable/Disable functionality /////
|
493 |
|
494 |
/*
|
495 |
* (non-Javadoc)
|
496 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#isEnabledAcceptButton()
|
497 |
*/
|
498 |
public boolean isEnabledAcceptButton() { |
499 |
if (parentPanelGroup != null) |
500 |
return ((IButtonsPanel)parentPanelGroup).isEnabledAcceptButton();
|
501 |
|
502 |
return false; |
503 |
} |
504 |
|
505 |
/*
|
506 |
* (non-Javadoc)
|
507 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#isEnabledApplyButton()
|
508 |
*/
|
509 |
public boolean isEnabledApplyButton() { |
510 |
if (parentPanelGroup != null) |
511 |
return ((IButtonsPanel)parentPanelGroup).isEnabledApplyButton();
|
512 |
|
513 |
return false; |
514 |
} |
515 |
|
516 |
/*
|
517 |
* (non-Javadoc)
|
518 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#isEnabledCancelButton()
|
519 |
*/
|
520 |
public boolean isEnabledCancelButton() { |
521 |
if (parentPanelGroup != null) |
522 |
return ((IButtonsPanel)parentPanelGroup).isEnabledCancelButton();
|
523 |
|
524 |
return false; |
525 |
} |
526 |
|
527 |
/*
|
528 |
* (non-Javadoc)
|
529 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#isEnabledCloseButton()
|
530 |
*/
|
531 |
public boolean isEnabledCloseButton() { |
532 |
if (parentPanelGroup != null) |
533 |
return ((IButtonsPanel)parentPanelGroup).isEnabledCloseButton();
|
534 |
|
535 |
return false; |
536 |
} |
537 |
|
538 |
/*
|
539 |
* (non-Javadoc)
|
540 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#isEnabledExitButton()
|
541 |
*/
|
542 |
public boolean isEnabledExitButton() { |
543 |
if (parentPanelGroup != null) |
544 |
return ((IButtonsPanel)parentPanelGroup).isEnabledExitButton();
|
545 |
|
546 |
return false; |
547 |
} |
548 |
|
549 |
/*
|
550 |
* (non-Javadoc)
|
551 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#isEnabledHideDetailsButton()
|
552 |
*/
|
553 |
public boolean isEnabledHideDetailsButton() { |
554 |
if (parentPanelGroup != null) |
555 |
return ((IButtonsPanel)parentPanelGroup).isEnabledHideDetailsButton();
|
556 |
|
557 |
return false; |
558 |
} |
559 |
|
560 |
/*
|
561 |
* (non-Javadoc)
|
562 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#isEnabledNoButton()
|
563 |
*/
|
564 |
public boolean isEnabledNoButton() { |
565 |
if (parentPanelGroup != null) |
566 |
return ((IButtonsPanel)parentPanelGroup).isEnabledNoButton();
|
567 |
|
568 |
return false; |
569 |
} |
570 |
|
571 |
/*
|
572 |
* (non-Javadoc)
|
573 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#isEnabledPauseButton()
|
574 |
*/
|
575 |
public boolean isEnabledPauseButton() { |
576 |
if (parentPanelGroup != null) |
577 |
return ((IButtonsPanel)parentPanelGroup).isEnabledPauseButton();
|
578 |
|
579 |
return false; |
580 |
} |
581 |
|
582 |
/*
|
583 |
* (non-Javadoc)
|
584 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#isEnabledRestartButton()
|
585 |
*/
|
586 |
public boolean isEnabledRestartButton() { |
587 |
if (parentPanelGroup != null) |
588 |
return ((IButtonsPanel)parentPanelGroup).isEnabledRestartButton();
|
589 |
|
590 |
return false; |
591 |
} |
592 |
|
593 |
/*
|
594 |
* (non-Javadoc)
|
595 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#isEnabledSaveButton()
|
596 |
*/
|
597 |
public boolean isEnabledSaveButton() { |
598 |
if (parentPanelGroup != null) |
599 |
return ((IButtonsPanel)parentPanelGroup).isEnabledSaveButton();
|
600 |
|
601 |
return false; |
602 |
} |
603 |
|
604 |
/*
|
605 |
* (non-Javadoc)
|
606 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#isEnabledSeeDetailsButton()
|
607 |
*/
|
608 |
public boolean isEnabledSeeDetailsButton() { |
609 |
if (parentPanelGroup != null) |
610 |
return ((IButtonsPanel)parentPanelGroup).isEnabledSeeDetailsButton();
|
611 |
|
612 |
return false; |
613 |
} |
614 |
|
615 |
/*
|
616 |
* (non-Javadoc)
|
617 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#isEnabledYesButton()
|
618 |
*/
|
619 |
public boolean isEnabledYesButton() { |
620 |
if (parentPanelGroup != null) |
621 |
return ((IButtonsPanel)parentPanelGroup).isEnabledYesButton();
|
622 |
|
623 |
return false; |
624 |
} |
625 |
|
626 |
/*
|
627 |
* (non-Javadoc)
|
628 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#setEnabledAcceptButton(boolean)
|
629 |
*/
|
630 |
public void setEnabledAcceptButton(boolean b) { |
631 |
if (parentPanelGroup != null) |
632 |
((IButtonsPanel)parentPanelGroup).setEnabledAcceptButton(b); |
633 |
} |
634 |
|
635 |
/*
|
636 |
* (non-Javadoc)
|
637 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#setEnabledApplyButton(boolean)
|
638 |
*/
|
639 |
public void setEnabledApplyButton(boolean b) { |
640 |
if (parentPanelGroup != null) |
641 |
((IButtonsPanel)parentPanelGroup).setEnabledApplyButton(b); |
642 |
} |
643 |
|
644 |
/*
|
645 |
* (non-Javadoc)
|
646 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#setEnabledCancelButton(boolean)
|
647 |
*/
|
648 |
public void setEnabledCancelButton(boolean b) { |
649 |
if (parentPanelGroup != null) |
650 |
((IButtonsPanel)parentPanelGroup).setEnabledCancelButton(b); |
651 |
} |
652 |
|
653 |
/*
|
654 |
* (non-Javadoc)
|
655 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#setEnabledCloseButton(boolean)
|
656 |
*/
|
657 |
public void setEnabledCloseButton(boolean b) { |
658 |
if (parentPanelGroup != null) |
659 |
((IButtonsPanel)parentPanelGroup).setEnabledCloseButton(b); |
660 |
} |
661 |
|
662 |
/*
|
663 |
* (non-Javadoc)
|
664 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#setEnabledExitButton(boolean)
|
665 |
*/
|
666 |
public void setEnabledExitButton(boolean b) { |
667 |
if (parentPanelGroup != null) |
668 |
((IButtonsPanel)parentPanelGroup).setEnabledExitButton(b); |
669 |
} |
670 |
|
671 |
/*
|
672 |
* (non-Javadoc)
|
673 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#setEnabledHideDetailsButton(boolean)
|
674 |
*/
|
675 |
public void setEnabledHideDetailsButton(boolean b) { |
676 |
if (parentPanelGroup != null) |
677 |
((IButtonsPanel)parentPanelGroup).setEnabledHideDetailsButton(b); |
678 |
} |
679 |
|
680 |
/*
|
681 |
* (non-Javadoc)
|
682 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#setEnabledNoButton(boolean)
|
683 |
*/
|
684 |
public void setEnabledNoButton(boolean b) { |
685 |
if (parentPanelGroup != null) |
686 |
((IButtonsPanel)parentPanelGroup).setEnabledNoButton(b); |
687 |
} |
688 |
|
689 |
/*
|
690 |
* (non-Javadoc)
|
691 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#setEnabledPauseButton(boolean)
|
692 |
*/
|
693 |
public void setEnabledPauseButton(boolean b) { |
694 |
if (parentPanelGroup != null) |
695 |
((IButtonsPanel)parentPanelGroup).setEnabledPauseButton(b); |
696 |
} |
697 |
|
698 |
/*
|
699 |
* (non-Javadoc)
|
700 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#setEnabledRestartButton(boolean)
|
701 |
*/
|
702 |
public void setEnabledRestartButton(boolean b) { |
703 |
if (parentPanelGroup != null) |
704 |
((IButtonsPanel)parentPanelGroup).setEnabledRestartButton(b); |
705 |
} |
706 |
|
707 |
/*
|
708 |
* (non-Javadoc)
|
709 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#setEnabledSaveButton(boolean)
|
710 |
*/
|
711 |
public void setEnabledSaveButton(boolean b) { |
712 |
if (parentPanelGroup != null) |
713 |
((IButtonsPanel)parentPanelGroup).setEnabledSaveButton(b); |
714 |
} |
715 |
|
716 |
/*
|
717 |
* (non-Javadoc)
|
718 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#setEnabledSeeDetailsButton(boolean)
|
719 |
*/
|
720 |
public void setEnabledSeeDetailsButton(boolean b) { |
721 |
if (parentPanelGroup != null) |
722 |
((IButtonsPanel)parentPanelGroup).setEnabledSeeDetailsButton(b); |
723 |
} |
724 |
|
725 |
/*
|
726 |
* (non-Javadoc)
|
727 |
* @see org.gvsig.gui.beans.buttonspanel.IButtonsPanel#setEnabledYesButton(boolean)
|
728 |
*/
|
729 |
public void setEnabledYesButton(boolean b) { |
730 |
if (parentPanelGroup != null) |
731 |
((IButtonsPanel)parentPanelGroup).setEnabledYesButton(b); |
732 |
} |
733 |
|
734 |
///// END: Buttons Enable/Disable functionality /////
|
735 |
} |