Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / main / java / org / gvsig / app / project / documents / view / toolListeners / PointSelectListener.java @ 40558

History | View | Annotate | Download (3.4 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.app.project.documents.view.toolListeners;
25

    
26

    
27
import org.gvsig.andami.PluginServices;
28
import org.gvsig.fmap.mapcontrol.MapControl;
29
import org.gvsig.fmap.mapcontrol.tools.BehaviorException;
30
import org.gvsig.fmap.mapcontrol.tools.PointSelectionListener;
31
import org.gvsig.fmap.mapcontrol.tools.Events.PointEvent;
32

    
33

    
34

    
35
/**
36
 * <p>Inherits {@link PointSelectListener PointSelectListener} enabling/disabling special
37
 *  controls for managing the data selected.</p>
38
 *
39
 * @see PointSelectionListener
40
 *
41
 * @author Vicente Caballero Navarro
42
 */
43
public class PointSelectListener extends PointSelectionListener {
44
        /**
45
         * <p>Creates a new <code>PointSelectListener</code> object.</p>
46
         * 
47
         * @param mapCtrl the <code>MapControl</code> where will be applied the changes
48
         */
49
        public PointSelectListener(MapControl mapCtrl) {
50
                super(mapCtrl);
51
        }
52

    
53
        /*
54
         * (non-Javadoc)
55
         * @see com.iver.cit.gvsig.fmap.tools.PointSelectionListener#point(com.iver.cit.gvsig.fmap.tools.Events.PointEvent)
56
         */
57
        public void point(PointEvent event) throws BehaviorException {
58
                super.point(event);
59
                PluginServices.getMainFrame().enableControls();
60
        }
61

    
62
        /*
63
         * (non-Javadoc)
64
         * @see com.iver.cit.gvsig.fmap.tools.PointSelectionListener#pointDoubleClick(com.iver.cit.gvsig.fmap.tools.Events.PointEvent)
65
         */
66
        public void pointDoubleClick(PointEvent event) throws BehaviorException {
67
        /*        try {
68
                        FLayer[] actives = mapCtrl.getMapContext()
69
            .getLayers().getActives();
70
            for (int i=0; i < actives.length; i++){
71
                if (actives[i] instanceof FLyrAnnotation && actives[i].isEditing()) {
72
                    FLyrAnnotation lyrAnnotation = (FLyrAnnotation) actives[i];
73

74
                            lyrAnnotation.setSelectedEditing();
75
                            lyrAnnotation.setInEdition(lyrAnnotation.getRecordset().getSelection().nextSetBit(0));
76
                            FLabel fl=lyrAnnotation.getLabel(lyrAnnotation.getInEdition());
77
                                        if (fl!=null){
78

79
                                                View vista=(View)PluginServices.getMDIManager().getActiveView();
80
                                                TextFieldEdit tfe=new TextFieldEdit(lyrAnnotation);
81

82
                                                tfe.show(vista.getMapControl().getViewPort().fromMapPoint(fl.getOrig()),vista.getMapControl());
83
                                        }
84

85

86
                }
87
            }
88

89
                } catch (DriverLoadException e) {
90
                        e.printStackTrace();
91
                        throw new BehaviorException("Fallo con el recordset");
92
                } catch (com.iver.cit.gvsig.fmap.DriverException e) {
93
                        e.printStackTrace();
94
                        throw new BehaviorException("Fallo con el recordset");
95
                }
96
*/
97
        }
98
}