public void itemStateChanged(ItemEvent ie) {
   if (ie.getStateChange() == ItemEvent.SELECTED) {
     scModel.setSelected(icon);
     pModel.setSelectedComponent(icon.getComponent());
   } else if (scModel.getSelected() == icon) {
     pModel.clearPanel();
     scModel.clearSelection();
   }
 }
  public SelectedComponentController(
      SelectedComponentModel scModel, ParameterModel pModel, IconPainter icon) {

    this.icon = icon;
    icon.setColor(Color.BLACK);
    icon.setLength(scModel.getICONLENGTH());
    super.setIcon(icon);

    addItemListener(this);

    this.scModel = scModel;
    this.pModel = pModel;

    scModel.addChangeListener(this);
    setSelected(scModel.getSelected() == icon);
  }
 public void stateChanged(ChangeEvent ce) {
   setSelected(scModel.getSelected() == icon);
 }