Revision 17838 trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/georeferencing/Georeferencing.java

View differences:

Georeferencing.java
31 31
import org.gvsig.raster.util.ExtendedFileFilter;
32 32
import org.gvsig.raster.util.RasterToolsUtil;
33 33
import org.gvsig.rastertools.georeferencing.ui.table.GCPTablePanel;
34
import org.gvsig.rastertools.georeferencing.ui.zoom.ControlsPanel;
35 34
import org.gvsig.rastertools.georeferencing.view.ViewPanel;
35
import org.gvsig.rastertools.georeferencing.view.ZoomMapDialog;
36
import org.gvsig.rastertools.georeferencing.view.ZoomRasterDialog;
36 37

  
37 38
import com.iver.andami.PluginServices;
38 39
import com.iver.andami.ui.mdiFrame.MDIFrame;
......
55 56
 */
56 57
public class Georeferencing {
57 58
	private static GCPTablePanel          table = null;
58
	private static ControlsPanel          zooms = null;
59
	private static ZoomMapDialog          zoomMap = null;
60
	private static ZoomRasterDialog       zoomPixel = null;
59 61
	private static ViewPanel              view = null;
60 62
	private static final int              smallWindowsHeight = 100;
61 63
	private static final double           smallWindowsWidthPercent = 0.5;
......
74 76
		int wViews = p.getWidth() >> 1;
75 77
		int hViews = p.getHeight() - 178 - smallWindowsHeight;
76 78
		int posYViews = p.getHeight() - 138 - smallWindowsHeight;
77
		int hSmallWindows = (int)(p.getWidth() * smallWindowsWidthPercent);
79
		int smallWindowsWidth = (int)(p.getWidth() * (smallWindowsWidthPercent * 0.5));
80
		int tableWidth = (int)(p.getWidth() * (1 - smallWindowsWidthPercent));
78 81
		
79 82
		IWindow[] windowList = PluginServices.getMDIManager().getAllWindows();
80 83
		BufferedImage imgView = null;
......
91 94
				vp = ((IView)windowList[i]).getMapControl().getViewPort();
92 95
			}
93 96
		}
94
		if(zooms != null)
95
			PluginServices.getMDIManager().closeWindow(zooms);
97
		if(zoomMap != null)
98
			PluginServices.getMDIManager().closeWindow(zoomMap);
99
		if(zoomPixel != null)
100
			PluginServices.getMDIManager().closeWindow(zoomPixel);
96 101
		if(view != null)
97 102
			PluginServices.getMDIManager().closeWindow(view);
98 103
		if(table != null)
99 104
			PluginServices.getMDIManager().closeWindow(table);
100 105
		
101
		zooms = new ControlsPanel(0, posYViews, hSmallWindows, smallWindowsHeight);
102
		table = new GCPTablePanel(hSmallWindows, posYViews, (int)(p.getWidth() * (1 - smallWindowsWidthPercent)), smallWindowsHeight);
106
		zoomMap = new ZoomMapDialog(0, posYViews, smallWindowsWidth, smallWindowsHeight);
107
		table = new GCPTablePanel(smallWindowsWidth, posYViews, tableWidth, smallWindowsHeight);
108
		zoomPixel = new ZoomRasterDialog(smallWindowsWidth + tableWidth, posYViews, smallWindowsWidth, smallWindowsHeight);
109
		
103 110
		view = new ViewPanel(wViews, 0, wViews, hViews);
104 111
		viewRequestManager = new ViewRasterRequestManager(view, lyrToGeoref, new Dimension(wViews, hViews));
105 112
		view.setExtensionRequest(viewRequestManager);
......
116 123
		
117 124
		PluginServices.getMDIManager().addWindow(view);
118 125
		PluginServices.getMDIManager().addWindow(table);
119
		PluginServices.getMDIManager().addWindow(zooms);
126
		PluginServices.getMDIManager().addWindow(zoomMap);
127
		PluginServices.getMDIManager().addWindow(zoomPixel);
120 128
	}
121 129
	
122 130
	/**
......
125 133
	 * @param vp ViewPort
126 134
	 */
127 135
	public void setMapParams(BufferedImage img, ViewPort vp) {
128
		if(zooms != null && img != null) {
136
		if(zoomMap != null && img != null) {
129 137
			Rectangle2D r = vp.getAdjustedExtent();
130 138
			int w = vp.getImageWidth();
131
			zooms.setMapDrawParams(img, r, r.getWidth() / w, new Point2D.Double(r.getCenterX(), r.getCenterY()));
132
			zooms.getMapGraphicLayer();
139
			zoomMap.setMapDrawParams(img, r, r.getWidth() / w, new Point2D.Double(r.getCenterX(), r.getCenterY()));
140
			zoomMap.getMapGraphicLayer();
133 141
		}
134 142
	}
135 143

  
......
139 147
	 * @param vp ViewPort
140 148
	 */
141 149
	public void setPixelParams(BufferedImage img, FLyrRasterSE lyr) {
142
		if(view != null && zooms != null && img != null && lyr != null) {
150
		if(view != null && zoomPixel != null && img != null && lyr != null) {
143 151
			Rectangle2D extBuf = viewRequestManager.request(null);
144 152
			
145 153
			viewRequestManager.setPixelParams(img, extBuf);	
146
			zooms.setPixelDrawParams(img, extBuf, extBuf.getHeight()/img.getHeight(), new Point2D.Double(extBuf.getCenterX(), extBuf.getCenterY()));
147
			zooms.getPixelGraphicLayer();
154
			zoomPixel.setPixelDrawParams(img, extBuf, extBuf.getHeight()/img.getHeight(), new Point2D.Double(extBuf.getCenterX(), extBuf.getCenterY()));
155
			zoomPixel.getPixelGraphicLayer();
148 156
		}
149 157
	}
150 158
	

Also available in: Unified diff