Java 类org.eclipse.draw2d.MouseListener 实例源码

项目:OpenSPIFe    文件:PlanElementRowEditPart.java   
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);
}
项目:birt    文件:RotatedTextFigure.java   
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( );
                }
            }
        }
    } );
}
项目:neoscada    文件:GenericLevelPresets.java   
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 );
        }
    } );
}
项目:OpenSPIFe    文件:PlanElementRowEditPart.java   
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);
}
项目:cogtool    文件:InteractionFigure.java   
public InteractionFigure(IEnterExitListener enterExitL,
                         MouseMotionListener motionL,
                         MouseListener clickL,
                         Cursor figureCursor)
{
    enterExitListener = enterExitL;
    motionListener = motionL;
    clickListener = clickL;

    setLayoutManager(new XYLayout());

    setCursor(figureCursor);
}
项目:gemoc-studio    文件:PossibleStepEditPart.java   
/**
 * 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);
            }
        }

    });

}
项目:cogtool    文件:InteractionFigure.java   
public MouseListener getClickListener()
{
    return clickListener;
}
项目:cogtool    文件:InteractionFigure.java   
public void setClickListener(MouseListener clickL)
{
    if (clickListener != clickL) {
        clickListener = clickL;
    }
}