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


Java MouseListener类代码示例

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


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

示例1: addVisibleLabel

import org.eclipse.draw2d.MouseListener; //导入依赖的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

示例2: RotatedTextFigure

import org.eclipse.draw2d.MouseListener; //导入依赖的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

示例3: activate

import org.eclipse.draw2d.MouseListener; //导入依赖的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

示例4: addScheduledLabel

import org.eclipse.draw2d.MouseListener; //导入依赖的package包/类
private void addScheduledLabel(IFigure figure) {
	scheduledLabel = new Label();
	scheduledLabel.setBorder(new SimpleRaisedBorder());
	scheduledLabel.addMouseListener(new MouseListener.Stub() {
		@Override
		public void mousePressed(MouseEvent me) {
			EPlanElement node = getModel();
			ScheduledOperation.toggleScheduledness(node);
		}
	});
	updateScheduledVisual();
	figure.add(scheduledLabel);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:14,代码来源:PlanElementRowEditPart.java

示例5: InteractionFigure

import org.eclipse.draw2d.MouseListener; //导入依赖的package包/类
public InteractionFigure(IEnterExitListener enterExitL,
                         MouseMotionListener motionL,
                         MouseListener clickL,
                         Cursor figureCursor)
{
    enterExitListener = enterExitL;
    motionListener = motionL;
    clickListener = clickL;

    setLayoutManager(new XYLayout());

    setCursor(figureCursor);
}
 
开发者ID:cogtool,项目名称:cogtool,代码行数:14,代码来源:InteractionFigure.java

示例6: PossibleStepFigure

import org.eclipse.draw2d.MouseListener; //导入依赖的package包/类
/**
 * Constructor.
 */
public PossibleStepFigure() {
	final LineLayout layout = new LineLayout();
	layout.setHorizontal(true);
	layout.setMajorAlignment(FlowLayout.ALIGN_TOPLEFT);
	layout.setMinorAlignment(FlowLayout.ALIGN_CENTER);
	layout.setMinorSpacing(SPACING);

	setLayoutManager(layout);
	toolTip = new Label();
	toolTip.setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT));
	toolTip.setBackgroundColor(ColorConstants.tooltipBackground);
	toolTip.setForegroundColor(ColorConstants.tooltipForeground);
	ellipse = createEllipse();
	add(ellipse);
	label = new Label();
	if (withLabel) {
		add(label);
		hasLabel = true;
	} else {
		ellipse.setToolTip(toolTip);
		hasLabel = false;
	}
	addMouseListener(new MouseListener.Stub() {

		/**
		 * {@inheritDoc}
		 * 
		 * @see org.eclipse.draw2d.MouseListener.Stub#mouseReleased(org.eclipse.draw2d.MouseEvent)
		 */
		@Override
		public void mousePressed(MouseEvent me) {
			if (me.button == 1) {
				final EditPartViewer viewer = getViewer();
				viewer.getSelectionManager().deselectAll();
				viewer.getSelectionManager().appendSelection(PossibleStepEditPart.this);
			}
		}

	});

}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:45,代码来源:PossibleStepEditPart.java

示例7: getClickListener

import org.eclipse.draw2d.MouseListener; //导入依赖的package包/类
public MouseListener getClickListener()
{
    return clickListener;
}
 
开发者ID:cogtool,项目名称:cogtool,代码行数:5,代码来源:InteractionFigure.java

示例8: setClickListener

import org.eclipse.draw2d.MouseListener; //导入依赖的package包/类
public void setClickListener(MouseListener clickL)
{
    if (clickListener != clickL) {
        clickListener = clickL;
    }
}
 
开发者ID:cogtool,项目名称:cogtool,代码行数:7,代码来源:InteractionFigure.java


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