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


Java MouseEvent类代码示例

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


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

示例1: mouseExited

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

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

示例3: addVisibleLabel

import org.eclipse.draw2d.MouseEvent; //导入依赖的package包/类
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);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:25,代码来源:PlanElementRowEditPart.java

示例4: mousePressed

import org.eclipse.draw2d.MouseEvent; //导入依赖的package包/类
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;
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:19,代码来源:ScrollableThumbnail.java

示例5: mouseMoved

import org.eclipse.draw2d.MouseEvent; //导入依赖的package包/类
public void mouseMoved( MouseEvent me )
{
	// System.out.println( "handle move" );
	isInGuideHandle = true;

	// addGuideFeedBack();
}
 
开发者ID:eclipse,项目名称:birt,代码行数:8,代码来源:AbstractGuideHandle.java

示例6: RotatedTextFigure

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

示例7: mouseEntered

import org.eclipse.draw2d.MouseEvent; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:d-case,项目名称:d-case_editor,代码行数:12,代码来源:Userdef005EditPart.java

示例8: mousePressed

import org.eclipse.draw2d.MouseEvent; //导入依赖的package包/类
@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);
		}
	}
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:22,代码来源:ProcessFigure.java

示例9: convertEvent

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

示例10: activate

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

示例11: mousePressed

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

示例12: mousePressed

import org.eclipse.draw2d.MouseEvent; //导入依赖的package包/类
public void mousePressed(MouseEvent me) {
	if (me.getState() == MouseEvent.BUTTON1) {
	
	}
	else if (me.getState() == MouseEvent.BUTTON3) {
	
	}
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:9,代码来源:SimpleNodeMouseListener.java

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

示例14: mouseReleased

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

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


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