Revision 4621 trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/fmap/layers/FLyrPoints.java

View differences:

FLyrPoints.java
140 140
		}
141 141

  
142 142
	}
143
	
143

  
144
	private ArrayList 				pointList = new ArrayList();
145
	private final int 				DIAM_CIRCLE = 18;
146
	private String 					lastTool = "zoomIn";
147
	private boolean 				showNumber = true;
148
	private FLyrPointsState 		state = null;
149
	private GeoPointPersistence 	geoPointPersistence = new GeoPointPersistence(this);
150
	private FLyrGeoRaster 			lyrGeoRaster = null;
151
	private ViewPort				viewPort = null;
152
		
144 153
	/**
145 154
	 * Estado de la capa de puntos. 
146 155
	 * @author Nacho Brodin (brodin_ign@gva.es)
......
152 161
	}
153 162
	
154 163
	
155
	
156
	
157
	private ArrayList pointList = new ArrayList();
158
	private final int DIAM_CIRCLE = 18;
159
	private String lastTool = "zoomIn";
160
	private boolean showNumber = true;
161
	private FLyrPointsState state = null;
162
	private GeoPointPersistence geoPointPersistence = new GeoPointPersistence(this);
163
	private FLyrGeoRaster lyrGeoRaster = null;
164
	
165 164
	/**
166 165
	 * Constructor
167 166
	 * @param flyGeoRaster
......
226 225
	 */
227 226
	public void draw(BufferedImage image, Graphics2D g, ViewPort vp,
228 227
			Cancellable cancel,double scale) throws DriverException {
229
			
230
		//BufferedImage img = theView.getMapControl().getImage();
231
		//g.drawImage(img, 0, 0, null);
232
		int dpto = (DIAM_CIRCLE >> 1);
233
		int incr = 5;
228
		
229
		View theView = (View)PluginServices.getMDIManager().getActiveView();
230
		ViewPort vpView = theView.getMapControl().getMapContext().getViewPort();
231
		
234 232
		Point2D pto = null;
235 233
		
236 234
		if(lyrGeoRaster != null){
......
242 240
				if(((GeoPoint)pointList.get(i)).active){
243 241
					if(pto != null){
244 242
						Point2D p = lyrGeoRaster.img2World(pto);
245
						p = lyrGeoRaster.getViewPortWithoutTransformation().fromMapPoint(p);
243
						if(this.viewPort != null)
244
							p = this.viewPort.fromMapPoint(p);
245
						else
246
							p = vpView.fromMapPoint(p);
246 247
						drawPixelCrux(g, p, i);
247
						
248 248
					}
249 249
					
250 250
					//Punto de la vista
251 251
					pto = ((GeoPoint)pointList.get(i)).mapPoint;
252 252
					if(pto != null){
253
						Point2D p = lyrGeoRaster.getViewPortWithoutTransformation().fromMapPoint(pto);
253
						Point2D p = null;
254
						if(this.viewPort != null)
255
							p = this.viewPort.fromMapPoint(pto);
256
						else
257
							p = vpView.fromMapPoint(pto);
254 258
						drawMapCrux(g, p, i);
255 259
					}
256 260
				}
257 261
			}
258
		} 
262
		}
263
		this.viewPort = null;
259 264
	}
260 265
	
261 266
	/**
......
822 827
	public void updateData(GeoreferencingDialog geoDialog){
823 828
		geoPointPersistence.updateData(geoDialog);
824 829
	}
830

  
831
	/**
832
	 * Asigna el viewPort de la vista sobre la que se dibuja. Si no hay ninguna 
833
	 * asignada se usar? el de la vista de gvSIG. Esta funci?n es util para cuando
834
	 * las miniimagenes tienen que dibujar sobre su propio graphics que tiene un
835
	 * viewPort distinto al de la vista.
836
	 * @param vp ViewPort sobre el que se dibuja
837
	 */
838
	public void setDrawView(ViewPort vp) {
839
		this.viewPort = vp;
840
	}
825 841
	
826 842
}

Also available in: Unified diff