Revision 47719
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.impl/src/main/resources/org/gvsig/metadata/swing/impl/i18n/text.properties | ||
---|---|---|
1 |
# Resource bundle texts for the Spanish language locale (es) |
|
2 |
Example.returns_value=devuelve el valor |
|
0 | 3 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.impl/src/main/resources/org/gvsig/metadata/swing/impl/i18n/text_en.properties | ||
---|---|---|
1 |
# Resource bundle texts for the English language locale (en) |
|
2 |
Example.returns_value=returns value |
|
0 | 3 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.impl/src/main/resources/README.txt | ||
---|---|---|
1 |
Put into this folder the resources needed by your library classes. |
|
2 |
|
|
3 |
This folder is added to the runtime classpath, so you can load any resources |
|
4 |
through the ClassLoader. |
|
5 |
|
|
6 |
By default, into this folder you can find some examples of resource bundle |
|
7 |
property files that may be used by your library classes. |
|
0 | 8 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.metadata.swing.basic.impl.BasicMetadataSwingLibrary |
tags/org.gvsig.desktop-2.0.444/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 | ||
---|---|---|
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 3 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.metadata.swing.basic.impl; |
|
24 |
|
|
25 |
import org.gvsig.metadata.Metadata; |
|
26 |
import org.gvsig.metadata.MetadataLocator; |
|
27 |
import org.gvsig.metadata.MetadataManager; |
|
28 |
import org.gvsig.metadata.exceptions.MetadataException; |
|
29 |
import org.gvsig.metadata.swing.basic.api.JMetadataPanel; |
|
30 |
import org.gvsig.metadata.swing.basic.api.MetadataSwingManager; |
|
31 |
import org.gvsig.tools.ToolsLocator; |
|
32 |
import org.gvsig.tools.i18n.I18nManager; |
|
33 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
34 |
import org.gvsig.tools.swing.api.usability.UsabilitySwingManager; |
|
35 |
import org.slf4j.Logger; |
|
36 |
import org.slf4j.LoggerFactory; |
|
37 |
|
|
38 |
/** |
|
39 |
* |
|
40 |
* 04/04/2010 |
|
41 |
* |
|
42 |
* @author <a href="mailto:reinhold@uji.es">cmartin</a> |
|
43 |
*/ |
|
44 |
public class BasicMetadataSwingManager implements MetadataSwingManager { |
|
45 |
|
|
46 |
private static final Logger logger = LoggerFactory.getLogger(BasicMetadataSwingManager.class); |
|
47 |
|
|
48 |
private I18nManager i18nManager; |
|
49 |
|
|
50 |
public BasicMetadataSwingManager() { |
|
51 |
i18nManager = ToolsLocator.getI18nManager(); |
|
52 |
} |
|
53 |
|
|
54 |
public String translate(String message) { |
|
55 |
if (message != null) { |
|
56 |
return i18nManager.getTranslation(message); |
|
57 |
} |
|
58 |
return ""; |
|
59 |
} |
|
60 |
|
|
61 |
public MetadataManager getManager() { |
|
62 |
return MetadataLocator.getMetadataManager(); |
|
63 |
} |
|
64 |
|
|
65 |
public JMetadataPanel createJMetadataPanel(Metadata metadata, boolean editable) { |
|
66 |
try { |
|
67 |
this.getManager().loadMetadata(metadata); |
|
68 |
|
|
69 |
} catch (MetadataException e) { |
|
70 |
logger.warn("Can't load metadata", e); |
|
71 |
} |
|
72 |
BasicJMetadataPanel panel = new BasicJMetadataPanel(this, metadata,editable); |
|
73 |
panel.setMetadata(metadata); |
|
74 |
return panel; |
|
75 |
} |
|
76 |
|
|
77 |
public JMetadataPanel createJMetadataPanel(Metadata metadata) { |
|
78 |
return this.createJMetadataPanel(metadata, true); |
|
79 |
} |
|
80 |
|
|
81 |
public UsabilitySwingManager getUIBuilder() { |
|
82 |
return ToolsSwingLocator.getUsabilitySwingManager(); |
|
83 |
} |
|
84 |
} |
|
0 | 85 |
tags/org.gvsig.desktop-2.0.444/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/BasicJMetadataPanel.java | ||
---|---|---|
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 3 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.metadata.swing.basic.impl; |
|
24 |
|
|
25 |
import java.awt.BorderLayout; |
|
26 |
|
|
27 |
import javax.swing.JLabel; |
|
28 |
|
|
29 |
import org.gvsig.metadata.Metadata; |
|
30 |
import org.gvsig.metadata.MetadataLocator; |
|
31 |
import org.gvsig.metadata.MetadataManager; |
|
32 |
import org.gvsig.metadata.exceptions.MetadataException; |
|
33 |
import org.gvsig.metadata.swing.basic.api.AbstractSimpleMetadataPanel; |
|
34 |
import org.gvsig.metadata.swing.basic.api.JMetadataPanel; |
|
35 |
import org.gvsig.metadata.swing.basic.api.MetadataSwingManager; |
|
36 |
import org.gvsig.tools.ToolsLocator; |
|
37 |
import org.gvsig.tools.dynform.DynFormLocator; |
|
38 |
import org.gvsig.tools.dynform.DynFormManager; |
|
39 |
import org.gvsig.tools.dynform.JDynForm; |
|
40 |
import org.gvsig.tools.dynobject.exception.DynObjectValidateException; |
|
41 |
import org.gvsig.tools.i18n.I18nManager; |
|
42 |
import org.gvsig.tools.service.ServiceException; |
|
43 |
|
|
44 |
import org.slf4j.Logger; |
|
45 |
import org.slf4j.LoggerFactory; |
|
46 |
|
|
47 |
public class BasicJMetadataPanel extends JMetadataPanel { |
|
48 |
|
|
49 |
private static final Logger logger = LoggerFactory.getLogger(BasicJMetadataPanel.class); |
|
50 |
|
|
51 |
private static final long serialVersionUID = 6514865354393558940L; |
|
52 |
private JLabel lblName; |
|
53 |
private MetadataManager manager; |
|
54 |
private JDynForm dynform; |
|
55 |
|
|
56 |
private I18nManager i18nManager; |
|
57 |
|
|
58 |
|
|
59 |
public BasicJMetadataPanel(MetadataSwingManager uiManager, |
|
60 |
Metadata metadata, boolean editable) { |
|
61 |
super(uiManager, metadata, editable); |
|
62 |
} |
|
63 |
|
|
64 |
protected void initManagers() { |
|
65 |
manager = MetadataLocator.getMetadataManager(); |
|
66 |
i18nManager = ToolsLocator.getI18nManager(); |
|
67 |
} |
|
68 |
|
|
69 |
protected void initData() { |
|
70 |
String metadataName = ""; |
|
71 |
if (!this.hasMetadata()) { |
|
72 |
return; |
|
73 |
} |
|
74 |
try { |
|
75 |
metadataName = getMetadata().getMetadataName(); |
|
76 |
this.lblName.setText(i18nManager.getTranslation("_{0}_metadata", new String[] {i18nManager.getTranslation(metadataName)})); |
|
77 |
} catch (MetadataException e) { |
|
78 |
logger.warn("Can't init panel data", e); |
|
79 |
} |
|
80 |
} |
|
81 |
|
|
82 |
protected void initUI() { |
|
83 |
this.setLayout(new BorderLayout()); |
|
84 |
this.lblName = new JLabel(); |
|
85 |
|
|
86 |
this.add(this.lblName, BorderLayout.NORTH); |
|
87 |
} |
|
88 |
|
|
89 |
public void saveMetadata() throws DynObjectValidateException { |
|
90 |
try { |
|
91 |
this.dynform.getValues(this.getMetadata()); |
|
92 |
this.getMetadata().getDynClass().validate(this.getMetadata()); |
|
93 |
manager.storeMetadata(this.getMetadata()); |
|
94 |
} catch (MetadataException e) { |
|
95 |
logger.warn("Can't save metadata", e); |
|
96 |
} |
|
97 |
} |
|
98 |
|
|
99 |
protected AbstractSimpleMetadataPanel createMetadataComponent(Metadata metadata, boolean refresh) { |
|
100 |
if (metadata == null) { |
|
101 |
metadata = getMetadata(); |
|
102 |
} |
|
103 |
DynFormManager dynformmgr = DynFormLocator.getDynFormManager(); |
|
104 |
if(dynform == null){ |
|
105 |
dynform = dynformmgr.createJDynForm(metadata); |
|
106 |
} else { |
|
107 |
dynform.setValues(metadata); |
|
108 |
} |
|
109 |
this.add(dynform.asJComponent()); |
|
110 |
this.updateUI(); |
|
111 |
return this; |
|
112 |
} |
|
113 |
} |
|
0 | 114 |
tags/org.gvsig.desktop-2.0.444/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/package.html | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
4 |
<head> |
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
6 |
<title>org.gvsig.metadata.swing.impl package documentation</title> |
|
7 |
</head> |
|
8 |
<body> |
|
9 |
|
|
10 |
<p>TODO: Example library description.</p> |
|
11 |
|
|
12 |
<p>See the <a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#packagecomment">Javadoc Tool documentation about the package file</a></p> |
|
13 |
|
|
14 |
</body> |
|
15 |
</html> |
|
0 | 16 |
tags/org.gvsig.desktop-2.0.444/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/BasicMetadataSwingLibrary.java | ||
---|---|---|
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 |
|
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. |
|
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.metadata.swing.basic.impl; |
|
25 |
|
|
26 |
import org.gvsig.metadata.MetadataLibrary; |
|
27 |
import org.gvsig.metadata.swing.basic.api.MetadataSwingLibrary; |
|
28 |
import org.gvsig.metadata.swing.basic.api.MetadataSwingLocator; |
|
29 |
import org.gvsig.tools.ToolsLocator; |
|
30 |
import org.gvsig.tools.i18n.I18nManager; |
|
31 |
import org.gvsig.tools.library.AbstractLibrary; |
|
32 |
import org.gvsig.tools.library.LibraryException; |
|
33 |
import org.gvsig.tools.swing.api.ToolsSwingLibrary; |
|
34 |
|
|
35 |
/** |
|
36 |
* |
|
37 |
* @author gvSIG Team |
|
38 |
* @version $Id$ |
|
39 |
* |
|
40 |
*/ |
|
41 |
public class BasicMetadataSwingLibrary extends AbstractLibrary { |
|
42 |
|
|
43 |
public void doRegistration() { |
|
44 |
super.doRegistration(); |
|
45 |
this.registerAsImplementationOf(MetadataSwingLibrary.class); |
|
46 |
require(ToolsSwingLibrary.class); |
|
47 |
require(MetadataLibrary.class); |
|
48 |
} |
|
49 |
|
|
50 |
protected void doInitialize() throws LibraryException { |
|
51 |
MetadataSwingLocator |
|
52 |
.registerDefaultMetadataSwingManager(BasicMetadataSwingManager.class); |
|
53 |
|
|
54 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
55 |
|
|
56 |
i18nManager.addResourceFamily( |
|
57 |
"org.gvsig.metadata.swing.basic.impl.i18n.text", |
|
58 |
BasicMetadataSwingLibrary.class.getClassLoader(), |
|
59 |
BasicMetadataSwingLibrary.class.getClass().getName()); |
|
60 |
} |
|
61 |
|
|
62 |
protected void doPostInitialize() throws LibraryException { |
|
63 |
|
|
64 |
} |
|
65 |
|
|
66 |
} |
|
0 | 67 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.impl/src/main/javadoc/overview.html | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
4 |
<head> |
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
6 |
<title>org.gvsig.metadata.swing.impl package documentation</title> |
|
7 |
</head> |
|
8 |
<body> |
|
9 |
|
|
10 |
<p>TODO: Example library overview.</p> |
|
11 |
|
|
12 |
<p>See the <a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#overviewcomment">Javadoc Tool documentation about the overview file</a></p> |
|
13 |
|
|
14 |
</body> |
|
15 |
</html> |
|
0 | 16 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.impl/src/test/java/README.txt | ||
---|---|---|
1 |
#set( $symbol_pound = '#' ) |
|
2 |
#set( $symbol_dollar = '$' ) |
|
3 |
#set( $symbol_escape = '\' ) |
|
4 |
For each class you are going to test, create one Test class with the same |
|
5 |
name as the class to test, ending with Test. |
|
6 |
|
|
7 |
For example, the unit tests of the "ExampleLibrary" class are performed |
|
8 |
by the "ExampleLibraryTest" class. |
|
0 | 9 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.impl/src/test/resources/README.txt | ||
---|---|---|
1 |
#set( $symbol_pound = '#' ) |
|
2 |
#set( $symbol_dollar = '$' ) |
|
3 |
#set( $symbol_escape = '\' ) |
|
4 |
Put into this folder the resources needed by your test classes. |
|
5 |
|
|
6 |
This folder is added to the Tests classpath, so you can load any resources |
|
7 |
through the ClassLoader. |
|
8 |
|
|
9 |
By default, in this folder you can find an example of log4j configuration, |
|
10 |
prepared to log messages through the console, so logging works when you |
|
11 |
run your tests classes. |
|
0 | 12 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.impl/src/test/resources/log4j.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> |
|
3 |
|
|
4 |
<!-- |
|
5 |
Log4J configuration file for unit tests execution. |
|
6 |
--> |
|
7 |
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> |
|
8 |
|
|
9 |
<!-- Appender configuration to show logging messages through the console --> |
|
10 |
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> |
|
11 |
<layout class="org.apache.log4j.PatternLayout"> |
|
12 |
<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n %m%n" /> |
|
13 |
</layout> |
|
14 |
</appender> |
|
15 |
|
|
16 |
<!-- |
|
17 |
Activate logging messages of DEBUG level of higher only for the |
|
18 |
DefaultExampleManager class. |
|
19 |
You can put full classes names or packages instead, to configure |
|
20 |
logging for all the classes and subpackages of the package. |
|
21 |
--> |
|
22 |
<category name="org.gvsig.metadata.swing.impl.impl.DefaultExampleManager"> |
|
23 |
<priority value="DEBUG" /> |
|
24 |
</category> |
|
25 |
|
|
26 |
<!-- |
|
27 |
By default, show only logging messages of INFO level or higher, |
|
28 |
through the previously configured CONSOLE appender. |
|
29 |
--> |
|
30 |
<root> |
|
31 |
<priority value="INFO" /> |
|
32 |
<appender-ref ref="CONSOLE" /> |
|
33 |
</root> |
|
34 |
</log4j:configuration> |
|
0 | 35 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.impl/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
3 |
<modelVersion>4.0.0</modelVersion> |
|
4 |
<artifactId>org.gvsig.metadata.swing.basic.impl</artifactId> |
|
5 |
<packaging>jar</packaging> |
|
6 |
|
|
7 |
<name>org.gvsig.metadata.swing.basic.impl</name> |
|
8 |
<description /> |
|
9 |
<parent> |
|
10 |
<groupId>org.gvsig</groupId> |
|
11 |
<artifactId>org.gvsig.metadata.basic.swing</artifactId> |
|
12 |
<version>2.0.444</version> |
|
13 |
</parent> |
|
14 |
|
|
15 |
<dependencies> |
|
16 |
<dependency> |
|
17 |
<groupId>org.gvsig</groupId> |
|
18 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
19 |
<scope>compile</scope> |
|
20 |
</dependency> |
|
21 |
<dependency> |
|
22 |
<groupId>org.gvsig</groupId> |
|
23 |
<artifactId>org.gvsig.tools.swing.api</artifactId> |
|
24 |
<scope>compile</scope> |
|
25 |
</dependency> |
|
26 |
<dependency> |
|
27 |
<groupId>org.gvsig</groupId> |
|
28 |
<artifactId>org.gvsig.tools.dynform.api</artifactId> |
|
29 |
<scope>compile</scope> |
|
30 |
</dependency> |
|
31 |
<dependency> |
|
32 |
<groupId>org.gvsig</groupId> |
|
33 |
<artifactId>org.gvsig.tools.dynform.spi</artifactId> |
|
34 |
<scope>compile</scope> |
|
35 |
</dependency> |
|
36 |
<dependency> |
|
37 |
<groupId>org.gvsig</groupId> |
|
38 |
<artifactId>org.gvsig.tools.dynform.services</artifactId> |
|
39 |
<scope>compile</scope> |
|
40 |
</dependency> |
|
41 |
<dependency> |
|
42 |
<groupId>org.gvsig</groupId> |
|
43 |
<artifactId>org.gvsig.tools.dynform.impl</artifactId> |
|
44 |
<scope>compile</scope> |
|
45 |
</dependency> |
|
46 |
<dependency> |
|
47 |
<groupId>org.gvsig</groupId> |
|
48 |
<artifactId>org.gvsig.metadata.swing.basic.api</artifactId> |
|
49 |
<scope>compile</scope> |
|
50 |
</dependency> |
|
51 |
<!-- FIXME: No deberia tener una dependencia con la implementacion --> |
|
52 |
<!-- |
|
53 |
<dependency> |
|
54 |
<groupId>org.gvsig</groupId> |
|
55 |
<artifactId>org.gvsig.metadata.lib.basic.impl</artifactId> |
|
56 |
</dependency> |
|
57 |
--> |
|
58 |
</dependencies> |
|
59 |
</project> |
|
0 | 60 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
4 |
|
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<artifactId>org.gvsig.metadata.basic.swing</artifactId> |
|
7 |
<name>${project.artifactId}</name> |
|
8 |
<packaging>pom</packaging> |
|
9 |
<description>This project contains the basic metadata features.</description> |
|
10 |
<parent> |
|
11 |
<groupId>org.gvsig</groupId> |
|
12 |
<artifactId>org.gvsig.metadata.basic</artifactId> |
|
13 |
<version>2.0.444</version> |
|
14 |
</parent> |
|
15 |
|
|
16 |
<modules> |
|
17 |
<module>org.gvsig.metadata.swing.basic.api</module> |
|
18 |
<module>org.gvsig.metadata.swing.basic.impl</module> |
|
19 |
</modules> |
|
20 |
|
|
21 |
</project> |
|
0 | 22 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.api/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
3 |
<modelVersion>4.0.0</modelVersion> |
|
4 |
<artifactId>org.gvsig.metadata.swing.basic.api</artifactId> |
|
5 |
<packaging>jar</packaging> |
|
6 |
|
|
7 |
<name>org.gvsig.metadata.swing.basic.api</name> |
|
8 |
<description /> |
|
9 |
<parent> |
|
10 |
<groupId>org.gvsig</groupId> |
|
11 |
<artifactId>org.gvsig.metadata.basic.swing</artifactId> |
|
12 |
<version>2.0.444</version> |
|
13 |
</parent> |
|
14 |
|
|
15 |
<dependencies> |
|
16 |
<dependency> |
|
17 |
<groupId>org.gvsig</groupId> |
|
18 |
<artifactId>org.gvsig.tools.dynform.api</artifactId> |
|
19 |
<scope>compile</scope> |
|
20 |
</dependency> |
|
21 |
<dependency> |
|
22 |
<groupId>org.gvsig</groupId> |
|
23 |
<artifactId>org.gvsig.metadata.lib.basic.api</artifactId> |
|
24 |
</dependency> |
|
25 |
<dependency> |
|
26 |
<groupId>org.gvsig</groupId> |
|
27 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
28 |
</dependency> |
|
29 |
<dependency> |
|
30 |
<groupId>org.gvsig</groupId> |
|
31 |
<artifactId>org.gvsig.tools.swing.api</artifactId> |
|
32 |
</dependency> |
|
33 |
</dependencies> |
|
34 |
</project> |
|
0 | 35 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.api/src/main/javadoc/overview.html | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
4 |
<head> |
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
6 |
<title>org.gvsig.metadata.swing.api package documentation</title> |
|
7 |
</head> |
|
8 |
<body> |
|
9 |
|
|
10 |
<p>TODO: Example library overview.</p> |
|
11 |
|
|
12 |
<p>See the <a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#overviewcomment">Javadoc Tool documentation about the overview file</a></p> |
|
13 |
|
|
14 |
</body> |
|
15 |
</html> |
|
0 | 16 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.metadata.swing.basic.api.MetadataSwingLibrary |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.api/src/main/resources/org/gvsig/metadata/swing/api/i18n/text_en.properties | ||
---|---|---|
1 |
# Resource bundle texts for the English language locale (en) |
|
2 |
Example.returns_value=returns value |
|
0 | 3 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.api/src/main/resources/org/gvsig/metadata/swing/api/i18n/text.properties | ||
---|---|---|
1 |
# Resource bundle texts for the Spanish language locale (es) |
|
2 |
Example.returns_value=devuelve el valor |
|
0 | 3 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.api/src/main/resources/README.txt | ||
---|---|---|
1 |
Put into this folder the resources needed by your library classes. |
|
2 |
|
|
3 |
This folder is added to the runtime classpath, so you can load any resources |
|
4 |
through the ClassLoader. |
|
5 |
|
|
6 |
By default, into this folder you can find some examples of resource bundle |
|
7 |
property files that may be used by your library classes. |
|
0 | 8 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.api/src/main/java/org/gvsig/metadata/swing/basic/api/JMetadataPanel.java | ||
---|---|---|
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 3 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.metadata.swing.basic.api; |
|
24 |
|
|
25 |
import java.awt.Component; |
|
26 |
|
|
27 |
import org.gvsig.metadata.Metadata; |
|
28 |
import org.gvsig.tools.dynform.DynFormLocator; |
|
29 |
import org.gvsig.tools.dynform.DynFormManager; |
|
30 |
import org.gvsig.tools.dynform.JDynForm; |
|
31 |
import org.gvsig.tools.dynobject.DynClass; |
|
32 |
import org.gvsig.tools.dynobject.DynField; |
|
33 |
import org.gvsig.tools.dynobject.exception.DynObjectValidateException; |
|
34 |
import org.gvsig.tools.service.ServiceException; |
|
35 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
36 |
//import org.gvsig.tools.swing.api.dynobject.JDynObjectComponent; |
|
37 |
|
|
38 |
/** |
|
39 |
* |
|
40 |
* The metadata editor panel. |
|
41 |
* |
|
42 |
* @author gvSIG Team |
|
43 |
* @author <a href="mailto:reinhold@uji.es">cmartin</a> |
|
44 |
* @version $Id$ |
|
45 |
* |
|
46 |
*/ |
|
47 |
public abstract class JMetadataPanel extends AbstractSimpleMetadataPanel |
|
48 |
implements MetadataPanel { |
|
49 |
|
|
50 |
private static final long serialVersionUID = 3029756241879733963L; |
|
51 |
|
|
52 |
public JMetadataPanel(MetadataSwingManager uiManager, Metadata metadata, |
|
53 |
boolean editable) { |
|
54 |
super(uiManager, metadata, editable); |
|
55 |
} |
|
56 |
|
|
57 |
protected JDynForm createJDynObjectComponent(DynClass dynClass, |
|
58 |
Metadata metadata, boolean isEditable) throws ServiceException { |
|
59 |
DynFormManager manager = DynFormLocator.getDynFormManager(); |
|
60 |
JDynForm form = manager.createJDynForm(dynClass); |
|
61 |
if (metadata != null) { |
|
62 |
form.setValues(metadata); |
|
63 |
} |
|
64 |
form.setReadOnly(!isEditable); |
|
65 |
return form; |
|
66 |
} |
|
67 |
|
|
68 |
/** |
|
69 |
* Saves the current status of the GUI into the Metadata object |
|
70 |
* |
|
71 |
* @throws DynObjectValidateException |
|
72 |
* |
|
73 |
*/ |
|
74 |
public abstract void saveMetadata() throws DynObjectValidateException; |
|
75 |
|
|
76 |
public void save() { |
|
77 |
try { |
|
78 |
saveMetadata(); |
|
79 |
} catch (DynObjectValidateException e) { |
|
80 |
// TODO Auto-generated catch block |
|
81 |
e.printStackTrace(); |
|
82 |
} |
|
83 |
} |
|
84 |
|
|
85 |
public DynField getDynField() { |
|
86 |
// TODO Auto-generated method stub |
|
87 |
return null; |
|
88 |
} |
|
89 |
|
|
90 |
public Component asJComponent() { |
|
91 |
return this; |
|
92 |
} |
|
93 |
|
|
94 |
} |
|
0 | 95 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.api/src/main/java/org/gvsig/metadata/swing/basic/api/MetadataSwingLocator.java | ||
---|---|---|
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 |
|
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. |
|
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.metadata.swing.basic.api; |
|
25 |
|
|
26 |
import org.gvsig.tools.locator.BaseLocator; |
|
27 |
import org.gvsig.tools.locator.Locator; |
|
28 |
import org.gvsig.tools.locator.LocatorException; |
|
29 |
|
|
30 |
/** |
|
31 |
* Locator for the Metadata Library main object instances. |
|
32 |
* |
|
33 |
* Replaces the MetadataManager by its own services, by adding as many constants |
|
34 |
* and methods as needed, taking the MetadataManager as a guide. |
|
35 |
* |
|
36 |
* @author gvSIG Team |
|
37 |
* @author <a href="mailto:reinhold@uji.es">cmartin</a> |
|
38 |
* @version $Id$ |
|
39 |
* |
|
40 |
*/ |
|
41 |
public class MetadataSwingLocator extends BaseLocator { |
|
42 |
|
|
43 |
/** |
|
44 |
* Unique instance. |
|
45 |
*/ |
|
46 |
private static final MetadataSwingLocator instance = new MetadataSwingLocator(); |
|
47 |
|
|
48 |
private static final String METADATA_MANAGER_DESCRIPTION = "Metadata API Library Manager"; |
|
49 |
|
|
50 |
public static final String METADATA_MANAGER_NAME = "org.gvsig.metadata.swing.basic.api.manager"; |
|
51 |
|
|
52 |
/** |
|
53 |
* Returns the Metadata singleton instance. |
|
54 |
* |
|
55 |
* @return the Metadata singleton instance |
|
56 |
*/ |
|
57 |
public static MetadataSwingLocator getInstance() { |
|
58 |
return instance; |
|
59 |
} |
|
60 |
|
|
61 |
/** |
|
62 |
* Returns a reference to the MetadataManager. |
|
63 |
* |
|
64 |
* @return a reference to MetadataManager |
|
65 |
* @throws LocatorException |
|
66 |
* if there is no access to the class or the class cannot be |
|
67 |
* instantiated |
|
68 |
* @see Locator#get(String) |
|
69 |
*/ |
|
70 |
public static MetadataSwingManager getMetadataSwingManager() |
|
71 |
throws LocatorException { |
|
72 |
return (MetadataSwingManager) getInstance().get(METADATA_MANAGER_NAME); |
|
73 |
} |
|
74 |
|
|
75 |
public static void registerDefaultMetadataSwingManager(Class clazz) { |
|
76 |
getInstance().registerDefault(METADATA_MANAGER_NAME, |
|
77 |
METADATA_MANAGER_DESCRIPTION, clazz); |
|
78 |
} |
|
79 |
|
|
80 |
/** |
|
81 |
* Registers the Class implementing the MetadataManager interface. |
|
82 |
* |
|
83 |
* @param clazz |
|
84 |
* implementing the MetadataManager interface |
|
85 |
*/ |
|
86 |
public static void registerMetadataSwingManager(Class clazz) { |
|
87 |
getInstance().register(METADATA_MANAGER_NAME, |
|
88 |
METADATA_MANAGER_DESCRIPTION, clazz); |
|
89 |
} |
|
90 |
} |
|
0 | 91 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.api/src/main/java/org/gvsig/metadata/swing/basic/api/CreateJMetadataPanelException.java | ||
---|---|---|
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 |
|
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. |
|
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.metadata.swing.basic.api; |
|
25 |
|
|
26 |
import org.gvsig.metadata.Metadata; |
|
27 |
import org.gvsig.metadata.exceptions.MetadataException; |
|
28 |
|
|
29 |
public class CreateJMetadataPanelException extends MetadataException { |
|
30 |
|
|
31 |
/** |
|
32 |
* |
|
33 |
*/ |
|
34 |
private static final long serialVersionUID = 7989045357127054749L; |
|
35 |
|
|
36 |
public CreateJMetadataPanelException(Metadata metadata, Throwable cause) { |
|
37 |
super( |
|
38 |
"Can't create a JMetadataPanel based on this metadata: '%(metadata)'", |
|
39 |
cause, |
|
40 |
"_cant_create_a_JMetadataPanel_based_on_this_metadata_XmetadataX", |
|
41 |
serialVersionUID |
|
42 |
); |
|
43 |
String name; |
|
44 |
try { |
|
45 |
name = metadata.getMetadataName(); |
|
46 |
} catch(Exception e) { |
|
47 |
name = null; |
|
48 |
} |
|
49 |
if( name==null ) { |
|
50 |
name = "(unknow)"; |
|
51 |
} |
|
52 |
setValue("metadata", name); |
|
53 |
} |
|
54 |
} |
|
0 | 55 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.api/src/main/java/org/gvsig/metadata/swing/basic/api/MetadataSwingLibrary.java | ||
---|---|---|
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 |
|
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. |
|
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.metadata.swing.basic.api; |
|
25 |
|
|
26 |
import org.gvsig.metadata.MetadataLocator; |
|
27 |
import org.gvsig.metadata.MetadataManager; |
|
28 |
import org.gvsig.tools.library.AbstractLibrary; |
|
29 |
import org.gvsig.tools.library.LibraryException; |
|
30 |
import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
|
31 |
import org.gvsig.tools.swing.api.ToolsSwingLibrary; |
|
32 |
|
|
33 |
/** |
|
34 |
* |
|
35 |
* Initialization of the basic Metadata API Library. |
|
36 |
* |
|
37 |
* @author gvSIG Team |
|
38 |
* @author <a href="mailto:reinhold@uji.es">cmartin</a> |
|
39 |
* @version $Id$ |
|
40 |
* |
|
41 |
*/ |
|
42 |
public class MetadataSwingLibrary extends AbstractLibrary { |
|
43 |
|
|
44 |
public void doRegistration() { |
|
45 |
super.doRegistration(); |
|
46 |
registerAsAPI(MetadataSwingLibrary.class); |
|
47 |
require(ToolsSwingLibrary.class); |
|
48 |
} |
|
49 |
|
|
50 |
/** |
|
51 |
* Performs all the initializations of the library, only related to himself: |
|
52 |
* register implementation classes through the Locator, start services, etc. |
|
53 |
* |
|
54 |
* @throws LibraryException |
|
55 |
* if there is an error while performing the initialization of |
|
56 |
* the library |
|
57 |
*/ |
|
58 |
protected void doInitialize() throws LibraryException { |
|
59 |
|
|
60 |
} |
|
61 |
|
|
62 |
/** |
|
63 |
* Performs all the initializations or validations related to the library |
|
64 |
* dependencies, as getting references to objects through other libraries |
|
65 |
* Locators. |
|
66 |
* |
|
67 |
* @throws LibraryException |
|
68 |
* if there is an error while loading an implementation of the |
|
69 |
* library |
|
70 |
*/ |
|
71 |
protected void doPostInitialize() throws LibraryException { |
|
72 |
// Validate there is any implementation registered. |
|
73 |
MetadataManager manager = MetadataLocator.getMetadataManager(); |
|
74 |
|
|
75 |
if (manager == null) { |
|
76 |
throw new ReferenceNotRegisteredException( |
|
77 |
MetadataLocator.METADATA_MANAGER_NAME, MetadataLocator.getInstance()); |
|
78 |
} |
|
79 |
/* |
|
80 |
* Validates if there is at least an implementation of the |
|
81 |
* MetadataManager registered. |
|
82 |
*/ |
|
83 |
MetadataSwingManager swingManager = MetadataSwingLocator.getMetadataSwingManager(); |
|
84 |
|
|
85 |
if (swingManager == null) { |
|
86 |
throw new ReferenceNotRegisteredException( |
|
87 |
MetadataSwingLocator.METADATA_MANAGER_NAME, |
|
88 |
MetadataSwingLocator.getInstance()); |
|
89 |
} |
|
90 |
} |
|
91 |
} |
|
0 | 92 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.api/src/main/java/org/gvsig/metadata/swing/basic/api/AbstractSimpleMetadataPanel.java | ||
---|---|---|
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 3 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.metadata.swing.basic.api; |
|
24 |
|
|
25 |
import javax.swing.JPanel; |
|
26 |
|
|
27 |
import org.gvsig.metadata.Metadata; |
|
28 |
|
|
29 |
public abstract class AbstractSimpleMetadataPanel extends JPanel { |
|
30 |
|
|
31 |
/** |
|
32 |
* |
|
33 |
*/ |
|
34 |
private static final long serialVersionUID = 8275085021104037254L; |
|
35 |
private AbstractSimpleMetadataPanel metadataComponent; |
|
36 |
private Metadata metadata; |
|
37 |
private boolean editable; |
|
38 |
|
|
39 |
protected MetadataSwingManager uiManager; |
|
40 |
|
|
41 |
public AbstractSimpleMetadataPanel(MetadataSwingManager uiManager, |
|
42 |
Metadata metadata, boolean editable) { |
|
43 |
super(); |
|
44 |
this.uiManager = uiManager; |
|
45 |
this.editable = editable; |
|
46 |
this.metadata = metadata; |
|
47 |
init(); |
|
48 |
} |
|
49 |
|
|
50 |
private void init() { |
|
51 |
initManagers(); |
|
52 |
initUI(); |
|
53 |
setMetadata(metadata); |
|
54 |
} |
|
55 |
|
|
56 |
protected boolean isEditable() { |
|
57 |
return this.editable; |
|
58 |
} |
|
59 |
|
|
60 |
protected void setEditable(boolean isEditable) { |
|
61 |
this.editable = isEditable; |
|
62 |
} |
|
63 |
|
|
64 |
protected abstract void initManagers(); |
|
65 |
|
|
66 |
protected abstract void initData(); |
|
67 |
|
|
68 |
protected abstract void initUI(); |
|
69 |
|
|
70 |
protected abstract AbstractSimpleMetadataPanel createMetadataComponent(Metadata metadata, boolean doRefresh); |
|
71 |
|
|
72 |
public void setMetadataComponent(AbstractSimpleMetadataPanel metadataComponent) { |
|
73 |
this.metadataComponent = metadataComponent; |
|
74 |
} |
|
75 |
|
|
76 |
public AbstractSimpleMetadataPanel getMetadataComponent() { |
|
77 |
return metadataComponent; |
|
78 |
} |
|
79 |
|
|
80 |
public void setMetadata(Metadata metadata) { |
|
81 |
this.metadata = metadata; |
|
82 |
initData(); |
|
83 |
this.setMetadataComponent(createMetadataComponent(getMetadata(), true)); |
|
84 |
this.updateUI(); |
|
85 |
} |
|
86 |
|
|
87 |
public Metadata getMetadata() { |
|
88 |
return metadata; |
|
89 |
} |
|
90 |
|
|
91 |
protected boolean hasMetadata() { |
|
92 |
return (this.metadata != null); |
|
93 |
} |
|
94 |
|
|
95 |
} |
|
0 | 96 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.api/src/main/java/org/gvsig/metadata/swing/basic/api/MetadataPanel.java | ||
---|---|---|
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 |
|
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. |
|
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.metadata.swing.basic.api; |
|
25 |
|
|
26 |
import java.awt.Component; |
|
27 |
|
|
28 |
import org.gvsig.metadata.Metadata; |
|
29 |
import org.gvsig.tools.dynobject.DynField; |
|
30 |
|
|
31 |
public interface MetadataPanel { |
|
32 |
|
|
33 |
public Metadata getMetadata(); |
|
34 |
|
|
35 |
public void save(); |
|
36 |
|
|
37 |
public DynField getDynField(); |
|
38 |
|
|
39 |
public Component asJComponent(); |
|
40 |
|
|
41 |
} |
|
0 | 42 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.api/src/main/java/org/gvsig/metadata/swing/basic/api/MetadataSwingManager.java | ||
---|---|---|
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 |
|
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. |
|
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.metadata.swing.basic.api; |
|
25 |
|
|
26 |
import org.gvsig.metadata.Metadata; |
|
27 |
import org.gvsig.metadata.MetadataManager; |
|
28 |
import org.gvsig.metadata.exceptions.MetadataException; |
|
29 |
import org.gvsig.tools.swing.api.usability.UsabilitySwingManager; |
|
30 |
|
|
31 |
/** |
|
32 |
* |
|
33 |
* A basic metadata swing manager to provide a metadata GUI editor. |
|
34 |
* |
|
35 |
* @author gvSIG Team |
|
36 |
* @author <a href="mailto:reinhold@uji.es">cmartin</a> |
|
37 |
* @version $Id$ |
|
38 |
* |
|
39 |
*/ |
|
40 |
public interface MetadataSwingManager { |
|
41 |
|
|
42 |
/** |
|
43 |
* |
|
44 |
* Given a text, it looks for its translation. If none is found, then the |
|
45 |
* original text is shown. |
|
46 |
* |
|
47 |
* @param text |
|
48 |
* to be translated. |
|
49 |
* @return the translation text result. |
|
50 |
*/ |
|
51 |
public String translate(String message); |
|
52 |
|
|
53 |
/** |
|
54 |
* Gets the main manager that allows interacting with metadata objects. |
|
55 |
* |
|
56 |
* @return the metadata Manager |
|
57 |
*/ |
|
58 |
public MetadataManager getManager(); |
|
59 |
|
|
60 |
/** |
|
61 |
* Creates the JPanel in which users can edit and visualize metadata |
|
62 |
* objects. Editable by default. |
|
63 |
* |
|
64 |
* @param metadata |
|
65 |
* the metadata to be displayed. |
|
66 |
* @return the metadata editor Panel |
|
67 |
* @throws MetadataException |
|
68 |
*/ |
|
69 |
public JMetadataPanel createJMetadataPanel(Metadata metadata); |
|
70 |
|
|
71 |
/** |
|
72 |
* Creates the JPanel in which users can edit and visualize metadata |
|
73 |
* objects. |
|
74 |
* |
|
75 |
* @param metadata |
|
76 |
* the metadata to be displayed. |
|
77 |
* @param editable |
|
78 |
* if the metadata panel should be editable or not. |
|
79 |
* @return the metadata editor Panel |
|
80 |
* @throws MetadataException |
|
81 |
*/ |
|
82 |
public JMetadataPanel createJMetadataPanel(Metadata metadata, |
|
83 |
boolean editable); |
|
84 |
|
|
85 |
/** |
|
86 |
* Gets the ToolsLocator usability swing manager to create UI components |
|
87 |
* based on gvSIG standards. |
|
88 |
* |
|
89 |
* @return |
|
90 |
*/ |
|
91 |
public UsabilitySwingManager getUIBuilder(); |
|
92 |
|
|
93 |
} |
|
0 | 94 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.api/src/test/resources/README.txt | ||
---|---|---|
1 |
#set( $symbol_pound = '#' ) |
|
2 |
#set( $symbol_dollar = '$' ) |
|
3 |
#set( $symbol_escape = '\' ) |
|
4 |
Put into this folder the resources needed by your test classes. |
|
5 |
|
|
6 |
This folder is added to the Tests classpath, so you can load any resources |
|
7 |
through the ClassLoader. |
|
8 |
|
|
9 |
By default, in this folder you can find an example of log4j configuration, |
|
10 |
prepared to log messages through the console, so logging works when you |
|
11 |
run your tests classes. |
|
0 | 12 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.api/src/test/resources/log4j.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> |
|
3 |
|
|
4 |
<!-- |
|
5 |
Log4J configuration file for unit tests execution. |
|
6 |
--> |
|
7 |
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> |
|
8 |
|
|
9 |
<!-- Appender configuration to show logging messages through the console --> |
|
10 |
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> |
|
11 |
<layout class="org.apache.log4j.PatternLayout"> |
|
12 |
<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n %m%n" /> |
|
13 |
</layout> |
|
14 |
</appender> |
|
15 |
|
|
16 |
<!-- |
|
17 |
Activate logging messages of DEBUG level of higher only for the |
|
18 |
DefaultExampleManager class. |
|
19 |
You can put full classes names or packages instead, to configure |
|
20 |
logging for all the classes and subpackages of the package. |
|
21 |
--> |
|
22 |
<category name="org.gvsig.metadata.swing.api.impl.DefaultExampleManager"> |
|
23 |
<priority value="DEBUG" /> |
|
24 |
</category> |
|
25 |
|
|
26 |
<!-- |
|
27 |
By default, show only logging messages of INFO level or higher, |
|
28 |
through the previously configured CONSOLE appender. |
|
29 |
--> |
|
30 |
<root> |
|
31 |
<priority value="INFO" /> |
|
32 |
<appender-ref ref="CONSOLE" /> |
|
33 |
</root> |
|
34 |
</log4j:configuration> |
|
0 | 35 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/org.gvsig.metadata.basic.swing/org.gvsig.metadata.swing.basic.api/src/test/java/README.txt | ||
---|---|---|
1 |
#set( $symbol_pound = '#' ) |
|
2 |
#set( $symbol_dollar = '$' ) |
|
3 |
#set( $symbol_escape = '\' ) |
|
4 |
For each class you are going to test, create one Test class with the same |
|
5 |
name as the class to test, ending with Test. |
|
6 |
|
|
7 |
For example, the unit tests of the "ExampleLibrary" class are performed |
|
8 |
by the "ExampleLibraryTest" class. |
|
0 | 9 |
tags/org.gvsig.desktop-2.0.444/org.gvsig.desktop.compat.cdc/org.gvsig.metadata.basic/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
4 |
|
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<artifactId>org.gvsig.metadata.basic</artifactId> |
|
7 |
<name>${project.artifactId}</name> |
|
8 |
<packaging>pom</packaging> |
|
9 |
<description>This project contains the basic metadata features.</description> |
|
10 |
<parent> |
|
11 |
<groupId>org.gvsig</groupId> |
|
12 |
<artifactId>org.gvsig.desktop.compat.cdc</artifactId> |
|
13 |
<version>2.0.444</version> |
|
14 |
</parent> |
Also available in: Unified diff