Statistics
| Revision:

gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.swing / org.gvsig.tools.swing.impl / src / main / java / org / gvsig / tools / swing / impl / ToolsSwingDefaultImplLibrary.java @ 3017

History | View | Annotate | Download (16.6 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 modify it under
7
 * the terms of the GNU General Public License as published by the Free Software
8
 * Foundation; either version 2 of the License, or (at your option) any later
9
 * version.
10
 *
11
 * This program is distributed in the hope that it will be useful, but WITHOUT
12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14
 * details.
15
 *
16
 * You should have received a copy of the GNU General Public License along with
17
 * this program; if not, write to the Free Software Foundation, Inc., 51
18
 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us at info AT
21
 * gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.tools.swing.impl;
24

    
25
import org.gvsig.texteditor.DefaultTextEditorManager;
26
import org.gvsig.tools.library.AbstractLibrary;
27
import org.gvsig.tools.library.Library;
28
import org.gvsig.tools.library.LibraryException;
29
import org.gvsig.tools.swing.api.ToolsSwingLibrary;
30
import org.gvsig.tools.swing.api.ToolsSwingLocator;
31
import org.gvsig.tools.swing.api.ToolsSwingManager;
32
import org.gvsig.tools.swing.api.ToolsSwingUtils;
33
import org.gvsig.tools.swing.impl.bookmarkshistory.DefaultBookmarksController;
34
import org.gvsig.tools.swing.impl.bookmarkshistory.DefaultHistoryController;
35
import org.gvsig.tools.swing.impl.bookmarkshistory.TextFieldWithHistoryAndBookmarkControllerImpl;
36
import org.gvsig.tools.swing.impl.coerce.CoerceToColor;
37
import org.gvsig.tools.swing.impl.component.DefaultComponentSwingManager;
38
import org.gvsig.tools.swing.impl.dialogreminder.DefaultDialogReminderManager;
39
import org.gvsig.tools.swing.impl.hexeditor.HexEditorFactory;
40
import org.gvsig.tools.swing.impl.icontheme.DefaultIconThemeManager;
41
import org.gvsig.tools.swing.impl.pickercontroller.BytearrayPickerControllerImpl;
42
import org.gvsig.tools.swing.impl.pickercontroller.CharsetPickerControllerImpl;
43
import org.gvsig.tools.swing.impl.pickercontroller.ColorPickerControllerImpl;
44
import org.gvsig.tools.swing.impl.pickercontroller.DatePickerControllerImpl;
45
import org.gvsig.tools.swing.impl.pickercontroller.TimestampPickerControllerImpl;
46
import org.gvsig.tools.swing.impl.pickercontroller.FilePickerControllerImpl;
47
import org.gvsig.tools.swing.impl.pickercontroller.FolderPickerControllerImpl;
48
import org.gvsig.tools.swing.impl.pickercontroller.TimePickerControllerImpl;
49
import org.gvsig.tools.swing.impl.script.DefaultScriptSwingManager;
50
import org.gvsig.tools.swing.impl.task.DefaultTaskStatusSwingManager;
51
import org.gvsig.tools.swing.impl.threadsafedialogs.DefaultThreadSafeDialogsManager;
52
import org.gvsig.tools.swing.impl.usability.DefaultUsabilitySwingManager;
53
import org.gvsig.tools.swing.impl.webbrowsersimple.JWebBrowserSimpleFactory;
54
import org.gvsig.tools.swing.impl.windowmanager.DefaultWindowManager;
55
import org.gvsig.tools.swing.impl.zipviewer.ZipViewerFactory;
56

    
57
/**
58
 * {@link Library} for the default tools swing implementation.
59
 *
60
 * @author gvSIG team
61
 */
62
public class ToolsSwingDefaultImplLibrary extends AbstractLibrary {
63

    
64
    public static final String LIBRARY_NAME = "ToolsSwing";
65
    
66
    @Override
67
    public void doRegistration() {
68
        super.doRegistration();
69
        registerAsImplementationOf(ToolsSwingLibrary.class);
70
    }
71

    
72
    @Override
73
    protected void doInitialize() throws LibraryException {
74
        ToolsSwingLocator.registerToolsSwingManager(DefaultToolsSwingManager.class);
75
        ToolsSwingLocator.registerUsabilitySwingManager(DefaultUsabilitySwingManager.class);
76
        ToolsSwingLocator.registerTaskStatusSwingManager(DefaultTaskStatusSwingManager.class);
77
        ToolsSwingLocator.registerComponentSwingManager(DefaultComponentSwingManager.class);
78
        ToolsSwingLocator.registerDefaultWindowManager(DefaultWindowManager.class);
79
        ToolsSwingLocator.registerDefaultIconThemeManager(DefaultIconThemeManager.class);
80
        ToolsSwingLocator.registerDefaultThreadSafeDialogsManager(DefaultThreadSafeDialogsManager.class);
81
        ToolsSwingLocator.registerDefaultDialogReminderManager(DefaultDialogReminderManager.class);
82
        
83
        CoerceToColor.selfRegister();
84
        
85
        ColorPickerControllerImpl.selfRegister();
86
        DatePickerControllerImpl.selfRegister();
87
        TimePickerControllerImpl.selfRegister();
88
        TimestampPickerControllerImpl.selfRegister();
89
        FilePickerControllerImpl.selfRegister();
90
        FolderPickerControllerImpl.selfRegister();
91
        BytearrayPickerControllerImpl.selfRegister();
92
        DefaultBookmarksController.selfRegister();
93
        DefaultHistoryController.selfRegister();
94
        CharsetPickerControllerImpl.selfRegister();
95
        
96
        DefaultScriptSwingManager.selfRegister();
97
        
98
        JWebBrowserSimpleFactory.selfRegister();
99
        
100
        TextFieldWithHistoryAndBookmarkControllerImpl.registerPersistence();
101
        
102
        registerIcons();
103
        
104
        ToolsSwingLocator.registerDefaultTextEditorManager(DefaultTextEditorManager.class);
105
    }
106

    
107
    @Override
108
    protected void doPostInitialize() throws LibraryException {
109
        ToolsSwingManager manager = ToolsSwingLocator.getToolsSwingManager();
110
        
111
        manager.registerViewer(new HexEditorFactory());
112
        manager.registerViewer(new DefaultTextEditorManager());
113
        manager.registerViewer(new ZipViewerFactory());
114

    
115
    }
116

    
117
    private void registerIcons() {
118
        ToolsSwingUtils.registerIcons(
119
                ToolsSwingDefaultImplLibrary.class, 
120
                "/org/gvsig/tools/swing/impl/datatypes/images",
121
                LIBRARY_NAME,
122
                new String[] { "datatypes", "datatype-any" },
123
                new String[] { "datatypes", "datatype-binary" },
124
                new String[] { "datatypes", "datatype-boolean" },
125
                new String[] { "datatypes", "datatype-byte", null, "Byte o entero de 0 a 255, o -127 a 128." },
126
                new String[] { "datatypes", "datatype-bytearray", null, "Array de bytes." },
127
                new String[] { "datatypes", "datatype-date", null, "Dia (dia, mes, a?o, sin la hora)." },
128
                new String[] { "datatypes", "datatype-double", null, "Valor decimal grande de precisi?n variable." },
129
                new String[] { "datatypes", "datatype-decimal", null, "Valor decimal de precisi?n fija." },
130
                new String[] { "datatypes", "datatype-float", null, "Valor decimal peque?o de precision variable " },
131
                new String[] { "datatypes", "datatype-image" },
132
                new String[] { "datatypes", "datatype-integer", null, "Entero." },
133
                new String[] { "datatypes", "datatype-locale", null, "Configuraci?n regional, por ejemplo:\n- Espa?ol de Espa?a (es_ES)\n? Espa?ol de Argentina (es_AR)\n- Ingl?s, Reino Unido (en_GB)\n- Ingl?s, Estados Unidos (es_US)" },
134
                new String[] { "datatypes", "datatype-long", null, "Entero grande" },
135
                new String[] { "datatypes", "datatype-object" },
136
                new String[] { "datatypes", "datatype-string", null, "Cadena de texto" },
137
                new String[] { "datatypes", "datatype-text", null, "Cadena de texto grande" },
138
                new String[] { "datatypes", "datatype-time", null, "Hora (horas, minutos y segundos)" },
139
                new String[] { "datatypes", "datatype-timestamp", null, "D?a y hora" }
140
        );
141
        ToolsSwingUtils.registerIcons(
142
                ToolsSwingDefaultImplLibrary.class, 
143
                "/org/gvsig/tools/swing/impl/common",
144
                LIBRARY_NAME,
145
                new String[] { "common", "common-applychanges", "common-others", "Aparece en botones normalmente con la etiqueta ?Aplicar cambios?." },
146
                new String[] { "common", "common-filter", "common-others", "Se presenta junto algunas cajas de texto que permiten filtrar el contenido de una lista o tabla. El usuario introduce en la caja el filtro y pulsa enter o hace clic en este bot?n para que se ejecute el filtro." },
147
                new String[] { "common", "common-refresh", "common-others", "Bot?n gen?rico de actualizar o refrescar los contenidos de un componente." },
148
                new String[] { "common", "common-more", "common-others", "Usado en botones que normalmente llevan la etiqueta ?Mas??." },
149
                new String[] { "common", "common-showform", "common-others", "Imagen gen?rica usada en botones que muestran el formulario de datos. Hay varios iconos que duplican a este y que mientras no se cambien deber?a tener la misma imagen." },
150
                new String[] { "common", "common-add", "common-others", "" },
151
                new String[] { "common", "common-remove", "common-others", "" },
152
                new String[] { "common", "common-sortdown", "common-others", "Se presenta junto a listas o tablas, y suele tener dos usos:\n? Como bot?n de acci?n. Al pulsarlo se ordena la lista de forma descendente.\n? Como bot?n de selecci?n (se queda pulsado al hacer clic sobre el). Indica que hay que ordenar descendentemente por el elemento seleccionado en la lista."  },
153
                new String[] { "common", "common-sortup", "common-others", "Similar a common-sortdown pero ascendente"  },
154
                new String[] { "common", "common-start", "common-others" },
155
                new String[] { "common", "common-stop", "common-others" },
156
                new String[] { "common", "common-copy", "common-others" },
157

    
158
                new String[] { "common", "common-arrow-left", "common-arrows" },
159
                new String[] { "common", "common-arrow-right", "common-arrows" },
160
                new String[] { "common", "common-arrow-up", "common-arrows" },
161
                new String[] { "common", "common-arrow-down", "common-arrows" },
162

    
163
                new String[] { "common", "common-folder-open", "common-tree", "Usada para representar una carpeta expandida en el arbol" },
164
                new String[] { "common", "common-folder-closed", "common-tree", "Usada para representar una capeta en el arbol" },
165
                new String[] { "common", "common-leaf", "common-tree", "Usada para representar una rama final o hoja en el arbol" },
166
                new String[] { "common", "common-collapse-all", "common-tree", "Colapsa o cierra todas las ramas del arbol" },
167
                new String[] { "common", "common-expand-all", "common-tree", "Expande todas las ramas del arbol." },
168
                
169
                new String[] { "common", "common-form-cancelnew", "common-form", "" },
170
                new String[] { "common", "common-form-close", "common-form", "" },
171
                new String[] { "common", "common-form-copy", "common-form", "" },
172
                new String[] { "common", "common-form-delete", "common-form", "" },
173
                new String[] { "common", "common-form-first", "common-form", "" },
174
                new String[] { "common", "common-form-last", "common-form", "" },
175
                new String[] { "common", "common-form-needrefresh", "common-form", "" },
176
                new String[] { "common", "common-form-new", "common-form", "" },
177
                new String[] { "common", "common-form-next", "common-form", "" },
178
                new String[] { "common", "common-form-previous", "common-form", "" },
179
                new String[] { "common", "common-form-print", "common-form", "" },
180
                new String[] { "common", "common-form-problemindicator", "common-form", "" },
181
                new String[] { "common", "common-form-refresh", "common-form", "" },
182
                new String[] { "common", "common-form-save", "common-form", "" },
183
                new String[] { "common", "common-form-search", "common-form", "" },
184
                new String[] { "common", "common-form-compute", "common-form", "" },
185
               
186
                new String[] { "common", "common-go-first", "common-toolbargo", "" },
187
                new String[] { "common", "common-go-last", "common-toolbargo", "" },
188
                new String[] { "common", "common-go-next", "common-toolbargo", "" },
189
                new String[] { "common", "common-go-next-fast", "common-toolbargo", "" },
190
                new String[] { "common", "common-go-previous-fast", "common-toolbargo", "" },
191
                new String[] { "common", "common-go-previous", "common-toolbargo", "" },
192
                
193
                new String[] { "common", "common-check-on", "common-checks" },
194
                new String[] { "common", "common-check-onsmart", "common-checks" },
195
                new String[] { "common", "common-check-off", "common-checks" }
196
                
197
        );
198
        ToolsSwingUtils.registerIcons(
199
                ToolsSwingDefaultImplLibrary.class, 
200
                "/org/gvsig/tools/swing/picker",
201
                LIBRARY_NAME,
202
                new String[] { "picker", "picker-bytearray-download","picker-bytearray" },
203
                new String[] { "picker", "picker-bytearray-editastext","picker-bytearray" },
204
//                new String[] { "picker", "picker-bytearray-setnull","picker-bytearray" },
205
                new String[] { "picker", "picker-bytearray-upload","picker-bytearray" },
206
                new String[] { "picker", "picker-cleartext", "picker-cleartext", "Se utiliza para presentar un bot?n dentro de la capa de texto, a la derecha de esta y permite al usuario borrar el contenido de esta al pulsar sobre el." },
207
                new String[] { "picker", "picker-color", "picker-color" },
208
                new String[] { "picker", "picker-date", "picker-date" },
209
                new String[] { "picker", "picker-file", "picker-file" },
210
                new String[] { "picker", "picker-folder", "picker-folder" },
211
                new String[] { "picker", "picker-script-remove", "picker-script" },
212
                new String[] { "picker", "picker-script", "picker-script" },
213
                new String[] { "picker", "picker-datatype", "picker-datatype" }
214
        );        
215
        
216
        ToolsSwingUtils.registerGroupIconDescription("datatypes","Images used in lists and dropdowns where the available data types are presented next to the type name for the user to select a data type.");
217
        ToolsSwingUtils.registerGroupIconDescription("common","Images in the 'common' group are not used as images associated with menu actions or the toolbar. They are images that are used in buttons along the different panels of the application.");
218
        ToolsSwingUtils.registerGroupIconDescription("picker","These are images that are part of a component that allows the user to enter a special type of data. For example, when you need to enter a file name in the application, a text box usually appears with a button to the right of it. Clicking on the button displays the file selection dialog, and then the selected file is displayed in the text box. Just as there is the file selection component made up of a text box and a button, there are others to select a date, a color or a CRS. In gvSIG desktop we call these components 'pickers', each of them presenting specific images in the buttons they have associated. These images are the ones that appear in the 'picker' group. These types of components help to present a uniform appearance of the application in the parts of the application that have data input.");
219
        
220
        ToolsSwingUtils.registerSubgroupIconDescription("common","common-others","");
221
        ToolsSwingUtils.registerSubgroupIconDescription("common","common-arrows","");
222
        ToolsSwingUtils.registerSubgroupIconDescription("common","common-tree","Estas imagenes suelen usarse en los arboles o botones asociados a los arboles.");
223
        ToolsSwingUtils.registerSubgroupIconDescription("common","common-form","Estos botones son usados en la barra de herramientas especifica de los formularios de datos.");
224
        ToolsSwingUtils.registerSubgroupIconDescription("common","common-checks","Normalmente usados para indicar marcar todo, ninguno, o algunos seg?n algun criterio especifico del contexto.");
225

    
226
        ToolsSwingUtils.registerSubgroupIconDescription("picker","picker-bytearray","Asociado a un dato binario o array-de-bytes. Tiene asociados varios botones.");
227
        ToolsSwingUtils.registerSubgroupIconDescription("picker","picker-color","Usados en los compoenents de selecci?n de color");
228
        ToolsSwingUtils.registerSubgroupIconDescription("picker","picker-datatype","Es usado en el componente de selecci?n de tipo de datos.");
229
        ToolsSwingUtils.registerSubgroupIconDescription("picker","picker-date","Usados en los compoenents de selecci?n de color");
230

    
231
        ToolsSwingUtils.registerSubgroupIconScreenshot(
232
                ToolsSwingDefaultImplLibrary.class, 
233
                "picker",
234
                "picker-bytearray",
235
                "/org/gvsig/tools/swing/impl/screenshots/picker-bytearray.png"
236
        );
237

    
238
    }
239
}