svn-document-layout / trunk / org.gvsig.app.document.layout2.app / org.gvsig.app.document.layout2.app.mainplugin / src / main / java / org / gvsig / app / project / documents / layout / fframes / gui / dialogs / AbstractFFrameDialog.java @ 724
History | View | Annotate | Download (3.45 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
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 2
|
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 |
*/
|
22 |
package org.gvsig.app.project.documents.layout.fframes.gui.dialogs; |
23 |
|
24 |
import java.awt.event.ActionEvent; |
25 |
import java.awt.event.ActionListener; |
26 |
|
27 |
import javax.swing.JPanel; |
28 |
|
29 |
import org.slf4j.Logger; |
30 |
import org.slf4j.LoggerFactory; |
31 |
|
32 |
import org.gvsig.app.project.documents.layout.fframes.IFFrame; |
33 |
import org.gvsig.app.project.documents.layout.gui.LayoutPanel; |
34 |
import org.gvsig.tools.observer.ObservableHelper; |
35 |
import org.gvsig.tools.observer.Observer; |
36 |
import org.gvsig.tools.swing.api.ActionListenerSupport; |
37 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
38 |
|
39 |
/**
|
40 |
* @author gvSIG Team
|
41 |
* @version $Id$
|
42 |
*
|
43 |
*/
|
44 |
public abstract class AbstractFFrameDialog extends JPanel implements |
45 |
IFFrameDialog { |
46 |
|
47 |
private static final long serialVersionUID = 262802843678561933L; |
48 |
|
49 |
protected static final Logger LOG = LoggerFactory |
50 |
.getLogger(AbstractFFrameDialog.class); |
51 |
|
52 |
protected LayoutPanel layoutPanel = null; |
53 |
protected IFFrame frame = null; |
54 |
private ObservableHelper observableHelper = new ObservableHelper(); |
55 |
|
56 |
private ActionListenerSupport actionListenerSupportHelper;
|
57 |
|
58 |
public AbstractFFrameDialog(LayoutPanel layoutPanel, IFFrame frame) {
|
59 |
super();
|
60 |
this.layoutPanel = layoutPanel;
|
61 |
this.frame = frame;
|
62 |
this.actionListenerSupportHelper = ToolsSwingLocator.getToolsSwingManager().createActionListenerSupport();
|
63 |
} |
64 |
|
65 |
public void addObserver(Observer observer) { |
66 |
observableHelper.addObserver(observer); |
67 |
} |
68 |
|
69 |
public void deleteObserver(Observer observer) { |
70 |
observableHelper.deleteObserver(observer); |
71 |
} |
72 |
|
73 |
public void deleteObservers() { |
74 |
observableHelper.deleteObservers(); |
75 |
} |
76 |
|
77 |
protected void notifyDialogClosed() { |
78 |
observableHelper.notifyObservers(this, new FFrameDialogNotification(FFrameDialogNotification.DIALOG_CLOSED)); |
79 |
} |
80 |
|
81 |
@Override
|
82 |
public void addActionListener(ActionListener listener) { |
83 |
actionListenerSupportHelper.addActionListener(listener); |
84 |
|
85 |
} |
86 |
|
87 |
@Override
|
88 |
public boolean hasActionListeners() { |
89 |
return actionListenerSupportHelper.hasActionListeners();
|
90 |
} |
91 |
|
92 |
|
93 |
@Override
|
94 |
public ActionListener[] getActionListeners() { |
95 |
return actionListenerSupportHelper.getActionListeners();
|
96 |
} |
97 |
|
98 |
@Override
|
99 |
public void removeActionListener(ActionListener listener) { |
100 |
actionListenerSupportHelper.removeActionListener(listener); |
101 |
|
102 |
} |
103 |
|
104 |
@Override
|
105 |
public void removeAllActionListener() { |
106 |
actionListenerSupportHelper.removeAllActionListener(); |
107 |
|
108 |
} |
109 |
|
110 |
@Override
|
111 |
public void fireActionEvent(ActionEvent event) { |
112 |
actionListenerSupportHelper.fireActionEvent(event); |
113 |
} |
114 |
} |