Package java.awt.event

Examples of java.awt.event.MouseEvent


    {
      public void mousePressed(MouseEvent evt)
      {
        if (evt.getClickCount() == 2)
        {
          MouseEvent tableEvt = SwingUtilities.convertMouseEvent(
            (RestorableJTextField)DataTypeBinary.this._textComponent,
            evt, DataTypeBinary.this._table);
          CellDataPopup.showDialog(DataTypeBinary.this._table,
            DataTypeBinary.this._colDef, tableEvt, true);
        }
View Full Code Here


    {
      public void mousePressed(MouseEvent evt)
      {
        if (evt.getClickCount() == 2)
        {
          MouseEvent tableEvt = SwingUtilities.convertMouseEvent(
            (RestorableJTextField)DataTypeClob.this._textComponent,
            evt, DataTypeClob.this._table);
          CellDataPopup.showDialog(DataTypeClob.this._table,
            DataTypeClob.this._colDef, tableEvt, true);
        }
View Full Code Here

    boolean draggingFile = false;

  public void exportAsDrag(JComponent comp, InputEvent e, int action) {
    /* TODO: add support for dragging file link from table icon into other apps */
        if (e instanceof MouseEvent) {
            MouseEvent me = (MouseEvent)e;
            int col = entryTable.columnAtPoint(me.getPoint());
            String[] res = entryTable.getIconTypeForColumn(col);
            if (res == null) {
                super.exportAsDrag(comp, e, DnDConstants.ACTION_LINK);
                return;
            }
View Full Code Here

          if (component.getBounds().contains(ev.getPoint())) {
            if (component instanceof Container) {
              Container container = (Container)component;
              for (int i = container.getComponentCount() - 1; i >= 0; i--) {
                Component c = container.getComponent(i);
                MouseEvent retargetedEvent = deriveEvent(ev, component, ev.getID(),
                    ev.getX() - component.getX(), ev.getY() - component.getY());
                Component mouseEventTarget = retargetMouseEvent(c, retargetedEvent);
                if (mouseEventTarget != null) {
                  return mouseEventTarget;
                }
              }
            }
            int newX = ev.getX() - component.getX();
            int newY = ev.getY() - component.getY();
            if (dispatchRetargetedEvent(deriveEvent(ev, component, ev.getID(), newX, newY))) {             
              if (ev.getID() == MouseEvent.MOUSE_PRESSED) {
                this.grabComponent = component;
             
              return component;
            }
          }
          return null;
        }
       
        /**
         * Dispatches the given event to its component and returns <code>true</code> if component needs to be redrawn.
         */
        private boolean dispatchRetargetedEvent(MouseEvent ev) {
          ev.getComponent().dispatchEvent(ev);
          if (!RepaintManager.currentManager(ev.getComponent()).getDirtyRegion((JComponent)ev.getComponent()).isEmpty()) {
            updateNavigationPanelImage();
            component3D.repaint();
            return true;
          }
          return false;
        }
       
        /**
         * Returns a new <code>MouseEvent</code> derived from the one given in parameter.
         */
        private MouseEvent deriveEvent(MouseEvent ev, Component component, int id, int x, int y) {
          return new MouseEvent(component, id, ev.getWhen(),
              ev.getModifiersEx() | ev.getModifiers(), x, y,
              ev.getClickCount(), ev.isPopupTrigger(), ev.getButton());
        }
      };
    MouseWheelListener mouseWheelListener = new MouseWheelListener() {
View Full Code Here

      if (component.getMouseListeners().length == 0) {
        component.addMouseListener(new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            MouseEvent newEvent = SwingUtilities.convertMouseEvent(component, e, _table);
            _table.consumeMouseClick(newEvent);
          }
        });
      }
View Full Code Here

    _tabbedPane = tabbedPane;
  }

  @Override
  public void actionPerformed(ActionEvent e) {
    MouseEvent mouseEvent = (MouseEvent) e.getSource();
    showPopup(_tabbedPane, mouseEvent.getX(), mouseEvent.getY());
  }
View Full Code Here

    }

    Object value = getValueAt(row, col);
    if (value instanceof JComponent) {
      JComponent component = (JComponent) value;
      MouseEvent newEvent = SwingUtilities.convertMouseEvent(this, e, component);

      component.dispatchEvent(newEvent);
      repaint();
      return true;
    }
View Full Code Here

       
        @Override
        public void mouseMoved(MouseEvent ev) {
          Point mouseLocationInPlan = SwingUtilities.convertPoint(toolTipWindow,
              ev.getX(), ev.getY(), PlanComponent.this);
          dispatchEvent(new MouseEvent(PlanComponent.this, ev.getID(), ev.getWhen(),
              ev.getModifiers(), mouseLocationInPlan.x, mouseLocationInPlan.y,
              ev.getClickCount(), ev.isPopupTrigger(), ev.getButton()));
        }
       
        @Override
View Full Code Here

   * (non-Javadoc)
   * @see java.awt.event.AWTEventListener#eventDispatched(java.awt.AWTEvent)
   */
  public void eventDispatched(AWTEvent e) {
    if (e instanceof MouseEvent) {
      MouseEvent event = (MouseEvent) e;

      MouseEvent converted = SwingUtilities.convertMouseEvent(event.getComponent(), event, this);
      point = converted.getPoint();

      if (e.getID() == MouseEvent.MOUSE_DRAGGED) {
        requestDraw();
      } else if ((event.getID() == MouseEvent.MOUSE_RELEASED) && (dragged != null)) {
        stopDrag(event);
View Full Code Here

    private class HideAWTListener extends ComponentAdapter implements AWTEventListener, WindowStateListener {

        public void eventDispatched(java.awt.AWTEvent aWTEvent) {
            if (aWTEvent instanceof MouseEvent) {
                MouseEvent mv = (MouseEvent) aWTEvent;
                if (mv.getClickCount() > 0) {
                    if (!(aWTEvent.getSource() instanceof Component)) {
                        return;
                    }
                    Component comp = (Component) aWTEvent.getSource();
                    Container par = SwingUtilities.getAncestorNamed("jpopuppane", comp); //NOI18N
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.