Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.about / org.gvsig.about.impl / src / main / java / org / gvsig / about / swing / JAboutPanel.java @ 42024

History | View | Annotate | Download (2.81 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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 2
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
 */
22
package org.gvsig.about.swing;
23

    
24
import java.awt.BorderLayout;
25
import java.awt.Dimension;
26
import java.awt.event.ActionEvent;
27
import java.awt.event.ActionListener;
28

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

    
32
import org.gvsig.about.AboutParticipant;
33
import org.gvsig.about.AboutProject;
34
import org.gvsig.about.impl.DefaultAboutManager;
35

    
36
/**
37
 * @author gvSIG Team
38
 * @version $Id$
39
 * 
40
 */
41
public class JAboutPanel extends JPanel implements ActionListener {
42

    
43
    /**
44
         * 
45
         */
46
    private static final long serialVersionUID = 5605530722128487156L;
47
    protected DefaultAboutManager manager;
48
    protected JAboutBrowser browser;
49
    protected JContentPanel content;
50

    
51
    public JAboutPanel(DefaultAboutManager manager) {
52
        this.manager = manager;
53

    
54
        setLayout(new BorderLayout());
55

    
56
        browser = new JAboutBrowser(manager, manager.getProject());
57
        browser.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
58
        browser.addDefaultActionListener(this);
59
        add(browser, BorderLayout.WEST);
60

    
61
        content = new JContentPanel(manager, manager.getProject());
62
        content.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
63
        add(content, BorderLayout.CENTER);
64
        setPreferredSize(new Dimension(650, 400));
65
    }
66

    
67
    public void actionPerformed(ActionEvent arg0) {
68

    
69
        if (arg0.getSource() instanceof JAboutBrowser) {
70
            JAboutBrowser browser = (JAboutBrowser) arg0.getSource();
71

    
72
            if (browser.getSelectedNode() instanceof AboutProject) {
73
                AboutProject project = (AboutProject) browser.getSelectedNode();
74
                content.setContent(project);
75
            } else
76
                if (browser.getSelectedNode() instanceof AboutParticipant) {
77
                    AboutParticipant participant =
78
                        (AboutParticipant) browser.getSelectedNode();
79
                    content.setContent(participant);
80
                }
81

    
82
        }
83
    }
84

    
85
}