01: //** Copyright Statement ***************************************************
02: //The Salmon Open Framework for Internet Applications (SOFIA)
03: // Copyright (C) 1999 - 2002, Salmon LLC
04: //
05: // This program is free software; you can redistribute it and/or
06: // modify it under the terms of the GNU General Public License version 2
07: // as published by the Free Software Foundation;
08: //
09: // This program is distributed in the hope that it will be useful,
10: // but WITHOUT ANY WARRANTY; without even the implied warranty of
11: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: // GNU General Public License for more details.
13: //
14: // You should have received a copy of the GNU General Public License
15: // along with this program; if not, write to the Free Software
16: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17: //
18: // For more information please visit http://www.salmonllc.com
19: //** End Copyright Statement ***************************************************
20: package com.salmonllc.swing;
21:
22: import javax.swing.*;
23:
24: /**
25: * SOFIA implementation of a JButton
26: */
27: public class SButton extends JButton {
28: /**
29: * Creates a button with no set text or icon.
30: */
31: public SButton() {
32: }
33:
34: /**
35: * Creates a button where properties are taken from the
36: * <code>Action</code> supplied.
37: *
38: * @param a the <code>Action</code> used to specify the new button
39: *
40: * @since 1.3
41: */
42: public SButton(Action a) {
43: super (a);
44: }
45:
46: /**
47: * Creates a button with an icon.
48: *
49: * @param icon the Icon image to display on the button
50: */
51: public SButton(Icon icon) {
52: super (icon);
53: if (icon instanceof SIcon)
54: ((SIcon) icon).setParent(this );
55:
56: }
57:
58: /**
59: * Creates a button with text.
60: *
61: * @param text the text of the button
62: */
63: public SButton(String text) {
64: super (text);
65: }
66:
67: /**
68: * Creates a button with initial text and an icon.
69: *
70: * @param text the text of the button
71: * @param icon the Icon image to display on the button
72: */
73: public SButton(String text, Icon icon) {
74: super (text, icon);
75: if (icon instanceof SIcon)
76: ((SIcon) icon).setParent(this);
77:
78: }
79: }
|