コード例 #1
0
 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();
   }
 }
コード例 #2
0
  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);
  }
コード例 #3
0
 public void stateChanged(ChangeEvent ce) {
   setSelected(scModel.getSelected() == icon);
 }