01: /*
02: * Project: AMODA - Abstract Modeled Application
03: * Class: de.gulden.framework.amoda.environment.gui.component.DefaultButton
04: * Version: snapshot-beautyj-1.1
05: *
06: * Date: 2004-09-29
07: *
08: * This is a snapshot version of the AMODA 0.2 development branch,
09: * 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;
26:
27: /**
28: * Class DefaultButton.
29: *
30: * @author Jens Gulden
31: * @version snapshot-beautyj-1.1
32: */
33: public class DefaultButton extends JButton {
34:
35: // ------------------------------------------------------------------------
36: // --- field ---
37: // ------------------------------------------------------------------------
38:
39: public static Dimension BUTTON_DEFAULT_SIZE = new Dimension(80, 25);
40:
41: // ------------------------------------------------------------------------
42: // --- constructors ---
43: // ------------------------------------------------------------------------
44:
45: public DefaultButton() {
46: super ();
47: }
48:
49: public DefaultButton(String label) {
50: super (label);
51: }
52:
53: // ------------------------------------------------------------------------
54: // --- method ---
55: // ------------------------------------------------------------------------
56:
57: public Dimension getPreferredSize() {
58: Dimension d = super .getPreferredSize();
59: if (d.width < BUTTON_DEFAULT_SIZE.width) {
60: d.width = BUTTON_DEFAULT_SIZE.width;
61: }
62: if (d.height < BUTTON_DEFAULT_SIZE.height) {
63: d.height = BUTTON_DEFAULT_SIZE.height;
64: }
65: return d;
66: }
67:
68: } // end DefaultButton
|