01: /*
02: * Copyright Javelin Software, All rights reserved.
03: */
04:
05: package com.javelin.swinglets;
06:
07: import java.awt.*;
08: import java.awt.event.*;
09: import java.util.*;
10: import java.io.*;
11:
12: /**
13: * SButton defines a button. The Button can aither contain
14: * text or an image.
15: *
16: * @author Robin Sharp
17: */
18:
19: public class SButton extends SAbstractButton {
20:
21: public final static String BUTTON = "SUBMIT";
22: public final static String IMAGE = "IMAGE";
23:
24: /**
25: * Creates a SButton with the following text and type.
26: * @param text
27: */
28: public SButton(String text) {
29: super (text);
30: this .type = BUTTON;
31: }
32:
33: /**
34: * Creates a SButton with the following icon and IMAGE type.
35: */
36: public SButton(SIcon icon) {
37: super (null, icon);
38: this .type = IMAGE;
39: }
40:
41: /**
42: * Creates a SButton with no text.
43: */
44: public SButton() {
45: this ("");
46: }
47:
48: /**
49: * Returns the name of the L&F class that renders this component.
50: */
51: public Class getUIClass() {
52: return SButton.class;
53: }
54:
55: /**
56: * Set the icon and turn the type into image.
57: */
58: public SAbstractButton setIcon(SIcon icon) {
59: super .setIcon(icon);
60: this .type = IMAGE;
61:
62: return this ;
63: }
64:
65: // PRIVATE /////////////////////////////////////////////////
66:
67: protected String type;
68:
69: }
|