Package java.awt.event

Examples of java.awt.event.MouseEvent


      if(threeBstate==sp
   //       || threeBstate==sppr
   ){
  threeBPressed=null;
  threeBstate=spp;
  e=new MouseEvent((Component)e.getSource(), e.getID(), e.getWhen(),
       (e.getModifiers()&(~(InputEvent.BUTTON1_MASK|InputEvent.BUTTON3_MASK)))|InputEvent.BUTTON2_MASK,
       e.getX(), e.getY(), e.getClickCount(), e.isPopupTrigger());
      }
    }
View Full Code Here


  threeBstate=s;
      }
      else if(threeBstate==spp){
  threeBPressed=null;
  threeBstate=sppr;
  e=new MouseEvent((Component)e.getSource(), e.getID(), e.getWhen(),
       (e.getModifiers()&(~(InputEvent.BUTTON1_MASK|InputEvent.BUTTON3_MASK)))|InputEvent.BUTTON2_MASK,
       e.getX(), e.getY(), e.getClickCount(), e.isPopupTrigger());
      }
    }
View Full Code Here

    procPressed(threeBPressed);
    threeBPressed=null;
    threeBstate=s;
  }
  else if(threeBstate==spp){
    e=new MouseEvent((Component)e.getSource(), e.getID(), e.getWhen(),
         (e.getModifiers()&(~(InputEvent.BUTTON1_MASK|InputEvent.BUTTON3_MASK)))|InputEvent.BUTTON2_MASK,
         e.getX(), e.getY(), e.getClickCount(), e.isPopupTrigger());
  }
  else if(threeBstate==sppr){
    return;
View Full Code Here

            protected void doShowPopupMenu(MouseEvent ev)
            {
                if (ev.isPopupTrigger())
                {
                    JPopupMenu menu = new JPopupMenu();
                    final MouseEvent mouseEv = ev;
                    JStatusMenuItem menuItem;
                    final TableModel tblModel = m_table.getModel();
                    if (tblModel.getColumnCount() != m_table.getColumnCount())
                    {
                        menuItem = new JStatusMenuItem(Main.getString("menu_tableheader_add"), Main.getString("statusbar_menutableheader_add_help"), m_statusBar);
                        menu.add(menuItem);
                        menuItem.addActionListener(new ActionListener()
                        {
                            public void actionPerformed (ActionEvent ev)
                            {
                                int i, anzahl = tblModel.getColumnCount(), colIndex, index = 0;
                                JColChooserData[] dataArray = new JColChooserData[anzahl - m_table.getColumnCount()];
                                for (i=0; i<anzahl; i++)
                                {
                                    colIndex = m_table.convertColumnIndexToView(i);
                                    if (colIndex == -1)
                                        dataArray[index++] = new JColChooserData(tblModel.getColumnName(i), i);
                                }
                                JColChooserDialog dia = new JColChooserDialog(Main.m_mainFrame, dataArray);
                                dia.setVisible(true);
                                if (dia.isOk())
                                {
                                    JColChooserData data = dia.getSelectedItem();
                                    TableColumn tblCol = new TableColumn();
                                    tblCol.setModelIndex(data.m_modelColIndex);
                                    TableColumnModel colModel = m_table.getColumnModel();
                                    colIndex = colModel.getColumnIndexAtX(mouseEv.getX());
                                    m_table.addColumn(tblCol);
                                    m_table.moveColumn(m_table.getColumnCount()-1, colIndex);
                                    if (JExifDataModel.m_colTag[data.m_modelColIndex] == JExifTag.GPSTAG_TAG_MAPLINK)
                                    {
                                        int w = new ImageIcon(Main.m_url_map).getIconWidth();
                                        tblCol.setPreferredWidth(w);
                                        tblCol.setMaxWidth(w);
                                        tblCol.setMinWidth(w);
                                    }
                                }
                            }
                        });
                    }
                    if (m_table.getColumnCount() > 1)
                    {
                        menuItem = new JStatusMenuItem(Main.getString("menu_tableheader_delete"), Main.getString("statusbar_menutableheader_delete_help"), m_statusBar);
                        menuItem.addActionListener(new ActionListener()
                        {
                            public void actionPerformed (ActionEvent ev)
                            {
                                TableColumnModel colModel = m_table.getColumnModel();
                                int colIndex = colModel.getColumnIndexAtX(mouseEv.getX());
                                TableColumn tblCol = colModel.getColumn(colIndex);
                                m_table.removeColumn(tblCol);
                                }
                        });
                        menu.add(menuItem);
View Full Code Here

              if (selIndex > 0) {
                // to prevent uncatchable null-pointers
                Rectangle rec = getUI().getTabBounds(this, selIndex - 1);

                MouseEvent event = new MouseEvent((Component) e.getSource(), e.getID() + 1, System
                    .currentTimeMillis(),

                e.getModifiers(), rec.x, rec.y, e.getClickCount(),

                e.isPopupTrigger(), e.getButton());
View Full Code Here

      if(threeBstate==sp
   //       || threeBstate==sppr
   ){
  threeBPressed=null;
  threeBstate=spp;
  e=new MouseEvent((Component)e.getSource(), e.getID(), e.getWhen(),
       (e.getModifiers()&(~(InputEvent.BUTTON1_MASK|InputEvent.BUTTON3_MASK)))|InputEvent.BUTTON2_MASK,
       e.getX(), e.getY(), e.getClickCount(), e.isPopupTrigger());
      }
    }
View Full Code Here

  threeBstate=s;
      }
      else if(threeBstate==spp){
  threeBPressed=null;
  threeBstate=sppr;
  e=new MouseEvent((Component)e.getSource(), e.getID(), e.getWhen(),
       (e.getModifiers()&(~(InputEvent.BUTTON1_MASK|InputEvent.BUTTON3_MASK)))|InputEvent.BUTTON2_MASK,
       e.getX(), e.getY(), e.getClickCount(), e.isPopupTrigger());
      }
    }
try{
View Full Code Here

    procPressed(threeBPressed);
    threeBPressed=null;
    threeBstate=s;
  }
  else if(threeBstate==spp){
    e=new MouseEvent((Component)e.getSource(), e.getID(), e.getWhen(),
         (e.getModifiers()&(~(InputEvent.BUTTON1_MASK|InputEvent.BUTTON3_MASK)))|InputEvent.BUTTON2_MASK,
         e.getX(), e.getY(), e.getClickCount(), e.isPopupTrigger());
  }
  else if(threeBstate==sppr){
    return;
View Full Code Here

            return e;
        }

        Point convertedPoint = SwingUtilities.convertPoint((Component) e.getSource(),
                e.getPoint(), _component);
        return new MouseEvent((Component) e.getSource(),
                e.getID(),
                e.getWhen(),
                e.getModifiers(),
                convertedPoint.x,
                convertedPoint.y,
View Full Code Here

        }
        if (_componentSelfScrollable && e.getSource() == _component) {
            return;
        }
        if (_component.isVisible()) {
            MouseEvent newEvent = convertMouseEvent(e);
            Rectangle r = new Rectangle();
            if (_component instanceof JComponent) {
                ((JComponent) _component).computeVisibleRect(r);
            }
            else {
                r = _component.getBounds();
            }
            if (newEvent.getPoint().y >= r.y && newEvent.getPoint().y <= r.y + r.height - 1 &&
                    newEvent.getPoint().x >= r.x && newEvent.getPoint().x <= r.x + r.width - 1) {
                _hasEntered = true;
                if (_autoScrolling) {
                    stopAutoScrolling();
                }
                Point location = newEvent.getPoint();
                if (r.contains(location)) {
                    updateSelectionForEvent(newEvent, false);
                }
            }
            else {
                if (_hasEntered) {
                    int directionToScroll;
                    if (newEvent.getPoint().y < r.y) {
                        directionToScroll = SCROLL_UP;
                    }
                    else if (newEvent.getPoint().x < r.x) {
                        directionToScroll = SCROLL_LEFT;
                    }
                    else if (newEvent.getPoint().y > r.y + r.height) {
                        directionToScroll = SCROLL_DOWN;
                    }
                    else /*if(e.getPoint().x > r.x + r.width)*/ {
                        directionToScroll = SCROLL_RIGHT;
                    }
View Full Code Here

TOP

Related Classes of java.awt.event.MouseEvent

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.