Java 类org.eclipse.draw2d.MouseEvent 实例源码

项目:scouter    文件:Axis.java   
@Override
public void mouseExited(final MouseEvent me)
{
          // Treat like releasing the button to stop zoomIn/Out timer
    switch (zoomType)
          {
          case ZOOM_IN:
          case ZOOM_IN_HORIZONTALLY:
          case ZOOM_IN_VERTICALLY:
          case ZOOM_OUT:
          case ZOOM_OUT_HORIZONTALLY:
          case ZOOM_OUT_VERTICALLY:
              mouseReleased(me);
          default:
          }
}
项目:scouter    文件:PlotArea.java   
@Override
public void mouseDragged(final MouseEvent me) {
    if (!armed)
        return;
    switch (zoomType) {
    case RUBBERBAND_ZOOM:
        end = me.getLocation();
        break;
    case HORIZONTAL_ZOOM:
        if (getCursor() != zoomType.getCursor()) {
            setCursor(zoomType.getCursor());  // scouter.porject 20150902
        }
        end = new Point(me.getLocation().x, bounds.y + bounds.height);
        break;
    case VERTICAL_ZOOM:
        end = new Point(bounds.x + bounds.width, me.getLocation().y);
        break;
    case PANNING:
        end = me.getLocation();
        pan();
        break;
    default:
        break;
    }
    PlotArea.this.repaint();
}
项目:OpenSPIFe    文件:PlanElementRowEditPart.java   
private void addVisibleLabel(IFigure figure) {
    visibleLabel = new Label();
    visibleLabel.setBorder(new SimpleRaisedBorder());
    visibleLabel.addMouseListener(new MouseListener.Stub() {
        @Override
        public void mousePressed(MouseEvent me) {
            EPlanElement node = getModel();
            TriState oldValue = SpifePlanUtils.getVisible(node);
            if (!PlanEditApproverRegistry.getInstance().canModify(node)) {
                return;
            }
            try {
                VisibleOperation op = new VisibleOperation(node, oldValue == TriState.FALSE);
                op.addContext(TransactionUtils.getUndoContext(node));
                IOperationHistory history = OperationHistoryFactory.getOperationHistory();
                history.execute(op, null, null);
            } catch (Exception e) {
                trace.error(e.getMessage(), e);
            }
        }
    });
    updateVisibleVisual();
    figure.add(visibleLabel);
}
项目:gef-gwt    文件:ScrollableThumbnail.java   
public void mousePressed(MouseEvent me) {
    if (!(ScrollableThumbnail.this.getClientArea().contains(me
            .getLocation())))
        return;
    Dimension selectorCenter = selector.getBounds().getSize()
            .scale(0.5f);
    Point scrollPoint = me
            .getLocation()
            .getTranslated(getLocation().getNegated())
            .translate(selectorCenter.negate())
            .scale(1.0f / getViewportScaleX(),
                    1.0f / getViewportScaleY())
            .translate(viewport.getHorizontalRangeModel().getMinimum(),
                    viewport.getVerticalRangeModel().getMinimum());
    viewport.setViewLocation(scrollPoint);
    syncher.mousePressed(me);
    dragTransfer = true;
}
项目:birt    文件:AbstractGuideHandle.java   
public void mouseMoved( MouseEvent me )
{
    // System.out.println( "handle move" );
    isInGuideHandle = true;

    // addGuideFeedBack();
}
项目:birt    文件:RotatedTextFigure.java   
RotatedTextFigure( RotatedTextItem textItem )
{
    super( );

    this.textItem = textItem;

    addMouseListener( new MouseListener.Stub( ) {

        public void mousePressed( MouseEvent me )
        {
            if ( me.button == 2 )
            {
                try
                {
                    RotatedTextFigure.this.textItem.setRotationAngle( normalize( RotatedTextFigure.this.textItem.getRotationAngle( ) + 45 ) );
                }
                catch ( SemanticException e )
                {
                    e.printStackTrace( );
                }
            }
        }
    } );
}
项目:d-case_editor    文件:Userdef005EditPart.java   
/**
 * The function that mouse entered event.
 * @param arg0 the mouse event.
 */
@Override
public void mouseEntered(MouseEvent arg0) {
    fFigureUserdef005NameFigure.setHighlightBGColor();
    fFigureUserdef005DescFigure.setHighlightBGColor();
    fFigureUserdef005Userdef001Figure.setHighlightBGColor();
    fFigureUserdef005Userdef002Figure.setHighlightBGColor();
}
项目:olca-app    文件:ProcessFigure.java   
@Override
public void mousePressed(MouseEvent arg0) {
    if (arg0.button == 1) {
        if (firstClick) {
            firstClick = false;
            TimerTask timerTask = new TimerTask() {

                @Override
                public void run() {
                    firstClick = true;
                }

            };
            Timer timer = new Timer();
            timer.schedule(timerTask, 250);
        } else {
            ChangeStateCommand command = new ChangeStateCommand(node);
            node.parent().editor.getCommandStack().execute(command);
        }
    }
}
项目:neoscada    文件:FigureRenderer.java   
private MouseState convertEvent ( final MouseEvent me )
{
    final MouseState state = new MouseState ();
    state.button = me.button;
    state.x = me.x;
    state.y = me.y;
    state.state = me.getState ();
    return state;
}
项目:neoscada    文件:GenericLevelPresets.java   
private void activate ( final String tag, final Shape shape )
{
    shape.addMouseListener ( new MouseListener.Stub () {

        @Override
        public void mouseReleased ( final MouseEvent me )
        {
            GenericLevelPresets.this.triggerAction ( tag );
        }
    } );
}
项目:subclipse    文件:GraphEditPart.java   
public void mousePressed(MouseEvent event) {
    NodeFigure nodeFigure = (NodeFigure) connection.getTargetAnchor().getOwner();
    scrollTo(nodeFigure);
    Map map = viewer.getEditPartRegistry();
    EditPart editPart = (EditPart)map.get(nodeFigure.getNode());
    if (editPart != null) viewer.select(editPart);
}
项目:JAADAS    文件:SimpleNodeMouseListener.java   
public void mousePressed(MouseEvent me) {
    if (me.getState() == MouseEvent.BUTTON1) {

    }
    else if (me.getState() == MouseEvent.BUTTON3) {

    }
}
项目:scouter    文件:Axis.java   
@Override
public void mouseDragged(final MouseEvent me)
{
    if (! armed)
        return;
    switch (zoomType)
    {
          case RUBBERBAND_ZOOM:
              // Treat rubberband zoom on axis like horiz/vert. zoom
              if (isHorizontal())
                  end = new Point(me.getLocation().x, bounds.y + bounds.height);
              else
                  end = new Point(bounds.x + bounds.width, me.getLocation().y);
              break;
    case HORIZONTAL_ZOOM:
              end = new Point(me.getLocation().x, bounds.y + bounds.height);
              break;
          case VERTICAL_ZOOM:
              end = new Point(bounds.x + bounds.width, me.getLocation().y);
              break;
          case PANNING:
              end = me.getLocation();
              pan();
              break;
          default:
              break;
    }
    Axis.this.repaint();
}
项目:scouter    文件:Axis.java   
public void mouseReleased(final MouseEvent me)
{
    if (! armed)
        return;
          armed = false;
          if (zoomType == ZoomType.PANNING)
              setCursor(zoomType.getCursor());
    if (end == null || start == null || command == null)
        return;

    switch (zoomType)
    {
          case RUBBERBAND_ZOOM:
          case HORIZONTAL_ZOOM:
          case VERTICAL_ZOOM:
              performStartEndZoom();
              break;
          case PANNING:
              pan();
              break;
          case ZOOM_IN:
          case ZOOM_IN_HORIZONTALLY:
          case ZOOM_IN_VERTICALLY:
          case ZOOM_OUT:
          case ZOOM_OUT_HORIZONTALLY:
          case ZOOM_OUT_VERTICALLY:
              performInOutZoom();
              break;
          default:
              break;
    }
    command.saveState();
    xyGraph.getOperationsManager().addCommand(command);
    command = null;
          start = null;
          end = null;
}
项目:scouter    文件:Annotation.java   
@Override
public void mouseDragged(MouseEvent me) {
    x0 = me.getLocation().x - currentPosition.x;
    y0 = me.getLocation().y - currentPosition.y;
    knowX0Y0 = true;
    updatedxdyFromX0Y0();
    Annotation.this.repaint();
    me.consume();
}
项目:scouter    文件:Annotation.java   
public void mousePressed(MouseEvent me) {
    command = new MovingAnnotationLabelCommand(Annotation.this);
    command.setBeforeMovingDxDy(dx, dy);
    infoLabelArmed = true;
    Annotation.this.repaint();
    me.consume(); //it must be consumed to make dragging smoothly.
}
项目:scouter    文件:Annotation.java   
public void mouseReleased(MouseEvent me) {
    command.setAfterMovingDxDy(dx, dy);
    xyGraph.getOperationsManager().addCommand(command);
    infoLabelArmed = false;
    Annotation.this.repaint();
    me.consume();
}
项目:scouter    文件:Annotation.java   
@Override
public void mouseDragged(MouseEvent me) {
    //System.out.println("Annotation.Pointer.PointerDragger.mouseDragged()");

    //free
    if(trace == null){
        setCurrentPosition(me.getLocation(), 
                me.getState() == (InputEvent.BUTTON1 | InputEvent.CONTROL));        
    }else{ //snap to trace
        //double tempX = xAxis.getPositionValue(me.getLocation().x, false);
        //double tempY = yAxis.getPositionValue(me.getLocation().y, false);
        ISample tempSample = null;
        double minD = Double.POSITIVE_INFINITY;
        double d;
        for(ISample s : trace.getHotSampleList()){
            d =  Math.sqrt(Math.pow(
                    xAxis.getValuePosition(s.getXValue(), false) - me.getLocation().x, 2) + 
                    Math.pow(yAxis.getValuePosition(s.getYValue(), false) - me.getLocation().y, 2));
            if(minD > d){
                minD = d;
                tempSample = s;
            }                        
        }   
        if(tempSample != null && currentSnappedSample != tempSample)
            setCurrentSnappedSample(tempSample, 
                    me.getState() == (InputEvent.BUTTON1 | InputEvent.CONTROL));
        else if(tempSample == null){
            setCurrentPosition(me.getLocation(), 
                    me.getState() == (InputEvent.BUTTON1 | InputEvent.CONTROL));    
            pointerDragged = true;
        }

    }       
    me.consume();
}
项目:scouter    文件:Annotation.java   
public void mousePressed(MouseEvent me) {
    command = new MovingAnnotationCommand(Annotation.this);
    if(isFree())
        command.setBeforeMovePosition(currentPosition);
    else
        command.setBeforeMoveSnappedSample(currentSnappedSample);
    command.setBeforeDxDy(dx, dy);
    me.consume(); //it must be consumed to make dragging smoothly.
}
项目:scouter    文件:Annotation.java   
public void mouseReleased(MouseEvent me) {
    if(command != null){
        if(isFree())
            command.setAfterMovePosition(currentPosition);
        else
            command.setAfterMoveSnappedSample(currentSnappedSample);
        command.setAfterDxDy(dx, dy);
        xyGraph.getOperationsManager().addCommand(command);
    }

}
项目:scouter    文件:PlotArea.java   
@Override
public void mouseExited(final MouseEvent me) {
    // Treat like releasing the button to stop zoomIn/Out timer
    switch (zoomType) {
    case ZOOM_IN:
    case ZOOM_IN_HORIZONTALLY:
    case ZOOM_IN_VERTICALLY:
    case ZOOM_OUT:
    case ZOOM_OUT_HORIZONTALLY:
    case ZOOM_OUT_VERTICALLY:
        mouseReleased(me);
    default:
    }
}
项目:PDFReporter-Studio    文件:JSSScrollableThumbnail.java   
public void mousePressed(MouseEvent me) {
    if (!(JSSScrollableThumbnail.this.getClientArea().contains(me.getLocation())))
        return;
    Dimension selectorCenter = selector.getViewportBounds().getSize().scale(0.5f);
    Point scrollPoint = me.getLocation().getTranslated(getLocation().getNegated()).translate(selectorCenter.negate())
            .scale(1.0f / getViewportScaleX(), 1.0f / getViewportScaleY())
            .translate(viewport.getHorizontalRangeModel().getMinimum(), viewport.getVerticalRangeModel().getMinimum());

    viewport.setViewLocation(scrollPoint);
    syncher.mousePressed(me);
    dragTransfer = true;
}
项目:PDFReporter-Studio    文件:JSSScrollableThumbnail.java   
public void mouseDragged(MouseEvent me) {
    if (startLocation != null) {
        Dimension d = me.getLocation().getDifference(startLocation);
        d.scale(1.0f / getViewportScaleX(), 1.0f / getViewportScaleY());
        viewport.setViewLocation(viewLocation.getTranslated(d));
        me.consume();
    }
}
项目:PDFReporter-Studio    文件:ScrollableThumbnail.java   
public void mousePressed(MouseEvent me) {
    if (!(ScrollableThumbnail.this.getClientArea().contains(me.getLocation())))
        return;
    Dimension selectorCenter = selector.getBounds().getSize().scale(0.5f);
    Point scrollPoint = me.getLocation().getTranslated(getLocation().getNegated()).translate(selectorCenter.negate())
            .scale(1.0f / getViewportScaleX(), 1.0f / getViewportScaleY())
            .translate(viewport.getHorizontalRangeModel().getMinimum(), viewport.getVerticalRangeModel().getMinimum());
    viewport.setViewLocation(scrollPoint);
    syncher.mousePressed(me);
    dragTransfer = true;
}
项目:PDFReporter-Studio    文件:ScrollableThumbnail.java   
public void mouseDragged(MouseEvent me) {
    if (startLocation != null) {
        Dimension d = me.getLocation().getDifference(startLocation);
        d.scale(1.0f / getViewportScaleX(), 1.0f / getViewportScaleY());
        viewport.setViewLocation(viewLocation.getTranslated(d));
        me.consume();
    }
}
项目:OpenSPIFe    文件:PlanElementRowEditPart.java   
private void addScheduledLabel(IFigure figure) {
    scheduledLabel = new Label();
    scheduledLabel.setBorder(new SimpleRaisedBorder());
    scheduledLabel.addMouseListener(new MouseListener.Stub() {
        @Override
        public void mousePressed(MouseEvent me) {
            EPlanElement node = getModel();
            ScheduledOperation.toggleScheduledness(node);
        }
    });
    updateScheduledVisual();
    figure.add(scheduledLabel);
}
项目:CyclesMod    文件:ChangeValueListener.java   
@Override
public void mousePressed(final MouseEvent me) {
    mouseButton = me.button;
    if (BUTTON_LEFT == mouseButton) { // left click
        execute(me.getLocation());
    }
}
项目:gef-gwt    文件:ScrollableThumbnail.java   
public void mouseDragged(MouseEvent me) {
    if (startLocation != null) {
        Dimension d = me.getLocation().getDifference(startLocation);
        d.scale(1.0f / getViewportScaleX(), 1.0f / getViewportScaleY());
        viewport.setViewLocation(viewLocation.getTranslated(d));
        me.consume();
    }
}
项目:antlr4ide    文件:RailroadSelectionProvider.java   
protected void setSelection(final MouseEvent me, final boolean isDoubleClick) {
  IFigure selectedFigure = view.findFigureAt(me.getLocation());
  while (selectedFigure != null && !(selectedFigure instanceof IEObjectReferer)) {
    selectedFigure = selectedFigure.getParent();
  }
  if (selectedFigure != null) {
    setSelection(new StructuredSelection(selectedFigure), isDoubleClick);
  }
}
项目:birt    文件:MultipleGuideHandle.java   
public void mouseEntered( MouseEvent me )
{
    if ( showSource.getParent( ) == null && !isSelected( ) )
    {
        Rectangle rect = getBounds( ).getCopy( );
        showSource.setBounds( rect );
        getParent( ).add( showSource );
    }
    super.mouseEntered( me );
}
项目:birt    文件:MultipleGuideHandle.java   
public void mouseExited( MouseEvent me )
{
    if ( showSource.getParent( ) != null )
    {
        showSource.getParent( ).remove( showSource );
    }
    super.mouseExited( me );
}
项目:birt    文件:ListBandControlFigure.java   
public void mousePressed( MouseEvent me )
{
    state = !state;
    IFigure parent = this;
    while ( ( parent = parent.getParent( ) ) != null )
    {
        if ( parent instanceof ReportShowFigure )
        {
            ( (ReportShowFigure) parent ).setShowing( state );
            getOwner( ).markDirty( true );
            break;
        }
    }

}
项目:d-case_editor    文件:GoalEditPart.java   
/**
 * The function that mouse entered event.
 * @param arg0 the mouse event.
 */
