01: /*
02: * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI
03: * for visualizing and manipulating spatial features with geometry and attributes.
04: *
05: * Copyright (C) 2003 Vivid Solutions
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License
09: * as published by the Free Software Foundation; either version 2
10: * of the License, or (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with this program; if not, write to the Free Software
19: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20: *
21: * For more information, contact:
22: *
23: * Vivid Solutions
24: * Suite #1A
25: * 2328 Government Street
26: * Victoria BC V8T 5G5
27: * Canada
28: *
29: * (250)385-6040
30: * www.vividsolutions.com
31: */
32:
33: package com.vividsolutions.jump.workbench.ui;
34:
35: import java.awt.BorderLayout;
36: import java.awt.Color;
37: import java.awt.GridBagConstraints;
38: import java.awt.GridBagLayout;
39: import java.awt.Insets;
40:
41: import javax.swing.BorderFactory;
42: import javax.swing.Icon;
43: import javax.swing.JLabel;
44: import javax.swing.JPanel;
45: import javax.swing.SwingConstants;
46: import javax.swing.border.BevelBorder;
47: import javax.swing.border.Border;
48: import javax.swing.border.CompoundBorder;
49:
50: public class SplashPanel extends JPanel {
51: private GridBagLayout gridBagLayout = new GridBagLayout();
52: private JLabel captionLabel = new JLabel();
53: private JLabel imageLabel = new JLabel();
54: private Border border1;
55: private Border border2;
56:
57: public SplashPanel(Icon image, String caption) {
58: try {
59: jbInit();
60: imageLabel.setIcon(image);
61: captionLabel.setText(caption);
62: } catch (Exception e) {
63: e.printStackTrace();
64: }
65: }
66:
67: private void jbInit() throws Exception {
68: border2 = BorderFactory.createBevelBorder(BevelBorder.RAISED,
69: Color.white, Color.white, new Color(103, 101, 98),
70: new Color(148, 145, 140));
71:
72: CompoundBorder compoundBorder = new CompoundBorder(
73: BorderFactory.createLineBorder(Color.black), border2);
74: this .setLayout(gridBagLayout);
75: captionLabel.setFont(new java.awt.Font("Dialog", 1, 20));
76: this .setBackground(Color.white);
77: captionLabel.setForeground(Color.lightGray);
78: captionLabel.setBorder(border1);
79: captionLabel.setText("Version 1.0");
80: this .setBorder(compoundBorder);
81: this .add(imageLabel, new GridBagConstraints(0, 0, 1, 1, 1, 1,
82: GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
83: new Insets(0, 0, 0, 0), 0, 0));
84: this .add(captionLabel, new GridBagConstraints(0, 1, 1, 1, 0, 0,
85: GridBagConstraints.EAST, GridBagConstraints.NONE,
86: new Insets(0, 0, 0, 10), 0, 0));
87: }
88: }
|