Revision 10626 trunk/extensions/extWCS/src/com/iver/cit/gvsig/gui/toolListeners/WCSZoomPixelCursorListener.java
WCSZoomPixelCursorListener.java | ||
---|---|---|
51 | 51 |
|
52 | 52 |
import org.apache.log4j.Logger; |
53 | 53 |
|
54 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
55 |
import com.iver.cit.gvsig.exceptions.expansionfile.ExpansionFileReadException; |
|
54 | 56 |
import com.iver.cit.gvsig.fmap.MapControl; |
55 | 57 |
import com.iver.cit.gvsig.fmap.ViewPort; |
56 | 58 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
... | ... | |
80 | 82 |
public WCSZoomPixelCursorListener(MapControl mc) { |
81 | 83 |
this.mapCtrl = mc; |
82 | 84 |
} |
83 |
|
|
85 |
|
|
84 | 86 |
/* (non-Javadoc) |
85 | 87 |
* @see com.iver.cit.gvsig.fmap.tools.Listeners.PointListener#point(com.iver.cit.gvsig.fmap.tools.Events.PointEvent) |
86 | 88 |
*/ |
... | ... | |
88 | 90 |
Point2D pReal = mapCtrl.getMapContext().getViewPort().toMapPoint(event.getPoint()); |
89 | 91 |
Point imagePoint = new Point((int) event.getPoint().getX(), (int) event.getPoint().getY()); |
90 | 92 |
ViewPort v = mapCtrl.getMapContext().getViewPort(); |
91 |
|
|
93 |
|
|
92 | 94 |
FLayer[] actives = mapCtrl.getMapContext().getLayers().getActives(); |
93 | 95 |
Rectangle2D ext = null; |
94 |
try{ |
|
96 |
try {
|
|
95 | 97 |
ext = actives[0].getFullExtent(); |
96 |
} catch (com.iver.cit.gvsig.fmap.DriverException e1) { |
|
97 |
e1.printStackTrace(); |
|
98 |
} catch (ExpansionFileReadException e) { |
|
99 |
throw new BehaviorException(e.getMessage()); |
|
100 |
} catch (ReadDriverException e) { |
|
101 |
throw new BehaviorException(e.getMessage()); |
|
98 | 102 |
} |
99 |
|
|
103 |
|
|
104 |
|
|
100 | 105 |
if( ext != null ){ |
101 | 106 |
|
102 | 107 |
double w2 = v.getImageWidth()/2D; |
... | ... | |
109 | 114 |
double wcDstMinY = wcOriginY-h2*maxRes.getY(); |
110 | 115 |
double wcDstWidth = w2*maxRes.getX()*2D; |
111 | 116 |
double wcDstHeight = h2*maxRes.getY()*2D; |
112 |
|
|
117 |
|
|
113 | 118 |
ext = new Rectangle2D.Double(wcDstMinX, wcDstMinY, wcDstWidth, wcDstHeight); |
114 | 119 |
mapCtrl.getMapContext().getViewPort().setExtent(ext); |
115 | 120 |
} |
... | ... | |
132 | 137 |
|
133 | 138 |
public void pointDoubleClick(PointEvent event) throws BehaviorException { |
134 | 139 |
// TODO Auto-generated method stub |
135 |
|
|
140 |
|
|
136 | 141 |
} |
137 | 142 |
|
138 | 143 |
} |
Also available in: Unified diff