javafx.scene.Scene#setCursor ( )源码实例Demo

下面列出了javafx.scene.Scene#setCursor ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: paintera   文件: FloodFill2D.java
public void fillAt(final double x, final double y, final long fill)
{
	if (!isVisible.getAsBoolean())
	{
		LOG.info("Selected source is not visible -- will not fill");
		return;
	}

	final int level = 0;
	final int time = 0;
	final MaskInfo<UnsignedLongType> maskInfo = new MaskInfo<>(time, level, new UnsignedLongType(fill));

	final Scene  scene          = viewer.getScene();
	final Cursor previousCursor = scene.getCursor();
	scene.setCursor(Cursor.WAIT);
	try
	{
		final Mask<UnsignedLongType> mask = source.generateMask(maskInfo, FOREGROUND_CHECK);
		final Interval affectedInterval = fillMaskAt(x, y, this.viewer, mask, source, assignment, FILL_VALUE, this.fillDepth.get());
		requestRepaint.run();
		source.applyMask(mask, affectedInterval, FOREGROUND_CHECK);
	} catch (final MaskInUse e)
	{
		LOG.debug(e.getMessage());
	} finally
	{
		scene.setCursor(previousCursor);
	}
}
 
源代码2 项目: CircuitSim   文件: Text.java
@Override
public void mouseEntered(CircuitManager manager, CircuitState state) {
	Scene scene = manager.getSimulatorWindow().getScene();
	prevCursor = scene.getCursor();
	scene.setCursor(Cursor.TEXT);
	
	entered = true;
}
 
源代码3 项目: fx2048   文件: Game2048.java
private void setEnhancedDeviceSettings(Stage primaryStage, Scene scene) {
    var isARM = System.getProperty("os.arch").toUpperCase().contains("ARM");
    if (isARM) {
        primaryStage.setFullScreen(true);
        primaryStage.setFullScreenExitHint("");
    }

    if (Platform.isSupported(ConditionalFeature.INPUT_TOUCH)) {
        scene.setCursor(Cursor.NONE);
    }
}
 
源代码4 项目: tools-ocr   文件: ScreenCapture.java
/**
 * Constructor.
 */
public ScreenCapture(Stage mainStage) {
	data = new CaptureInfo();
	stage = mainStage;
	rootPane = new BorderPane();
	mainCanvas = new Canvas();
	mainCanvas.setCursor(Cursor.CROSSHAIR);
	mainCanvas.setStyle(CommUtils.STYLE_TRANSPARENT);
	rootPane.getChildren().add(mainCanvas);

	// Scene
	scene = new Scene(rootPane, CaptureInfo.ScreenWidth, CaptureInfo.ScreenHeight, Color.TRANSPARENT);
	scene.setCursor(Cursor.NONE);

	addKeyHandlers();

	// Canvas
	mainCanvas.setWidth(CaptureInfo.ScreenWidth);
	mainCanvas.setHeight(CaptureInfo.ScreenHeight);
	mainCanvas.setOnMousePressed(m -> {
		if (m.getButton() == MouseButton.PRIMARY) {
			data.mouseXPressed = (int) m.getX();
			data.mouseYPressed = (int) m.getY();
		}
	});

	mainCanvas.setOnMouseDragged(m -> {
		if (m.getButton() == MouseButton.PRIMARY) {
			if (m.getScreenX() >= CaptureInfo.ScreenMinX &&
					m.getScreenX() <= CaptureInfo.ScreenMaxX){
				data.mouseXNow = (int) m.getX();
			}
			else if(m.getScreenX() > CaptureInfo.ScreenMaxX){
				data.mouseXNow = CaptureInfo.ScreenWidth;
			}

			if (m.getScreenY() <= CaptureInfo.ScreenHeight){
				data.mouseYNow = (int) m.getY();
			}
			else{
				data.mouseYNow = CaptureInfo.ScreenHeight;
			}
			repaintCanvas();
		}
	});

	// graphics context 2D
	initGraphContent();
	// HideFeaturesPressed
	data.hideExtraFeatures.addListener((observable, oldValue, newValue) -> repaintCanvas());
}
 
