Statistics
| Revision:

root / org.gvsig.complexlegend / trunk / org.gvsig.complexlegend / org.gvsig.complexlegend.main / src / main / java / org / gvsig / complexlegend / main / Main.java @ 86

History | View | Annotate | Download (2.6 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.complexlegend.main;
23

    
24
import java.awt.BorderLayout;
25
import java.awt.Dimension;
26

    
27
import javax.swing.JFrame;
28
import javax.swing.JPanel;
29
import javax.swing.UIManager;
30
import javax.swing.UnsupportedLookAndFeelException;
31
import javax.swing.WindowConstants;
32

    
33
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
34
import org.gvsig.fmap.mapcontrol.MapControlCreationException;
35
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
36
import org.gvsig.tools.locator.LocatorException;
37
import org.slf4j.Logger;
38
import org.slf4j.LoggerFactory;
39

    
40
import com.jgoodies.looks.plastic.PlasticLookAndFeel;
41
import com.jgoodies.looks.plastic.PlasticXPLookAndFeel;
42

    
43
/**
44
 * Main executable class for testing the Chart library.
45
 * 
46
 * @author gvSIG Team
47
 * @version $Id$
48
 */
49
public class Main {
50

    
51
        private static final Logger LOG = LoggerFactory.getLogger(Main.class);
52

    
53
        public static void main(String args[]) throws MapControlCreationException,
54
                        LocatorException, LoadLayerException, UnsupportedLookAndFeelException {
55
                new DefaultLibrariesInitializer().fullInitialize();
56
                
57
                PlasticLookAndFeel laf = new PlasticXPLookAndFeel();
58
                UIManager.setLookAndFeel(laf);
59
                
60
                Main main = new Main();
61
                main.show();
62
        }
63

    
64

    
65
        @SuppressWarnings("serial")
66
    public void show() throws MapControlCreationException, LocatorException, LoadLayerException {
67
        JFrame frame = new JFrame("Example APP");
68
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
69
        
70
        JPanel content = new JPanel();
71
        content.setLayout(new BorderLayout());
72
        
73
        frame.add(content);
74
        frame.setPreferredSize(new Dimension(510, 560));
75

    
76
        // Display the window.
77
        frame.pack();
78
        frame.setVisible(true);
79
    }
80

    
81
}