Revision 27245

View differences:

branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/InitializeApplicationExtension.java
21 21
import org.gvsig.fmap.dal.store.shp.SHPLibrary;
22 22
import org.gvsig.fmap.geom.GeometryLibrary;
23 23
import org.gvsig.fmap.geom.impl.DefaultGeometryLibrary;
24
import org.gvsig.fmap.geom.operation.MapContextGeomOperationsLibrary;
24 25
import org.gvsig.fmap.mapcontext.MapContextLibrary;
25 26
import org.gvsig.tools.ToolsLibrary;
26 27
import org.gvsig.tools.ToolsLocator;
......
49 50
	private SHPLibrary shp;
50 51

  
51 52
	private MapContextLibrary mapContextLibrary;
53
	private MapContextGeomOperationsLibrary mapContextGeomOperationLibrary;
52 54

  
53 55

  
54 56
	private JTSIndexLibrary jtsIndex;
......
122 124
		gt2Index = new Gt2IndexLibrary();
123 125
		gt2Index.initialize();
124 126

  
125
		// Mapcontext library
127
		// MapContext library
126 128
		mapContextLibrary = new MapContextLibrary();
127 129
		mapContextLibrary.initialize();
128 130

  
131
		// MapContext Geomerty operations library
132
		mapContextGeomOperationLibrary = new MapContextGeomOperationsLibrary();
133
		mapContextGeomOperationLibrary.initialize();
134

  
129 135
		// appGvSIG library
130 136
		appGvSigLibrary = new AppGvSigLibrary();
131 137
		appGvSigLibrary.initialize();
......
156 162
		gt2Index.postInitialize();
157 163

  
158 164
		mapContextLibrary.postInitialize();
165
		mapContextGeomOperationLibrary.postInitialize();
159 166

  
160 167
		appGvSigLibrary.postInitialize();
161 168

  
branches/v2_0_0_prep/applications/appgvSIG/.classpath
8 8
	<classpathentry kind="lib" path="lib/batik-util.jar"/>
9 9
	<classpathentry kind="lib" path="lib/org.gvsig.raster.jar"/>
10 10
	<classpathentry kind="lib" path="lib/org.gvsig.fmap.geometry-impl.jar"/>
11
	<classpathentry kind="lib" path="lib/org.gvsig.fmap.mapcontext.operation.jar"/>
11 12
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
12 13
	<classpathentry kind="lib" path="lib/pdf-transcoder.jar"/>
13 14
	<classpathentry kind="lib" path="/_fwAndami/lib/castor-0.9.5.3-xml.jar"/>
branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/MapContextLibrary.java
32 32

  
33 33
import org.gvsig.fmap.dal.DataTypes;
34 34
import org.gvsig.fmap.dal.feature.FeatureStore;
35
import org.gvsig.fmap.geom.GeometryLibrary;
35 36
import org.gvsig.fmap.mapcontext.layers.FLayer;
36 37
import org.gvsig.fmap.mapcontext.layers.LayerFactory;
37 38
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
......
49 50
 */
50 51
public class MapContextLibrary extends BaseLibrary {
51 52

  
53
	private ToolsLibrary toolsLib;
54
	private GeometryLibrary geomLibrary;
55

  
52 56
	public void initialize() throws ReferenceNotRegisteredException {
53 57
		super.initialize();
54
		ToolsLibrary toolsLib = new ToolsLibrary();
58
		toolsLib = new ToolsLibrary();
55 59

  
56 60
		toolsLib.initialize();
61

  
62
		geomLibrary = new GeometryLibrary();
63

  
64
		geomLibrary.initialize();
65

  
66

  
67
		LayerFactory.getInstance().registerLayerToUseForStore(
68
				FeatureStore.class, FLyrVect.class);
69

  
70
	}
71

  
72
	public void postInitialize() throws ReferenceNotRegisteredException {
73
		super.postInitialize();
74

  
57 75
		toolsLib.postInitialize();
76
		geomLibrary.postInitialize();
58 77

  
78

  
59 79
		DynObjectManager dynManager = ToolsLocator.getDynObjectManager();
60 80

  
61 81
		DynField field;
......
70 90
			field.setType(DataTypes.SRS);
71 91
		}
72 92

  
73
		LayerFactory.getInstance().registerLayerToUseForStore(
74
				FeatureStore.class, FLyrVect.class);
75

  
93
		toolsLib.postInitialize();
76 94
	}
77 95

  
78 96
}
branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/geom/operation/AggregateDrawInts.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
* 2009 IVER T.I   {{Task}}
26
*/
27

  
28
/**
29
 *
30
 */
