Revision 36042 branches/v2_0_0_prep/extensions/extWFS2/src/org/gvsig/wfs/gui/panels/WFSAreaPanel.java
WFSAreaPanel.java | ||
---|---|---|
33 | 33 |
|
34 | 34 |
import org.gvsig.andami.PluginServices; |
35 | 35 |
import org.gvsig.andami.messages.NotificationManager; |
36 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
37 |
import org.gvsig.andami.ui.mdiManager.MDIManager; |
|
38 |
import org.gvsig.app.ApplicationLocator; |
|
36 | 39 |
import org.gvsig.app.project.documents.view.gui.AbstractViewPanel; |
40 |
import org.gvsig.app.project.documents.view.gui.IView; |
|
37 | 41 |
import org.gvsig.app.project.documents.view.toolListeners.AreaListener; |
38 | 42 |
import org.gvsig.app.project.documents.view.toolListeners.MeasureListener; |
39 | 43 |
import org.gvsig.app.project.documents.view.toolListeners.PanListener; |
... | ... | |
337 | 341 |
*/ |
338 | 342 |
private void enableCoorderatesRegionOperation() { |
339 | 343 |
getCoordinatesPanel().setAllTextFieldsEnabled(true); |
340 |
|
|
341 |
// If the current active view has layers -> set the area in the fields: |
|
342 |
// Adds the extent of the viewport of the current active view |
|
343 |
AbstractViewPanel view = (AbstractViewPanel) PluginServices.getMDIManager().getActiveWindow(); |
|
344 |
|
|
345 |
MDIManager mdiManager = ApplicationLocator.getManager().getUIManager(); |
|
346 |
IWindow[] windows = mdiManager.getOrderedWindows(); |
|
347 |
IView view = null; |
|
348 |
for (int i=0 ; i<windows.length ; i++){ |
|
349 |
if (windows[i] instanceof IView){ |
|
350 |
view = (IView)windows[i]; |
|
351 |
} |
|
352 |
} |
|
353 |
|
|
344 | 354 |
ViewPort vP = view.getMapControl().getMapContext().getViewPort(); |
345 | 355 |
|
346 | 356 |
// Update extent (we will use the adjusted extent because increases the usability) |
347 |
Envelope envelope = vP.getAdjustedExtent();
|
|
357 |
Envelope envelope = vP.getAdjustedEnvelope();
|
|
348 | 358 |
|
349 | 359 |
if (envelope != null) { |
350 | 360 |
getCoordinatesPanel().updateCoordinates(envelope); |
... | ... | |
1654 | 1664 |
last_Coordinates[2] = getJTextFieldVertex2X().getText(); |
1655 | 1665 |
previous_Coordinate_Value[2] = last_Coordinates[2]; |
1656 | 1666 |
|
1657 |
getJTextFieldVertex2Y().setText(String.valueOf(envelope.getMinimum(0)));
|
|
1667 |
getJTextFieldVertex2Y().setText(String.valueOf(envelope.getMinimum(1)));
|
|
1658 | 1668 |
last_Coordinates[3] = getJTextFieldVertex2Y().getText(); |
1659 | 1669 |
previous_Coordinate_Value[3] = last_Coordinates[3]; |
1660 | 1670 |
|
Also available in: Unified diff