001package icy.gui.system;
002
003import icy.gui.frame.IcyFrame;
004
005import java.awt.BorderLayout;
006import java.awt.Dimension;
007import java.awt.Font;
008
009import javax.swing.BoxLayout;
010import javax.swing.JLabel;
011import javax.swing.JPanel;
012import javax.swing.JScrollPane;
013import javax.swing.JTextPane;
014import javax.swing.SwingConstants;
015import javax.swing.WindowConstants;
016import javax.swing.border.EmptyBorder;
017
018public class NewVersionFrame extends IcyFrame
019{
020    private JPanel contentPane;
021    private JTextPane changesLogTextPane;
022
023    /**
024     * Create the New Version Frame.
025     */
026    public NewVersionFrame(String changesLog)
027    {
028        super("New version installed !", true, true, false, false);
029        
030        setPreferredSize(new Dimension(640, 480));
031        setSize(640, 480);
032
033        initialize();
034
035        changesLogTextPane.setText(changesLog);
036        changesLogTextPane.setCaretPosition(2);
037
038        addToDesktopPane();
039        center();
040        setVisible(true);
041        toFront();
042    }
043
044    private void initialize()
045    {
046        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
047
048        contentPane = new JPanel();
049        contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
050        contentPane.setLayout(new BorderLayout(0, 0));
051        setContentPane(contentPane);
052
053        final JPanel panel = new JPanel();
054        contentPane.add(panel, BorderLayout.NORTH);
055        panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
056
057        final JPanel panel_1 = new JPanel();
058        panel_1.setBorder(new EmptyBorder(2, 0, 2, 0));
059        panel.add(panel_1);
060        panel_1.setLayout(new BoxLayout(panel_1, BoxLayout.LINE_AXIS));
061
062        final JLabel lblHeresTheChanges = new JLabel("A new version has been installed !");
063        panel_1.add(lblHeresTheChanges);
064        lblHeresTheChanges.setFont(new Font("Tahoma", Font.BOLD, 12));
065        lblHeresTheChanges.setHorizontalAlignment(SwingConstants.CENTER);
066
067        final JPanel panel_2 = new JPanel();
068        panel_2.setBorder(new EmptyBorder(2, 0, 2, 0));
069        panel.add(panel_2);
070        panel_2.setLayout(new BoxLayout(panel_2, BoxLayout.LINE_AXIS));
071
072        final JLabel lblNewLabel = new JLabel("Checkout what is new in this version:");
073        panel_2.add(lblNewLabel);
074        lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
075        lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 12));
076
077        final JScrollPane scrollPane = new JScrollPane();
078        contentPane.add(scrollPane, BorderLayout.CENTER);
079
080        changesLogTextPane = new JTextPane();
081        changesLogTextPane.setEditable(false);
082        scrollPane.setViewportView(changesLogTextPane);
083    }
084}