Revision 41551 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.impl/src/main/java/org/gvsig/metadata/swing/basic/impl/BasicMetadataSwingManager.java
BasicMetadataSwingManager.java | ||
---|---|---|
3 | 3 |
* |
4 | 4 |
* Copyright (C) 2007-2013 gvSIG Association. |
5 | 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.
|
|
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 3 of the License, or (at your option) any later
|
|
9 |
* version. |
|
10 | 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.
|
|
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 | 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. |
|
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. |
|
20 | 19 |
* |
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
|
20 |
* For any additional information, do not hesitate to contact us at info AT
|
|
21 |
* gvsig.com, or visit our website www.gvsig.com. |
|
23 | 22 |
*/ |
24 | 23 |
package org.gvsig.metadata.swing.basic.impl; |
25 | 24 |
|
... | ... | |
33 | 32 |
import org.gvsig.tools.i18n.I18nManager; |
34 | 33 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
35 | 34 |
import org.gvsig.tools.swing.api.usability.UsabilitySwingManager; |
35 |
import org.slf4j.Logger; |
|
36 |
import org.slf4j.LoggerFactory; |
|
36 | 37 |
|
37 | 38 |
/** |
38 |
*
|
|
39 |
* |
|
39 | 40 |
* 04/04/2010 |
40 |
*
|
|
41 |
* |
|
41 | 42 |
* @author <a href="mailto:reinhold@uji.es">cmartin</a> |
42 | 43 |
*/ |
43 | 44 |
public class BasicMetadataSwingManager implements MetadataSwingManager { |
44 | 45 |
|
45 |
private I18nManager i18nManager;
|
|
46 |
private static final Logger logger = LoggerFactory.getLogger(BasicMetadataSwingManager.class);
|
|
46 | 47 |
|
47 |
public BasicMetadataSwingManager() { |
|
48 |
i18nManager = ToolsLocator.getI18nManager(); |
|
48 |
private I18nManager i18nManager; |
|
49 |
|
|
50 |
public BasicMetadataSwingManager() { |
|
51 |
i18nManager = ToolsLocator.getI18nManager(); |
|
49 | 52 |
} |
50 | 53 |
|
51 |
public String translate(String message) {
|
|
52 |
if (message != null) {
|
|
53 |
return i18nManager.getTranslation(message);
|
|
54 |
}
|
|
55 |
return "";
|
|
54 |
public String translate(String message) {
|
|
55 |
if (message != null) {
|
|
56 |
return i18nManager.getTranslation(message);
|
|
57 |
}
|
|
58 |
return "";
|
|
56 | 59 |
} |
57 | 60 |
|
58 | 61 |
public MetadataManager getManager() { |
59 | 62 |
return MetadataLocator.getMetadataManager(); |
60 | 63 |
} |
61 | 64 |
|
62 |
public JMetadataPanel createJMetadataPanel(Metadata metadata, boolean editable) {
|
|
65 |
public JMetadataPanel createJMetadataPanel(Metadata metadata, boolean editable) {
|
|
63 | 66 |
try { |
64 | 67 |
this.getManager().loadMetadata(metadata); |
65 |
|
|
68 |
|
|
66 | 69 |
} catch (MetadataException e) { |
67 |
// TODO Auto-generated catch block |
|
68 |
e.printStackTrace(); |
|
70 |
logger.warn("Can't load metadata", e); |
|
69 | 71 |
} |
70 |
|
|
71 |
BasicJMetadataPanel panel = new BasicJMetadataPanel(this, metadata, |
|
72 |
editable); |
|
73 |
panel.setMetadata(metadata); |
|
72 |
BasicJMetadataPanel panel = new BasicJMetadataPanel(this, metadata,editable); |
|
73 |
panel.setMetadata(metadata); |
|
74 | 74 |
return panel; |
75 | 75 |
} |
76 | 76 |
|
77 |
public JMetadataPanel createJMetadataPanel(Metadata metadata) {
|
|
78 |
return this.createJMetadataPanel(metadata, true);
|
|
79 |
}
|
|
77 |
public JMetadataPanel createJMetadataPanel(Metadata metadata) {
|
|
78 |
return this.createJMetadataPanel(metadata, true);
|
|
79 |
}
|
|
80 | 80 |
|
81 |
public UsabilitySwingManager getUIBuilder() {
|
|
82 |
return ToolsSwingLocator.getUsabilitySwingManager();
|
|
83 |
}
|
|
81 |
public UsabilitySwingManager getUIBuilder() {
|
|
82 |
return ToolsSwingLocator.getUsabilitySwingManager();
|
|
83 |
}
|
|
84 | 84 |
} |
Also available in: Unified diff