Class gjt.ImageButtonController
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gjt.ImageButtonController

java.lang.Object
   |
   +----gjt.ImageButtonController

public class ImageButtonController
extends Object
implements MouseController
A controller for an ImageButton, this abstract class establishes the association between itself and an ImageButton and delivers events to its ImageButton.

ImageButtonControllers must be constructed with an ImageButton; the ImageButton's controller gets set by ImageButtonController's constructor.

The ImageButton passed into the constructor must not be null; this is enforced by an assertion.

Methods defined in the MouseController interface are left for subclasses to implement. ImageButtonController defines mouseMove(), mouseEnter() and mouseExit() as no-ops, so that extensions of ImageButtonController only have to implement mouseDown(), mouseUp() and mouseDrag(). Note that extensions are still free to override mouseMove(), mouseEnter() and mouseExit() if desired.

Subclasses should also call the protected XXXButton(Event) methods below, where XXX is either arm, disarm, activate, or deactivate as appropriate. SpringyImageButtonController is a good example of this (so is StickyImageButtonController, but it is more complicated than it's springy sibling).

See Also:
MouseController, ImageButton, ImageButtonEvent, SpringyImageButtonController, StickyImageButtonController, ImageButtonTest

Method Index

 o activateButton(Event)
 o armButton(Event)
 o disarmButton(Event)
 o getButton()
 o mouseDown(Event, int, int)
 o mouseDrag(Event, int, int)
 o mouseEnter(Event, int, int)
 o mouseExit(Event, int, int)
 o mouseMove(Event, int, int)
 o mouseUp(Event, int, int)

Methods

 o getButton
  public ImageButton getButton()
 o mouseEnter
  public boolean mouseEnter(Event event,
                            int x,
                            int y)
 o mouseExit
  public boolean mouseExit(Event event,
                           int x,
                           int y)
 o mouseMove
  public boolean mouseMove(Event event,
                           int x,
                           int y)
 o armButton
  protected void armButton(Event event)
 o disarmButton
  protected void disarmButton(Event event)
 o activateButton
  protected void activateButton(Event event)

All Packages  Class Hierarchy  This Package  Previous  Next  Index