summaryrefslogtreecommitdiff
path: root/java/gjt/ImageButtonPanelController.java
blob: 74f900001b67862bcf9ab7512bceaa1625ae4bf9 (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.Event;

/**
 * A controller for an ImageButtonPanel, this abstract class 
 * does nothing more than establish the association between an 
 * ImageButton and its controller.<p>
 *
 * ImageButtonControllers must be constructed with an 
 * ImageButtonPanel; the ImageButtonPanels' controller gets set 
 * by the constructor.<p>
 *
 * The ImageButton passed into the constructor must not be null; 
 * this is enforced by an assertion.<p>
 *
 * Methods defined in the MouseController interface are left 
 * for subclasses to implement.<p>
 *
 * @version 1.0, Apr 1 1996
 * @author  David Geary
 * @see     MouseController
 * @see     ImageButtonPanel
 * @see     gjt.test.Toolbar
 */
abstract class ImageButtonPanelController implements 
                                          MouseController {
    private ImageButtonPanel panel;

    ImageButtonPanelController(ImageButtonPanel panel) {
        Assert.notNull(panel);
        this.panel = panel;
        panel.setController(this);
    }
    public ImageButtonPanel panel() {
        return panel;
    }
    public boolean mouseEnter(Event event, int x, int y) {
        return false;
    }
    public boolean mouseExit (Event event, int x, int y) {
        return false;
    }
    public boolean mouseMove (Event event, int x, int y) {
        return false;
    }
}