Package java.awt.event

Examples of java.awt.event.ItemEvent


        repaint( 0, headerHeight + rowHeight * oldSelection, 1000, rowHeight );
        repaint( 0, headerHeight + rowHeight * selectedRow, 1000, rowHeight );

        if ( itemListener != null )
          itemListener.itemStateChanged( new ItemEvent( owner,
              ItemEvent.ITEM_STATE_CHANGED, new Integer( selectedRow ),
              ItemEvent.SELECTED ) );
      }
    }
    syncModel();
View Full Code Here


      repaint( 0, headerHeight + rowHeight * oldSelection, 1000, rowHeight );
      repaint( 0, headerHeight + rowHeight * selectedRow, 1000, rowHeight );

      if ( itemListener != null )
        itemListener.itemStateChanged( new ItemEvent( owner, ItemEvent.ITEM_STATE_CHANGED, new Integer( selectedRow ),
            ItemEvent.SELECTED ) );
    }
    syncModel();
  }
View Full Code Here

        repaint( 0, headerHeight + rowHeight * oldSelection, 1000, rowHeight );
        repaint( 0, headerHeight + rowHeight * selectedRow, 1000, rowHeight );

        if ( itemListener != null )
          itemListener.itemStateChanged( new ItemEvent( owner,
              ItemEvent.ITEM_STATE_CHANGED, new Integer( selectedRow ),
              ItemEvent.SELECTED ) );
      }
    }
    syncModel();
View Full Code Here

    void handleListChanged(final int index) {
        final List l = (List)target;
        WToolkit.executeOnEventHandlerThread(l, new Runnable() {
            public void run() {
                postEvent(new ItemEvent(l, ItemEvent.ITEM_STATE_CHANGED,
                                Integer.valueOf(index),
                                isSelected(index)? ItemEvent.SELECTED :
                                                   ItemEvent.DESELECTED));

            }
View Full Code Here

    public void handleAction(final boolean state) {
        final CheckboxMenuItem target = (CheckboxMenuItem)this.target;
        WToolkit.executeOnEventHandlerThread(target, new Runnable() {
            public void run() {
                target.setState(state);
                postEvent(new ItemEvent(target, ItemEvent.ITEM_STATE_CHANGED,
                                        target.getLabel(), (state)
                                          ? ItemEvent.SELECTED
                                          : ItemEvent.DESELECTED));
            }
        });
View Full Code Here

        }
    }

    void notifySelection(String item) {
        Choice c = (Choice)target;
        ItemEvent e = new ItemEvent(c, ItemEvent.ITEM_STATE_CHANGED,
                                item, ItemEvent.SELECTED);
        postEvent(e);
    }
View Full Code Here

                    if (listIndex == selected[i]) {
                        isSelected = true;
                        break;
                    }
                }
                postEvent(new ItemEvent(list, ItemEvent.ITEM_STATE_CHANGED,
                                Integer.valueOf(listIndex),
                                isSelected? ItemEvent.SELECTED : ItemEvent.DESELECTED));

            }
        });
View Full Code Here

    void handleAction(final int index) {
        final Choice c = (Choice)target;
        WToolkit.executeOnEventHandlerThread(c, new Runnable() {
            public void run() {
                c.select(index);
                postEvent(new ItemEvent(c, ItemEvent.ITEM_STATE_CHANGED,
                                c.getItem(index), 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

   * 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

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.