本文整理汇总了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);
}
示例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( );
}
}
}
} );
}
示例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 );
}
} );
}
示例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);
}
示例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);
}
示例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);
}
}
});
}
示例7: getClickListener
import org.eclipse.draw2d.MouseListener; //导入依赖的package包/类
public MouseListener getClickListener()
{
return clickListener;
}
示例8: setClickListener
import org.eclipse.draw2d.MouseListener; //导入依赖的package包/类
public void setClickListener(MouseListener clickL)
{
if (clickListener != clickL) {
clickListener = clickL;
}
}