KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > gulden > framework > amoda > environment > gui > component > DefaultButton


1 /*
2  * Project: AMODA - Abstract Modeled Application
3  * Class: de.gulden.framework.amoda.environment.gui.component.DefaultButton
4  * Version: snapshot-beautyj-1.1
5  *
6  * Date: 2004-09-29
7  *
8  * This is a snapshot version of the AMODA 0.2 development branch,
9  * it is not released as a seperate version.
10  * For AMODA, see http://amoda.berlios.de/.
11  *
12  * This is licensed under the GNU Lesser General Public License (LGPL)
13  * and comes with NO WARRANTY.
14  *
15  * Author: Jens Gulden
16  * Email: amoda@jensgulden.de
17  */

18
19 package de.gulden.framework.amoda.environment.gui.component;
20
21 import de.gulden.framework.amoda.environment.commandline.*;
22 import java.awt.*;
23 import java.lang.*;
24 import java.util.*;
25 import javax.swing.JButton JavaDoc;
26
27 /**
28  * Class DefaultButton.
29  *
30  * @author Jens Gulden
31  * @version snapshot-beautyj-1.1
32  */

33 public class DefaultButton extends JButton JavaDoc {
34
35     // ------------------------------------------------------------------------
36
// --- field ---
37
// ------------------------------------------------------------------------
38

39     public static Dimension BUTTON_DEFAULT_SIZE = new Dimension(80,25);
40
41
42     // ------------------------------------------------------------------------
43
// --- constructors ---
44
// ------------------------------------------------------------------------
45

46     public DefaultButton() {
47         super();
48     }
49
50     public DefaultButton(String JavaDoc label) {
51         super(label);
52     }
53
54
55     // ------------------------------------------------------------------------
56
// --- method ---
57
// ------------------------------------------------------------------------
58

59     public Dimension getPreferredSize() {
60         Dimension d = super.getPreferredSize();
61         if (d.width < BUTTON_DEFAULT_SIZE.width) {
62             d.width = BUTTON_DEFAULT_SIZE.width;
63         }
64         if (d.height < BUTTON_DEFAULT_SIZE.height) {
65             d.height = BUTTON_DEFAULT_SIZE.height;
66         }
67         return d;
68     }
69
70 } // end DefaultButton
71
Popular Tags