Logo Search packages:      
Sourcecode: wims version File versions  Download package

CheckboxMenuItemAction.java

package rene.gui;

import java.awt.CheckboxMenuItem;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

class CheckboxTranslator implements ItemListener
{   DoActionListener C;
    String S;
    public CheckboxMenuItem CB;
    public CheckboxTranslator 
        (CheckboxMenuItem cb, DoActionListener c, String s)
    {   C=c; S=s; CB=cb;
    }
    public void itemStateChanged (ItemEvent e)
    {   C.itemAction(S,CB.getState());
    }
}

/**
A CheckboxMenuItem with modifyable font.
<p>
This is to be used in DoActionListener interfaces.
*/

00026 public class CheckboxMenuItemAction extends CheckboxMenuItem
{   public CheckboxMenuItemAction (DoActionListener c, String s, String st)
    {   super(s);
        addItemListener(new CheckboxTranslator(this,c,st));
        if (Global.NormalFont!=null) setFont(Global.NormalFont);
    }
      public CheckboxMenuItemAction (DoActionListener c, String s)
      {     this(c,s,s);
      }
}

Generated by  Doxygen 1.6.0   Back to index