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 @ 2088
History | View | Annotate | Download (5.75 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 java.net.URL; |
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.icontheme.IconTheme; |
32 |
import org.gvsig.tools.swing.impl.bookmarkshistory.DefaultBookmarksController; |
33 |
import org.gvsig.tools.swing.impl.bookmarkshistory.DefaultHistoryController; |
34 |
import org.gvsig.tools.swing.impl.coerce.CoerceToColor; |
35 |
import org.gvsig.tools.swing.impl.component.DefaultComponentSwingManager; |
36 |
import org.gvsig.tools.swing.impl.dialogreminder.DefaultDialogReminderManager; |
37 |
import org.gvsig.tools.swing.impl.icontheme.DefaultIconThemeManager; |
38 |
import org.gvsig.tools.swing.impl.pickercontroller.BytearrayPickerControllerImpl; |
39 |
import org.gvsig.tools.swing.impl.pickercontroller.ColorPickerControllerImpl; |
40 |
import org.gvsig.tools.swing.impl.pickercontroller.DatePickerControllerImpl; |
41 |
import org.gvsig.tools.swing.impl.pickercontroller.FilePickerControllerImpl; |
42 |
import org.gvsig.tools.swing.impl.pickercontroller.FolderPickerControllerImpl; |
43 |
import org.gvsig.tools.swing.impl.script.DefaultScriptSwingManager; |
44 |
import org.gvsig.tools.swing.impl.task.DefaultTaskStatusSwingManager; |
45 |
import org.gvsig.tools.swing.impl.threadsafedialogs.DefaultThreadSafeDialogsManager; |
46 |
import org.gvsig.tools.swing.impl.usability.DefaultUsabilitySwingManager; |
47 |
import org.gvsig.tools.swing.impl.webbrowsersimple.JWebBrowserSimpleFactory; |
48 |
import org.gvsig.tools.swing.impl.windowmanager.DefaultWindowManager; |
49 |
|
50 |
/**
|
51 |
* {@link Library} for the default tools swing implementation.
|
52 |
*
|
53 |
* @author gvSIG team
|
54 |
*/
|
55 |
public class ToolsSwingDefaultImplLibrary extends AbstractLibrary { |
56 |
|
57 |
@Override
|
58 |
public void doRegistration() { |
59 |
super.doRegistration();
|
60 |
registerAsImplementationOf(ToolsSwingLibrary.class); |
61 |
} |
62 |
|
63 |
@Override
|
64 |
protected void doInitialize() throws LibraryException { |
65 |
ToolsSwingLocator.registerToolsSwingManager(DefaultToolsSwingManager.class); |
66 |
ToolsSwingLocator.registerUsabilitySwingManager(DefaultUsabilitySwingManager.class); |
67 |
ToolsSwingLocator.registerTaskStatusSwingManager(DefaultTaskStatusSwingManager.class); |
68 |
ToolsSwingLocator.registerComponentSwingManager(DefaultComponentSwingManager.class); |
69 |
ToolsSwingLocator.registerDefaultWindowManager(DefaultWindowManager.class); |
70 |
ToolsSwingLocator.registerDefaultIconThemeManager(DefaultIconThemeManager.class); |
71 |
ToolsSwingLocator.registerDefaultThreadSafeDialogsManager(DefaultThreadSafeDialogsManager.class); |
72 |
ToolsSwingLocator.registerDefaultDialogReminderManager(DefaultDialogReminderManager.class); |
73 |
|
74 |
CoerceToColor.selfRegister(); |
75 |
|
76 |
ColorPickerControllerImpl.selfRegister(); |
77 |
DatePickerControllerImpl.selfRegister(); |
78 |
FilePickerControllerImpl.selfRegister(); |
79 |
FolderPickerControllerImpl.selfRegister(); |
80 |
BytearrayPickerControllerImpl.selfRegister(); |
81 |
DefaultBookmarksController.selfRegister(); |
82 |
DefaultHistoryController.selfRegister(); |
83 |
|
84 |
DefaultScriptSwingManager.selfRegister(); |
85 |
|
86 |
JWebBrowserSimpleFactory.selfRegister(); |
87 |
|
88 |
registerDataTypeIcons(); |
89 |
} |
90 |
|
91 |
@Override
|
92 |
protected void doPostInitialize() throws LibraryException { |
93 |
|
94 |
} |
95 |
|
96 |
private void registerDataTypeIcons() { |
97 |
String[][] iconNames = new String[][] { |
98 |
new String[] { "DataTypes", "datatype-any" }, |
99 |
new String[] { "DataTypes", "datatype-binary" }, |
100 |
new String[] { "DataTypes", "datatype-boolean" }, |
101 |
new String[] { "DataTypes", "datatype-byte" }, |
102 |
new String[] { "DataTypes", "datatype-bytearray" }, |
103 |
new String[] { "DataTypes", "datatype-date" }, |
104 |
new String[] { "DataTypes", "datatype-double" }, |
105 |
new String[] { "DataTypes", "datatype-decimal" }, |
106 |
new String[] { "DataTypes", "datatype-float" }, |
107 |
new String[] { "DataTypes", "datatype-image" }, |
108 |
new String[] { "DataTypes", "datatype-integer" }, |
109 |
new String[] { "DataTypes", "datatype-locale" }, |
110 |
new String[] { "DataTypes", "datatype-long" }, |
111 |
new String[] { "DataTypes", "datatype-object" }, |
112 |
new String[] { "DataTypes", "datatype-string" }, |
113 |
new String[] { "DataTypes", "datatype-text" }, |
114 |
new String[] { "DataTypes", "datatype-time" }, |
115 |
new String[] { "DataTypes", "datatype-timestamp" } |
116 |
}; |
117 |
IconTheme theme = ToolsSwingLocator.getIconThemeManager().getCurrent(); |
118 |
for (String[] icon : iconNames) { |
119 |
URL url = ToolsSwingDefaultImplLibrary.class.getResource("datatypes/images/"+icon[1]+".png"); |
120 |
theme.registerDefault("DataTypes", icon[0], icon[1], null, url); |
121 |
} |
122 |
} |
123 |
} |