Revision 18236 trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/georeferencing/view/ViewDialog.java

View differences:

ViewDialog.java
19 19
package org.gvsig.rastertools.georeferencing.view;
20 20

  
21 21
import java.awt.BorderLayout;
22
import java.awt.Graphics2D;
23 22
import java.awt.geom.Point2D;
24 23
import java.awt.geom.Rectangle2D;
25 24
import java.awt.image.BufferedImage;
26 25

  
27
import javax.swing.JPanel;
28

  
29 26
import org.gvsig.rastertools.georeferencing.ui.zoom.IExtensionRequest;
30 27
import org.gvsig.rastertools.georeferencing.ui.zoom.ViewControl;
31 28
import org.gvsig.rastertools.georeferencing.ui.zoom.layers.GCPsGraphicLayer;
32 29
import org.gvsig.rastertools.georeferencing.ui.zoom.layers.GPGraphic;
30
import org.gvsig.rastertools.georeferencing.ui.zoom.layers.ZoomCursorGraphicLayer;
33 31

  
34 32
import com.iver.andami.PluginServices;
35 33
import com.iver.andami.ui.mdiManager.IWindow;
......
41 39
 * 22/12/2007
42 40
 * @author Nacho Brodin (nachobrodin@gmail.com)
43 41
 */
44
public class ViewDialog extends JPanel implements IWindow {
42
public class ViewDialog extends BaseZoomView implements IWindow {
45 43
	private static final long         serialVersionUID = 1L;
46
	private ViewControl               zoomPixelControl = null;
47 44
	private GCPsGraphicLayer          graphicLayer = null;
45
	private ZoomCursorGraphicLayer    zoomCursorGraphic = null;
48 46
	private int                       w = 640;
49 47
	private int                       h = 100;
50 48
	private int                       posX = 0;
......
91 89
		setLayout(new BorderLayout());
92 90
		add(getZoomPixelControl(), BorderLayout.CENTER);
93 91
		getPixelGraphicLayer();
92
		getZoomCursorGraphicLayer();
94 93
	}
95 94
	
96 95
	/**
......
140 139
	}
141 140
	
142 141
	/**
143
	 * Obtiene el ancho del canvas
144
	 * @return 
145
	 */
146
	public int getCanvasWith() {
147
		return zoomPixelControl.getCanvasWith();
148
	}
149
	
150
	/**
151
	 * Obtiene el alto del canvas
142
	 * Obtiene el la capa gr?fica con la ventana de zoom
152 143
	 * @return
153 144
	 */
154
	public int getCanvasHeight() {
155
		return zoomPixelControl.getCanvasHeight();
145
	public ZoomCursorGraphicLayer getZoomCursorGraphicLayer() {
146
		if(zoomCursorGraphic == null) {
147
			zoomCursorGraphic = new ZoomCursorGraphicLayer(w / 2, h / 2, 40, 20);
148
			getZoomPixelControl().setGraphicLayer(zoomCursorGraphic);
149
		}
150
		return zoomCursorGraphic;
156 151
	}
157
	
152
		
158 153
	/**
159
	 * Obtiene el graphics del canvas
160
	 * @return
161
	 */
162
	public Graphics2D getCanvasGraphic() {
163
		return (Graphics2D)zoomPixelControl.getCanvas().getGraphics();
164
	}
165
	
166
	/**
167 154
	 * Activa o desactiva el mostrado de informaci?n
168 155
	 * @param showInfo
169 156
	 */
......
171 158
		zoomPixelControl.getCanvas().setShowInfo(show);
172 159
	}
173 160
	
161
	/**
162
	 * Asigna el ancho y el alto de la ventana del cursor
163
	 * @param w Ancho
164
	 * @param h Alto
165
	 */
166
	public void setZoomCursorSize(int w, int h) {
167
		getZoomCursorGraphicLayer().setCursorSize(w, h);
168
	}
169
	
174 170
	/*
175 171
	 * (non-Javadoc)
176 172
	 * @see com.iver.andami.ui.mdiManager.IWindow#getWindowInfo()

Also available in: Unified diff