public void dragEnter(DropTargetDragEvent dtde) { orginalCursor = component.getCursor(); }
public void dragEnter(DropTargetDragEvent dtde) { orginalCursor = component.getCursor(); }
public void dragEnter(DropTargetDragEvent dtde) { orginalCursor = component.getCursor(); }
public void dragEnter(DropTargetDragEvent dtde) { orginalCursor = component.getCursor(); }
/** * Gets the cursor set in the component. If the component does not have a cursor set, the cursor of its parent is * returned. If no cursor is set in the entire hierarchy, <code>Cursor.DEFAULT_CURSOR</code> is returned. * * @see #setCursor * @since JDK1.1 */ @Override public Cursor getCursor() { if (isEnabled()) { return Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR); } else { return super.getCursor(); } }
@Override public synchronized void cancelScheduleAndSetDefaultCursor(JComponent component) { TimerTask task = componentTasks.get(component); if (task != null) { task.cancel(); componentTasks.remove(component); } if (component.getCursor().getType() == Cursor.WAIT_CURSOR) { component.setCursor(Cursor.getDefaultCursor()); } }
@Override public void mousePressed(final MouseEvent e) { final JComponent component = (JComponent) e.getComponent(); final int cursorType = component.getCursor().getType(); if (cursorType == Cursor.SE_RESIZE_CURSOR) { final IViewerFactory factory = (IViewerFactory) component.getClientProperty(IViewerFactory.class); if (factory == null) { return; } final Point point = e.getPoint(); setBasePoint(new Point (component.getWidth() - point.x, component.getHeight() - point.y)); return; } else { imagePopupMenu.maybeShowPopup(e); return; } }
/** * {@inheritDoc} */ @Override public void mouseMoved(MouseEvent e) { currentMouseX = e.getX(); currentMouseY = e.getY(); Cursor cursorToUse = Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR); if (isOverCancelButton() || isOverFindButton()) { cursorToUse = Cursor.getDefaultCursor(); } JComponent c = (JComponent) e.getSource(); if (!cursorToUse.equals(c.getCursor())) { c.setCursor(cursorToUse); } super.mouseMoved(e); }
@Override public void onMousePressed(MouseEvent event) { if (event.getClickCount() > 1) { return; } if (event.getButton() != MouseEvent.BUTTON1) { return; } GraphTool selectedTool = this.selectionHandler.getSelectedTool(); if (IEdge.class.isInstance(selectedTool.getNodeOrEdge())) { return; } double zoom = editorPart.getZoomFactor(); final Point2D mousePoint = new Point2D.Double(event.getX() / zoom, event.getY() / zoom); if (isMouseOnNode(mousePoint)) { changeSelectedElementIfNeeded(mousePoint); this.isReadyForDragging = true; this.lastMousePoint = mousePoint; this.initialCursor = this.editorPart.getSwingComponent().getCursor(); this.editorPart.getSwingComponent().setCursor(this.dragCursor); } }
/** Creates a new instance of SplashDnDSupport */ DragManager(JComponent component) { this.component = component; dSource = new DragSource(); dRecognizer = dSource.createDefaultDragGestureRecognizer(this.component,DnDConstants.ACTION_MOVE,this); dTarget = new DropTarget(this.component,DnDConstants.ACTION_MOVE,this); component.addMouseMotionListener(this); oCursor = component.getCursor(); }
private void setSize(final JComponent component, int x, int y) { final int cursorType = component.getCursor().getType(); sizeChanged = true; final Dimension size; switch (cursorType) { case Cursor.SE_RESIZE_CURSOR: final Dimension minimumSize = new Dimension(10, 10); if (x <= 2*BORDER_SIZE || y <= 2*BORDER_SIZE) { return; } final double r = Math.sqrt(x * x + y * y); final Dimension preferredSize = ((ScalableComponent) component).getOriginalSize(); final int width = preferredSize.width; final int height = preferredSize.height; final double r0 = Math.sqrt(width * width + height * height); x = (int) (width * r / r0); y = (int) (height * r / r0); final MapView mapView = (MapView) SwingUtilities.getAncestorOfClass(MapView.class, component); if (x < mapView.getZoomed(minimumSize.width) || y < mapView.getZoomed(minimumSize.height)) { return; } size = new Dimension(x, y); ((ScalableComponent) component).setDraftViewerSize(size); component.revalidate(); break; default: } return; }
cursor_ = s.getCursor(); s.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR)); values_ = v;
final String successMessage, final String failureMessage, final List<String> lines, final Runnable successCompletionTask, final String command, final String... commandArgs) { final Cursor originalCursor = parent.getCursor(); Cursor busy = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR); parent.setCursor(busy);
private boolean showNext(final MouseEvent e) { final int cursorType = component.getCursor().getType(); if ((e.getClickCount() != 2) || (e.getButton() != MouseEvent.BUTTON1) || (cursorType == Cursor.SE_RESIZE_CURSOR)) {
@Override public void onMouseMoved(MouseEvent event) { if (!isPrerequisitesOK()) { return; } boolean isMouseOnEdgePath = isMouseOnEdgePath(event); if (isMouseOnEdgePath) { if (this.initialCursor == null) { this.initialCursor = this.editorPart.getSwingComponent().getCursor(); } this.editorPart.getSwingComponent().setCursor(this.transitionCursor); } if (!isMouseOnEdgePath) { if (this.initialCursor != null) { this.editorPart.getSwingComponent().setCursor(this.initialCursor); this.initialCursor = null; } } }