Statistics
| Revision:

svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / ZoomPrev.java @ 774

History | View | Annotate | Download (1.31 KB)

1 312 fernando
package com.iver.cit.gvsig;
2
3 596 fernando
import com.iver.andami.PluginServices;
4
import com.iver.andami.plugins.Extension;
5 312 fernando
import com.iver.cit.gvsig.fmap.FMap;
6
import com.iver.cit.gvsig.fmap.ViewPort;
7
import com.iver.cit.gvsig.gui.View;
8
9
10 596 fernando
public class ZoomPrev implements Extension {
11 312 fernando
12
        /**
13
         * @see com.iver.mdiApp.plugins.Extension#isEnabled()
14
         */
15
        public boolean isEnabled() {
16 596 fernando
                View vista = (View) PluginServices.getMDIManager().getActiveView();
17 312 fernando
                ViewPort vp = vista.getModel().getMapContext().getViewPort();
18
                return vp.getExtents().hasPrevious();
19
        }
20
21
        /**
22
         * @see com.iver.mdiApp.plugins.Extension#isVisible()
23
         */
24
        public boolean isVisible() {
25 596 fernando
                com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager().getActiveView();
26 312 fernando
27
                if (f == null) {
28
                        return false;
29
                }
30
31
                if (f.getClass() == View.class) {
32
                        View v = (View) f;
33
34
                        FMap mapa = v.getModel().getMapContext();
35 387 fjp
                        return mapa.getLayers().getLayersCount() > 0;
36 312 fernando
                } else {
37
                        return false;
38
                }
39
        }
40
41
        /**
42
         * @see com.iver.mdiApp.plugins.Extension#updateUI(java.lang.String)
43
         */
44 596 fernando
        public void execute(String arg0) {
45
                View vista = (View) PluginServices.getMDIManager().getActiveView();
46 312 fernando
                ViewPort vp = vista.getModel().getMapContext().getViewPort();
47
                vp.setExtentPrev();
48
        }
49
50 596 fernando
        /**
51
         * @see com.iver.andami.plugins.Extension#inicializar()
52
         */
53
        public void inicializar() {
54
        }
55
56 312 fernando
}