Package java.awt.event

Examples of java.awt.event.MouseAdapter


      m_componentTree.setCellRenderer(new BeanIconRenderer());
      DefaultTreeSelectionModel selectionModel = new DefaultTreeSelectionModel();
      selectionModel.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
      m_componentTree.setSelectionModel(selectionModel);

      m_componentTree.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent e) {

          if (((e.getModifiers() & InputEvent.BUTTON1_MASK)
              != InputEvent.BUTTON1_MASK) || e.isAltDown()) {
            boolean clearSelection = true;
View Full Code Here


   *
   * @param button
   *          The button to add the MouseAdapter
   */
  private void addMouseAdapter(JButton button) {
    button.addMouseListener(new MouseAdapter() {
      boolean mOver;
      boolean mPressed;

      public void mouseEntered(MouseEvent e) {
        mOver = true;
View Full Code Here

   *
   * @param caller
   *          The ContextMenuIf that called this.
   */
  public void addMouseListeners(final ContextMenuIf caller) {
    addMouseListener(new MouseAdapter() {
      private Thread mLeftSingleClickThread;
      private Thread mMiddleSingleClickThread;
      private boolean mPerformingSingleClick = false;
      private boolean mPerformingSingleMiddleClick = false;
     
View Full Code Here

      btn = new JButton(icon);
      btn.setToolTipText(text);
      btn.setBorderPainted(false);
      btn.setMargin(ZERO_INSETS);

      btn.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseEntered(MouseEvent e) {
          if (btn.isEnabled()) {
            btn.setBorderPainted(true);
          }
View Full Code Here

        }
      }
    });


      mLeftList.addMouseListener(new MouseAdapter() {
          public void mouseClicked(MouseEvent e) {
              if (SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 2) {
                  //int index = mLeftList.locationToIndex(e.getPoint());
                  Object[] items = UiUtilities.moveSelectedItems(mLeftList, mRightList);
                  if (items != null && items.length>0) {
                    fireItemTransferredToRightList(items);
                  }
              }
          }
      });

      mRightList.addMouseListener(new MouseAdapter() {
          public void mouseClicked(MouseEvent e) {
              if (SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 2) {
                  //int index = mRightList.locationToIndex(e.getPoint());
                  Object[] items = UiUtilities.moveSelectedItems(mRightList, mLeftList);
                  if (items != null && items.length > 0) {
View Full Code Here

   * @param caller
   *          The ContextMenuIf to exclude from the context menu. When
   *          <code>null</code> no ContextMenuIf is excluded.
   */
  public void addPluginContextMenuMouseListener(final ContextMenuIf caller) {
    addMouseListener(new MouseAdapter() {
      private Thread mLeftClickThread;
      private boolean mPerformingSingleClick = false;

      private Thread mMiddleSingleClickThread;
      private boolean mPerformingMiddleSingleClick = false;
View Full Code Here

    collapsed = true;
    collapseIcon = UIManager.getIcon("Tree.expandedIcon");
    expandIcon = UIManager.getIcon("Tree.collapsedIcon");
    label = new JLabel(DEFAULT_LABEL_TEXT, expandIcon, SwingConstants.LEADING);

    label.addMouseListener(new MouseAdapter() {
      /** {@inheritDoc} */
      public void mouseClicked(final MouseEvent event) {
        if (collapsed) {
          expand();
        } else {
View Full Code Here

   
    mItemRenderer.setScrollPane(mScrollPane);
   
    add(mScrollPane, BorderLayout.CENTER);
   
    mList.addMouseListener(new MouseAdapter() {
      public void mousePressed(MouseEvent evt) {
        if (evt.getX() < mItemRenderer.getSelectionWidth() && mIsEnabled) {
          int index = mList.locationToIndex(evt.getPoint());
            
          if (index != -1) {
View Full Code Here

        c.insets = new Insets(5, 5, 5, 5);
        panel.add(updateButton, c);
       
        workItemsList = new JList();
        workItemsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        workItemsList.addMouseListener(new MouseAdapter() {
            public void mouseClicked(MouseEvent e) {
                if (e.getClickCount() == 2) {
                    select();
                }
            }
View Full Code Here

        getRootPane().setLayout(new BorderLayout());
        getRootPane().add(panel, BorderLayout.CENTER);
       
        workItemsList = new JList();
        workItemsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        workItemsList.addMouseListener(new MouseAdapter() {
            public void mouseClicked(MouseEvent e) {
                if (e.getClickCount() == 2) {
                    select();
                }
            }
View Full Code Here

TOP

Related Classes of java.awt.event.MouseAdapter

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.