源代码5 项目: Path-of-Leveling   文件: ResizeHelper.java
@Override
public void handle(MouseEvent mouseEvent) {
    EventType<? extends MouseEvent> mouseEventType = mouseEvent.getEventType();
    Scene scene = stage.getScene();

    double mouseEventX = mouseEvent.getSceneX();
    double mouseEventY = mouseEvent.getSceneY();
    double sceneWidth = scene.getWidth();
    double sceneHeight = scene.getHeight();

    if (MouseEvent.MOUSE_MOVED.equals(mouseEventType)) {
        if (mouseEventX < border && mouseEventY < border) {
            cursorEvent = Cursor.NW_RESIZE;
        } else if (mouseEventX < border && mouseEventY > sceneHeight - border) {
            cursorEvent = Cursor.SW_RESIZE;
        } else if (mouseEventX > sceneWidth - border && mouseEventY < border) {
            cursorEvent = Cursor.NE_RESIZE;
        } else if (mouseEventX > sceneWidth - border && mouseEventY > sceneHeight - border) {
            cursorEvent = Cursor.SE_RESIZE;
        } else if (mouseEventX < border) {
            cursorEvent = Cursor.W_RESIZE;
        } else if (mouseEventX > sceneWidth - border) {
            cursorEvent = Cursor.E_RESIZE;
        } else if (mouseEventY < border) {
            cursorEvent = Cursor.N_RESIZE;
        } else if (mouseEventY > sceneHeight - border) {
            cursorEvent = Cursor.S_RESIZE;
        } else {
            cursorEvent = Cursor.DEFAULT;
        }
        scene.setCursor(cursorEvent);
    } else if (MouseEvent.MOUSE_EXITED.equals(mouseEventType) || MouseEvent.MOUSE_EXITED_TARGET.equals(mouseEventType)) {
        scene.setCursor(Cursor.DEFAULT);
    } else if (MouseEvent.MOUSE_PRESSED.equals(mouseEventType)) {
        startX = stage.getWidth() - mouseEventX;
        startY = stage.getHeight() - mouseEventY;
    } else if (MouseEvent.MOUSE_DRAGGED.equals(mouseEventType)) {
        if (!Cursor.DEFAULT.equals(cursorEvent)) {
            if (!Cursor.W_RESIZE.equals(cursorEvent) && !Cursor.E_RESIZE.equals(cursorEvent)) {
                double minHeight = stage.getMinHeight() > (border * 2) ? stage.getMinHeight() : (border * 2);
                double maxHeight = stage.getMaxHeight();
                if (Cursor.NW_RESIZE.equals(cursorEvent) || Cursor.N_RESIZE.equals(cursorEvent) || Cursor.NE_RESIZE.equals(cursorEvent)) {
                    double newHeight = stage.getHeight() - (mouseEvent.getScreenY() - stage.getY());
                    if (newHeight >= minHeight && newHeight <= maxHeight) {
                        stage.setHeight(newHeight);
                        stage.setY(mouseEvent.getScreenY());
                    } else {
                        newHeight = Math.min(Math.max(newHeight, minHeight), maxHeight);
                        // y1 + h1 = y2 + h2
                        // y1 = y2 + h2 - h1
                        stage.setY(stage.getY() + stage.getHeight() - newHeight);
                        stage.setHeight(newHeight);
                    }
                } else {
                    stage.setHeight(Math.min(Math.max(mouseEventY + startY, minHeight), maxHeight));
                }
            }

            if (!Cursor.N_RESIZE.equals(cursorEvent) && !Cursor.S_RESIZE.equals(cursorEvent)) {
                double minWidth = stage.getMinWidth() > (border * 2) ? stage.getMinWidth() : (border * 2);
                double maxWidth = stage.getMaxWidth();
                if (Cursor.NW_RESIZE.equals(cursorEvent) || Cursor.W_RESIZE.equals(cursorEvent) || Cursor.SW_RESIZE.equals(cursorEvent)) {
                    double newWidth = stage.getWidth() - (mouseEvent.getScreenX() - stage.getX());
                    if (newWidth >= minWidth && newWidth <= maxWidth) {
                        stage.setWidth(newWidth);
                        stage.setX(mouseEvent.getScreenX());
                    } else {
                        newWidth = Math.min(Math.max(newWidth, minWidth), maxWidth);
                        // x1 + w1 = x2 + w2
                        // x1 = x2 + w2 - w1
                        stage.setX(stage.getX() + stage.getWidth() - newWidth);
                        stage.setWidth(newWidth);
                    }
                } else {
                    stage.setWidth(Math.min(Math.max(mouseEventX + startX, minWidth), maxWidth));
                }
            }
        }
    }

    if (MouseEvent.MOUSE_PRESSED.equals(mouseEventType)) {
        startScreenX = mouseEvent.getScreenX();
        startScreenY = mouseEvent.getScreenY();
    } else if (MouseEvent.MOUSE_DRAGGED.equals(mouseEventType)) {
        if (Cursor.DEFAULT.equals(cursorEvent) && !stage.isMaximized()) {
            stage.setX(stage.getX() + mouseEvent.getScreenX() - startScreenX);
            startScreenX = mouseEvent.getScreenX();
            stage.setY(stage.getY() + mouseEvent.getScreenY() - startScreenY);
            startScreenY = mouseEvent.getScreenY();
        }
    }
}
 