31
package org.gvsig.fmap.geom.operation;
32

  
33
import org.gvsig.fmap.geom.Geometry;
34
import org.gvsig.fmap.geom.GeometryLocator;
35
import org.gvsig.fmap.geom.GeometryManager;
36
import org.gvsig.fmap.geom.Geometry.TYPES;
37
import org.gvsig.fmap.geom.aggregate.Aggregate;
38
import org.slf4j.Logger;
39
import org.slf4j.LoggerFactory;
40

  
41
/**
42
 * @author jmvivo
43
 *
44
 */
45
public class AggregateDrawInts extends GeometryOperation {
46
	final static private Logger logger = LoggerFactory
47
			.getLogger(DrawInts.class);
48

  
49
	public static final int CODE = GeometryLocator.getGeometryManager()
50
			.registerGeometryOperation("drawInts", new AggregateDrawInts(),
51
					TYPES.AGGREGATE);
52

  
53

  
54
	/* (non-Javadoc)
55
	 * @see org.gvsig.fmap.geom.operation.GeometryOperation#getOperationIndex()
56
	 */
57
	@Override
58
	public int getOperationIndex() {
59
		return CODE;
60
	}
61

  
62
	/* (non-Javadoc)
63
	 * @see org.gvsig.fmap.geom.operation.GeometryOperation#invoke(org.gvsig.fmap.geom.Geometry, org.gvsig.fmap.geom.operation.GeometryOperationContext)
64
	 */
65
	@Override
66
	public Object invoke(Geometry geom, GeometryOperationContext ctx)
67
			throws GeometryOperationException {
68

  
69
		Aggregate aggregate = (Aggregate) geom;
70
		for (int i=0;i<aggregate.getPrimitivesNumber();i++){
71
			Geometry prim = aggregate.getPrimitiveAt(i);
72
			try {
73
				prim.invokeOperation(CODE, ctx);
74
			} catch (GeometryOperationNotSupportedException e) {
75
				throw new GeometryOperationException(e);
76
			}
77
		}
78
		return null;
79
	}
80

  
81
	public static void register() {
82
		GeometryManager geoMan = GeometryLocator.getGeometryManager();
83

  
84
		geoMan.registerGeometryOperation("drawInts", new AggregateDrawInts(),
85
				TYPES.MULTIPOINT);
86
		geoMan.registerGeometryOperation("drawInts", new AggregateDrawInts(),
87
				TYPES.MULTICURVE);
88
		geoMan.registerGeometryOperation("drawInts", new AggregateDrawInts(),
89
				TYPES.MULTISURFACE);
90
		geoMan.registerGeometryOperation("drawInts", new AggregateDrawInts(),
91
				TYPES.MULTISOLID);
92

  
93
	}
94

  
95
}
0 96

  
branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/geom/operation/MapContextGeomOperationsLibrary.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
* 2009 IVER T.I   {{Task}}
26
*/
27

  
28
/**
29
 *
30
 */
31
package org.gvsig.fmap.geom.operation;
32

  
33
import org.gvsig.tools.locator.BaseLibrary;
34
import org.gvsig.tools.locator.ReferenceNotRegisteredException;
35

  
36
/**
37
 * @author jmvivo
38
 *
39
 */
40
public class MapContextGeomOperationsLibrary extends BaseLibrary {
41

  
42
	public void postInitialize() throws ReferenceNotRegisteredException {
43
		super.postInitialize();
44
		// Regsiter Draw Operations
45
		Draw.register();
46
		DrawInts.register();
47
		AggregateDrawInts.register();
48

  
49
	}
50

  
51
}
0 52

  
branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/geom/operation/DrawInts.java
47 47
	public int getOperationIndex() {
48 48
		return CODE;
49 49
	}
