All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----java.awt.Component | +----java.awt.Canvas | +----gjt.ImageButton
ImageButtons have two constructors, both of which take an Image. The Image passed to the constructor must not be null; this is enforced by an assertion.
Default border thickness is 2 pixels - thickness may be set at construction time only.
Event handling is delegated to an ImageButtonController. By default, all ImageButtons are fitted with an instance of SpringyImageButtonController, however, setController(ImageButtonController) may be used to fit an ImageButton with a different derivation of ImageButtonController after construction.
ImageButtons ensure that their Images are completely loaded before they are displayed.
Drawn either raised or inset, current state may be queried via the isRaised() method.
disable() disables response to input and repaints the image with a bleached version. enable() restores the original image and enables response to input. The intensity of the bleaching effect may be controlled (for all ImageButtons) via the static setBleachPercent(int) method.
public ImageButton(Image image)
public ImageButton(Image image, ImageButtonController controller)
public ImageButton(Image image, int thickness, ImageButtonController controller)
public static int setBleachPercent()
public static void getBleachPercent(int p)
public void setImage(Image image)
public Dimension minimumSize()
public Dimension preferredSize()
public boolean isRaised()
public boolean isDisabled()
public void enable()
public void disable()
public void resize(int w, int h)
public void reshape(int x, int y, int w, int h)
public void paint(Graphics g)
public void paintInset()
public void paintRaised()
public boolean isInside(int x, int y)
public void setController(ImageButtonController controller)
public ImageButtonController getController()
public boolean mouseDown(Event event, int x, int y)
public boolean mouseUp(Event event, int x, int y)
public boolean mouseDrag(Event event, int x, int y)
All Packages Class Hierarchy This Package Previous Next Index