Revision 24759 branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toc/actions/ZoomAlTemaTocMenuEntry.java
ZoomAlTemaTocMenuEntry.java | ||
---|---|---|
1 | 1 |
package com.iver.cit.gvsig.project.documents.view.toc.actions; |
2 | 2 |
|
3 |
import java.awt.geom.Rectangle2D; |
|
4 |
|
|
5 |
import org.gvsig.fmap.data.ReadException; |
|
3 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
6 | 4 |
import org.gvsig.fmap.geom.primitive.DefaultEnvelope; |
7 | 5 |
import org.gvsig.fmap.geom.primitive.Envelope; |
8 | 6 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
... | ... | |
117 | 115 |
|
118 | 116 |
if (selectedItems.length==1) { |
119 | 117 |
try { |
120 |
if (!selectedItems[0].isAvailable()) return; |
|
118 |
if (!selectedItems[0].isAvailable()) { |
|
119 |
return; |
|
120 |
} |
|
121 | 121 |
getMapContext().zoomToEnvelope(selectedItems[0].getFullEnvelope()); |
122 | 122 |
} catch (ReadException e1) { |
123 | 123 |
e1.printStackTrace(); |
... | ... | |
150 | 150 |
double maxYVar = extVar.getMaximum(1); |
151 | 151 |
double maxXVar = extVar.getMaximum(0); |
152 | 152 |
double minYVar = extVar.getMinimum(1); |
153 |
if (minXVar <= minXRef) |
|
153 |
if (minXVar <= minXRef) {
|
|
154 | 154 |
minXRef = minXVar; |
155 |
if (maxYVar >= maxYRef) |
|
155 |
} |
|
156 |
if (maxYVar >= maxYRef) { |
|
156 | 157 |
maxYRef = maxYVar; |
157 |
if (maxXVar >= maxXRef) |
|
158 |
} |
|
159 |
if (maxXVar >= maxXRef) { |
|
158 | 160 |
maxXRef = maxXVar; |
159 |
if (minYVar <= minYRef) |
|
161 |
} |
|
162 |
if (minYVar <= minYRef) { |
|
160 | 163 |
minYRef = minYVar; |
164 |
} |
|
161 | 165 |
extRef=new DefaultEnvelope(2,new double[]{minXRef, minYRef},new double[]{ maxXRef, maxYRef}); |
162 | 166 |
} |
163 | 167 |
} |
Also available in: Unified diff