// created: 3.1.01
// modified:

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

class ChoiceFunctionChanger extends FunctionChanger
 {

 JRadioButton comButton; 
 JRadioButton orgButton;
 JRadioButton netButton;
 JRadioButton govButton;

 ChoiceFunctionChanger()
  {  
  super();
  // set up the components
  comButton = new JRadioButton("com");
  comButton.setSelected(true);
  orgButton = new JRadioButton("org");
  netButton = new JRadioButton("net");
  govButton = new JRadioButton("gov");

  ButtonGroup group = new ButtonGroup();
  group.add(comButton);
  group.add(orgButton);
  group.add(netButton);
  group.add(govButton);

  add(comButton);
  add(orgButton);
  add(netButton);
  add(govButton);
  } 
 
 public void setEnabled(boolean bool)
  {
  super.setEnabled(bool);
  comButton.setEnabled(bool);
  orgButton.setEnabled(bool);
  netButton.setEnabled(bool);
  govButton.setEnabled(bool);
  }

 /**********************/
 /* method getFunction */
 /**********************/

 ValueFunction getFunction()
  { 
  if (comButton.isSelected())
    return new ChoiceValueFunction("com");
  else if (orgButton.isSelected())
    return new ChoiceValueFunction("org");
  else if (netButton.isSelected())
    return new ChoiceValueFunction("net");
  else // if (govButton.isSelected())
    return new ChoiceValueFunction("gov");
  }

 }