本文整理汇总了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();
}
示例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.
}
示例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();
}
示例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();
}
}
示例5: mouseReleased
import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
@Override
public void mouseReleased(MouseEvent me) {
if(mDragLocation != null){
me.consume();
mDragLocation = null;
}
}
示例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();
}
示例7: mousePressed
import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
public void mousePressed(MouseEvent me) {
startLocation = me.getLocation();
viewLocation = viewport.getViewLocation();
me.consume();
}
示例8: mousePressed
import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
@Override
public void mousePressed(MouseEvent me) {
mDragLocation = me.getLocation();
me.consume();
}