PageRenderTime 19ms CodeModel.GetById 12ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/branches/jsdoc_tk_gui/src/org/jsdoctoolkit/view/MainFrame.java

http://jsdoc-toolkit.googlecode.com/
Java | 104 lines | 73 code | 17 blank | 14 comment | 1 complexity | 7c3f5716758f785a173f82fd7a0fd13d MD5 | raw file
  1package org.jsdoctoolkit.view;
  2
  3import java.awt.BorderLayout;
  4import java.awt.Button;
  5import java.awt.Color;
  6import java.awt.Dimension;
  7import java.awt.FlowLayout;
  8import java.awt.GridBagConstraints;
  9import java.awt.GridBagLayout;
 10import java.awt.Insets;
 11import java.awt.event.ActionEvent;
 12import java.awt.event.ActionListener;
 13
 14import javax.swing.BorderFactory;
 15import javax.swing.ImageIcon;
 16import javax.swing.JApplet;
 17import javax.swing.JButton;
 18import javax.swing.JCheckBox;
 19import javax.swing.JComboBox;
 20import javax.swing.JDialog;
 21import javax.swing.JFrame;
 22import javax.swing.JLabel;
 23import javax.swing.JPanel;
 24import javax.swing.JScrollPane;
 25import javax.swing.JTextArea;
 26import javax.swing.JTextField;
 27import javax.swing.JTree;
 28import javax.swing.UIManager;
 29import javax.swing.border.BevelBorder;
 30import javax.swing.border.EtchedBorder;
 31import javax.swing.border.TitledBorder;
 32import javax.swing.tree.DefaultTreeCellRenderer;
 33
 34import org.jsdoctoolkit.image.IconFactory;
 35import org.jsdoctoolkit.model.MainModel;
 36import org.jsdoctoolkit.model.MyLogger;
 37import org.jvnet.substance.SubstanceLookAndFeel;
 38import org.jvnet.substance.theme.SubstanceRaspberryTheme;
 39
 40public class MainFrame extends JFrame {
 41
 42    /**
 43     * Comment for <code>serialVersionUID</code>
 44     */
 45    private static final long serialVersionUID = 6588748923047774108L;
 46
 47    private static MainFrame instance;
 48
 49    public MainFrame(String titre) {
 50        super(titre);
 51        MainModel mm = new MainModel();
 52        MainView mv = new MainView(mm);
 53        mv.init();
 54
 55        add(mv);
 56        
 57        instance = this;
 58    }
 59
 60    public static MainFrame getInstance() {
 61        return instance;
 62    }
 63
 64    /**
 65     * Close application
 66     */
 67    private void close() {
 68        System.exit(0);
 69    }
 70
 71    /** 
 72     * Lancement de l'application 
 73     */
 74    public static void main(String[] args) {
 75        MyLogger.getLogger().info("Start JsDoc Toolbox");
 76
 77        JFrame.setDefaultLookAndFeelDecorated(true);
 78        JDialog.setDefaultLookAndFeelDecorated(true);
 79        try {
 80            UIManager.setLookAndFeel(new SubstanceLookAndFeel());
 81            SubstanceLookAndFeel.setCurrentTheme(new SubstanceRaspberryTheme());
 82/*
 83            SubstanceLookAndFeel.setCurrentWatermark(new ExtraBrushedMetalWatermark());
 84            SubstanceLookAndFeel.setCurrentButtonShaper(new ClassicButtonShaper());
 85            SubstanceLookAndFeel.setCurrentGradientPainter(new SpecularGradientPainter());*/
 86        } catch (Exception e) {
 87            //MyLogger.getLogger().severe(e.getMessage());
 88        }
 89
 90        MainFrame f = new MainFrame("JsDoc ToolBox Project");
 91
 92        f.pack();
 93        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 94        f.setSize(800, 600);
 95        f.setLocationRelativeTo(null);
 96        f.setVisible(true);
 97        ImageIcon img = IconFactory.getImageIcon("script", IconFactory.GIF);
 98        if(img!=null)
 99            f.setIconImage(img.getImage());
100
101        MyLogger.getLogger().info("Stop JsDoc Toolbox");
102    }
103    
104}