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 / info / gui / FInfoDialog.java @ 40558

History | View | Annotate | Download (3.16 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

    
25
package org.gvsig.app.project.documents.view.info.gui;
26

    
27
import java.awt.BorderLayout;
28

    
29
import javax.swing.JPanel;
30
import javax.swing.JScrollPane;
31

    
32
import org.gvsig.andami.PluginServices;
33
import org.gvsig.andami.ui.mdiManager.IWindowListener;
34
import org.gvsig.andami.ui.mdiManager.SingletonWindow;
35
import org.gvsig.andami.ui.mdiManager.WindowInfo;
36
import org.gvsig.fmap.mapcontrol.swing.dynobject.LayersDynObjectSetComponent;
37

    
38

    
39

    
40
/**
41
 * Dialog that contains the generic Feature Info Viewer
42
 *
43
 * @author laura
44
 *
45
 */
46
public class FInfoDialog extends JPanel implements SingletonWindow,
47
    IWindowListener {
48

    
49
    private static final long serialVersionUID = -6707094091114785970L;
50
    
51
    private LayersDynObjectSetComponent infoViewer;
52
    private JScrollPane scroll = null;
53

    
54
    public FInfoDialog(LayersDynObjectSetComponent info) {
55
        super(new BorderLayout());
56
        this.infoViewer = info;
57
        
58
        scroll = new JScrollPane(
59
            JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
60
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
61
        scroll.setViewportView(infoViewer.asJComponent());
62
        add(scroll, BorderLayout.CENTER);
63
                setSize(500, 375);
64
        }
65
    
66
    public void setInfo(LayersDynObjectSetComponent info) {
67
        
68
        if (infoViewer != null) {
69
            infoViewer.dispose();
70
        }
71

    
72
        this.removeAll();
73
        this.infoViewer = info;
74
        
75
        scroll = new JScrollPane(
76
            JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
77
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
78
        scroll.setViewportView(infoViewer.asJComponent());
79
        add(scroll, BorderLayout.CENTER);
80
    }
81

    
82
        public WindowInfo getWindowInfo() {
83

    
84
                WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG |
85
                                WindowInfo.RESIZABLE | WindowInfo.PALETTE);
86
                m_viewinfo.setWidth(getWidth()+8);
87
                m_viewinfo.setHeight(getHeight());
88
                m_viewinfo.setTitle(PluginServices.getText(this,
89
                                "Identificar_Resultados"));
90

    
91
                return m_viewinfo;
92
        }
93

    
94
        public Object getWindowModel() {
95
                return "FInfoDialog";
96
        }
97

    
98
        public Object getWindowProfile() {
99
                return WindowInfo.PROPERTIES_PROFILE;
100
        }
101

    
102
    public void windowActivated() {
103
        // Nothing to do
104
    }
105

    
106
    public void windowClosed() {
107
        infoViewer.dispose();
108
    }
109
}