01: /*
02: * PropertiesRootPanel.java
03: *
04: * Copyright (C) 2002, 2003, 2004, 2005, 2006 Takis Diakoumis
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19: *
20: */
21:
22: package org.executequery.gui.prefs;
23:
24: import java.awt.Color;
25: import java.awt.GradientPaint;
26: import java.awt.Graphics;
27: import java.awt.Graphics2D;
28: import java.awt.Image;
29: import javax.swing.ImageIcon;
30: import javax.swing.JPanel;
31:
32: /* ----------------------------------------------------------
33: * CVS NOTE: Changes to the CVS repository prior to the
34: * release of version 3.0.0beta1 has meant a
35: * resetting of CVS revision numbers.
36: * ----------------------------------------------------------
37: */
38:
39: /**
40: *
41: * @author Takis Diakoumis
42: * @version $Revision: 1.4 $
43: * @date $Date: 2006/05/14 06:56:52 $
44: */
45: public class PropertiesRootPanel extends JPanel implements
46: UserPreferenceFunction {
47:
48: private Color darkColour;
49: private Color lightColour;
50: private Image preferencesImage;
51: private Image textImage;
52:
53: public PropertiesRootPanel() {
54: darkColour = new Color(151, 155, 235);
55: lightColour = new Color(181, 184, 241);
56:
57: ImageIcon icon = new ImageIcon(getClass().getResource(
58: "/org/executequery/images/PreferencesIconImage.gif"));
59: preferencesImage = icon.getImage();
60:
61: icon = new ImageIcon(getClass().getResource(
62: "/org/executequery/images/PreferencesText.png"));
63: textImage = icon.getImage();
64: }
65:
66: public void paintComponent(Graphics g) {
67: Graphics2D g2d = (Graphics2D) g;
68:
69: int width = getWidth();
70: int height = getHeight();
71:
72: g2d.setPaint(new GradientPaint(0, 0, darkColour, width, height,
73: lightColour));
74: g2d.fillRect(0, 0, width, height);
75:
76: g2d.drawImage(preferencesImage, 30, 20, this );
77:
78: int xOffset = width - textImage.getWidth(this ) - 15;
79: int yOffset = height - textImage.getHeight(this ) - 20;
80: g2d.drawImage(textImage, xOffset, yOffset, this );
81: }
82:
83: public void save() {
84: }
85:
86: public void restoreDefaults() {
87: }
88:
89: }
|