本文整理了Java中javafx.scene.Node.setCursor()
方法的一些代码示例,展示了Node.setCursor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.setCursor()
方法的具体详情如下:
包路径:javafx.scene.Node
类名称:Node
方法名:setCursor
暂无
代码示例来源:origin: stackoverflow.com
byNode.setCursor(Cursor.MOVE);
byNode.setCursor(Cursor.HAND);
@Override public void handle(MouseEvent mouseEvent) {
if (!mouseEvent.isPrimaryButtonDown()) {
byNode.setCursor(Cursor.HAND);
@Override public void handle(MouseEvent mouseEvent) {
if (!mouseEvent.isPrimaryButtonDown()) {
byNode.setCursor(Cursor.DEFAULT);
代码示例来源:origin: stackoverflow.com
node.setOnMouseEntered(new EventHandler<MouseEvent>() {
public void handle(MouseEvent e) {
node.setCursor(Cursor.HAND);
dragImageView.setMouseTransparent(true);
node.setMouseTransparent(true);
node.setCursor(Cursor.CLOSED_HAND);
dragImageView.setMouseTransparent(false);
node.setMouseTransparent(false);
node.setCursor(Cursor.DEFAULT);
sceneRoot.getChildren().remove(dragImageView);
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
public void setCursor(Node n, Cursor c) {
n.setCursor(c);
}
}
代码示例来源:origin: stackoverflow.com
byNode.setCursor(Cursor.MOVE);
});
final BooleanProperty inDrag = new SimpleBooleanProperty(false);
byNode.setCursor(Cursor.HAND);
byNode.setOnMouseEntered(mouseEvent -> {
if (!mouseEvent.isPrimaryButtonDown()) {
byNode.setCursor(Cursor.HAND);
byNode.setCursor(Cursor.DEFAULT);
代码示例来源:origin: org.controlsfx/controlsfx
/**
* Handles mouse events.
*
* @param event
* the {@link MouseEvent} to handle
*/
private void handleMouseEvent(MouseEvent event) {
Cursor newCursor = snapshotViewBehavior.handleMouseEvent(event);
mouseNode.setCursor(newCursor);
}
代码示例来源:origin: stackoverflow.com
byNode.setCursor(Cursor.MOVE);
byNode.setCursor(Cursor.HAND);
@Override public void handle(MouseEvent mouseEvent) {
if (!mouseEvent.isPrimaryButtonDown()) {
byNode.setCursor(Cursor.HAND);
@Override public void handle(MouseEvent mouseEvent) {
if (!mouseEvent.isPrimaryButtonDown()) {
byNode.setCursor(Cursor.DEFAULT);
代码示例来源:origin: stackoverflow.com
byNode.setCursor(Cursor.MOVE);
byNode.setCursor(Cursor.HAND);
@Override public void handle(MouseEvent mouseEvent) {
if (!mouseEvent.isPrimaryButtonDown()) {
byNode.setCursor(Cursor.HAND);
@Override public void handle(MouseEvent mouseEvent) {
if (!mouseEvent.isPrimaryButtonDown()) {
byNode.setCursor(Cursor.DEFAULT);
代码示例来源:origin: stackoverflow.com
byNode.setCursor(Cursor.MOVE);
byNode.setCursor(Cursor.HAND);
@Override public void handle(MouseEvent mouseEvent) {
if (!mouseEvent.isPrimaryButtonDown()) {
byNode.setCursor(Cursor.HAND);
@Override public void handle(MouseEvent mouseEvent) {
if (!mouseEvent.isPrimaryButtonDown()) {
byNode.setCursor(Cursor.DEFAULT);
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
protected void initMaterialNodeDrag() {
final Delta dragDelta = new Delta();
materialNode.setOnMousePressed(mouseEvent -> {
AnchorPane.setTopAnchor(materialNode, null);
AnchorPane.setBottomAnchor(materialNode, null);
AnchorPane.setRightAnchor(materialNode, null);
// record a delta distance for the drag and drop operation.
dragDelta.x = materialNode.getLayoutX() - mouseEvent.getSceneX();
dragDelta.y = materialNode.getLayoutY() - mouseEvent.getSceneY();
materialNode.setCursor(Cursor.MOVE);
});
materialNode.setOnMouseReleased(mouseEvent -> materialNode.setCursor(Cursor.HAND));
materialNode.setOnMouseDragged(mouseEvent -> {
materialNode.setLayoutX(mouseEvent.getSceneX() + dragDelta.x);
materialNode.setLayoutY(mouseEvent.getSceneY() + dragDelta.y);
});
materialNode.setOnMouseEntered(mouseEvent -> materialNode.setCursor(Cursor.HAND));
}
代码示例来源:origin: eu.mihosoft.vrl.workflow/vworkflows-fx
public DefaultWindowIconSkin(final WindowIcon c) {
super(c);
getNode().setCursor(Cursor.DEFAULT);
getNode().onMouseClickedProperty().set((EventHandler<MouseEvent>) (MouseEvent t) -> {
if (c.getOnAction()!=null) {
c.getOnAction().handle(new ActionEvent(t, c));
}
});
}
}
代码示例来源:origin: org.jfxtras/jfxtras-window
public DefaultWindowIconSkin(final WindowIcon c) {
super(c);
getNode().setCursor(Cursor.DEFAULT);
getNode().onMouseClickedProperty().set((EventHandler<MouseEvent>) (MouseEvent t) -> {
if (c.getOnAction()!=null) {
c.getOnAction().handle(new ActionEvent(t, c));
}
});
}
}
代码示例来源:origin: stackoverflow.com
public void handle(MouseEvent arg0) {
node.setEffect(ds);
node.setCursor(Cursor.HAND);
lbl.setText("X-value=" + data.getXValue().toString() + "\nY-value=" + data.getYValue().toString());
System.out.println("X-value=" + data.getXValue().toString() + ", Y-value=" + data.getYValue().toString());
public void handle(MouseEvent arg0) {
node.setEffect(null);
node.setCursor(Cursor.DEFAULT);
lbl.setText("");
代码示例来源:origin: org.jrebirth.af/core
/**
* {@inheritDoc}
*/
@Override
public void perform(final Wave wave) {
final Cursor cursor = getKeyPart(Cursor.class);
// A cursor shall be used as key part
if (cursor == null) {
throw new CoreRuntimeException("You must use a Cursor instance as a key part.");
}
final Node node = getKeyPart(Node.class);
// Check if a node has been provided
if (node == null) {
// Define the cursor on the application's root node
localFacade().globalFacade().application().rootNode().setCursor(cursor);
} else {
// Define the cursor for the given node
node.setCursor(cursor);
}
}
}
代码示例来源:origin: stackoverflow.com
node.setCursor(Cursor.HAND);
node.setOnMouseDragged(e -> {
Point2D pointInScene = new Point2D(e.getSceneX(), e.getSceneY());
代码示例来源:origin: stackoverflow.com
public void handle(MouseEvent arg0) {
node.setEffect(ds);
node.setCursor(Cursor.HAND);
public void handle(MouseEvent arg0) {
node.setEffect(null);
node.setCursor(Cursor.DEFAULT);
代码示例来源:origin: eu.mihosoft.vrl.workflow/vworkflows-fx
n.setCursor(Cursor.W_RESIZE);
resizeMode = ResizeMode.LEFT;
resizeLeft = true;
} else if (left && top && !bottom) {
n.setCursor(Cursor.NW_RESIZE);
resizeMode = ResizeMode.TOP_LEFT;
resizeLeft = true;
resizeTop = true;
} else if (left && !top && bottom) {
n.setCursor(Cursor.SW_RESIZE);
resizeMode = ResizeMode.BOTTOM_LEFT;
resizeLeft = true;
resizeBottom = true;
} else if (right && !top && !bottom) {
n.setCursor(Cursor.E_RESIZE);
resizeMode = ResizeMode.RIGHT;
resizeRight = true;
} else if (right && top && !bottom) {
n.setCursor(Cursor.NE_RESIZE);
resizeMode = ResizeMode.TOP_RIGHT;
resizeRight = true;
resizeTop = true;
} else if (right && !top && bottom) {
n.setCursor(Cursor.SE_RESIZE);
resizeMode = ResizeMode.BOTTOM_RIGHT;
resizeRight = true;
resizeBottom = true;
} else if (top && !left && !right) {
n.setCursor(Cursor.N_RESIZE);
代码示例来源:origin: org.jfxtras/jfxtras-window
n.setCursor(Cursor.W_RESIZE);
resizeMode = ResizeMode.LEFT;
RESIZE_LEFT = true;
} else if (left && top && !bottom) {
n.setCursor(Cursor.NW_RESIZE);
resizeMode = ResizeMode.TOP_LEFT;
RESIZE_LEFT = true;
RESIZE_TOP = true;
} else if (left && !top && bottom) {
n.setCursor(Cursor.SW_RESIZE);
resizeMode = ResizeMode.BOTTOM_LEFT;
RESIZE_LEFT = true;
RESIZE_BOTTOM = true;
} else if (right && !top && !bottom) {
n.setCursor(Cursor.E_RESIZE);
resizeMode = ResizeMode.RIGHT;
RESIZE_RIGHT = true;
} else if (right && top && !bottom) {
n.setCursor(Cursor.NE_RESIZE);
resizeMode = ResizeMode.TOP_RIGHT;
RESIZE_RIGHT = true;
RESIZE_TOP = true;
} else if (right && !top && bottom) {
n.setCursor(Cursor.SE_RESIZE);
resizeMode = ResizeMode.BOTTOM_RIGHT;
RESIZE_RIGHT = true;
RESIZE_BOTTOM = true;
} else if (top && !left && !right) {
n.setCursor(Cursor.N_RESIZE);
代码示例来源:origin: eu.mihosoft.vrl.workflow/vworkflows-fx
n.setCursor(Cursor.W_RESIZE);
resizeMode = ResizeMode.LEFT;
resizeLeft = true;
} else if (left && top && !bottom) {
n.setCursor(Cursor.NW_RESIZE);
resizeMode = ResizeMode.TOP_LEFT;
resizeLeft = true;
resizeTop = true;
} else if (left && !top && bottom) {
n.setCursor(Cursor.SW_RESIZE);
resizeMode = ResizeMode.BOTTOM_LEFT;
resizeLeft = true;
resizeBottom = true;
} else if (right && !top && !bottom) {
n.setCursor(Cursor.E_RESIZE);
resizeMode = ResizeMode.RIGHT;
resizeRight = true;
} else if (right && top && !bottom) {
n.setCursor(Cursor.NE_RESIZE);
resizeMode = ResizeMode.TOP_RIGHT;
resizeRight = true;
resizeTop = true;
} else if (right && !top && bottom) {
n.setCursor(Cursor.SE_RESIZE);
resizeMode = ResizeMode.BOTTOM_RIGHT;
resizeRight = true;
resizeBottom = true;
} else if (top && !left && !right) {
n.setCursor(Cursor.N_RESIZE);
内容来源于网络,如有侵权,请联系作者删除!