gvsig-raster / org.gvsig.raster / trunk / org.gvsig.raster / org.gvsig.raster.swing / org.gvsig.raster.swing.api / src / main / java / org / gvsig / raster / swing / basepanel / IButtonsPanel.java @ 2106
History | View | Annotate | Download (4.92 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2012 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 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 |
* 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.raster.swing.basepanel; |
25 |
|
26 |
import javax.swing.JButton; |
27 |
import javax.swing.JComponent; |
28 |
|
29 |
public interface IButtonsPanel { |
30 |
public static final int BUTTON_ACCEPT = 1; |
31 |
public static final int BUTTON_CANCEL = 2; |
32 |
public static final int BUTTON_APPLY = 3; |
33 |
public static final int BUTTON_YES = 4; |
34 |
public static final int BUTTON_NO = 5; |
35 |
public static final int BUTTON_CLOSE = 6; |
36 |
public static final int BUTTON_EXIT = 7; |
37 |
public static final int BUTTON_SEEDETAILS = 8; |
38 |
public static final int BUTTON_HIDEDETAILS = 9; |
39 |
public static final int BUTTON_PAUSE = 10; |
40 |
public static final int BUTTON_RESTART = 11; |
41 |
public static final int BUTTON_SAVE = 12; |
42 |
/**
|
43 |
* Sirve para cuando se crean botones nuevos, saber el ?ltimo n?mero usado
|
44 |
* internamente, as? '<code>new_id = BUTTON_LAST + 1;</code>' podr?a ser
|
45 |
* el ?ndice del nuevo bot?n.
|
46 |
*/
|
47 |
public static final int BUTTON_LAST = 12; |
48 |
public static final int BUTTONS_ACCEPT = 1; |
49 |
public static final int BUTTONS_ACCEPTCANCEL = 2; |
50 |
public static final int BUTTONS_ACCEPTCANCELAPPLY = 3; |
51 |
public static final int BUTTONS_CANCEL = 4; |
52 |
public static final int BUTTONS_YESNO = 5; |
53 |
public static final int BUTTONS_CLOSE = 6; |
54 |
public static final int BUTTONS_EXIT = 7; |
55 |
public static final int BUTTONS_NONE = 8; |
56 |
public static final int BUTTONS_APPLYCLOSE = 9; |
57 |
|
58 |
/**
|
59 |
* A?adir el disparador de cuando se pulsa un bot?n.
|
60 |
* @param listener
|
61 |
*/
|
62 |
public void addButtonPressedListener(ButtonsPanelListener listener); |
63 |
|
64 |
/**
|
65 |
* Devuelve el array de listeners del componente
|
66 |
* @return
|
67 |
*/
|
68 |
public Object[] getButtonPressedListeners(); |
69 |
|
70 |
/**
|
71 |
* Borrar el disparador de eventos de los botones.
|
72 |
* @param listener
|
73 |
*/
|
74 |
public void removeButtonPressedListener(ButtonsPanelListener listener); |
75 |
|
76 |
/**
|
77 |
* A?adir el boton Aceptar.
|
78 |
*/
|
79 |
public void addAccept(); |
80 |
|
81 |
/**
|
82 |
* A?adir el boton Guardar.
|
83 |
*/
|
84 |
public void addSave(); |
85 |
|
86 |
/**
|
87 |
* A?adir el boton Cancelar.
|
88 |
*/
|
89 |
public void addCancel(); |
90 |
|
91 |
/**
|
92 |
* A?adir el boton S?.
|
93 |
*/
|
94 |
public void addYes(); |
95 |
|
96 |
/**
|
97 |
* A?adir el boton No.
|
98 |
*/
|
99 |
public void addNo(); |
100 |
|
101 |
/**
|
102 |
* A?adir el boton Aplicar.
|
103 |
*/
|
104 |
public void addApply(); |
105 |
|
106 |
/**
|
107 |
* A?adir el boton Cerrar.
|
108 |
*/
|
109 |
public void addClose(); |
110 |
|
111 |
/**
|
112 |
* A?adir el boton Salir.
|
113 |
*/
|
114 |
public void addExit(); |
115 |
|
116 |
/**
|
117 |
* A?adir el boton Ver detalles.
|
118 |
*/
|
119 |
public void addSeeDetails(); |
120 |
|
121 |
/**
|
122 |
* A?adir el boton Ocultar detalles.
|
123 |
*/
|
124 |
public void addHideDetails(); |
125 |
|
126 |
/**
|
127 |
* A?adir el boton Pausar.
|
128 |
*/
|
129 |
public void addPause(); |
130 |
|
131 |
/**
|
132 |
* A?adir el boton Reanudar.
|
133 |
*/
|
134 |
public void addRestart(); |
135 |
|
136 |
/**
|
137 |
* A?adimos un bot?n definido por el usuario.
|
138 |
*
|
139 |
* @param text Texto que contendr? el bot?n
|
140 |
* @param id Entero para identificar los eventos del bot?n
|
141 |
*/
|
142 |
public void addButton(String text, int id); |
143 |
|
144 |
/**
|
145 |
* Obtener un bot?n por su Entero
|
146 |
* @param id N?mero del disparador del bot?n
|
147 |
* @return El bot?n especificado o <code>null</code> si no se encontr? el bot?n.
|
148 |
*/
|
149 |
public JButton getButton(int id); |
150 |
|
151 |
/**
|
152 |
* <p>Removes the button identified by <code>id</code>.</p>
|
153 |
*
|
154 |
* @param id identifier of the button
|
155 |
* @return <code>true</code> if has removed the button; otherwise <code>false</code>
|
156 |
*/
|
157 |
public boolean removeButton(int id); |
158 |
|
159 |
/**
|
160 |
* <p>Returns the text of the button identified by <code>id</code>.</p>
|
161 |
*
|
162 |
* @param id identifier of the button
|
163 |
*
|
164 |
* @return text of the identified button
|
165 |
*/
|
166 |
public String getButtonText(int id); |
167 |
|
168 |
/**
|
169 |
* <p>Enables (or disables) the button identified by <code>id</code>.</p>
|
170 |
*
|
171 |
* @param id identifier of the button
|
172 |
* @param b <code>true</code> to enable the button, otherwise <code>false</code>
|
173 |
*
|
174 |
* @return <code>true</code> if there was a button of that kind in this group, otherwise <code>false</code>
|
175 |
*/
|
176 |
public boolean setEnabled(int id, boolean b); |
177 |
|
178 |
public JComponent getComponent(); |
179 |
} |