Back to index

wims  3.65+svn20090927
Public Member Functions | Package Attributes | Private Member Functions
ballenbak.controles Class Reference
Inheritance diagram for ballenbak.controles:
Inheritance graph
[legend]
Collaboration diagram for ballenbak.controles:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 controles (dessin D)
void actionPerformed (ActionEvent e)

Package Attributes

dessin D
TextField tn
TextField tdt
TextField tbars
Button ok
Button plus
Button etoile
Font f

Private Member Functions

Label ajoutlbl (String s)
TextField ajouttf (int i, int j)
Button ajoutb (String s)
int maj (TextField T, int n)

Detailed Description

Definition at line 254 of file ballenbak.java.


Constructor & Destructor Documentation

Definition at line 282 of file ballenbak.java.

  { this.D = D ;
    f = new Font ("Arial", Font.PLAIN, 10) ;
    setBackground (Color.white) ;
    setLayout (new GridLayout(2, 1)) ;
    Panel p = new Panel () ;
    add (p) ;
    p.add (tdt = ajouttf (D.delay, 2)) ;
    p.add (ajoutlbl (droptime)) ;
    p.add (ajoutlbl (numgate)) ;
    p.add (tbars = ajouttf (D.bars, 2)) ;
    p.add (ok = ajoutb (OK)) ;
    p = new Panel () ;
    add (p) ;
    p.add (ajoutlbl (numballs)) ;
    p.add (tn = ajouttf (D.n, 3)) ;
    p.add (plus = ajoutb (oneextra)) ;
    p.add (etoile = ajoutb (START)) ;
  }

Here is the call graph for this function:


Member Function Documentation

void ballenbak.controles.actionPerformed ( ActionEvent  e) [inline]

Definition at line 309 of file ballenbak.java.

  { 
    Object obj = e.getSource () ;
    if (( obj == ok) || (obj == plus) || (obj == etoile))
    { int n = maj (tn, D.n) ;
      if (n >= 0) D.n = n ;
      tn.setText (Integer.toString (D.n)) ;
      try { D.delay = Integer.parseInt (tdt.getText ()) ; }
      catch (NumberFormatException nfe) { }
      tdt.setText (Integer.toString (D.delay)) ;
      if (obj == ok)
      { bars = maj (tbars, D.bars) ;
        if (bars > 0) D.bars = bars ;
        if (D.classes.length < bars + 1) D.classes = new int [bars + 1] ;
        else for (int i = 0 ; i < D.classes.length ; i ++) D.classes [i] = 0 ;
        D.gt.maj (D.bars + 1, D.classes) ;
      }
      else if (obj == plus) D.boucle = 1 ;
           else D.boucle = D.n ;
      tbars.setText (Integer.toString (D.bars)) ;
      tdt.setText (Integer.toString (D.delay)) ;
      D.repaint () ;
    }
  }

Here is the call graph for this function:

Button ballenbak.controles.ajoutb ( String  s) [inline, private]

Definition at line 274 of file ballenbak.java.

  { Button b = new Button (s) ;
    b.addActionListener (this) ;
    b.setFont (f) ;
    return b ;
  }

Here is the caller graph for this function:

Label ballenbak.controles.ajoutlbl ( String  s) [inline, private]

Definition at line 260 of file ballenbak.java.

  { Label l = new Label (s) ;
    l.setBackground (Color.white) ;
    l.setFont (f) ;
    return l ;
  }

Here is the caller graph for this function:

TextField ballenbak.controles.ajouttf ( int  i,
int  j 
) [inline, private]

Definition at line 267 of file ballenbak.java.

  { TextField T = new TextField (Integer.toString (i), j) ;
  T.setBackground (Color.yellow) ; 
    T.setFont (f) ;
    return T ;
  }

Here is the caller graph for this function:

int ballenbak.controles.maj ( TextField  T,
int  n 
) [inline, private]

Definition at line 302 of file ballenbak.java.

  { try { n = Integer.parseInt (T.getText ()) ; }
      catch (NumberFormatException nfe) { }
    if (n <= 0) n = 1 ;
    return n ;
  }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 255 of file ballenbak.java.

Button ballenbak.controles.etoile [package]

Definition at line 257 of file ballenbak.java.

Font ballenbak.controles.f [package]

Definition at line 258 of file ballenbak.java.

Button ballenbak.controles.ok [package]

Definition at line 257 of file ballenbak.java.

Button ballenbak.controles.plus [package]

Definition at line 257 of file ballenbak.java.

TextField ballenbak.controles.tbars [package]

Definition at line 256 of file ballenbak.java.

TextField ballenbak.controles.tdt [package]

Definition at line 256 of file ballenbak.java.

TextField ballenbak.controles.tn [package]

Definition at line 256 of file ballenbak.java.


The documentation for this class was generated from the following file: