@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: } }
@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(); }
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); }
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; }
public void mouseMoved( MouseEvent me ) { // System.out.println( "handle move" ); isInGuideHandle = true; // addGuideFeedBack(); }
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( ); } } } } ); }
/** * 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(); }
@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); } } }
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; }
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 ); } } ); }
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); }
public void mousePressed(MouseEvent me) { if (me.getState() == MouseEvent.BUTTON1) { } else if (me.getState() == MouseEvent.BUTTON3) { } }
@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(); }
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; }
@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(); }
public void mousePressed(MouseEvent me) { command = new MovingAnnotationLabelCommand(Annotation.this); command.setBeforeMovingDxDy(dx, dy); infoLabelArmed = true; Annotation.this.repaint(); me.consume(); //it must be consumed to make dragging smoothly. }
public void mouseReleased(MouseEvent me) { command.setAfterMovingDxDy(dx, dy); xyGraph.getOperationsManager().addCommand(command); infoLabelArmed = false; Annotation.this.repaint(); me.consume(); }
@Override public void mouseDragged(MouseEvent me) { //System.out.println("Annotation.Pointer.PointerDragger.mouseDragged()"); //free if(trace == null){ setCurrentPosition(me.getLocation(), me.getState() == (InputEvent.BUTTON1 | InputEvent.CONTROL)); }else{ //snap to trace //double tempX = xAxis.getPositionValue(me.getLocation().x, false); //double tempY = yAxis.getPositionValue(me.getLocation().y, false); ISample tempSample = null; double minD = Double.POSITIVE_INFINITY; double d; for(ISample s : trace.getHotSampleList()){ d = Math.sqrt(Math.pow( xAxis.getValuePosition(s.getXValue(), false) - me.getLocation().x, 2) + Math.pow(yAxis.getValuePosition(s.getYValue(), false) - me.getLocation().y, 2)); if(minD > d){ minD = d; tempSample = s; } } if(tempSample != null && currentSnappedSample != tempSample) setCurrentSnappedSample(tempSample, me.getState() == (InputEvent.BUTTON1 | InputEvent.CONTROL)); else if(tempSample == null){ setCurrentPosition(me.getLocation(), me.getState() == (InputEvent.BUTTON1 | InputEvent.CONTROL)); pointerDragged = true; } } me.consume(); }
public void mousePressed(MouseEvent me) { command = new MovingAnnotationCommand(Annotation.this); if(isFree()) command.setBeforeMovePosition(currentPosition); else command.setBeforeMoveSnappedSample(currentSnappedSample); command.setBeforeDxDy(dx, dy); me.consume(); //it must be consumed to make dragging smoothly. }
public void mouseReleased(MouseEvent me) { if(command != null){ if(isFree()) command.setAfterMovePosition(currentPosition); else command.setAfterMoveSnappedSample(currentSnappedSample); command.setAfterDxDy(dx, dy); xyGraph.getOperationsManager().addCommand(command); } }
public void mousePressed(MouseEvent me) { if (!(JSSScrollableThumbnail.this.getClientArea().contains(me.getLocation()))) return; Dimension selectorCenter = selector.getViewportBounds().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; }
public void mouseDragged(MouseEvent me) { if (startLocation != null) { Dimension d = me.getLocation().getDifference(startLocation); d.scale(1.0f / getViewportScaleX(), 1.0f / getViewportScaleY()); viewport.setViewLocation(viewLocation.getTranslated(d)); me.consume(); } }
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; }
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); }
@Override public void mousePressed(final MouseEvent me) { mouseButton = me.button; if (BUTTON_LEFT == mouseButton) { // left click execute(me.getLocation()); } }
protected void setSelection(final MouseEvent me, final boolean isDoubleClick) { IFigure selectedFigure = view.findFigureAt(me.getLocation()); while (selectedFigure != null && !(selectedFigure instanceof IEObjectReferer)) { selectedFigure = selectedFigure.getParent(); } if (selectedFigure != null) { setSelection(new StructuredSelection(selectedFigure), isDoubleClick); } }
public void mouseEntered( MouseEvent me ) { if ( showSource.getParent( ) == null && !isSelected( ) ) { Rectangle rect = getBounds( ).getCopy( ); showSource.setBounds( rect ); getParent( ).add( showSource ); } super.mouseEntered( me ); }
public void mouseExited( MouseEvent me ) { if ( showSource.getParent( ) != null ) { showSource.getParent( ).remove( showSource ); } super.mouseExited( me ); }
public void mousePressed( MouseEvent me ) { state = !state; IFigure parent = this; while ( ( parent = parent.getParent( ) ) != null ) { if ( parent instanceof ReportShowFigure ) { ( (ReportShowFigure) parent ).setShowing( state ); getOwner( ).markDirty( true ); break; } } }
/** * The function that mouse entered event. * @param arg0 the mouse event. */ @Override public void mouseEntered(MouseEvent arg0) { fFigureGoalNameFigure.setHighlightBGColor(); fFigureGoalDescFigure.setHighlightBGColor(); fFigureGoalUserdef001Figure.setHighlightBGColor(); fFigureGoalUserdef002Figure.setHighlightBGColor(); }
@Override public void handleMouseMoved(MouseEvent evt) { if (motionListener != null) { motionListener.mouseMoved(evt); } }
@Override public void handleMousePressed(MouseEvent evt) { if (clickListener != null) { clickListener.mousePressed(evt); } }
@Override public void handleMouseDoubleClicked(MouseEvent evt) { if (clickListener != null) { clickListener.mouseDoubleClicked(evt); } }
@Override public void handleMouseEntered(MouseEvent evt) { enterExitListener.observeEnter(); if (motionListener != null) { motionListener.mouseEntered(evt); } }
/** * The function that mouse exited event. * @param arg0 the mouse event. */ @Override public void mouseExited(MouseEvent arg0) { fFigureUserdef005NameFigure.setDefaultBGColor(); fFigureUserdef005DescFigure.setDefaultBGColor(); fFigureUserdef005Userdef001Figure.setDefaultBGColor(); fFigureUserdef005Userdef002Figure.setDefaultBGColor(); }
@Override public void mousePressed(MouseEvent arg0) { int x = arg0.getLocation().x; int y = arg0.getLocation().y; if (in(x, 350) && in(y, 120)) { SankeySelectionAction psa = new SankeySelectionAction(); psa.setSankeyDiagram(node.editor); psa.run(); } }
@Override public void mousePressed(MouseEvent evt) { if (evt.button != 1) return; if (firstClick) { firstClick = false; scheduleTimer(); } else { App.openEditor(processNode.process); } }