50
	private static Geometry transformToInts(Geometry gp, AffineTransform at) {
50

  
51
	private Geometry transformToInts(Geometry gp, AffineTransform at) {
51 52
	        GeneralPathX newGp = new GeneralPathX();
52 53
	        double[] theData = new double[6];
53 54
	        double[] aux = new double[6];
......
120 121
	        } //end while loop
121 122

  
122 123
	        Geometry geom = null;
123
	        switch (gp.getType())
124
	        {
125
	            case Geometry.TYPES.POINT: 	            
126
	                geom = UtilFunctions.createPoint(ptDst.getX(), ptDst.getY());
127
	                break;
124
	        switch (gp.getType()) {
125
		        case Geometry.TYPES.POINT:
126
		        	geom = UtilFunctions.createPoint(ptDst.getX(), ptDst.getY());
127
		        	break;
128
		        case Geometry.TYPES.CURVE:
129
		        case Geometry.TYPES.ARC:
130
		        	geom = UtilFunctions.createCurve(newGp);
131
		        	break;
128 132

  
129
	            case Geometry.TYPES.CURVE:	           
130
	            case Geometry.TYPES.ARC:
131
	            	geom = UtilFunctions.createCurve(newGp);
132
	                break;
133
		        case Geometry.TYPES.SURFACE:
134
		        case Geometry.TYPES.CIRCLE:
135
		        case Geometry.TYPES.ELLIPSE:
133 136

  
134
	            case Geometry.TYPES.SURFACE:	           
135
	            case Geometry.TYPES.CIRCLE:
136
	            case Geometry.TYPES.ELLIPSE:
137

  
138
	                geom = UtilFunctions.createSurface(newGp);
139
	                break;
137
		        	geom = UtilFunctions.createSurface(newGp);
138
		        	break;
140 139
	        }
141 140
	        return geom;
142
	    }
141
	}
143 142

  
143
	public static void register() {
144
		// Nothing to do
144 145

  
146
	}
147

  
148

  
145 149
}
branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/geom/operation/Draw.java
4 4

  
5 5
import org.gvsig.fmap.geom.Geometry;
6 6
import org.gvsig.fmap.geom.GeometryLocator;
7
import org.gvsig.fmap.geom.GeometryManager;
8
import org.gvsig.fmap.geom.operation.GeometryOperation;
9
import org.gvsig.fmap.geom.operation.GeometryOperationContext;
10
import org.gvsig.fmap.geom.operation.GeometryOperationException;
11 7

  
12 8
public class Draw extends GeometryOperation{
13 9
	public static final int CODE = GeometryLocator.getGeometryManager()
......
25 21
		return CODE;
26 22
	}
27 23

  
24
	public static void register() {
25
		// Nothing to do
26

  
27
	}
28

  
28 29
}
branches/v2_0_0_prep/libraries/libFMap_mapcontext/.classpath
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="src"/>
4
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
5
	<classpathentry kind="src" output="bin-test" path="src-test"/>
6
	<classpathentry combineaccessrules="false" kind="src" path="/libFMap_dal"/>
7
	<classpathentry combineaccessrules="false" kind="src" path="/libMetadata"/>
8
	<classpathentry kind="lib" path="lib/batik-anim.jar"/>
9
	<classpathentry kind="lib" path="lib/batik-awt-util.jar"/>
10
	<classpathentry kind="lib" path="lib/batik-bridge.jar"/>
11
	<classpathentry kind="lib" path="lib/batik-codec.jar"/>
12
	<classpathentry kind="lib" path="lib/batik-css.jar"/>
13
	<classpathentry kind="lib" path="lib/batik-dom.jar"/>
14
	<classpathentry kind="lib" path="lib/batik-ext.jar"/>
15
	<classpathentry kind="lib" path="lib/batik-extension.jar"/>
16
	<classpathentry kind="lib" path="lib/batik-gui-util.jar"/>
17
	<classpathentry kind="lib" path="lib/batik-gvt.jar"/>
18
	<classpathentry kind="lib" path="lib/batik-parser.jar"/>
19
	<classpathentry kind="lib" path="lib/batik-script.jar"/>
20
	<classpathentry kind="lib" path="lib/batik-svg-dom.jar"/>
21
	<classpathentry kind="lib" path="lib/batik-svggen.jar"/>
22
	<classpathentry kind="lib" path="lib/batik-swing.jar"/>
23
	<classpathentry kind="lib" path="lib/batik-transcoder.jar"/>
24
	<classpathentry kind="lib" path="lib/batik-util.jar"/>
25
	<classpathentry kind="lib" path="lib/batik-xml.jar"/>
26
	<classpathentry kind="lib" path="lib/geoapi-2.0.jar"/>
27
	<classpathentry kind="lib" path="lib/gt2-legacy.jar"/>
28
	<classpathentry kind="lib" path="lib/gt2-main.jar"/>
29
	<classpathentry kind="lib" path="lib/units-0.01.jar"/>
30
	<classpathentry kind="lib" path="lib/castor-0.9.5.3-xml.jar"/>
31
	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
32
	<classpathentry combineaccessrules="false" kind="src" path="/libTools"/>
