Revision 35625
branches/dal_time_support/libraries/libFMap_mapcontext/src/org/gvsig/fmap/geom/operation/Draw.java | ||
---|---|---|
12 | 12 |
public static int CODE = Integer.MIN_VALUE; |
13 | 13 |
|
14 | 14 |
public Object invoke(Geometry geom, GeometryOperationContext ctx) throws GeometryOperationException { |
15 |
DrawOperationContext doc=(DrawOperationContext)ctx; |
|
16 |
AffineTransform at=doc.getViewPort().getAffineTransform(); |
|
17 |
geom.transform(at); |
|
15 |
DrawOperationContext doc = (DrawOperationContext)ctx; |
|
16 |
AffineTransform at = doc.getViewPort().getAffineTransform(); |
|
18 | 17 |
doc.getSymbol().draw(doc.getGraphics(), at, geom, doc.getFeature(), |
19 | 18 |
doc.getCancellable()); |
20 | 19 |
return null; |
branches/dal_time_support/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/ViewPort.java | ||
---|---|---|
56 | 56 |
import org.slf4j.LoggerFactory; |
57 | 57 |
|
58 | 58 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
59 |
import org.gvsig.fmap.geom.Geometry; |
|
59 | 60 |
import org.gvsig.fmap.geom.GeometryLocator; |
60 | 61 |
import org.gvsig.fmap.geom.GeometryManager; |
61 | 62 |
import org.gvsig.fmap.geom.exception.CreateEnvelopeException; |
63 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
|
62 | 64 |
import org.gvsig.fmap.geom.primitive.Envelope; |
65 |
import org.gvsig.fmap.geom.primitive.Point; |
|
63 | 66 |
import org.gvsig.fmap.mapcontext.events.ColorEvent; |
64 | 67 |
import org.gvsig.fmap.mapcontext.events.ExtentEvent; |
65 | 68 |
import org.gvsig.fmap.mapcontext.events.ProjectionEvent; |
... | ... | |
583 | 586 |
* |
584 | 587 |
* @see #toMapPoint(Point2D) |
585 | 588 |
* @see #fromMapPoint(double, double) |
589 |
* @deprecated use {@link #convertToMapPoint(int, int)} |
|
586 | 590 |
*/ |
587 | 591 |
public Point2D toMapPoint(int x, int y) { |
588 | 592 |
Point2D pScreen = new Point2D.Double(x, y); |
... | ... | |
649 | 653 |
* @see #toMapPoint(int, int) |
650 | 654 |
* @see AffineTransform#createInverse() |
651 | 655 |
* @see AffineTransform#transform(Point2D, Point2D) |
656 |
* @deprecated use {@link #convertToMapPoint(Point2D)} |
|
652 | 657 |
*/ |
653 | 658 |
public Point2D toMapPoint(Point2D pScreen) { |
654 | 659 |
Point2D.Double pWorld = new Point2D.Double(); |
... | ... | |
664 | 669 |
return pWorld; |
665 | 670 |
} |
666 | 671 |
|
672 |
public Point convertToMapPoint(Point2D pScreen) { |
|
673 |
Point2D p = toMapPoint(pScreen); |
|
674 |
try { |
|
675 |
return geomManager.createPoint( |
|
676 |
p.getX(), |
|
677 |
p.getY(), |
|
678 |
Geometry.SUBTYPES.GEOM2D |
|
679 |
); |
|
680 |
} catch (CreateGeometryException e) { |
|
681 |
// FIXME: Use a most especific exception. |
|
682 |
throw new RuntimeException(e); |
|
683 |
} |
|
684 |
} |
|
685 |
|
|
686 |
public Point convertToMapPoint(int x, int y) { |
|
687 |
Point2D pScreen = new Point2D.Double(x, y); |
|
688 |
|
|
689 |
return convertToMapPoint(pScreen); |
|
690 |
} |
|
691 |
|
|
692 |
|
|
667 | 693 |
/** |
668 | 694 |
* <p> |
669 | 695 |
* Returns the real distance (in <i>world coordinates</i>) at the graphic |
branches/dal_time_support/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/operations/InfoByPoint.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package org.gvsig.fmap.mapcontext.layers.operations; |
42 | 42 |
|
43 |
import java.awt.Point; |
|
44 | 43 |
|
45 | 44 |
import org.gvsig.fmap.dal.exception.DataException; |
45 |
import org.gvsig.fmap.geom.primitive.Point; |
|
46 | 46 |
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException; |
47 | 47 |
import org.gvsig.tools.dynobject.DynObjectSet; |
48 | 48 |
import org.gvsig.tools.task.Cancellable; |
... | ... | |
82 | 82 |
* TODO |
83 | 83 |
* @throws LoadLayerException |
84 | 84 |
* any exception produced using the driver. |
85 |
* |
|
86 |
* @deprecated use instead {@link #getInfo(Point, double)} |
|
85 | 87 |
*/ |
86 |
public DynObjectSet getInfo(Point p, double tolerance, Cancellable cancel) |
|
88 |
public DynObjectSet getInfo(java.awt.Point p, double tolerance, Cancellable cancel)
|
|
87 | 89 |
throws LoadLayerException, DataException; |
88 | 90 |
|
89 | 91 |
/** |
... | ... | |
118 | 120 |
* TODO |
119 | 121 |
* @throws LoadLayerException |
120 | 122 |
* any exception produced using the driver. |
123 |
* |
|
124 |
* @deprecated use instead {@link #getInfo(Point, double)} |
|
121 | 125 |
*/ |
122 |
public DynObjectSet getInfo(Point p, double tolerance, Cancellable cancel, |
|
126 |
public DynObjectSet getInfo(java.awt.Point p, double tolerance, Cancellable cancel,
|
|
123 | 127 |
boolean fast) throws LoadLayerException, DataException; |
128 |
|
|
129 |
/** |
|
130 |
* <p> |
|
131 |
* Executes a consultation about information of a point on the layer. |
|
132 |
* </p> |
|
133 |
* |
|
134 |
* <p> |
|
135 |
* There is an area around the point where will got the information. |
|
136 |
* </p> |
|
137 |
* |
|
138 |
* @param p |
|
139 |
* point in map coordinates where is the consultation |
|
140 |
* @param tolerance |
|
141 |
* permissible margin around the coordinates of the point where |
|
142 |
* the method will got the information. Each |
|
143 |
* singular implementation of this method would use it in a |
|
144 |
* different way. The unit are in map coordinates. |
|
145 |
*/ |
|
146 |
public DynObjectSet getInfo(Point p, double tolerance) throws LoadLayerException, DataException; |
|
124 | 147 |
} |
branches/dal_time_support/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/FLayers.java | ||
---|---|---|
883 | 883 |
|
884 | 884 |
public DynObjectSet getInfo(Point p, double tolerance, |
885 | 885 |
Cancellable cancel) throws LoadLayerException, DataException { |
886 |
return this.getInfo(p, tolerance, cancel, true);
|
|
886 |
return getInfo(this.getMapContext().getViewPort().convertToMapPoint(p), tolerance);
|
|
887 | 887 |
} |
888 | 888 |
|
889 | 889 |
public DynObjectSet getInfo(Point p, double tolerance, Cancellable cancel, |
890 | 890 |
boolean fast) throws LoadLayerException, DataException { |
891 |
return getInfo(this.getMapContext().getViewPort().convertToMapPoint(p), tolerance); |
|
892 |
} |
|
893 |
|
|
894 |
public DynObjectSet getInfo(org.gvsig.fmap.geom.primitive.Point p, |
|
895 |
double tolerance) throws LoadLayerException, DataException { |
|
891 | 896 |
int i; |
892 | 897 |
FLayer layer; |
893 | 898 |
List res = new ArrayList(); |
... | ... | |
895 | 900 |
layer = (FLayer) layers.get(i); |
896 | 901 |
if (layer instanceof InfoByPoint) { |
897 | 902 |
InfoByPoint queryable_layer = (InfoByPoint) layer; |
898 |
res.add(queryable_layer.getInfo(p, tolerance, null, fast));
|
|
903 |
res.add(queryable_layer.getInfo(p, tolerance)); |
|
899 | 904 |
} |
900 | 905 |
} |
901 | 906 |
DynObjectSet[] innerSets = |
902 | 907 |
(DynObjectSet[]) res.toArray(new DynObjectSet[res.size()]); |
903 | 908 |
return new MultiDynObjectSet(innerSets); |
904 | 909 |
} |
905 |
|
|
910 |
|
|
906 | 911 |
/* |
907 | 912 |
* (non-Javadoc) |
908 | 913 |
* @see com.iver.cit.gvsig.fmap.layers.FLyrDefault#getTocImageIcon() |
branches/dal_time_support/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/vectorial/FLyrVect.java | ||
---|---|---|
1251 | 1251 |
return (FeatureStore) getDataStore(); |
1252 | 1252 |
} |
1253 | 1253 |
|
1254 |
/** |
|
1255 |
* @deprecated use instead {@link #queryByPoint(org.gvsig.fmap.geom.primitive.Point, double, FeatureType)} |
|
1256 |
*/ |
|
1254 | 1257 |
public FeatureSet queryByPoint(Point2D mapPoint, |
1255 | 1258 |
double tol, |
1256 | 1259 |
FeatureType featureType) throws DataException { |
1260 |
logger.warn("Deprecated use of queryByPoint."); |
|
1257 | 1261 |
GeometryManager manager = GeometryLocator.getGeometryManager(); |
1258 | 1262 |
org.gvsig.fmap.geom.primitive.Point center; |
1259 | 1263 |
try { |
... | ... | |
1271 | 1275 |
} |
1272 | 1276 |
} |
1273 | 1277 |
|
1278 |
public FeatureSet queryByPoint(org.gvsig.fmap.geom.primitive.Point point, |
|
1279 |
double tol, |
|
1280 |
FeatureType featureType) throws DataException { |
|
1281 |
GeometryManager manager = GeometryLocator.getGeometryManager(); |
|
1282 |
try { |
|
1283 |
Circle circle = |
|
1284 |
(Circle) manager.create(TYPES.CIRCLE, SUBTYPES.GEOM2D); |
|
1285 |
circle.setPoints(point, tol); |
|
1286 |
return queryByGeometry(circle, featureType); |
|
1287 |
} catch (org.gvsig.fmap.geom.exception.CreateGeometryException e) { |
|
1288 |
throw new CreateGeometryException(TYPES.CIRCLE, SUBTYPES.GEOM2D, e); |
|
1289 |
} |
|
1290 |
} |
|
1291 |
|
|
1274 | 1292 |
public FeatureSet queryByGeometry(Geometry geom, FeatureType featureType) throws DataException { |
1275 | 1293 |
FeatureQuery featureQuery = featureStore.createFeatureQuery(); |
1276 | 1294 |
String geomName = |
... | ... | |
1331 | 1349 |
getFeatureStore().getDefaultFeatureType()).getDynObjectSet(fast); |
1332 | 1350 |
} |
1333 | 1351 |
|
1352 |
public DynObjectSet getInfo(org.gvsig.fmap.geom.primitive.Point p, |
|
1353 |
double tolerance) throws LoadLayerException, DataException { |
|
1354 |
return queryByPoint(p,tolerance, getFeatureStore().getDefaultFeatureType()).getDynObjectSet(true); |
|
1355 |
} |
|
1356 |
|
|
1334 | 1357 |
public void legendCleared(LegendClearEvent event) { |
1335 | 1358 |
// this.updateDrawVersion(); TODO |
1336 | 1359 |
LegendChangedEvent e = |
Also available in: Unified diff