本文整理汇总了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:
}
}
示例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();
}
示例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);
}
示例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;
}
示例5: mouseMoved
import org.eclipse.draw2d.MouseEvent; //导入依赖的package包/类
public void mouseMoved( MouseEvent me )
{
// System.out.println( "handle move" );
isInGuideHandle = true;
// addGuideFeedBack();
}
示例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( );
}
}
}
} );
}
示例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();
}
示例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);
}
}
}
示例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;
}
示例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 );
}
} );
}
示例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);
}
示例12: mousePressed
import org.eclipse.draw2d.MouseEvent; //导入依赖的package包/类
public void mousePressed(MouseEvent me) {
if (me.getState() == MouseEvent.BUTTON1) {
}
else if (me.getState() == MouseEvent.BUTTON3) {
}
}
示例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();
}
示例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;
}
示例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();
}