当前位置: 首页>>代码示例>>Java>>正文


Java MouseEvent.consume方法代码示例

本文整理汇总了Java中org.eclipse.draw2d.MouseEvent.consume方法的典型用法代码示例。如果您正苦于以下问题:Java MouseEvent.consume方法的具体用法?Java MouseEvent.consume怎么用?Java MouseEvent.consume使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.draw2d.MouseEvent的用法示例。


在下文中一共展示了MouseEvent.consume方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: mouseDragged

import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
@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();
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:10,代码来源:Annotation.java

示例2: mousePressed

import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
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.
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:8,代码来源:Annotation.java

示例3: mouseReleased

import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
public void mouseReleased(MouseEvent me) {
	command.setAfterMovingDxDy(dx, dy);
	xyGraph.getOperationsManager().addCommand(command);
	infoLabelArmed = false;
	Annotation.this.repaint();
	me.consume();
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:8,代码来源:Annotation.java

示例4: mouseDragged

import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
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();
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:9,代码来源:JSSScrollableThumbnail.java

示例5: mouseReleased

import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
@Override
public void mouseReleased(MouseEvent me) {
	if(mDragLocation != null){
		me.consume();
		mDragLocation = null;
	}
}
 
开发者ID:SERESLab,项目名称:OnionUmlVisualization,代码行数:8,代码来源:ClassElementEditPart.java

示例6: mousePressed

import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
public void mousePressed(final MouseEvent me)
{
    // Only react to 'main' mouse button, only react to 'real' zoom
    if (me.button != 1  ||  !isValidZoomType(zoomType))
        return;
    armed = true;
    // get start position
    switch (zoomType)
    {
    case RUBBERBAND_ZOOM:
    	if(isHorizontal())
    		start = new Point(me.getLocation().x, bounds.y);
    	else
    		start = new Point(bounds.x, me.getLocation().y);
        end = null;
        break;
    case HORIZONTAL_ZOOM:
        start = new Point(me.getLocation().x, bounds.y);
        end = null;
        break;
    case VERTICAL_ZOOM:
        start = new Point(bounds.x, me.getLocation().y);
        end = null;
        break;
    case PANNING:
        setCursor(grabbing);
        start = me.getLocation();
        end = null;
        startRange = getRange();
        break;
    case ZOOM_IN:
    case ZOOM_IN_HORIZONTALLY:
    case ZOOM_IN_VERTICALLY:
    case ZOOM_OUT:
    case ZOOM_OUT_HORIZONTALLY:
    case ZOOM_OUT_VERTICALLY:
        start = me.getLocation();
        end = new Point();
        // Start timer that will zoom while mouse button is pressed
        Display.getCurrent().timerExec(ZOOM_SPEED, new Runnable()
        {
            public void run()
            {
                if (!armed)
                    return;
                performInOutZoom();
                Display.getCurrent().timerExec(ZOOM_SPEED, this);
            }
        });
        break;
    default:
        break;
	}

    //add command for undo operation
    command = new AxisPanOrZoomCommand(zoomType.getDescription(), Axis.this);
    me.consume();
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:59,代码来源:Axis.java

示例7: mousePressed

import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
public void mousePressed(MouseEvent me) {
	startLocation = me.getLocation();
	viewLocation = viewport.getViewLocation();
	me.consume();
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:6,代码来源:JSSScrollableThumbnail.java

示例8: mousePressed

import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
@Override
public void mousePressed(MouseEvent me) {
	mDragLocation = me.getLocation();
	me.consume();
}
 
开发者ID:SERESLab,项目名称:OnionUmlVisualization,代码行数:6,代码来源:ClassElementEditPart.java


注:本文中的org.eclipse.draw2d.MouseEvent.consume方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。