summaryrefslogtreecommitdiff
path: root/java/gjt/ExclusiveImageButtonPanel.java
blob: f1d0878a49970af652cff92626a78f39e45a39ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package gjt;

import java.awt.Image;

/**
 * An ImageButtonPanel which fits all of its ImageButtons with 
 * a StickyImageButtonController.  ExclusiveImageButtonPanel 
 * relies upon its superclass' controller:  a 
 * RadioImageButtonPanelController, which ensures that only one 
 * of the ImageButtons is selected at a time.<p>
 *
 * @version 1.0, Apr 1 1996
 * @author  David Geary
 * @see     ImageButton
 * @see     ImageButtonPanel
 * @see     gjt.test.ToolbarTest
 */
public class ExclusiveImageButtonPanel extends 
                                       ImageButtonPanel {
    public ExclusiveImageButtonPanel(Orientation orient) {
        this(orient, 5);
    }
    public ExclusiveImageButtonPanel(Orientation orient, 
                                     int gap) {
        super(orient, gap);
    }
    public ExclusiveImageButtonPanel(Orientation orient, 
                                     Orientation horient,
                                     Orientation vorient,
                                     int gap) {
        super(orient, horient, vorient, gap);
    }
    public void add(ImageButton button) {
        super.add(button);
        new StickyImageButtonController(button);
    }
    public ImageButton add(Image image) {
        ImageButton button = super.add(image);
        new StickyImageButtonController(button);
        return button;
    }
    public ImageButton add(Image image, String name) {
        ImageButton button = super.add(image, name);
        new StickyImageButtonController(button);
        return button;
    }
}