Revision 29798 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/GeometryManager.java

View differences:

GeometryManager.java
40 40
 */
41 41
package org.gvsig.fmap.geom;
42 42

  
43
import java.util.List;
44

  
43 45
import org.gvsig.fmap.geom.aggregate.MultiCurve;
44 46
import org.gvsig.fmap.geom.aggregate.MultiSurface;
45 47
import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
......
79 81
	 * Returns an unique index that is used later to identify and invoke the operation.
80 82
	 * </p>
81 83
	 * <p>
82
	 * By convention, the return value should be stored in a public constant within the class implementing
83
	 * the operation:<BR>
84
	 * By convention this index should be in a final and static variable in the 
85
	 * class that implements the operation. The value of this variable must be set 
86
	 * using the method {@link GeometryManager#getGeometryOperationCode(String)}:<BR>	
84 87
	 * <pre>
85 88
	 * public class MyOperation extends GeometryOperation {
86 89
	 *   public static final int CODE =
87 90
	 *     GeometryLocator.getGeometryManager()
88
	 *        .registerGeometryOperation("MyOperation", new MyOperation(), geomType);
91
	 *        .getGeometryOperationCode("MyOperation");
89 92
	 * }
90 93
	 * </pre>
91 94
	 * </p>
......
104 107
	 * Returns an unique index that is used later to identify and invoke the operation.
105 108
	 * </p>
106 109
	 * <p>
107
	 * By convention, the return value should be stored in a public constant within the class implementing
108
	 * the operation:<BR>
110
	 * By convention this index should be in a final and static variable in the 
111
	 * class that implements the operation. The value of this variable must be set 
112
	 * using the method {@link GeometryManager#getGeometryOperationCode(String)}:<BR>	
109 113
	 * <pre>
110 114
	 * public class MyOperation extends GeometryOperation {
111 115
	 *   public static final int CODE =
112 116
	 *     GeometryLocator.getGeometryManager()
113
	 *        .registerGeometryOperation("MyOperation", new MyOperation());
117
	 *        .getGeometryOperationCode("MyOperation");
114 118
	 * }
115 119
	 * </pre>
116 120
	 * </p>
......
128 132
	 * Returns an unique index that is used later to identify and invoke the operation.
129 133
	 * </p>
130 134
	 * <p>
131
	 * By convention, the return value should be stored in a public constant within the class implementing
132
	 * the operation:<BR>
135
	 * By convention this index should be in a final and static variable in the 
136
	 * class that implements the operation. The value of this variable must be set 
137
	 * using the method {@link GeometryManager#getGeometryOperationCode(String)}:<BR>	
133 138
	 * <pre>
134 139
	 * public class MyOperation extends GeometryOperation {
135 140
	 *   public static final int CODE =
136 141
	 *     GeometryLocator.getGeometryManager()
137
	 *        .registerGeometryOperation("MyOperation", new MyOperation(), TYPES.POINT, SUBTYPES.GEOM2D);
142
	 *        .getGeometryOperationCode("MyOperation");
138 143
	 * }
139 144
	 * </pre>
140 145
	 * </p>
......
165 170
	 * Returns an unique index that is used later to identify and invoke the operation.<br>
166 171
	 * </p>
167 172
	 * <p>
168
	 * By convention, the return value should be stored in a public constant within the class implementing
169
	 * the operation:<BR>
173
	 * By convention this index should be in a final and static variable in the 
174
	 * class that implements the operation. The value of this variable must be set 
175
	 * using the method {@link GeometryManager#getGeometryOperationCode(String)}:<BR>	
170 176
	 * <pre>
171 177
	 * public class MyOperation extends GeometryOperation {
172 178
	 *   public static final int CODE =
173 179
	 *     GeometryLocator.getGeometryManager()
174
	 *        .registerGeometryOperation("MyOperation", new MyOperation(), TYPES.POINT);
180
	 *        .getGeometryOperationCode("MyOperation");
175 181
	 * }
176 182
	 * </pre>
177 183
	 * </p>
......
191 197
	 * Returns an unique index that is used later to identify and invoke the operation.<br>
192 198
	 * </p>
193 199
	 * <p>
194
	 * By convention, the return value should be stored in a public constant within the class implementing
195
	 * the operation:<BR>
200
	 * By convention this index should be in a final and static variable in the 
201
	 * class that implements the operation. The value of this variable must be set 
202
	 * using the method {@link GeometryManager#getGeometryOperationCode(String)}:<BR>	
196 203
	 * <pre>
197 204
	 * public class MyOperation extends GeometryOperation {
198 205
	 *   public static final int CODE =
199 206
	 *     GeometryLocator.getGeometryManager()
200
	 *        .registerGeometryOperation("MyOperation", new MyOperation(), SUBTYPES.GEOM2D);
207
	 *        .getGeometryOperationCode("MyOperation");
201 208
	 * }
202 209
	 * </pre>
203 210
	 * </p>
......
362 369
	 * <pre>
363 370
	 * Point point = (Point)GeometryLocator
364 371
	 * 		.getGeometryManager().create("Point2D");
365
	 * 	point.setX(1);
366
	 * 	point.setY(1);
372
	 * point.setX(1);
373
	 * point.setY(1);
367 374
	 * </pre>
368 375
	 *
369 376
	 * @param name
......
590 597
	 * The object returned by an operation, depends on each operation.
591 598
	 */
592 599
	public Object invokeOperation(String geomOpName, Geometry geom, GeometryOperationContext ctx) throws GeometryOperationNotSupportedException, GeometryOperationException;
600
	
601
	/**
602
	 * <p>
603
	 * Registers the unique name of one operation. If it already exists 
604
	 * then this method does nothing but returning the name's corresponding 
605
	 * index.
606
	 * </p>
607
	 * <p>
608
	 * By convention this method is used to set the value of the final and static 
609
	 * variable that is located in the classes that implements the operation:<BR>	
610
	 * <pre>
611
	 * public class MyOperation extends GeometryOperation {
612
	 *   public static final int CODE =
613
	 *     GeometryLocator.getGeometryManager()
614
	 *        .getGeometryOperationCode("MyOperation");
615
	 * }
616
	 * </pre>
617
	 * </p>
618
	 * @param geomOpName
619
	 * Name used to register the geometry operation
620
	 * @return
621
	 * Index assigned to the operation name passed as parameter
622
	 */
623
	public int getGeometryOperationCode(String geomOpName);
624
	
625
	/**
626
	 * Returns a list with the name of the operations that have been
627
	 * registered.
628
	 * @return
629
	 * A list of the registered operations.
630
	 */
631
	public List getGeometryOperationNames();
593 632
}

Also available in: Unified diff