Revision 39467
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/buildNumber.properties | ||
---|---|---|
1 |
#maven.buildNumber.plugin properties file |
|
2 |
#Fri Dec 14 11:34:21 CET 2012 |
|
3 |
buildNumber=2080 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/org.gvsig.annotation.app.extension/buildNumber.properties | ||
---|---|---|
1 |
#maven.buildNumber.plugin properties file |
|
2 |
#Fri Dec 14 11:34:21 CET 2012 |
|
3 |
buildNumber=2072 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/org.gvsig.annotation.app.extension/src/test/resources/README.txt | ||
---|---|---|
1 |
Put into this folder the resources needed by your test classes. |
|
2 |
|
|
3 |
This folder is added to the Tests classpath, so you can load any resources |
|
4 |
through the ClassLoader. |
|
5 |
|
|
6 |
By default, in this folder you can find an example of log4j configuration, |
|
7 |
prepared to log messages through the console, so logging works when you |
|
8 |
run your tests classes. |
|
0 | 9 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/org.gvsig.annotation.app.extension/src/test/resources/log4j.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1" ?> |
|
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 |
org.gvsig.tools packages. |
|
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.tools"> |
|
23 |
<priority value="DEBUG" /> |
|
24 |
</category> |
|
25 |
<category name="org.gvsig.annotation"> |
|
26 |
<priority value="DEBUG" /> |
|
27 |
</category> |
|
28 |
|
|
29 |
<!-- |
|
30 |
By default, show only logging messages of INFO level or higher, |
|
31 |
through the previously configured CONSOLE appender. |
|
32 |
--> |
|
33 |
<root> |
|
34 |
<priority value="INFO" /> |
|
35 |
<appender-ref ref="CONSOLE" /> |
|
36 |
</root> |
|
37 |
</log4j:configuration> |
|
0 | 38 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/org.gvsig.annotation.app.extension/src/main/java/org/gvsig/annotation/app/extension/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.annotation package documentation</title> |
|
7 |
</head> |
|
8 |
<body> |
|
9 |
|
|
10 |
<p>Annotation gvSIG extension</p> |
|
11 |
|
|
12 |
<p> |
|
13 |
Shows Annotation into gvSIG. |
|
14 |
</p> |
|
15 |
|
|
16 |
</body> |
|
17 |
</html> |
|
0 | 18 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/org.gvsig.annotation.app.extension/src/main/java/org/gvsig/annotation/app/extension/AnnotationAboutExtension.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Prodevelop} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.annotation.app.extension; |
|
29 |
|
|
30 |
import org.gvsig.andami.plugins.Extension; |
|
31 |
|
|
32 |
/** |
|
33 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
34 |
*/ |
|
35 |
public class AnnotationAboutExtension extends Extension { |
|
36 |
|
|
37 |
public void execute(String actionCommand) { |
|
38 |
// Nothing to do |
|
39 |
} |
|
40 |
|
|
41 |
public void initialize() { |
|
42 |
// Nothing to do |
|
43 |
} |
|
44 |
|
|
45 |
public boolean isEnabled() { |
|
46 |
return false; |
|
47 |
} |
|
48 |
|
|
49 |
public boolean isVisible() { |
|
50 |
return false; |
|
51 |
} |
|
52 |
|
|
53 |
public void postInitialize() { |
|
54 |
super.postInitialize(); |
|
55 |
} |
|
56 |
} |
|
0 | 57 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/org.gvsig.annotation.app.extension/src/main/java/org/gvsig/annotation/app/extension/AnnotationWindow.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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 |
*/ |
|
22 |
package org.gvsig.annotation.app.extension; |
|
23 |
|
|
24 |
import java.awt.BorderLayout; |
|
25 |
import java.awt.Dimension; |
|
26 |
|
|
27 |
import javax.swing.JPanel; |
|
28 |
|
|
29 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
30 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
|
31 |
import org.gvsig.annotation.swing.AnnotationWindowManager; |
|
32 |
|
|
33 |
/** |
|
34 |
* {@link IWindow} to show a Annotation. |
|
35 |
* |
|
36 |
* @author gvSIG Team |
|
37 |
* @version $Id$ |
|
38 |
*/ |
|
39 |
public class AnnotationWindow extends JPanel implements IWindow { |
|
40 |
|
|
41 |
private static final long serialVersionUID = -4401123724140025094L; |
|
42 |
|
|
43 |
private WindowInfo info; |
|
44 |
|
|
45 |
private Object profile = WindowInfo.EDITOR_PROFILE; |
|
46 |
|
|
47 |
/** |
|
48 |
* Constructor. |
|
49 |
* |
|
50 |
* @param panel |
|
51 |
* the panel to show |
|
52 |
* @param title |
|
53 |
* the window title |
|
54 |
* @param mode |
|
55 |
* the window mode |
|
56 |
* @see {@link AnnotationWindowManager#MODE_DIALOG} |
|
57 |
* @see {@link AnnotationWindowManager#MODE_TOOL} |
|
58 |
* @see {@link AnnotationWindowManager#MODE_WINDOW} |
|
59 |
*/ |
|
60 |
public AnnotationWindow(JPanel panel, String title, int mode) { |
|
61 |
this.setLayout(new BorderLayout()); |
|
62 |
add(panel, BorderLayout.CENTER); |
|
63 |
|
|
64 |
Dimension dimension = new Dimension(700, 400); |
|
65 |
setSize(dimension); |
|
66 |
int code = |
|
67 |
WindowInfo.ICONIFIABLE | WindowInfo.MAXIMIZABLE |
|
68 |
| WindowInfo.RESIZABLE; |
|
69 |
switch (mode) { |
|
70 |
case AnnotationWindowManager.MODE_DIALOG: |
|
71 |
code |= WindowInfo.MODALDIALOG; |
|
72 |
profile = WindowInfo.DIALOG_PROFILE; |
|
73 |
break; |
|
74 |
case AnnotationWindowManager.MODE_TOOL: |
|
75 |
code |= WindowInfo.PALETTE; |
|
76 |
profile = WindowInfo.TOOL_PROFILE; |
|
77 |
break; |
|
78 |
case AnnotationWindowManager.MODE_WINDOW: |
|
79 |
default: |
|
80 |
code |= WindowInfo.MODELESSDIALOG; |
|
81 |
profile = WindowInfo.EDITOR_PROFILE; |
|
82 |
} |
|
83 |
info = new WindowInfo(code); |
|
84 |
info.setTitle(title); |
|
85 |
info.setMinimumSize(dimension); |
|
86 |
} |
|
87 |
|
|
88 |
public WindowInfo getWindowInfo() { |
|
89 |
return info; |
|
90 |
} |
|
91 |
|
|
92 |
public Object getWindowProfile() { |
|
93 |
return profile; |
|
94 |
} |
|
95 |
} |
|
0 | 96 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/org.gvsig.annotation.app.extension/src/main/java/org/gvsig/annotation/app/extension/AddLayerFinishAction.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Prodevelop} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.annotation.app.extension; |
|
29 |
|
|
30 |
import javax.swing.JComponent; |
|
31 |
import javax.swing.JOptionPane; |
|
32 |
|
|
33 |
import org.gvsig.andami.PluginServices; |
|
34 |
import org.gvsig.andami.messages.NotificationManager; |
|
35 |
import org.gvsig.annotation.AnnotationCreationFinishAction; |
|
36 |
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel; |
|
37 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
38 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
39 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
40 |
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException; |
|
41 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
42 |
import org.gvsig.tools.locator.LocatorException; |
|
43 |
|
|
44 |
/** |
|
45 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
46 |
*/ |
|
47 |
public class AddLayerFinishAction implements AnnotationCreationFinishAction { |
|
48 |
private MapContext mapContext; |
|
49 |
|
|
50 |
public AddLayerFinishAction(MapContext mapContext) { |
|
51 |
this.mapContext = mapContext; |
|
52 |
} |
|
53 |
|
|
54 |
public void finished(FeatureStore featureStore) { |
|
55 |
int res = JOptionPane.showConfirmDialog((JComponent) PluginServices.getMDIManager() |
|
56 |
.getActiveWindow(), |
|
57 |
PluginServices.getText(this, |
|
58 |
"insertar_en_la_vista_la_capa_creada"), |
|
59 |
PluginServices.getText(this, "insertar_capa"), |
|
60 |
JOptionPane.YES_NO_OPTION); |
|
61 |
|
|
62 |
if (res == JOptionPane.YES_OPTION) { |
|
63 |
try { |
|
64 |
addShape(featureStore); |
|
65 |
} catch (LoadLayerException e) { |
|
66 |
NotificationManager.addError(e); |
|
67 |
} catch (LocatorException e) { |
|
68 |
NotificationManager.addError(e); |
|
69 |
} |
|
70 |
} |
|
71 |
} |
|
72 |
|
|
73 |
private void addShape(FeatureStore featureStore) throws LoadLayerException, LocatorException { |
|
74 |
FLayer layer = MapContextLocator.getMapContextManager().createLayer("Annotations", featureStore); |
|
75 |
mapContext.getLayers().addLayer(layer); |
|
76 |
} |
|
77 |
|
|
78 |
} |
|
79 |
|
|
0 | 80 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/org.gvsig.annotation.app.extension/src/main/java/org/gvsig/annotation/app/extension/AnnotationExtension.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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 |
*/ |
|
22 |
package org.gvsig.annotation.app.extension; |
|
23 |
|
|
24 |
import java.util.Locale; |
|
25 |
|
|
26 |
import org.gvsig.andami.IconThemeHelper; |
|
27 |
import org.gvsig.andami.PluginServices; |
|
28 |
import org.gvsig.andami.messages.NotificationManager; |
|
29 |
import org.gvsig.andami.plugins.Extension; |
|
30 |
import org.gvsig.annotation.AnnotationCreationService; |
|
31 |
import org.gvsig.annotation.AnnotationLocator; |
|
32 |
import org.gvsig.annotation.AnnotationManager; |
|
33 |
import org.gvsig.annotation.swing.AnnotationSwingLocator; |
|
34 |
import org.gvsig.annotation.swing.AnnotationSwingManager; |
|
35 |
import org.gvsig.annotation.swing.AnnotationWindowManager; |
|
36 |
import org.gvsig.annotation.swing.JAnnotationCreationServicePanel; |
|
37 |
import org.gvsig.app.ApplicationLocator; |
|
38 |
import org.gvsig.app.ApplicationManager; |
|
39 |
import org.gvsig.app.project.documents.view.ViewDocument; |
|
40 |
import org.gvsig.app.project.documents.view.ViewManager; |
|
41 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
42 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
43 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
44 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
45 |
import org.gvsig.i18n.Messages; |
|
46 |
import org.gvsig.tools.ToolsLocator; |
|
47 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
|
48 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
|
49 |
import org.gvsig.tools.service.ServiceException; |
|
50 |
|
|
51 |
/** |
|
52 |
* Andami extension to show Annotation in the application. |
|
53 |
* |
|
54 |
* @author gvSIG Team |
|
55 |
* @version $Id$ |
|
56 |
*/ |
|
57 |
public class AnnotationExtension extends Extension { |
|
58 |
private AnnotationManager manager; |
|
59 |
private AnnotationSwingManager swingManager; |
|
60 |
|
|
61 |
public void initialize() { |
|
62 |
ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager(); |
|
63 |
ExtensionPoint ep = extensionPoints.add("AplicationPreferences", ""); |
|
64 |
|
|
65 |
ep.append("AnnotationPreferencesPage", "", new AnnotationPreferencesPage()); |
|
66 |
|
|
67 |
IconThemeHelper.registerIcon("preferences", "annotation-preferences", this); |
|
68 |
|
|
69 |
if (!Messages.hasLocales()) { |
|
70 |
Messages.addLocale(Locale.getDefault()); |
|
71 |
} |
|
72 |
Messages.addResourceFamily("org.gvsig.annotation.app.extension.i18n.text", |
|
73 |
AnnotationExtension.class.getClassLoader(), |
|
74 |
AnnotationExtension.class.getClass().getName()); |
|
75 |
} |
|
76 |
|
|
77 |
@Override |
|
78 |
public void postInitialize() { |
|
79 |
super.postInitialize(); |
|
80 |
manager = AnnotationLocator.getManager(); |
|
81 |
// Asignamos el locator e iniciamos la instancia |
|
82 |
swingManager = AnnotationSwingLocator.getSwingManager(); |
|
83 |
|
|
84 |
swingManager.registerWindowManager(new GvSIGAnnotationWindowManager()); |
|
85 |
|
|
86 |
} |
|
87 |
|
|
88 |
private FLyrVect getCurrentLayer() { |
|
89 |
return this.getCurrentLayer(null); |
|
90 |
} |
|
91 |
|
|
92 |
private FLyrVect getCurrentLayer(MapContext mapContext) { |
|
93 |
FLyrVect layer = null; |
|
94 |
|
|
95 |
if( mapContext == null ) { |
|
96 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
97 |
|
|
98 |
ViewDocument view = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
99 |
if( view == null ) { |
|
100 |
return null; |
|
101 |
} |
|
102 |
mapContext = view.getMapContext(); |
|
103 |
} |
|
104 |
FLayer[] actives = mapContext.getLayers().getActives(); |
|
105 |
|
|
106 |
for (int i=0 ; i<actives.length ; i++){ |
|
107 |
if (actives[i] instanceof FLyrVect){ |
|
108 |
layer = (FLyrVect)actives[i]; |
|
109 |
break; |
|
110 |
} |
|
111 |
} |
|
112 |
return layer; |
|
113 |
} |
|
114 |
|
|
115 |
public void execute(String actionCommand) { |
|
116 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
117 |
|
|
118 |
ViewDocument view = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
119 |
if( view == null ) { |
|
120 |
return; |
|
121 |
} |
|
122 |
MapContext mapContext = view.getMapContext(); |
|
123 |
FLyrVect layer = getCurrentLayer(mapContext); |
|
124 |
if (layer == null){ |
|
125 |
return; |
|
126 |
} |
|
127 |
showAnnotation(manager, layer.getFeatureStore(), mapContext); |
|
128 |
} |
|
129 |
|
|
130 |
public void showAnnotation(AnnotationManager manager, FeatureStore featureStore, MapContext mapContext) { |
|
131 |
try { |
|
132 |
AnnotationCreationService service = |
|
133 |
(AnnotationCreationService) manager.getAnnotationCreationService(featureStore); |
|
134 |
service.setAnnotationCreationFinishAction(new AddLayerFinishAction(mapContext)); |
|
135 |
|
|
136 |
JAnnotationCreationServicePanel panel = |
|
137 |
swingManager.createAnnotation(service); |
|
138 |
swingManager.getWindowManager().showWindow(panel, "Annotation", |
|
139 |
AnnotationWindowManager.MODE_WINDOW); |
|
140 |
|
|
141 |
} catch (ServiceException e) { |
|
142 |
NotificationManager.addError(e); |
|
143 |
} |
|
144 |
} |
|
145 |
|
|
146 |
public boolean isEnabled() { |
|
147 |
FLayer layer = getCurrentLayer(); |
|
148 |
if( layer == null ) { |
|
149 |
return false; |
|
150 |
} |
|
151 |
return true; |
|
152 |
} |
|
153 |
|
|
154 |
public boolean isVisible() { |
|
155 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
156 |
|
|
157 |
ViewDocument view = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
158 |
if( view == null ) { |
|
159 |
return false; |
|
160 |
} |
|
161 |
return true; |
|
162 |
} |
|
163 |
} |
|
0 | 164 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/org.gvsig.annotation.app.extension/src/main/java/org/gvsig/annotation/app/extension/AnnotationPreferencesPage.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaciļæ½n Geogrļæ½fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ibļæ½ļæ½ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
|
|
42 |
package org.gvsig.annotation.app.extension; |
|
43 |
|
|
44 |
import java.awt.GridBagConstraints; |
|
45 |
import java.awt.Insets; |
|
46 |
|
|
47 |
import javax.swing.ImageIcon; |
|
48 |
import javax.swing.JLabel; |
|
49 |
import javax.swing.JPanel; |
|
50 |
import javax.swing.JTextField; |
|
51 |
|
|
52 |
import org.gvsig.andami.IconThemeHelper; |
|
53 |
import org.gvsig.andami.PluginServices; |
|
54 |
import org.gvsig.andami.preferences.AbstractPreferencePage; |
|
55 |
import org.gvsig.andami.preferences.StoreException; |
|
56 |
import org.gvsig.annotation.AnnotationLocator; |
|
57 |
import org.gvsig.annotation.AnnotationManager; |
|
58 |
import org.gvsig.annotation.swing.AnnotationSwingLocator; |
|
59 |
import org.gvsig.annotation.swing.JAnnotationPreferencesPanel; |
|
60 |
/** |
|
61 |
* Default configuration page. |
|
62 |
* <b><b> |
|
63 |
* Here the user can establish what settings wants to use by default annotations. |
|
64 |
* |
|
65 |
* |
|
66 |
* @author Vicente Caballero Navarro |
|
67 |
*/ |
|
68 |
public class AnnotationPreferencesPage extends AbstractPreferencePage { |
|
69 |
/** |
|
70 |
* |
|
71 |
*/ |
|
72 |
private static final long serialVersionUID = -472617080926223575L; |
|
73 |
protected String id; |
|
74 |
//private ImageIcon icon; |
|
75 |
private JTextField txtDefaultText; |
|
76 |
// private JComboBox cmbDefaultTypeFont; |
|
77 |
// private JComboBox cmbDefaultStyleFont; |
|
78 |
// private JTextField txtDefaultRotate; |
|
79 |
// private JTextField txtDefaultHeight; |
|
80 |
// private ColorChooserPanel jccDefaultColor; |
|
81 |
private JAnnotationPreferencesPanel panel = null; |
|
82 |
|
|
83 |
private AnnotationManager annotationManager = null; |
|
84 |
|
|
85 |
|
|
86 |
/** |
|
87 |
* Creates a new panel containing View preferences settings. |
|
88 |
* |
|
89 |
*/ |
|
90 |
public AnnotationPreferencesPage() { |
|
91 |
super(); |
|
92 |
id = this.getClass().getName(); |
|
93 |
this.annotationManager = AnnotationLocator.getManager(); |
|
94 |
} |
|
95 |
|
|
96 |
public void initializeValues() { |
|
97 |
getPanel(); // init UI |
|
98 |
} |
|
99 |
|
|
100 |
public String getID() { |
|
101 |
return id; |
|
102 |
} |
|
103 |
|
|
104 |
public String getTitle() { |
|
105 |
return PluginServices.getText(this, "annotation_preferences"); |
|
106 |
} |
|
107 |
|
|
108 |
public JPanel getPanel() { |
|
109 |
if (panel==null) { |
|
110 |
addComponent(new JLabel(PluginServices.getText(this,"text")), |
|
111 |
txtDefaultText = new JTextField(), GridBagConstraints.BOTH, new Insets(4,0,4,8)); |
|
112 |
panel = AnnotationSwingLocator.getSwingManager().createAnnotationPreferences(); |
|
113 |
addComponent(panel); |
|
114 |
} |
|
115 |
return this; |
|
116 |
} |
|
117 |
|
|
118 |
public void storeValues() throws StoreException { |
|
119 |
annotationManager.setDefaultFontColor(panel.getDefaultFontColor()); |
|
120 |
annotationManager.setDefaultTextValue(txtDefaultText.getText()); |
|
121 |
annotationManager.setDefaultFontType(panel.getDefaultFontType()); |
|
122 |
annotationManager.setDefaultFontStyle(panel.getDefaultFontStyle()); |
|
123 |
annotationManager.setDefaultFontHeight(panel.getDefaultFontHeight()); |
|
124 |
annotationManager.setDefaultFontRotation(panel.getDefaultFontRotation()); |
|
125 |
} |
|
126 |
|
|
127 |
|
|
128 |
public void initializeDefaults() { |
|
129 |
txtDefaultText.setText(annotationManager.getDefaultTextValue()); |
|
130 |
panel.setDefaultFontType(annotationManager.getDefaultFontType()); |
|
131 |
panel.setDefaultFontStyle(annotationManager.getDefaultFontStyle()); |
|
132 |
panel.setDefaultFontHeight(annotationManager.getDefaultFontHeight()); |
|
133 |
panel.setDefaultFontColor(annotationManager.getDefaultFontColor()); |
|
134 |
panel.setDefaultFontRotation(annotationManager.getDefaultFontRotation()); |
|
135 |
} |
|
136 |
|
|
137 |
public ImageIcon getIcon() { |
|
138 |
return IconThemeHelper.getImageIcon("annotation-preferences"); |
|
139 |
} |
|
140 |
|
|
141 |
public boolean isValueChanged() { |
|
142 |
return super.hasChanged(); |
|
143 |
} |
|
144 |
|
|
145 |
public void setChangesApplied() { |
|
146 |
setChanged(false); |
|
147 |
} |
|
148 |
} |
|
0 | 149 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/org.gvsig.annotation.app.extension/src/main/java/org/gvsig/annotation/app/extension/GvSIGAnnotationWindowManager.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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 |
*/ |
|
22 |
package org.gvsig.annotation.app.extension; |
|
23 |
|
|
24 |
import java.awt.Component; |
|
25 |
import java.awt.event.ComponentEvent; |
|
26 |
import java.awt.event.ComponentListener; |
|
27 |
|
|
28 |
import javax.swing.JOptionPane; |
|
29 |
|
|
30 |
import org.gvsig.andami.PluginServices; |
|
31 |
import org.gvsig.annotation.swing.AnnotationWindowManager; |
|
32 |
import org.gvsig.annotation.swing.AnnotationWizardPanelActionListener; |
|
33 |
import org.gvsig.annotation.swing.JAnnotationCreationServicePanel; |
|
34 |
import org.gvsig.annotation.swing.JAnnotationPreferencesPanel; |
|
35 |
|
|
36 |
/** |
|
37 |
* {@link AnnotationWindowManager} implementation to show Annotation |
|
38 |
* windows as gvSIG windows |
|
39 |
* |
|
40 |
* @author gvSIG Team |
|
41 |
* @version $Id$ |
|
42 |
*/ |
|
43 |
public class GvSIGAnnotationWindowManager implements AnnotationWindowManager, ComponentListener { |
|
44 |
|
|
45 |
public void showWindow(JAnnotationCreationServicePanel panel, String title, int mode) { |
|
46 |
AnnotationWindow window = |
|
47 |
new AnnotationWindow(panel, title, mode); |
|
48 |
|
|
49 |
panel.setAnnotationServicePanelActionListener(new AnnotationWizardListener(window)); |
|
50 |
|
|
51 |
window.addComponentListener(this); |
|
52 |
|
|
53 |
PluginServices.getMDIManager().addCentredWindow(window); |
|
54 |
} |
|
55 |
|
|
56 |
public void componentHidden(ComponentEvent componentEvent) { |
|
57 |
AnnotationWindow window = |
|
58 |
(AnnotationWindow) componentEvent.getSource(); |
|
59 |
if (window.isVisible()){ |
|
60 |
PluginServices.getMDIManager().closeWindow(window); |
|
61 |
} |
|
62 |
} |
|
63 |
|
|
64 |
public void componentMoved(ComponentEvent e) { |
|
65 |
// Nothing to do |
|
66 |
} |
|
67 |
|
|
68 |
public void componentResized(ComponentEvent e) { |
|
69 |
// Nothing to do |
|
70 |
} |
|
71 |
|
|
72 |
public void componentShown(ComponentEvent e) { |
|
73 |
// Nothing to do |
|
74 |
} |
|
75 |
|
|
76 |
public class AnnotationWizardListener implements AnnotationWizardPanelActionListener{ |
|
77 |
private AnnotationWindow annotationWindow = null; |
|
78 |
|
|
79 |
public AnnotationWizardListener(AnnotationWindow annotationWindow) { |
|
80 |
super(); |
|
81 |
this.annotationWindow = annotationWindow; |
|
82 |
} |
|
83 |
|
|
84 |
public void cancel( |
|
85 |
JAnnotationCreationServicePanel annotationCreationServicePanel) { |
|
86 |
if (annotationWindow.isVisible()){ |
|
87 |
PluginServices.getMDIManager().closeWindow(annotationWindow); |
|
88 |
} |
|
89 |
} |
|
90 |
|
|
91 |
public void finish( |
|
92 |
JAnnotationCreationServicePanel annotationCreationServicePanel) { |
|
93 |
if (annotationWindow.isVisible()){ |
|
94 |
PluginServices.getMDIManager().closeWindow(annotationWindow); |
|
95 |
} |
|
96 |
} |
|
97 |
} |
|
98 |
|
|
99 |
|
|
100 |
public boolean showFileExistsPopup(String title, String text) { |
|
101 |
int resp = JOptionPane.showConfirmDialog( |
|
102 |
(Component)PluginServices.getMainFrame(), text, |
|
103 |
title, JOptionPane.YES_NO_OPTION); |
|
104 |
if (resp == JOptionPane.YES_OPTION) { |
|
105 |
return true; |
|
106 |
} |
|
107 |
return false; |
|
108 |
} |
|
109 |
|
|
110 |
public void showPreferencesWindow(JAnnotationPreferencesPanel panel, |
|
111 |
String title, int mode) { |
|
112 |
// TODO Auto-generated method stub |
|
113 |
|
|
114 |
} |
|
115 |
} |
|
0 | 116 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/org.gvsig.annotation.app.extension/src/main/resources/config.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<plugin-config> |
|
3 |
<depends plugin-name="org.gvsig.app" /> |
|
4 |
<depends plugin-name="org.gvsig.editing" /> |
|
5 |
<depends plugin-name="org.gvsig.app.document.table.app.mainplugin" /> |
|
6 |
<resourceBundle name="text"/> |
|
7 |
<libraries library-dir="lib"/> |
|
8 |
<extensions> |
|
9 |
<extension class-name="org.gvsig.annotation.app.extension.AnnotationExtension" |
|
10 |
description="" |
|
11 |
active="true" |
|
12 |
priority="1"> |
|
13 |
<menu text="Layer/export_to_annotation" |
|
14 |
position="600550000" |
|
15 |
action-command="Annotation"/> |
|
16 |
</extension> |
|
17 |
<extension class-name="org.gvsig.annotation.app.extension.AnnotationAboutExtension" |
|
18 |
description="" |
|
19 |
active="true" |
|
20 |
priority="1"> |
|
21 |
</extension> |
|
22 |
</extensions> |
|
23 |
</plugin-config> |
|
0 | 24 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/org.gvsig.annotation.app.extension/src/main/resources/org/gvsig/annotation/app/extension/i18n/text.properties | ||
---|---|---|
1 |
# Resource bundle texts for the Spanish language locale (es) |
|
2 |
export_to_annotation=Exportar a anotaciones |
|
0 | 3 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/org.gvsig.annotation.app.extension/src/main/resources/org/gvsig/annotation/app/extension/i18n/text_en.properties | ||
---|---|---|
1 |
# Resource bundle texts for the English language locale (en) |
|
2 |
export_to_annotation=Export to anotation |
|
3 |
|
|
0 | 4 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/org.gvsig.annotation.app.extension/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
4 |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<artifactId>org.gvsig.annotation.app.extension</artifactId> |
|
7 |
<packaging>jar</packaging> |
|
8 |
<name>Tools: Export to annotation</name> |
|
9 |
<parent> |
|
10 |
<groupId>org.gvsig</groupId> |
|
11 |
<artifactId>org.gvsig.annotation.app</artifactId> |
|
12 |
<version>1.0.0-SNAPSHOT</version> |
|
13 |
</parent> |
|
14 |
|
|
15 |
<dependencies> |
|
16 |
<dependency> |
|
17 |
<groupId>org.gvsig</groupId> |
|
18 |
<artifactId>org.gvsig.andami</artifactId> |
|
19 |
<scope>compile</scope> |
|
20 |
</dependency> |
|
21 |
<dependency> |
|
22 |
<groupId>org.gvsig</groupId> |
|
23 |
<artifactId>org.gvsig.i18n</artifactId> |
|
24 |
<scope>compile</scope> |
|
25 |
</dependency> |
|
26 |
<dependency> |
|
27 |
<groupId>org.gvsig</groupId> |
|
28 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
29 |
<scope>compile</scope> |
|
30 |
</dependency> |
|
31 |
<dependency> |
|
32 |
<groupId>org.gvsig</groupId> |
|
33 |
<artifactId>org.gvsig.annotation.lib.api</artifactId> |
|
34 |
<scope>compile</scope> |
|
35 |
</dependency> |
|
36 |
<dependency> |
|
37 |
<groupId>org.gvsig</groupId> |
|
38 |
<artifactId>org.gvsig.annotation.swing.api</artifactId> |
|
39 |
<scope>compile</scope> |
|
40 |
</dependency> |
|
41 |
<dependency> |
|
42 |
<groupId>org.gvsig</groupId> |
|
43 |
<artifactId>org.gvsig.annotation.lib.impl</artifactId> |
|
44 |
<scope>compile</scope> |
|
45 |
</dependency> |
|
46 |
<dependency> |
|
47 |
<groupId>org.gvsig</groupId> |
|
48 |
<artifactId>org.gvsig.annotation.swing.impl</artifactId> |
|
49 |
<scope>compile</scope> |
|
50 |
</dependency> |
|
51 |
<dependency> |
|
52 |
<groupId>org.gvsig</groupId> |
|
53 |
<artifactId>org.gvsig.fmap.dal</artifactId> |
|
54 |
<scope>compile</scope> |
|
55 |
</dependency> |
|
56 |
<dependency> |
|
57 |
<groupId>org.gvsig</groupId> |
|
58 |
<artifactId>org.gvsig.fmap.mapcontext</artifactId> |
|
59 |
<scope>compile</scope> |
|
60 |
</dependency> |
|
61 |
<dependency> |
|
62 |
<groupId>org.gvsig</groupId> |
|
63 |
<artifactId>org.gvsig.utils</artifactId> |
|
64 |
<scope>compile</scope> |
|
65 |
</dependency> |
|
66 |
<dependency> |
|
67 |
<groupId>org.gvsig</groupId> |
|
68 |
<artifactId>org.gvsig.app</artifactId> |
|
69 |
<version>2.0-SNAPSHOT</version> |
|
70 |
<scope>compile</scope> |
|
71 |
</dependency> |
|
72 |
<dependency> |
|
73 |
<groupId>org.gvsig</groupId> |
|
74 |
<artifactId>org.gvsig.app.document.table.app.mainplugin</artifactId> |
|
75 |
<version>2.0.0-SNAPSHOT</version> |
|
76 |
<scope>compile</scope> |
|
77 |
</dependency> |
|
78 |
<dependency> |
|
79 |
<groupId>org.gvsig</groupId> |
|
80 |
<artifactId>org.gvsig.ui</artifactId> |
|
81 |
<scope>compile</scope> |
|
82 |
</dependency> |
|
83 |
<dependency> |
|
84 |
<groupId>org.gvsig</groupId> |
|
85 |
<artifactId>org.gvsig.metadata.lib.basic.api</artifactId> |
|
86 |
<scope>compile</scope> |
|
87 |
</dependency> |
|
88 |
<dependency> |
|
89 |
<groupId>org.gvsig</groupId> |
|
90 |
<artifactId>org.gvsig.fmap.control</artifactId> |
|
91 |
<scope>compile</scope> |
|
92 |
</dependency> |
|
93 |
</dependencies> |
|
94 |
<profiles> |
|
95 |
<profile> |
|
96 |
<id>gvsig-install</id> |
|
97 |
<activation> |
|
98 |
<activeByDefault>true</activeByDefault> |
|
99 |
</activation> |
|
100 |
<properties> |
|
101 |
<!-- |
|
102 |
Default gvSIG installation folder relative to the current workspace |
|
103 |
--> |
|
104 |
<gvsig.install.dir>${basedir}/../../build/product</gvsig.install.dir> |
|
105 |
</properties> |
|
106 |
</profile> |
|
107 |
</profiles> |
|
108 |
<properties> |
|
109 |
<package.info.dependencies>required: org.gvsig.app.document.table.app.mainplugin -ge 2</package.info.dependencies> |
|
110 |
<package.info.categories>View,Vector</package.info.categories> |
|
111 |
</properties> |
|
112 |
</project> |
|
0 | 113 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/org.gvsig.annotation.app.extension/distribution/distribution.xml | ||
---|---|---|
1 |
<assembly> |
|
2 |
<id>distribution</id> |
|
3 |
<formats> |
|
4 |
<format>dir</format> |
|
5 |
</formats> |
|
6 |
<fileSets> |
|
7 |
<!-- Estructure for the extension --> |
|
8 |
<fileSet> |
|
9 |
<directory>src/main/resources</directory> |
|
10 |
<outputDirectory>${extension.install.dir.name} |
|
11 |
</outputDirectory> |
|
12 |
</fileSet> |
|
13 |
</fileSets> |
|
14 |
<files> |
|
15 |
<file> |
|
16 |
<source>package.info</source> |
|
17 |
<outputDirectory>${extension.install.dir.name} |
|
18 |
</outputDirectory> |
|
19 |
</file> |
|
20 |
</files> |
|
21 |
<dependencySets> |
|
22 |
<dependencySet> |
|
23 |
<outputDirectory>${extension.install.dir.name}/${library-dir} |
|
24 |
</outputDirectory> |
|
25 |
<includes> |
|
26 |
<include>org.gvsig:org.gvsig.annotation.app.extension</include> |
|
27 |
<include>org.gvsig:org.gvsig.annotation.lib.api</include> |
|
28 |
<include>org.gvsig:org.gvsig.annotation.swing.api</include> |
|
29 |
<include>org.gvsig:org.gvsig.annotation.lib.impl</include> |
|
30 |
<include>org.gvsig:org.gvsig.annotation.swing.impl</include> |
|
31 |
</includes> |
|
32 |
</dependencySet> |
|
33 |
</dependencySets> |
|
34 |
</assembly> |
|
0 | 35 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/prepare-workspace.xml | ||
---|---|---|
1 |
<project name="org.gvsig.initial.build" default="prepare-workspace"> |
|
2 |
|
|
3 |
<dirname property="org.gvsig.initial.build.basedir" file="${ant.file.org.gvsig.initial.build}" /> |
|
4 |
|
|
5 |
<property name="workspace.basedir" value="${org.gvsig.initial.build.basedir}/.." /> |
|
6 |
<property name="build.basedir" value="${workspace.basedir}/org.gvsig.maven.base.build" description="Eclipse workspace location" /> |
|
7 |
<property name="build.jar.version" value="1.0.8-SNAPSHOT" /> |
|
8 |
<property name="build.jar.file" value="org.gvsig.maven.base.build-${build.jar.version}.jar" /> |
|
9 |
|
|
10 |
<property name="ant.libs.dir" location="${build.basedir}" description="Additional ant tasks libs folder" /> |
|
11 |
|
|
12 |
<target name="check-maven-base-build-available"> |
|
13 |
<available file="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" property="maven-base-build-available" /> |
|
14 |
</target> |
|
15 |
|
|
16 |
<target name="get-maven-base-build-local" depends="check-maven-base-build-available" if="maven-base-build-available"> |
|
17 |
<!-- Unzip de build jar file from the maven repository into the workspace root folder --> |
|
18 |
<copy todir="${workspace.basedir}" preservelastmodified="false" filtering="false"> |
|
19 |
<zipfileset src="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}"> |
|
20 |
<patternset> |
|
21 |
<exclude name="META-INF/**" /> |
|
22 |
</patternset> |
|
23 |
</zipfileset> |
|
24 |
</copy> |
|
25 |
</target> |
|
26 |
|
|
27 |
<target name="get-maven-base-build-remote" depends="check-maven-base-build-available" unless="maven-base-build-available"> |
|
28 |
<mkdir dir="target" /> |
|
29 |
|
|
30 |
<!-- Download the build jar file --> |
|
31 |
<get src="http://devel.gvsig.org/m2repo/j2se/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" dest="target/${build.jar.file}" verbose="true" /> |
|
32 |
|
|
33 |
<!-- Unzip de build jar file into the workspace root folder --> |
|
34 |
<copy todir="${workspace.basedir}" preservelastmodified="false" filtering="false"> |
|
35 |
<zipfileset src="target/${build.jar.file}"> |
|
36 |
<patternset> |
|
37 |
<exclude name="META-INF/**" /> |
|
38 |
</patternset> |
|
39 |
</zipfileset> |
|
40 |
</copy> |
|
41 |
|
|
42 |
</target> |
|
43 |
|
|
44 |
<target name="find.depends.natives.file"> |
|
45 |
<condition property="depends.natives.file.exists"> |
|
46 |
<available file="${org.gvsig.initial.build.basedir}/DEPENDS_ON_NATIVE_LIBRARIES"/> |
|
47 |
</condition> |
|
48 |
</target> |
|
49 |
|
|
50 |
<target name="find.gvsig.platform.properties.file" |
|
51 |
depends="find.depends.natives.file" |
|
52 |
if="depends.natives.file.exists"> |
|
53 |
<condition property="gvsig.platform.exists"> |
|
54 |
<available file="${user.home}/.gvsig.platform.properties"/> |
|
55 |
</condition> |
|
56 |
</target> |
|
57 |
|
|
58 |
<target name="check.gvsig.platform.properties" |
|
59 |
depends="find.gvsig.platform.properties.file"> |
|
60 |
<fail if="depends.natives.file.exists" unless="gvsig.platform.exists"> |
|
61 |
ERROR!! |
|
62 |
|
|
63 |
You have to define your gvSIG platform properties, |
|
64 |
by creating the file: ${user.home}/.gvsig.platform.properties |
|
65 |
with the following content: |
|
66 |
|
|
67 |
native_platform=linux |
|
68 |
native_distribution=all |
|
69 |
native_compiler=gcc4 |
|
70 |
native_arch=i386 |
|
71 |
native_libraryType=dynamic |
|
72 |
export native_classifier=${native_platform}-${native_distribution}-${native_compiler}-${native_arch}-${native_libraryType} |
|
73 |
|
|
74 |
Replace the fifth initial variables values with the ones appropiate |
|
75 |
to your platform. |
|
76 |
|
|
77 |
If you use maven in the command line, you can use the previous file also |
|
78 |
to define the MAVEN_OPTS environment variable, by adding to your |
|
79 |
.bash_rc file something like this: |
|
80 |
|
|
81 |
if [ -f "${HOME}/.gvsig.platform.properties" ] |
|
82 |
then |
|
83 |
. ${HOME}/.gvsig.platform.properties |
|
84 |
export MAVEN_OPTS="-Xmx256M -XX:MaxPermSize=64m -Dnative-classifier=${native_classifier}" |
|
85 |
else |
|
86 |
export MAVEN_OPTS="-Xmx256M -XX:MaxPermSize=64m" |
|
87 |
fi |
|
88 |
|
|
89 |
It will work if you use the bash shell. In any other case or platform, you'll |
|
90 |
have to define your MAVEN_OPTS environment variable and set the |
|
91 |
"native-classifier" parameter directly. |
|
92 |
</fail> |
|
93 |
|
|
94 |
</target> |
|
95 |
|
|
96 |
<target name="prepare-workspace" depends="get-maven-base-build-local,get-maven-base-build-remote,check.gvsig.platform.properties"> |
|
97 |
|
|
98 |
<mkdir dir="target" /> |
|
99 |
|
|
100 |
<chmod dir="${build.basedir}/maven/bin" perm="u+x" includes="m2,mvn,mvnDebug" /> |
|
101 |
|
|
102 |
<!-- Copy the maven launchers to the workspace metadata folder --> |
|
103 |
<copy todir="${workspace.basedir}/.metadata"> |
|
104 |
<fileset dir="${build.basedir}/eclipse-launchers"> |
|
105 |
<exclude name="**/org.eclipse.jdt.core.prefs" /> |
|
106 |
<exclude name="**/org.eclipse.core.variables.prefs" /> |
|
107 |
</fileset> |
|
108 |
</copy> |
|
109 |
|
|
110 |
<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" append="true"> |
|
111 |
<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.jdt.core.prefs" /> |
|
112 |
</concat> |
|
113 |
<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" append="true"> |
|
114 |
<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.core.variables.prefs" /> |
|
115 |
</concat> |
|
116 |
|
|
117 |
<!-- Configure the eclipse workspace --> |
|
118 |
<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-configure-eclipse-workspace" /> |
|
119 |
|
|
120 |
<!-- Configure the gvSIG profile --> |
|
121 |
<ant antfile="${build.basedir}/check-gvsig-profile.xml" /> |
|
122 |
|
|
123 |
<property name="user-settings-file-location" value="${user.home}/.m2/settings.xml" /> |
|
124 |
|
|
125 |
<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask"> |
|
126 |
<classpath> |
|
127 |
<pathelement location="${ant.libs.dir}/com.oopsconsultancy.xmltask-1.16.1.jar" /> |
|
128 |
</classpath> |
|
129 |
</taskdef> |
|
130 |
|
|
131 |
<xmltask source="${user-settings-file-location}" dest="${user-settings-file-location}"> |
|
132 |
<copy path="//:settings/:profiles/:profile[:id/text() = 'gvsig-install']/:properties/:gvsig.install.dir/text()" property="current-gvsig-location" /> |
|
133 |
</xmltask> |
|
134 |
|
|
135 |
<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" /> |
|
136 |
<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" /> |
|
137 |
|
|
138 |
<!-- Compile, install and generate eclipse projects --> |
|
139 |
<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-install-and-eclipse-eclipse" /> |
|
140 |
|
|
141 |
<echo>INFORMATION!!!</echo> |
|
142 |
<echo>Restart eclipse and then proceed to import the subprojects contained into the main project</echo> |
|
143 |
|
|
144 |
<!-- TODO: copiar al proyecto de configuraciĆ³n general --> |
|
145 |
</target> |
|
146 |
|
|
147 |
<target name="clean"> |
|
148 |
<delete dir="target" /> |
|
149 |
</target> |
|
150 |
|
|
151 |
</project> |
|
0 | 152 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
4 |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<artifactId>org.gvsig.annotation.app</artifactId> |
|
7 |
<packaging>pom</packaging> |
|
8 |
<version>1.0.0-SNAPSHOT</version> |
|
9 |
<name>org.gvsig.annotation.app</name> |
|
10 |
<description>Anotation layer support: |
|
11 |
- Create anotation layer |
|
12 |
- Modify annotation layer (throught standard editing) |
|
13 |
- Editing single labelling (position and label settings) |
|
14 |
</description> |
|
15 |
<parent> |
|
16 |
<groupId>org.gvsig</groupId> |
|
17 |
<artifactId>org.gvsig.maven.base.extension.pom</artifactId> |
|
18 |
<version>1.0.8-SNAPSHOT</version> |
|
19 |
</parent> |
|
20 |
|
|
21 |
<scm> |
|
22 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-desktop/branches/v2_0_0_prep/extensions/org.gvsig.annotation.app</connection> |
|
23 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-desktop/branches/v2_0_0_prep/extensions/org.gvsig.annotation.app</developerConnection> |
|
24 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-desktop/repository/show/branches/v2_0_0_prep/extensions/org.gvsig.annotation.app</url> |
|
25 |
</scm> |
|
26 |
|
|
27 |
<developers> |
|
28 |
<developer> |
|
29 |
<id>jjdelcerro</id> |
|
30 |
<name>Joaqu?n Jos? del Cerro</name> |
|
31 |
<email>jjdelcerro@gvsig.org</email> |
|
32 |
<roles> |
|
33 |
<role>Architect</role> |
|
34 |
<role>Developer</role> |
|
35 |
</roles> |
|
36 |
</developer> |
|
37 |
<developer> |
|
38 |
<id>jbadia</id> |
|
39 |
<name>Jos? Bad?a</name> |
|
40 |
<email>badia_jos@gva.es</email> |
|
41 |
<roles> |
|
42 |
<role>Developer</role> |
|
43 |
</roles> |
|
44 |
</developer> |
|
45 |
<developer> |
|
46 |
<id>cordinyana</id> |
|
47 |
<name>C?sar Ordi?ana</name> |
|
48 |
<email>cordinyana@gvsig.com</email> |
|
49 |
<roles> |
|
50 |
<role>Architect</role> |
|
51 |
<role>Developer</role> |
|
52 |
</roles> |
|
53 |
</developer> |
|
54 |
</developers> |
|
55 |
<repositories> |
|
56 |
<repository> |
|
57 |
<id>gvsig-public-http-repository</id> |
|
58 |
<name>gvSIG maven public HTTP repository</name> |
|
59 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
60 |
<releases> |
|
61 |
<enabled>true</enabled> |
|
62 |
<updatePolicy>daily</updatePolicy> |
|
63 |
<checksumPolicy>warn</checksumPolicy> |
|
64 |
</releases> |
|
65 |
<snapshots> |
|
66 |
<enabled>true</enabled> |
|
67 |
<updatePolicy>daily</updatePolicy> |
|
68 |
<checksumPolicy>warn</checksumPolicy> |
|
69 |
</snapshots> |
|
70 |
</repository> |
|
71 |
</repositories> |
|
72 |
<dependencyManagement> |
|
73 |
<dependencies> |
|
74 |
<dependency> |
|
75 |
<groupId>org.gvsig</groupId> |
|
76 |
<artifactId>org.gvsig.core.maven.dependencies</artifactId> |
|
77 |
<version>2.0.1-SNAPSHOT</version> |
|
78 |
<type>pom</type> |
|
79 |
<scope>import</scope> |
|
80 |
</dependency> |
|
81 |
<dependency> |
|
82 |
<groupId>org.gvsig</groupId> |
|
83 |
<artifactId>org.gvsig.annotation.lib.api</artifactId> |
|
84 |
<version>1.0.0-SNAPSHOT</version> |
|
85 |
<scope>compile</scope> |
|
86 |
</dependency> |
|
87 |
<dependency> |
|
88 |
<groupId>org.gvsig</groupId> |
|
89 |
<artifactId>org.gvsig.annotation.lib.impl</artifactId> |
|
90 |
<version>1.0.0-SNAPSHOT</version> |
|
91 |
<scope>runtime</scope> |
|
92 |
</dependency> |
|
93 |
<dependency> |
|
94 |
<groupId>org.gvsig</groupId> |
|
95 |
<artifactId>org.gvsig.annotation.swing.api</artifactId> |
|
96 |
<version>1.0.0-SNAPSHOT</version> |
|
97 |
<scope>compile</scope> |
|
98 |
</dependency> |
|
99 |
<dependency> |
|
100 |
<groupId>org.gvsig</groupId> |
|
101 |
<artifactId>org.gvsig.annotation.swing.impl</artifactId> |
|
102 |
<version>1.0.0-SNAPSHOT</version> |
|
103 |
<scope>runtime</scope> |
|
104 |
</dependency> |
|
105 |
</dependencies> |
|
106 |
</dependencyManagement> |
|
107 |
|
|
108 |
<modules> |
|
109 |
<module>org.gvsig.annotation.app.extension</module> |
|
110 |
</modules> |
|
111 |
<properties> |
|
112 |
<package.info.state>testing</package.info.state> |
|
113 |
<!-- alpha-devel --> |
|
114 |
</properties> |
|
115 |
</project> |
|
0 | 116 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/README.txt | ||
---|---|---|
1 |
The first time you checkout the current project to a new workspace, |
|
2 |
you have to prepare it to be able to work easily with maven from |
|
3 |
eclipse itself. |
|
4 |
|
|
5 |
Perform the following steps: |
|
6 |
|
|
7 |
1.- Launch the *prepare-workspace.xml* ant build file. |
|
8 |
You can do it by loading the file into the ant view, |
|
9 |
and running the default task, or right-clicking the |
|
10 |
file from the package explorer or the navigator and |
|
11 |
select the option: *Run as > Ant build*. |
|
12 |
|
|
13 |
2.- Restart eclipse. |
|
14 |
|
|
15 |
3.- Import the subprojects of the project you have just checked out. |
|
16 |
|
|
17 |
Those steps are only needed once per workspace. |
|
18 |
|
|
0 | 19 |
tags/v2_0_0_Build_2061/extensions/org.gvsig.annotation.app/distribution/distribution.xml | ||
---|---|---|
1 |
<assembly> |
|
2 |
</assembly> |
|
0 | 3 |
Also available in: Unified diff