源代码6 项目: CustomStage   文件: ResizeHelper.java
@Override
public void handle(MouseEvent mouseEvent) {
    EventType<? extends MouseEvent> mouseEventType = mouseEvent.getEventType();
    Scene scene = stage.getScene();

    double mouseEventX = mouseEvent.getSceneX(),
            mouseEventY = mouseEvent.getSceneY(),
            sceneWidth = scene.getWidth(),
            sceneHeight = scene.getHeight();

    if (MouseEvent.MOUSE_MOVED.equals(mouseEventType)) {
        if (mouseEventX < border && mouseEventY < border) {
            cursorEvent = Cursor.NW_RESIZE;
        } else if (mouseEventX < border && mouseEventY > sceneHeight - border) {
            cursorEvent = Cursor.SW_RESIZE;
        } else if (mouseEventX > sceneWidth - border && mouseEventY < border) {
            cursorEvent = Cursor.NE_RESIZE;
        } else if (mouseEventX > sceneWidth - border && mouseEventY > sceneHeight - border) {
            cursorEvent = Cursor.SE_RESIZE;
        } else if (mouseEventX < border) {
            cursorEvent = Cursor.W_RESIZE;
        } else if (mouseEventX > sceneWidth - border) {
            cursorEvent = Cursor.E_RESIZE;
        } else if (mouseEventY < border) {
            cursorEvent = Cursor.N_RESIZE;
        } else if (mouseEventY > sceneHeight - border) {
            cursorEvent = Cursor.S_RESIZE;
        } else {
            cursorEvent = Cursor.DEFAULT;
        }
        scene.setCursor(cursorEvent);
    } else if (MouseEvent.MOUSE_EXITED.equals(mouseEventType) || MouseEvent.MOUSE_EXITED_TARGET.equals(mouseEventType)) {
        scene.setCursor(Cursor.DEFAULT);
    } else if (MouseEvent.MOUSE_PRESSED.equals(mouseEventType)) {
        startX = stage.getWidth() - mouseEventX;
        startY = stage.getHeight() - mouseEventY;
    } else if (MouseEvent.MOUSE_DRAGGED.equals(mouseEventType)) {
        if (!Cursor.DEFAULT.equals(cursorEvent)) {
            if (!Cursor.W_RESIZE.equals(cursorEvent) && !Cursor.E_RESIZE.equals(cursorEvent)) {
                double minHeight = stage.getMinHeight() > (border * 2) ? stage.getMinHeight() : (border * 2);
                if (Cursor.NW_RESIZE.equals(cursorEvent) || Cursor.N_RESIZE.equals(cursorEvent)
                        || Cursor.NE_RESIZE.equals(cursorEvent)) {
                    if (stage.getHeight() > minHeight || mouseEventY < 0) {
                        setStageHeight(stage.getY() - mouseEvent.getScreenY() + stage.getHeight());
                        stage.setY(mouseEvent.getScreenY());
                    }
                } else {
                    if (stage.getHeight() > minHeight || mouseEventY + startY - stage.getHeight() > 0) {
                        setStageHeight(mouseEventY + startY);
                    }
                }
            }

            if (!Cursor.N_RESIZE.equals(cursorEvent) && !Cursor.S_RESIZE.equals(cursorEvent)) {
                double minWidth = stage.getMinWidth() > (border * 2) ? stage.getMinWidth() : (border * 2);
                if (Cursor.NW_RESIZE.equals(cursorEvent) || Cursor.W_RESIZE.equals(cursorEvent)
                        || Cursor.SW_RESIZE.equals(cursorEvent)) {
                    if (stage.getWidth() > minWidth || mouseEventX < 0) {
                        setStageWidth(stage.getX() - mouseEvent.getScreenX() + stage.getWidth());
                        stage.setX(mouseEvent.getScreenX());
                    }
                } else {
                    if (stage.getWidth() > minWidth || mouseEventX + startX - stage.getWidth() > 0) {
                        setStageWidth(mouseEventX + startX);
                    }
                }
            }
        }

    }
}
 
