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


Java MouseEvent.getLocation方法代码示例

本文整理汇总了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();
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:27,代码来源:PlotArea.java

示例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();
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:30,代码来源:Axis.java

示例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();
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:10,代码来源:Annotation.java

示例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();
	}
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:11,代码来源:ProductSystemFigure.java

示例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();
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:59,代码来源:Axis.java

示例6: 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

示例7: mouseEntered

import org.eclipse.draw2d.MouseEvent; //导入方法依赖的package包/类
@Override
public void mouseEntered(final MouseEvent me) {
	mouseEnteredLocation = me.getLocation();
}
 
开发者ID:Albertus82,项目名称:CyclesMod,代码行数:5,代码来源:ChangeValueListener.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.getLocation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。