Back to index

wims  3.65+svn20090927
CheckboxMenuItemAction.java
Go to the documentation of this file.
00001 package rene.gui;
00002 
00003 import java.awt.CheckboxMenuItem;
00004 import java.awt.event.ItemEvent;
00005 import java.awt.event.ItemListener;
00006 
00007 class CheckboxTranslator implements ItemListener
00008 {   DoActionListener C;
00009     String S;
00010     public CheckboxMenuItem CB;
00011     public CheckboxTranslator 
00012         (CheckboxMenuItem cb, DoActionListener c, String s)
00013     {   C=c; S=s; CB=cb;
00014     }
00015     public void itemStateChanged (ItemEvent e)
00016     {   C.itemAction(S,CB.getState());
00017     }
00018 }
00019 
00026 public class CheckboxMenuItemAction extends CheckboxMenuItem
00027 {   public CheckboxMenuItemAction (DoActionListener c, String s, String st)
00028     {   super(s);
00029         addItemListener(new CheckboxTranslator(this,c,st));
00030         if (Global.NormalFont!=null) setFont(Global.NormalFont);
00031     }
00032        public CheckboxMenuItemAction (DoActionListener c, String s)
00033        {      this(c,s,s);
00034        }
00035 }