Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libUIComponent / src / org / gvsig / gui / beans / panelGroup / IPanelGroup.java @ 28501

History | View | Annotate | Download (6.45 KB)

1 15734 vcaballero
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19
20
package org.gvsig.gui.beans.panelGroup;
21
22
import java.util.Hashtable;
23
24 17543 jmvivo
import org.gvsig.exceptions.BaseException;
25 17026 vcaballero
import org.gvsig.gui.beans.panelGroup.exceptions.EmptyPanelGroupException;
26
import org.gvsig.gui.beans.panelGroup.exceptions.EmptyPanelGroupGUIException;
27
import org.gvsig.gui.beans.panelGroup.exceptions.ListCouldntAddPanelException;
28 15734 vcaballero
import org.gvsig.gui.beans.panelGroup.loaders.IPanelGroupLoader;
29
import org.gvsig.gui.beans.panelGroup.panels.IPanel;
30
31
/**
32
 * <p>All kind of panels which support a group of {@link IPanel IPanel} must
33
 *  implement this interface.</p>
34
 *
35
 * @version 15/10/2007
36
 * @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es)
37
 */
38
public interface IPanelGroup {
39
        /**
40 17026 vcaballero
         * <p>Adds another {@link IPanel IPanel} to this group.</p>
41 15734 vcaballero
         *
42 17026 vcaballero
         * @param panel the <code>IPanel</code> to add
43 15734 vcaballero
         *
44 17026 vcaballero
         * @throws EmptyPanelGroupException if there was no panel loaded and tries to add a new one, launches this exception
45
         *  if the panel to add hasn't been registered to this component and then, no remains without panels
46
         * @throws EmptyPanelGroupGUIException if there was no panel loaded and tries to add a new one, launches this exception
47
         *  if the panel to add hasn't been set to this component graphical interface and then, no remains without panels
48
         *  in its graphical interface
49
         *
50 15734 vcaballero
         * @see #loadPanels(IPanelGroupLoader)
51 17026 vcaballero
         * @see #removePanel(IPanel)
52 15734 vcaballero
         */
53 17543 jmvivo
        public abstract void addPanel(IPanel panel) throws BaseException;
54 17026 vcaballero
55 15734 vcaballero
        /**
56 17026 vcaballero
         * <p>Removes an {@link IPanel IPanel} from this group.</p>
57 15734 vcaballero
         *
58 17026 vcaballero
         * @param panel the <code>IPanel</code> to remove
59 15734 vcaballero
         *
60 17026 vcaballero
         * @see #addPanel(IPanel)
61 15734 vcaballero
         * @see #loadPanels(IPanelGroupLoader)
62
         */
63 17543 jmvivo
        public abstract void removePanel(IPanel panel);
64 15734 vcaballero
65
        /**
66 17026 vcaballero
         * <p>Tries to load as most as possible panels using an <code>IPanelGroupLoader</code>.</p>
67 15734 vcaballero
         *
68
         * @param loader used to load the panels into this group
69
         *
70 17026 vcaballero
         * @throws ListCouldntAddPanelException list with all exceptions produced loading and adding the panels
71
         * @throws EmptyPanelGroupException launched if there was no exception during the loading and adding processes
72
         *  but there is no panel registered finally in this component
73
         * @throws EmptyPanelGroupGUIException launched if there was no exception during the loading and adding processes
74
         * there is at least one panel registered, but finally none of them is in the graphical interface of this component
75 15734 vcaballero
         *
76 17026 vcaballero
         * @see #addPanel(IPanel)
77 15734 vcaballero
         */
78 17543 jmvivo
        public abstract void loadPanels(IPanelGroupLoader loader) throws ListCouldntAddPanelException, EmptyPanelGroupException, EmptyPanelGroupGUIException;
79 15734 vcaballero
80
        /**
81
         * <p>Gets a reference to the active panel in this group.</p>
82
         *
83
         * @return a reference to the active panel, or <code>null</code> if there is no any active
84
         */
85
        public abstract IPanel getActivePanel();
86
87
        /**
88
         * <p>Gets the properties associated to this group of panels.</p>
89
         *
90
         * @return properties associated to this group of panels
91
         */
92 17543 jmvivo
        public abstract Hashtable getProperties();
93 15734 vcaballero
94
        /**
95
         * <p>Gets the object that has a  a ''semantically'' or ''conceptually'' relation to this panel.</p>
96
         *
97 17743 vcaballero
         * @return type of object that has reference this panel, or <code>null</code> if there has reference
98 15734 vcaballero
         *  to no object
99
         */
100 17543 jmvivo
        public abstract Object getReference();
101 17743 vcaballero
102
        /**
103
         * <p>Updates the reference of all elements of the group with the new one.</p>
104
         *
105
         * @param reference type of object that has reference this panel, or <code>null</code> if there has reference
106
         *  to no object
107
         */
108
        public abstract void updateReference(Object reference);
109 15734 vcaballero
110
        /**
111 16231 vcaballero
         * <p>Changes the visibility of an existent panel of this group. If a panel changes to invisible, then that
112
         *  panel won't be accessible by the user interface. But if changes to visible and was invisible
113
         *  before, then will appear at the same position it was in the user interface. The position is
114
         *  according the order of the insertion at the group. Anyway, the group will have that panel.</p>
115
         *
116
         * @param panel reference to the panel with visibility has changed.
117
         * @param b the new visibility for that panel.
118
         */
119 17543 jmvivo
        public abstract void setPanelInGUI(IPanel panel, boolean b);
120 17026 vcaballero
121 16231 vcaballero
        /**
122
         * <p>Returns <code>true</code> if the panel as parameter belongs to a this group and it's loaded in the graphical user interface;
123
         *  otherwise returns <code>false</code>.</p>
124
         *
125
         * @return <code>true</code> if the panel as parameter belongs to a this group and it's loaded in the graphical user interface;
126
         *  otherwise returns <code>false</code>
127
         */
128 17543 jmvivo
        public abstract boolean isPanelInGUI(IPanel panel);
129 17026 vcaballero
130 16231 vcaballero
        /**
131 16557 vcaballero
         * <p>Returns the number of panels registered in this group.</p>
132
         *
133
         * @return number of panels registered in this group
134
         */
135 17543 jmvivo
        public abstract int getPanelCount();
136 17026 vcaballero
137 16557 vcaballero
        /**
138
         * <p>Returns the number of panels registered in this group that are in GUI.</p>
139
         *
140
         * @return number of panels registered in this group that are in GUI
141
         */
142 17543 jmvivo
        public abstract int getPanelInGUICount();
143 17026 vcaballero
144 16557 vcaballero
        /**
145 17026 vcaballero
         * <p>Determines if the last notification received has been {@linkplain IPanel#accept()}.</code>
146 15734 vcaballero
         *
147
         * @return <code>true</code> if that has been the last notification received, <code>false</code> otherwise
148
         */
149 17543 jmvivo
        public abstract boolean isAccepted();
150 15734 vcaballero
151
        /**
152 17543 jmvivo
         * <p>Sets the parent of this component. That object must be another {@link IPanelGroup IPanelGroup} component.</p>
153
         *
154
         * @param parent parent of this component
155 15734 vcaballero
         */
156 17543 jmvivo
        public abstract void setParentPanelGroup(IPanelGroup parent);
157 15734 vcaballero
158
        /**
159 17543 jmvivo
         * <p>Notifies this panel of an <i>accept</i> action.</p>
160
         */
161
        public abstract void accept();
162
163
        /**
164 15734 vcaballero
         * <p>Notifies this panel of an <i>apply</i> action.</p>
165
         */
166 17543 jmvivo
        public abstract void apply();
167 15734 vcaballero
168
        /**
169
         * <p>Notifies this panel of a <i>cancel</i> action.</p>
170
         */
171 17543 jmvivo
        public abstract void cancel();
172 15734 vcaballero
}