Class ImageButton

java.lang.Object
   |
   +----java.awt.Component
           |
           +----ImageButton

public class ImageButton
extends Component

bouton qui contient une image gif.


Variable Index

 o DOWN
variable pour distinguer l'etat du bouton
 o IMAGE
variable pour distinguer la presentation du bouton
 o L_CIRCLE
variable pour distinguer la presentation du bouton
 o LABEL
variable pour distinguer la presentation du bouton
 o NONE
variable pour distinguer l'etat du bouton
 o UP
variable pour distinguer l'etat du bouton

Constructor Index

 o ImageButton(String, int)
 o ImageButton(String, int, int)

Method Index

 o addListener(JWListener)
adds a JWListener class to this ImageButton.
 o getID()
 o getMinimumSize()
 o getPreferredSize()
 o getRound()
 o getSeparator()
 o getState()
 o getTransparency()
 o paint(Graphics)
Methode pour afficher le bouton
 o processMouseEvent(MouseEvent)
Is used only internally.
 o processMouseMotionEvent(MouseEvent)
Is used internally.
 o removeListener(JWListener)
Removes the given JWListener.
 o setHintWindow(HintWindow, String)
 o setRound(boolean)
Change l'apparence du bouton.
 o setSeparator(int)
 o setTransparency(boolean)
met ou efffacce la transparence du bouton

Variables

 o NONE
 public static final int NONE
variable pour distinguer l'etat du bouton

 o UP
 public static final int UP
variable pour distinguer l'etat du bouton

 o DOWN
 public static final int DOWN
variable pour distinguer l'etat du bouton

 o LABEL
 public static final int LABEL
variable pour distinguer la presentation du bouton

 o IMAGE
 public static final int IMAGE
variable pour distinguer la presentation du bouton

 o L_CIRCLE
 public static final int L_CIRCLE
variable pour distinguer la presentation du bouton

Constructors

 o ImageButton
 public ImageButton(String filename,
                    int type)
Parameters:
filename - nom d'image / text of Button
type - type de bouton :
  • IMAGE pour afficher le bouton comme image
  • LABEL pour afficher un bouton qui contient un texte
  • L_CIRCLE n'est pas utitlisee
 o ImageButton
 public ImageButton(String param,
                    int ID,
                    int type)
Parameters:
filename - nom d'image
ID - sert a reconetre le bouton qui a declanche une JWevenement
type - type dde bouton :
  • IMAGE pour afficher le bouton comme image
  • LABEL pour afficher un bouton qui contient un texte
  • L_CIRCLE n'est pas utitlisee
Defaults:
  • separator=0
  • transparent=true
  • rounded=false

Methods

 o getID
 public int getID()
Returns:
ID
See Also:
ID
 o getState
 public int getState()
Returns:
state etat du bouton = NONE, UP, DOWN
See Also:
state, NONE, UP, DOWN
 o setTransparency
 public void setTransparency(boolean tr)
met ou efffacce la transparence du bouton

 o getTransparency
 public boolean getTransparency()
Returns:
transparent (boolean) true si transparent, false sinon
 o setRound
 public void setRound(boolean r)
Change l'apparence du bouton.

Parameters:
r - true => le bouton est rond
false => le bouton n'est pas rond
 o getRound
 public boolean getRound()
Returns:
rounded (boolean) true si rond, false sinon
 o setSeparator
 public void setSeparator(int s)
Parameters:
s - l'espace entre ce bouton et le bouton suivant
 o getSeparator
 public int getSeparator()
Returns:
seperator l'espace entre ce bouton et le bouton suivant
 o setHintWindow
 public void setHintWindow(HintWindow hw,
                           String text)
Parameters:
hw - la fenetre qui afffiche le hint
text - texte qui est affiche dans la fenetre de hint
 o paint
 public void paint(Graphics g)
Methode pour afficher le bouton

Overrides:
paint in class Component
 o getPreferredSize
 public Dimension getPreferredSize()
Overrides:
getPreferredSize in class Component
 o getMinimumSize
 public Dimension getMinimumSize()
Overrides:
getMinimumSize in class Component
 o addListener
 public void addListener(JWListener j)
adds a JWListener class to this ImageButton. This class will receive an event, when the button is pressed. ajouter une classe qui recevoit les evenements de ce ImageBouton

 o removeListener
 public void removeListener(JWListener j)
Removes the given JWListener. effacer une classe qui recevoit les evenements de ce ImageBouton

 o processMouseEvent
 public void processMouseEvent(MouseEvent e)
Is used only internally.

Overrides:
processMouseEvent in class Component
 o processMouseMotionEvent
 public void processMouseMotionEvent(MouseEvent e)
Is used internally.

Overrides:
processMouseMotionEvent in class Component