源代码7 项目: util4j   文件: Game2048.java
/**
 *
 * @param primaryStage
 */
@Override
public void start(Stage primaryStage) {
    gameManager = new GameManager();
    gameBounds = gameManager.getLayoutBounds();

    StackPane root = new StackPane(gameManager);
    root.getStyleClass().addAll("game-root");
    ChangeListener<Number> resize = (ov, v, v1) -> {
        double scale = Math.min((root.getWidth() - MARGIN) / gameBounds.getWidth(), (root.getHeight() - MARGIN) / gameBounds.getHeight());
        gameManager.setScale(scale);
        gameManager.setLayoutX((root.getWidth() - gameBounds.getWidth()) / 2d);
        gameManager.setLayoutY((root.getHeight() - gameBounds.getHeight()) / 2d);
    };
    root.widthProperty().addListener(resize);
    root.heightProperty().addListener(resize);

    Scene scene = new Scene(root);
    scene.getStylesheets().add(CSS);
    addKeyHandler(scene);
    addSwipeHandlers(scene);

    if (isARMDevice()) {
        primaryStage.setFullScreen(true);
        primaryStage.setFullScreenExitHint("");
    }

    if (Platform.isSupported(ConditionalFeature.INPUT_TOUCH)) {
        scene.setCursor(Cursor.NONE);
    }

    Rectangle2D visualBounds = Screen.getPrimary().getVisualBounds();
    double factor = Math.min(visualBounds.getWidth() / (gameBounds.getWidth() + MARGIN),
            visualBounds.getHeight() / (gameBounds.getHeight() + MARGIN));
    primaryStage.setTitle("2048FX");
    primaryStage.setScene(scene);
    primaryStage.setMinWidth(gameBounds.getWidth() / 2d);
    primaryStage.setMinHeight(gameBounds.getHeight() / 2d);
    primaryStage.setWidth((gameBounds.getWidth() + MARGIN) * factor);
    primaryStage.setHeight((gameBounds.getHeight() + MARGIN) * factor);
    primaryStage.show();
}
 