33
	<classpathentry combineaccessrules="false" kind="src" path="/libEvaluator_SQLJEP"/>
34
	<classpathentry combineaccessrules="false" kind="src" path="/libProjection"/>
35
	<classpathentry combineaccessrules="false" kind="src" path="/libIverUtiles"/>
36
	<classpathentry kind="lib" path="/libFMap_geometries/lib/jts-1.9.jar"/>
37
	<classpathentry kind="lib" path="lib-references/slf4j-api-1.5.0.jar"/>
38
	<classpathentry kind="lib" path="lib/org.gvsig.fmap.geometry.jar"/>
39
	<classpathentry kind="lib" path="lib/org.gvsig.fmap.geometry.operation.jar"/>
40
	<classpathentry kind="lib" path="lib/log4j-1.2.14.jar"/>
41
	<classpathentry kind="lib" path="lib/slf4j-log4j12-1.5.0.jar"/>
42
	<classpathentry kind="lib" path="lib/org.gvsig.fmap.geometry-impl.jar"/>
43
	<classpathentry kind="output" path="bin"/>
44
</classpath>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="src"/>
4
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
5
	<classpathentry kind="src" output="bin-test" path="src-test"/>
6
	<classpathentry combineaccessrules="false" kind="src" path="/libFMap_dal"/>
7
	<classpathentry combineaccessrules="false" kind="src" path="/libMetadata"/>
8
	<classpathentry kind="lib" path="lib/batik-anim.jar"/>
9
	<classpathentry kind="lib" path="lib/batik-awt-util.jar"/>
10
	<classpathentry kind="lib" path="lib/batik-bridge.jar"/>
11
	<classpathentry kind="lib" path="lib/batik-codec.jar"/>
12
	<classpathentry kind="lib" path="lib/batik-css.jar"/>
13
	<classpathentry kind="lib" path="lib/batik-dom.jar"/>
14
	<classpathentry kind="lib" path="lib/batik-ext.jar"/>
15
	<classpathentry kind="lib" path="lib/batik-extension.jar"/>
16
	<classpathentry kind="lib" path="lib/batik-gui-util.jar"/>
17
	<classpathentry kind="lib" path="lib/batik-gvt.jar"/>
18
	<classpathentry kind="lib" path="lib/batik-parser.jar"/>
19
	<classpathentry kind="lib" path="lib/batik-script.jar"/>
20
	<classpathentry kind="lib" path="lib/batik-svg-dom.jar"/>
21
	<classpathentry kind="lib" path="lib/batik-svggen.jar"/>
22
	<classpathentry kind="lib" path="lib/batik-swing.jar"/>
23
	<classpathentry kind="lib" path="lib/batik-transcoder.jar"/>
24
	<classpathentry kind="lib" path="lib/batik-util.jar"/>
25
	<classpathentry kind="lib" path="lib/batik-xml.jar"/>
26
	<classpathentry kind="lib" path="lib/geoapi-2.0.jar"/>
27
	<classpathentry kind="lib" path="lib/gt2-legacy.jar"/>
28
	<classpathentry kind="lib" path="lib/gt2-main.jar"/>
29
	<classpathentry kind="lib" path="lib/units-0.01.jar"/>
30
	<classpathentry kind="lib" path="lib/castor-0.9.5.3-xml.jar"/>
31
	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
32
	<classpathentry combineaccessrules="false" kind="src" path="/libTools"/>
33
	<classpathentry combineaccessrules="false" kind="src" path="/libEvaluator_SQLJEP"/>
34
	<classpathentry combineaccessrules="false" kind="src" path="/libProjection"/>
35
	<classpathentry combineaccessrules="false" kind="src" path="/libIverUtiles"/>
36
	<classpathentry kind="lib" path="/libFMap_geometries/lib/jts-1.9.jar"/>
37
	<classpathentry kind="lib" path="lib-references/slf4j-api-1.5.0.jar"/>
38
	<classpathentry kind="lib" path="lib/org.gvsig.fmap.geometry.jar" sourcepath="/libFMap_geometries"/>
39
	<classpathentry kind="lib" path="lib/org.gvsig.fmap.geometry.operation.jar"/>
40
	<classpathentry kind="lib" path="lib/log4j-1.2.14.jar"/>
41
	<classpathentry kind="lib" path="lib/slf4j-log4j12-1.5.0.jar"/>
42
	<classpathentry kind="lib" path="lib/org.gvsig.fmap.geometry-impl.jar"/>
43
	<classpathentry kind="output" path="bin"/>
44
</classpath>

Also available in: Unified diff