@Override
public void mouseEntered(MouseEvent arg0) {
    fFigureGoalNameFigure.setHighlightBGColor();
    fFigureGoalDescFigure.setHighlightBGColor();
    fFigureGoalUserdef001Figure.setHighlightBGColor();
    fFigureGoalUserdef002Figure.setHighlightBGColor();
}
项目:cogtool    文件:InteractionFigure.java   
@Override
public void handleMouseMoved(MouseEvent evt)
{
    if (motionListener != null) {
        motionListener.mouseMoved(evt);
    }
}
项目:cogtool    文件:InteractionFigure.java   
@Override
public void handleMousePressed(MouseEvent evt)
{
    if (clickListener != null) {
        clickListener.mousePressed(evt);
    }
}
项目:cogtool    文件:InteractionFigure.java   
@Override
public void handleMouseDoubleClicked(MouseEvent evt)
{
    if (clickListener != null) {
        clickListener.mouseDoubleClicked(evt);
    }
}
项目:cogtool    文件:InteractionFigure.java   
@Override
public void handleMouseEntered(MouseEvent evt)
{
    enterExitListener.observeEnter();
    if (motionListener != null) {
        motionListener.mouseEntered(evt);
    }
}
项目:d-case_editor    文件:Userdef005EditPart.java   
/**
 * The function that mouse exited event.
 * @param arg0 the mouse event.
 */
@Override
public void mouseExited(MouseEvent arg0) {
    fFigureUserdef005NameFigure.setDefaultBGColor();
    fFigureUserdef005DescFigure.setDefaultBGColor();
    fFigureUserdef005Userdef001Figure.setDefaultBGColor();
    fFigureUserdef005Userdef002Figure.setDefaultBGColor();
}
项目:olca-app    文件:ProductSystemFigure.java   
@Override
public void mousePressed(MouseEvent arg0) {
    int x = arg0.getLocation().x;
    int y = arg0.getLocation().y;
    if (in(x, 350) && in(y, 120)) {
        SankeySelectionAction psa = new SankeySelectionAction();
        psa.setSankeyDiagram(node.editor);
        psa.run();
    }
}
项目:olca-app    文件:ProcessMouseClick.java   
@Override
public void mousePressed(MouseEvent evt) {
    if (evt.button != 1)
        return;
    if (firstClick) {
        firstClick = false;
        scheduleTimer();
    } else {
        App.openEditor(processNode.process);
    }
}