源代码8 项目: ApkToolPlus   文件: ResizeHelper.java
@Override
public void handle(MouseEvent mouseEvent) {
    EventType<? extends MouseEvent> mouseEventType = mouseEvent.getEventType();
    Scene scene = stage.getScene();

    double mouseEventX = mouseEvent.getSceneX(), 
           mouseEventY = mouseEvent.getSceneY(),
           sceneWidth = scene.getWidth(),
           sceneHeight = scene.getHeight();

    if (MouseEvent.MOUSE_MOVED.equals(mouseEventType) == true) {
        if (mouseEventX < border && mouseEventY < border) {
            cursorEvent = Cursor.NW_RESIZE;
        } else if (mouseEventX < border && mouseEventY > sceneHeight - border) {
            cursorEvent = Cursor.SW_RESIZE;
        } else if (mouseEventX > sceneWidth - border && mouseEventY < border) {
            cursorEvent = Cursor.NE_RESIZE;
        } else if (mouseEventX > sceneWidth - border && mouseEventY > sceneHeight - border) {
            cursorEvent = Cursor.SE_RESIZE;
        } else if (mouseEventX < border) {
            cursorEvent = Cursor.W_RESIZE;
        } else if (mouseEventX > sceneWidth - border) {
            cursorEvent = Cursor.E_RESIZE;
        } else if (mouseEventY < border) {
            cursorEvent = Cursor.N_RESIZE;
        } else if (mouseEventY > sceneHeight - border) {
            cursorEvent = Cursor.S_RESIZE;
        } else {
            cursorEvent = Cursor.DEFAULT;
        }
        scene.setCursor(cursorEvent);
    } else if (MouseEvent.MOUSE_PRESSED.equals(mouseEventType) == true) {
        startX = stage.getWidth() - mouseEventX;
        startY = stage.getHeight() - mouseEventY;
    } else if (MouseEvent.MOUSE_DRAGGED.equals(mouseEventType) == true) {
        if (Cursor.DEFAULT.equals(cursorEvent) == false) {
            if (Cursor.W_RESIZE.equals(cursorEvent) == false && Cursor.E_RESIZE.equals(cursorEvent) == false) {
                double minHeight = stage.getMinHeight() > (border*2) ? stage.getMinHeight() : (border*2);
                if (Cursor.NW_RESIZE.equals(cursorEvent) == true || Cursor.N_RESIZE.equals(cursorEvent) == true || Cursor.NE_RESIZE.equals(cursorEvent) == true) {
                    if (stage.getHeight() > minHeight || mouseEventY < 0) {
                        stage.setHeight(stage.getY() - mouseEvent.getScreenY() + stage.getHeight());
                        stage.setY(mouseEvent.getScreenY());
                    }
                } else {
                    if (stage.getHeight() > minHeight || mouseEventY + startY - stage.getHeight() > 0) {
                        stage.setHeight(mouseEventY + startY);
                    }
                }
            }

            if (Cursor.N_RESIZE.equals(cursorEvent) == false && Cursor.S_RESIZE.equals(cursorEvent) == false) {
                double minWidth = stage.getMinWidth() > (border*2) ? stage.getMinWidth() : (border*2);
                if (Cursor.NW_RESIZE.equals(cursorEvent) == true || Cursor.W_RESIZE.equals(cursorEvent) == true || Cursor.SW_RESIZE.equals(cursorEvent) == true) {
                    if (stage.getWidth() > minWidth || mouseEventX < 0) {
                        stage.setWidth(stage.getX() - mouseEvent.getScreenX() + stage.getWidth());
                        stage.setX(mouseEvent.getScreenX());
                    }
                } else {
                    if (stage.getWidth() > minWidth || mouseEventX + startX - stage.getWidth() > 0) {
                        stage.setWidth(mouseEventX + startX);
                    }
                }
            }
        }

    }
}
 
源代码9 项目: JavaFX-Chat   文件: ResizeHelper.java
@Override
public void handle(MouseEvent mouseEvent) {
    EventType<? extends MouseEvent> mouseEventType = mouseEvent.getEventType();
    Scene scene = stage.getScene();

    double mouseEventX = mouseEvent.getSceneX(),
            mouseEventY = mouseEvent.getSceneY(),
            sceneWidth = scene.getWidth(),
            sceneHeight = scene.getHeight();

    if (MouseEvent.MOUSE_MOVED.equals(mouseEventType)) {
        if (mouseEventX < border && mouseEventY < border) {
            cursorEvent = Cursor.NW_RESIZE;
        } else if (mouseEventX < border && mouseEventY > sceneHeight - border) {
            cursorEvent = Cursor.SW_RESIZE;
        } else if (mouseEventX > sceneWidth - border && mouseEventY < border) {
            cursorEvent = Cursor.NE_RESIZE;
        } else if (mouseEventX > sceneWidth - border && mouseEventY > sceneHeight - border) {
            cursorEvent = Cursor.SE_RESIZE;
        } else if (mouseEventX < border) {
            cursorEvent = Cursor.W_RESIZE;
        } else if (mouseEventX > sceneWidth - border) {
            cursorEvent = Cursor.E_RESIZE;
        } else if (mouseEventY < border) {
            cursorEvent = Cursor.N_RESIZE;
        } else if (mouseEventY > sceneHeight - border) {
            cursorEvent = Cursor.S_RESIZE;
        } else {
            cursorEvent = Cursor.DEFAULT;
        }
        scene.setCursor(cursorEvent);
    } else if(MouseEvent.MOUSE_EXITED.equals(mouseEventType) || MouseEvent.MOUSE_EXITED_TARGET.equals(mouseEventType)){
        scene.setCursor(Cursor.DEFAULT);
    } else if (MouseEvent.MOUSE_PRESSED.equals(mouseEventType)) {
        startX = stage.getWidth() - mouseEventX;
        startY = stage.getHeight() - mouseEventY;
    } else if (MouseEvent.MOUSE_DRAGGED.equals(mouseEventType)) {
        if (Cursor.DEFAULT.equals(cursorEvent) == false) {
            if (Cursor.W_RESIZE.equals(cursorEvent) == false && Cursor.E_RESIZE.equals(cursorEvent) == false) {
                double minHeight = stage.getMinHeight() > (border*2) ? stage.getMinHeight() : (border*2);
                if (Cursor.NW_RESIZE.equals(cursorEvent) == true || Cursor.N_RESIZE.equals(cursorEvent) == true || Cursor.NE_RESIZE.equals(cursorEvent) == true) {
                    if (stage.getHeight() > minHeight || mouseEventY < 0) {
                        stage.setHeight(stage.getY() - mouseEvent.getScreenY() + stage.getHeight());
                        stage.setY(mouseEvent.getScreenY());
                    }
                } else {
                    if (stage.getHeight() > minHeight || mouseEventY + startY - stage.getHeight() > 0) {
                        stage.setHeight(mouseEventY + startY);
                    }
                }
            }

            if (Cursor.N_RESIZE.equals(cursorEvent) == false && Cursor.S_RESIZE.equals(cursorEvent) == false) {
                double minWidth = stage.getMinWidth() > (border*2) ? stage.getMinWidth() : (border*2);
                if (Cursor.NW_RESIZE.equals(cursorEvent) == true || Cursor.W_RESIZE.equals(cursorEvent) == true || Cursor.SW_RESIZE.equals(cursorEvent) == true) {
                    if (stage.getWidth() > minWidth || mouseEventX < 0) {
                        stage.setWidth(stage.getX() - mouseEvent.getScreenX() + stage.getWidth());
                        stage.setX(mouseEvent.getScreenX());
                    }
                } else {
                    if (stage.getWidth() > minWidth || mouseEventX + startX - stage.getWidth() > 0) {
                        stage.setWidth(mouseEventX + startX);
                    }
                }
            }
        }

    }
}
 
