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