Package java.awt.event

Examples of java.awt.event.ItemEvent


    private void notifyFileAdded(ListItemUI itemUI)
    {
        int len = this.fileSelectionListeners.size();
        for(int i=0; i<len; i++)
        {
            this.fileSelectionListeners.get(i).itemStateChanged(new ItemEvent(this, EVENT_ADD, itemUI, 0));
        }
    }
View Full Code Here


    private void notifyFileRemoved(ListItemUI itemUI)
    {
        int len = this.fileSelectionListeners.size();
        for(int i=0; i<len; i++)
        {
            this.fileSelectionListeners.get(i).itemStateChanged(new ItemEvent(this, EVENT_REMOVE, itemUI, 0));
        }
    }
View Full Code Here

      }
      action.setSelected(b);
      // Send ChangeEvent
      fireStateChanged();
      // Send ItemEvent
      fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, this,
          this.isSelected() ? ItemEvent.SELECTED : ItemEvent.DESELECTED));
    }
View Full Code Here

                // Send ChangeEvent
                fireStateChanged();

                // Send ItemEvent
                int indeterminate = 3;
                fireItemStateChanged(new ItemEvent(
                        this, ItemEvent.ITEM_STATE_CHANGED, this,
                        indeterminate));
            }
        }
View Full Code Here

            // Send ChangeEvent
            fireStateChanged();

            // Send ItemEvent
            fireItemStateChanged(
                    new ItemEvent(this,
                                  ItemEvent.ITEM_STATE_CHANGED,
                                  this,
                                  this.isSelected() ?  ItemEvent.SELECTED : ItemEvent.DESELECTED));

        }
View Full Code Here

   * setter for the Mode.
   */
  @Override
  public void setMode(Mode mode) {
    if(this.mode != mode) {
      fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED,
          this.mode, ItemEvent.DESELECTED));
      this.mode = mode;
      if(mode == Mode.TRANSFORMING) {
        setTransformingMode();
      } else if(mode == Mode.PICKING) {
        setPickingMode();
      } else if(mode == Mode.ANNOTATING) {
        setAnnotatingMode();
      }
      if(modeBox != null) {
        modeBox.setSelectedItem(mode);
      }
      fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, mode, ItemEvent.SELECTED));
    }
  }
View Full Code Here

   * setter for the Mode.
   */
  @Override
    public void setMode(Mode mode) {
    if(this.mode != mode) {
      fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED,
          this.mode, ItemEvent.DESELECTED));
      this.mode = mode;
      if(mode == Mode.TRANSFORMING) {
        setTransformingMode();
      } else if(mode == Mode.PICKING) {
        setPickingMode();
      } else if(mode == Mode.EDITING) {
        setEditingMode();
      } else if(mode == Mode.ANNOTATING) {
        setAnnotatingMode();
      }
      if(modeBox != null) {
        modeBox.setSelectedItem(mode);
      }
      fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, mode, ItemEvent.SELECTED));
    }
  }
View Full Code Here

    public boolean pick(T v, boolean state) {
        boolean prior_state = this.picked.contains(v);
        if (state) {
            picked.add(v);
            if(prior_state == false) {
                fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED,
                        v, ItemEvent.SELECTED));
            }

        } else {
            picked.remove(v);
            if(prior_state == true) {
                fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED,
                    v, ItemEvent.DESELECTED));
            }

        }
        return prior_state;
View Full Code Here

    /**
     * setter for the Mode.
     */
    public void setMode(Mode mode) {
        if(this.mode != mode) {
            fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED,
                    this.mode, ItemEvent.DESELECTED));
            this.mode = mode;
            if(mode == Mode.TRANSFORMING) {
                setTransformingMode();
            } else if(mode == Mode.PICKING) {
                setPickingMode();
            }
            if(modeBox != null) {
                modeBox.setSelectedItem(mode);
            }
            fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, mode, ItemEvent.SELECTED));
        }
    }
View Full Code Here

                CheckboxGroup chg = cb.getCheckboxGroup();
                if ((chg != null) && (cb == chg.getSelectedCheckbox()) && cb.getState()) {
                    return;
                }
                cb.setState(state);
                postEvent(new ItemEvent(cb, ItemEvent.ITEM_STATE_CHANGED,
                                cb.getLabel(),
                                state? ItemEvent.SELECTED : ItemEvent.DESELECTED));
            }
        });
    }
View Full Code Here

TOP

Related Classes of java.awt.event.ItemEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.