源代码10 项目: Game2048FX   文件: Game2048.java
@Override
public void postInit(Scene scene) {

    String display = Services.get(DisplayService.class)
            .map(service -> service.isTablet() ? "tablet" : "phone")
            .orElse("phone");
    scene.getStylesheets().add(GameManager.class.getResource(display + ".css").toExternalForm());

    GameModel gameModel = Injector.instantiateModelOrService(GameModel.class);
    scene.getRoot().getStyleClass().add(gameModel.getGameMode().toString().toLowerCase());
    gameModel.gameModeProperty().addListener((obs, m, m1) -> {
        scene.getRoot().getStyleClass().remove(m.toString().toLowerCase());
        scene.getRoot().getStyleClass().add(m1.toString().toLowerCase());
    });
    Stage stage = (Stage) scene.getWindow();

    if (Platform.isDesktop()) {
        Services.get(DisplayService.class)
                .ifPresent(service -> {
                    if (service.isTablet()) {
                        // tablet
                        scene.getWindow().setWidth(600);
                        scene.getWindow().setHeight(800);
                    }
                });

        stage.setTitle("2048FX");
        stage.getIcons()
                .add(new Image(GameManager.class.getResourceAsStream("Icon-60.png")));
    }

    AppViewManager.GAME_VIEW.getPresenter().ifPresent(presenter -> {
        gamePresenter = (GamePresenter) presenter;
        gamePresenter.pauseProperty().bind(pause);
        gamePresenter.stopProperty().bind(stop);
    });

    if (Platform.isDesktop() && isARMDevice()) {
        stage.setFullScreen(true);
        stage.setFullScreenExitHint("");
    }

    if (javafx.application.Platform.isSupported(ConditionalFeature.INPUT_TOUCH)) {
        scene.setCursor(Cursor.NONE);
    }
}
 
源代码11 项目: gef   文件: CursorSupport.java
/**
 * Sets the given {@link Cursor} as the mouse cursor for the {@link Scene}
 * of the host visual. Note that this method does not store the original
 * mouse cursor.
 *
 * @param cursor
 *            The new mouse {@link Cursor}.
 * @see #storeAndReplaceCursor(Cursor)
 * @see #restoreCursor()
 */
public void setCursor(Cursor cursor) {
	Scene scene = getAdaptable().getRootPart().getVisual().getScene();
	if (cursor != scene.getCursor()) {
		scene.setCursor(cursor);
	}
}