svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.ui / src / main / java / org / gvsig / gui / beans / panelGroup / panels / IPanel.java @ 40561
History | View | Annotate | Download (7.46 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.panels; |
25 |
|
26 |
import org.gvsig.gui.beans.panelGroup.AbstractPanelGroup; |
27 |
import org.gvsig.gui.beans.panelGroup.IPanelGroup; |
28 |
|
29 |
/**
|
30 |
* <p>Common interface for all kinds of {@link AbstractPanel AbstractPanel}.</p>
|
31 |
* <p>An <i>IPanel</i> has:
|
32 |
* <ul>
|
33 |
* <li>Three identifiers:</li>
|
34 |
* <ul>
|
35 |
* <li><b>ID</b>: (optional) identifies neutrally the panel.</li>
|
36 |
* <li><b>Label</b>: identifier of the panel, used by a {@link AbstractPanelGroup AbstractPanelGroup}.</li>
|
37 |
* <li><b>LabelGroup</b>: identifier of the panel used to group together different <code>IPanel</code> panels
|
38 |
* of a {@link AbstractPanelGroup AbstractPanelGroup}.</li>
|
39 |
* </ul>
|
40 |
* <li>An optional reference to an object that is related ''semantically'' or ''conceptually'' to this panel (Ex. this panel is about some properties of a raster layer).</li>
|
41 |
* </ul>
|
42 |
* </p>
|
43 |
*
|
44 |
* @version 15/10/2007
|
45 |
* @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es)
|
46 |
*/
|
47 |
public interface IPanel { |
48 |
/**
|
49 |
* <p>Gets the panel identifier.</p>.
|
50 |
*
|
51 |
* @return panel identifier, or <code>null</code> if undefined
|
52 |
*
|
53 |
* @see #setID(String)
|
54 |
*/
|
55 |
public abstract String getID(); |
56 |
|
57 |
/**
|
58 |
* <p>Gets the identifier of the panel used by a {@link AbstractPanelGroup AbstractPanelGroup}.</p>
|
59 |
*
|
60 |
* @return panel label identifier, or <code>null</code> if undefined
|
61 |
*
|
62 |
* @see #setLabel(String)
|
63 |
*/
|
64 |
public abstract String getLabel(); |
65 |
|
66 |
/**
|
67 |
* <p>Gets the identifier of the panel used to group together different <code>IPanel</code> panels
|
68 |
* in a {@link AbstractPanelGroup AbstractPanelGroup}.</p>
|
69 |
*
|
70 |
* @return panel label group identifier, or <code>null</code> if undefined
|
71 |
*
|
72 |
* @see #setLabelGroup(String)
|
73 |
*/
|
74 |
public abstract String getLabelGroup(); |
75 |
|
76 |
/**
|
77 |
* <p>Sets the identifier of the panel used by a {@link AbstractPanelGroup AbstractPanelGroup}.</p>
|
78 |
*
|
79 |
* @param id panel label identifier, or <code>null</code> if undefined
|
80 |
*
|
81 |
* @see #getID()
|
82 |
*/
|
83 |
public abstract void setID(String id); |
84 |
|
85 |
/**
|
86 |
* <p>Sets the identifier of the panel used by a {@link AbstractPanelGroup AbstractPanelGroup}.</p>
|
87 |
*
|
88 |
* @param label panel label identifier, or <code>null</code> if undefined
|
89 |
*
|
90 |
* @see #getLabel()
|
91 |
*/
|
92 |
public abstract void setLabel(String label); |
93 |
|
94 |
/**
|
95 |
* <p>Sets the identifier of the panel used to group together different <code>IPanel</code> panels
|
96 |
* of a {@link AbstractPanelGroup AbstractPanelGroup}.</p>
|
97 |
*
|
98 |
* @param labelGroup label group identifier, or <code>null</code> if undefined
|
99 |
*
|
100 |
* @see #getLabelGroup()
|
101 |
*/
|
102 |
public abstract void setLabelGroup(String labelGroup); |
103 |
|
104 |
/**
|
105 |
* <p>Gets the object that has a ''semantically'' or ''conceptually'' relation to this panel, this is used to group
|
106 |
* <code>IPanel</code> panels on a {@link IPanelGroup IPanelGroup} object.</p>
|
107 |
*
|
108 |
* @return object that has reference this panel, or <code>null</code> if there has reference
|
109 |
* to no object
|
110 |
*
|
111 |
* @see #setReference(Object)
|
112 |
*/
|
113 |
public abstract Object getReference(); |
114 |
|
115 |
/**
|
116 |
* <p>Sets a reference to an object that is ''semantically' or 'contextually' related to this panel.</p>
|
117 |
*
|
118 |
* @param ref an object
|
119 |
*
|
120 |
* @see #getReference()
|
121 |
*/
|
122 |
public abstract void setReference(Object ref); |
123 |
|
124 |
/**
|
125 |
* <p>Gets a reference to the object that contains the group which this panel is a member.</p>
|
126 |
*
|
127 |
* @return an object that contains this panel's group
|
128 |
*
|
129 |
* @see #setPanelGroup(AbstractPanelGroup)
|
130 |
*/
|
131 |
public abstract AbstractPanelGroup getPanelGroup(); |
132 |
|
133 |
/**
|
134 |
* <p>Sets a reference to the object that contains the group which this panel is a member.</p>
|
135 |
*
|
136 |
* @param panelGroup object that contains this panel's group
|
137 |
*
|
138 |
* @see #getPanelGroup()
|
139 |
*/
|
140 |
public abstract void setPanelGroup(AbstractPanelGroup panelGroup); |
141 |
|
142 |
/**
|
143 |
* <p>If this panel belongs to a 'panel group', changes its visibility at the interface of the panel group.
|
144 |
* If changes to invisible, then this panel won't be accessible by the user interface. But if changes to visible
|
145 |
* and was invisible before, then will appear at the same position it was in the user interface. The position is
|
146 |
* according the order of the insertion at the group. Anyway, the group will have this panel.</p>
|
147 |
*
|
148 |
* @param b the new visibility for that panel.
|
149 |
*/
|
150 |
public abstract void setInGroupGUI(boolean b); |
151 |
|
152 |
/**
|
153 |
* <p>Returns <code>true</code> if this panel belongs to a 'panel group' and it's loaded in the graphical user interface
|
154 |
* of that component; otherwise returns <code>false</code>.</p>
|
155 |
*
|
156 |
* @return <code>true</code> if this panel belongs to a 'panel group' and it's loaded in the graphical user interface
|
157 |
* of that component
|
158 |
*/
|
159 |
public abstract boolean isInGroupGUI(); |
160 |
|
161 |
/**
|
162 |
* <p>Returns if this panel remains with its initial preferred size of it has been changed.</p>
|
163 |
*
|
164 |
* @return if this panel remains with its initial preferred size of it has been changed
|
165 |
*/
|
166 |
public abstract boolean remainsWithItsDefaultPreferredSize(); |
167 |
|
168 |
/**
|
169 |
* <p>Notifies to this panel of an <i>accept</i> action.</p>
|
170 |
*/
|
171 |
public abstract void accept(); |
172 |
|
173 |
/**
|
174 |
* <p>Notifies this panel of an <i>apply</i> action.</p>
|
175 |
*/
|
176 |
public abstract void apply(); |
177 |
|
178 |
/**
|
179 |
* <p>Notifies this panel of a <i>cancel</i> action.</p>
|
180 |
*/
|
181 |
public abstract void cancel(); |
182 |
|
183 |
/**
|
184 |
* <p>Notifies this panel that has been selected at the {@link AbstractPanelGroup AbstractPanelGroup}</p>
|
185 |
*/
|
186 |
public abstract void selected(); |
187 |
|
188 |
/**
|
189 |
* <p>Determines if this panel has changed since it was created, or applied (or accepted or cancelled). The
|
190 |
* programmer of each panel will be whom would set to <code>true</code> that a panel has changed.</p>
|
191 |
*
|
192 |
* @return <code>true</code> if this panel has changed since it was created, or applied (or accepted or cancelled); otherwise <code>false</code>
|
193 |
*/
|
194 |
public abstract boolean hasChanged(); |
195 |
|
196 |
/**
|
197 |
* <p>Resets this panel <i>changed status</i> to its initial value.</p>
|
198 |
*/
|
199 |
public abstract void resetChangedStatus(); |
200 |
|
201 |
/**
|
202 |
* <p>Sets if this panel will always be applied and accepted (by default), or only when has changed.</i></p>
|
203 |
*
|
204 |
* @param b if this panel will always be applied and accepted, or only when has changed
|
205 |
*
|
206 |
* @see #isAlwaysApplicable()
|
207 |
* @see #hasChanged()
|
208 |
*/
|
209 |
public abstract void setAlwaysApplicable(boolean b); |
210 |
|
211 |
/**
|
212 |
* <p>Gets if this panel will always be applied and accepted (by default), or only when has changed.</i></p>
|
213 |
*
|
214 |
* @return if this panel will always be applied and accepted, or only when has changed
|
215 |
*
|
216 |
* @see #setAlwaysApplicable(boolean)
|
217 |
* @see #hasChanged()
|
218 |
*/
|
219 |
public abstract boolean isAlwaysApplicable(); |
220 |
} |