javafx.scene.Node.setCursor()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(180)

本文整理了Java中javafx.scene.Node.setCursor()方法的一些代码示例,展示了Node.setCursor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.setCursor()方法的具体详情如下:
包路径:javafx.scene.Node
类名称:Node
方法名:setCursor

Node.setCursor介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

  1. byNode.setCursor(Cursor.MOVE);
  2. byNode.setCursor(Cursor.HAND);
  3. @Override public void handle(MouseEvent mouseEvent) {
  4. if (!mouseEvent.isPrimaryButtonDown()) {
  5. byNode.setCursor(Cursor.HAND);
  6. @Override public void handle(MouseEvent mouseEvent) {
  7. if (!mouseEvent.isPrimaryButtonDown()) {
  8. byNode.setCursor(Cursor.DEFAULT);

代码示例来源:origin: stackoverflow.com

  1. node.setOnMouseEntered(new EventHandler<MouseEvent>() {
  2. public void handle(MouseEvent e) {
  3. node.setCursor(Cursor.HAND);
  4. dragImageView.setMouseTransparent(true);
  5. node.setMouseTransparent(true);
  6. node.setCursor(Cursor.CLOSED_HAND);
  7. dragImageView.setMouseTransparent(false);
  8. node.setMouseTransparent(false);
  9. node.setCursor(Cursor.DEFAULT);
  10. sceneRoot.getChildren().remove(dragImageView);

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

  1. public void setCursor(Node n, Cursor c) {
  2. n.setCursor(c);
  3. }
  4. }

代码示例来源:origin: stackoverflow.com

  1. byNode.setCursor(Cursor.MOVE);
  2. });
  3. final BooleanProperty inDrag = new SimpleBooleanProperty(false);
  4. byNode.setCursor(Cursor.HAND);
  5. byNode.setOnMouseEntered(mouseEvent -> {
  6. if (!mouseEvent.isPrimaryButtonDown()) {
  7. byNode.setCursor(Cursor.HAND);
  8. byNode.setCursor(Cursor.DEFAULT);

代码示例来源:origin: org.controlsfx/controlsfx

  1. /**
  2. * Handles mouse events.
  3. *
  4. * @param event
  5. * the {@link MouseEvent} to handle
  6. */
  7. private void handleMouseEvent(MouseEvent event) {
  8. Cursor newCursor = snapshotViewBehavior.handleMouseEvent(event);
  9. mouseNode.setCursor(newCursor);
  10. }

代码示例来源:origin: stackoverflow.com

  1. byNode.setCursor(Cursor.MOVE);
  2. byNode.setCursor(Cursor.HAND);
  3. @Override public void handle(MouseEvent mouseEvent) {
  4. if (!mouseEvent.isPrimaryButtonDown()) {
  5. byNode.setCursor(Cursor.HAND);
  6. @Override public void handle(MouseEvent mouseEvent) {
  7. if (!mouseEvent.isPrimaryButtonDown()) {
  8. byNode.setCursor(Cursor.DEFAULT);

代码示例来源:origin: stackoverflow.com

  1. byNode.setCursor(Cursor.MOVE);
  2. byNode.setCursor(Cursor.HAND);
  3. @Override public void handle(MouseEvent mouseEvent) {
  4. if (!mouseEvent.isPrimaryButtonDown()) {
  5. byNode.setCursor(Cursor.HAND);
  6. @Override public void handle(MouseEvent mouseEvent) {
  7. if (!mouseEvent.isPrimaryButtonDown()) {
  8. byNode.setCursor(Cursor.DEFAULT);

代码示例来源:origin: stackoverflow.com

  1. byNode.setCursor(Cursor.MOVE);
  2. byNode.setCursor(Cursor.HAND);
  3. @Override public void handle(MouseEvent mouseEvent) {
  4. if (!mouseEvent.isPrimaryButtonDown()) {
  5. byNode.setCursor(Cursor.HAND);
  6. @Override public void handle(MouseEvent mouseEvent) {
  7. if (!mouseEvent.isPrimaryButtonDown()) {
  8. byNode.setCursor(Cursor.DEFAULT);

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

  1. protected void initMaterialNodeDrag() {
  2. final Delta dragDelta = new Delta();
  3. materialNode.setOnMousePressed(mouseEvent -> {
  4. AnchorPane.setTopAnchor(materialNode, null);
  5. AnchorPane.setBottomAnchor(materialNode, null);
  6. AnchorPane.setRightAnchor(materialNode, null);
  7. // record a delta distance for the drag and drop operation.
  8. dragDelta.x = materialNode.getLayoutX() - mouseEvent.getSceneX();
  9. dragDelta.y = materialNode.getLayoutY() - mouseEvent.getSceneY();
  10. materialNode.setCursor(Cursor.MOVE);
  11. });
  12. materialNode.setOnMouseReleased(mouseEvent -> materialNode.setCursor(Cursor.HAND));
  13. materialNode.setOnMouseDragged(mouseEvent -> {
  14. materialNode.setLayoutX(mouseEvent.getSceneX() + dragDelta.x);
  15. materialNode.setLayoutY(mouseEvent.getSceneY() + dragDelta.y);
  16. });
  17. materialNode.setOnMouseEntered(mouseEvent -> materialNode.setCursor(Cursor.HAND));
  18. }

代码示例来源:origin: eu.mihosoft.vrl.workflow/vworkflows-fx

  1. public DefaultWindowIconSkin(final WindowIcon c) {
  2. super(c);
  3. getNode().setCursor(Cursor.DEFAULT);
  4. getNode().onMouseClickedProperty().set((EventHandler<MouseEvent>) (MouseEvent t) -> {
  5. if (c.getOnAction()!=null) {
  6. c.getOnAction().handle(new ActionEvent(t, c));
  7. }
  8. });
  9. }
  10. }

代码示例来源:origin: org.jfxtras/jfxtras-window

  1. public DefaultWindowIconSkin(final WindowIcon c) {
  2. super(c);
  3. getNode().setCursor(Cursor.DEFAULT);
  4. getNode().onMouseClickedProperty().set((EventHandler<MouseEvent>) (MouseEvent t) -> {
  5. if (c.getOnAction()!=null) {
  6. c.getOnAction().handle(new ActionEvent(t, c));
  7. }
  8. });
  9. }
  10. }

代码示例来源:origin: stackoverflow.com

  1. public void handle(MouseEvent arg0) {
  2. node.setEffect(ds);
  3. node.setCursor(Cursor.HAND);
  4. lbl.setText("X-value=" + data.getXValue().toString() + "\nY-value=" + data.getYValue().toString());
  5. System.out.println("X-value=" + data.getXValue().toString() + ", Y-value=" + data.getYValue().toString());
  6. public void handle(MouseEvent arg0) {
  7. node.setEffect(null);
  8. node.setCursor(Cursor.DEFAULT);
  9. lbl.setText("");

代码示例来源:origin: org.jrebirth.af/core

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public void perform(final Wave wave) {
  6. final Cursor cursor = getKeyPart(Cursor.class);
  7. // A cursor shall be used as key part
  8. if (cursor == null) {
  9. throw new CoreRuntimeException("You must use a Cursor instance as a key part.");
  10. }
  11. final Node node = getKeyPart(Node.class);
  12. // Check if a node has been provided
  13. if (node == null) {
  14. // Define the cursor on the application's root node
  15. localFacade().globalFacade().application().rootNode().setCursor(cursor);
  16. } else {
  17. // Define the cursor for the given node
  18. node.setCursor(cursor);
  19. }
  20. }
  21. }

代码示例来源:origin: stackoverflow.com

  1. node.setCursor(Cursor.HAND);
  2. node.setOnMouseDragged(e -> {
  3. Point2D pointInScene = new Point2D(e.getSceneX(), e.getSceneY());

代码示例来源:origin: stackoverflow.com

  1. public void handle(MouseEvent arg0) {
  2. node.setEffect(ds);
  3. node.setCursor(Cursor.HAND);
  4. public void handle(MouseEvent arg0) {
  5. node.setEffect(null);
  6. node.setCursor(Cursor.DEFAULT);

代码示例来源:origin: eu.mihosoft.vrl.workflow/vworkflows-fx

  1. n.setCursor(Cursor.W_RESIZE);
  2. resizeMode = ResizeMode.LEFT;
  3. resizeLeft = true;
  4. } else if (left && top && !bottom) {
  5. n.setCursor(Cursor.NW_RESIZE);
  6. resizeMode = ResizeMode.TOP_LEFT;
  7. resizeLeft = true;
  8. resizeTop = true;
  9. } else if (left && !top && bottom) {
  10. n.setCursor(Cursor.SW_RESIZE);
  11. resizeMode = ResizeMode.BOTTOM_LEFT;
  12. resizeLeft = true;
  13. resizeBottom = true;
  14. } else if (right && !top && !bottom) {
  15. n.setCursor(Cursor.E_RESIZE);
  16. resizeMode = ResizeMode.RIGHT;
  17. resizeRight = true;
  18. } else if (right && top && !bottom) {
  19. n.setCursor(Cursor.NE_RESIZE);
  20. resizeMode = ResizeMode.TOP_RIGHT;
  21. resizeRight = true;
  22. resizeTop = true;
  23. } else if (right && !top && bottom) {
  24. n.setCursor(Cursor.SE_RESIZE);
  25. resizeMode = ResizeMode.BOTTOM_RIGHT;
  26. resizeRight = true;
  27. resizeBottom = true;
  28. } else if (top && !left && !right) {
  29. n.setCursor(Cursor.N_RESIZE);

代码示例来源:origin: org.jfxtras/jfxtras-window

  1. n.setCursor(Cursor.W_RESIZE);
  2. resizeMode = ResizeMode.LEFT;
  3. RESIZE_LEFT = true;
  4. } else if (left && top && !bottom) {
  5. n.setCursor(Cursor.NW_RESIZE);
  6. resizeMode = ResizeMode.TOP_LEFT;
  7. RESIZE_LEFT = true;
  8. RESIZE_TOP = true;
  9. } else if (left && !top && bottom) {
  10. n.setCursor(Cursor.SW_RESIZE);
  11. resizeMode = ResizeMode.BOTTOM_LEFT;
  12. RESIZE_LEFT = true;
  13. RESIZE_BOTTOM = true;
  14. } else if (right && !top && !bottom) {
  15. n.setCursor(Cursor.E_RESIZE);
  16. resizeMode = ResizeMode.RIGHT;
  17. RESIZE_RIGHT = true;
  18. } else if (right && top && !bottom) {
  19. n.setCursor(Cursor.NE_RESIZE);
  20. resizeMode = ResizeMode.TOP_RIGHT;
  21. RESIZE_RIGHT = true;
  22. RESIZE_TOP = true;
  23. } else if (right && !top && bottom) {
  24. n.setCursor(Cursor.SE_RESIZE);
  25. resizeMode = ResizeMode.BOTTOM_RIGHT;
  26. RESIZE_RIGHT = true;
  27. RESIZE_BOTTOM = true;
  28. } else if (top && !left && !right) {
  29. n.setCursor(Cursor.N_RESIZE);

代码示例来源:origin: eu.mihosoft.vrl.workflow/vworkflows-fx

  1. n.setCursor(Cursor.W_RESIZE);
  2. resizeMode = ResizeMode.LEFT;
  3. resizeLeft = true;
  4. } else if (left && top && !bottom) {
  5. n.setCursor(Cursor.NW_RESIZE);
  6. resizeMode = ResizeMode.TOP_LEFT;
  7. resizeLeft = true;
  8. resizeTop = true;
  9. } else if (left && !top && bottom) {
  10. n.setCursor(Cursor.SW_RESIZE);
  11. resizeMode = ResizeMode.BOTTOM_LEFT;
  12. resizeLeft = true;
  13. resizeBottom = true;
  14. } else if (right && !top && !bottom) {
  15. n.setCursor(Cursor.E_RESIZE);
  16. resizeMode = ResizeMode.RIGHT;
  17. resizeRight = true;
  18. } else if (right && top && !bottom) {
  19. n.setCursor(Cursor.NE_RESIZE);
  20. resizeMode = ResizeMode.TOP_RIGHT;
  21. resizeRight = true;
  22. resizeTop = true;
  23. } else if (right && !top && bottom) {
  24. n.setCursor(Cursor.SE_RESIZE);
  25. resizeMode = ResizeMode.BOTTOM_RIGHT;
  26. resizeRight = true;
  27. resizeBottom = true;
  28. } else if (top && !left && !right) {
  29. n.setCursor(Cursor.N_RESIZE);

相关文章

Node类方法