本文整理汇总了Java中org.eclipse.draw2d.MouseEvent.getLocation方法的典型用法代码示例。如果您正苦于以下问题:Java MouseEvent.getLocation方法的具体用法?Java MouseEvent.getLocation怎么用?Java MouseEvent.getLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.draw2d.MouseEvent
的用法示例。
在下文中一共展示了MouseEvent.getLocation方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mouseDragged
import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
@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();
}
示例2: mouseDragged
import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
@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();
}
示例3: 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();
}
示例4: mousePressed
import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
@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();
}
}
示例5: 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();
}
示例6: mousePressed
import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
public void mousePressed(MouseEvent me) {
startLocation = me.getLocation();
viewLocation = viewport.getViewLocation();
me.consume();
}
示例7: mouseEntered
import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
@Override
public void mouseEntered(final MouseEvent me) {
mouseEnteredLocation = me.getLocation();
}
示例8: mousePressed
import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
@Override
public void mousePressed(MouseEvent me) {
mDragLocation = me.getLocation();
me.consume();
}