Subversion Repositories wimsdev

Rev

Blame | Last modification | View Log | RSS feed

  1. package rene.gui;
  2.  
  3. import java.awt.Checkbox;
  4. import java.awt.event.ItemEvent;
  5. import java.awt.event.ItemListener;
  6.  
  7. class CheckboxActionTranslator implements ItemListener
  8. {   DoActionListener C;
  9.     String S;
  10.     public Checkbox CB;
  11.     public CheckboxActionTranslator
  12.         (Checkbox cb, DoActionListener c, String s)
  13.     {   C=c; S=s; CB=cb;
  14.     }
  15.     public void itemStateChanged (ItemEvent e)
  16.     {   C.itemAction(S,CB.getState());
  17.     }
  18. }
  19.  
  20. /**
  21. A Checkbox with modifyable font.
  22. <p>
  23. To be used in DoActionListener interfaces.
  24. */
  25.  
  26. public class CheckboxAction extends Checkbox
  27. {   public CheckboxAction (DoActionListener c, String s)
  28.     {   super(s);
  29.         if (Global.NormalFont!=null) setFont(Global.NormalFont);
  30.         addItemListener(new CheckboxActionTranslator(this,c,s));
  31.     }
  32.     public CheckboxAction (DoActionListener c, String s, String h)
  33.     {   super(s);
  34.         if (Global.NormalFont!=null) setFont(Global.NormalFont);
  35.         addItemListener(new CheckboxActionTranslator(this,c,h));
  36.     }
  37. }
  38.