本文整理了Java中javafx.scene.Node.getLayoutY()
方法的一些代码示例,展示了Node.getLayoutY()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getLayoutY()
方法的具体详情如下:
包路径:javafx.scene.Node
类名称:Node
方法名:getLayoutY
暂无
代码示例来源:origin: jfoenixadmin/JFoenix
@Override
public void initAnimation(Node contentContainer, Node overlay) {
overlay.setOpacity(0);
contentContainer.setTranslateY(contentContainer.getLayoutY()
+ contentContainer.getLayoutBounds().getMaxY());
}
代码示例来源:origin: jfoenixadmin/JFoenix
@Override
public void initAnimation(Node contentContainer, Node overlay) {
overlay.setOpacity(0);
contentContainer.setTranslateY(-(contentContainer.getLayoutY()
+ contentContainer.getLayoutBounds().getMaxY()));
}
代码示例来源:origin: jfoenixadmin/JFoenix
public VerticalTransition(boolean topDirection, Node contentContainer, Node overlay) {
super(contentContainer, new Timeline(
new KeyFrame(Duration.ZERO,
new KeyValue(contentContainer.translateYProperty(),
(contentContainer.getLayoutY() + contentContainer.getLayoutBounds().getMaxY())
* (topDirection? -1 : 1), Interpolator.LINEAR),
new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH),
new KeyValue(contentContainer.translateYProperty(), 0, Interpolator.EASE_OUT)
)));
// reduce the number to increase the shifting , increase number to reduce shifting
setCycleDuration(Duration.seconds(0.4));
setDelay(Duration.seconds(0));
}
}
代码示例来源:origin: org.fxmisc.flowless/flowless
@Override
public double layoutX(Node node) {
return node.getLayoutY();
}
代码示例来源:origin: org.fxmisc.flowless/flowless
@Override
public double layoutY(Node node) {
return node.getLayoutY();
}
代码示例来源:origin: stackoverflow.com
import javafx.scene.Node;
import javafx.scene.paint.Paint;
import javafx.scene.shape.Rectangle;
public class City extends Rectangle {
public City(final Node node) {
super(node.getLayoutX(), node.getLayoutY(), 32, 32);
this.setFill(Paint.valueOf("BLUE"));
}
}
代码示例来源:origin: stackoverflow.com
//gets the display region of the chart
Node chartPlotArea = chart.lookup(".chart-plot-background");
double chartZeroX = chartPlotArea.getLayoutX();
double chartZeroY = chartPlotArea.getLayoutY();
代码示例来源:origin: stackoverflow.com
private void clickOnMe(ObservableList<Node> nodes){
for(Node n : nodes){
n.fireEvent(new MouseEvent(MouseEvent.MOUSE_CLICKED,
n.getLayoutX(), n.getLayoutY(), n.getLayoutX(), n.getLayoutY(), MouseButton.PRIMARY, 1,
true, true, true, true, true, true, true, true, true, true, null));
}
}
代码示例来源:origin: eu.mihosoft.vrl.workflow/vworkflows-fx
@Override
protected double computeValue() {
return senderNode.getLayoutY()
+ senderNode.getTranslateY()
+ senderShape.getRadius();
}
};
代码示例来源:origin: com.jfoenix/jfoenix
@Override
public void initAnimation(Node contentContainer, Node overlay) {
overlay.setOpacity(0);
contentContainer.setTranslateY(contentContainer.getLayoutY()
+ contentContainer.getLayoutBounds().getMaxY());
}
代码示例来源:origin: com.jfoenix/jfoenix
@Override
public void initAnimation(Node contentContainer, Node overlay) {
overlay.setOpacity(0);
contentContainer.setTranslateY(-(contentContainer.getLayoutY()
+ contentContainer.getLayoutBounds().getMaxY()));
}
代码示例来源:origin: com.miglayout/miglayout-javafx
private static Rectangle2D getBounds(Node node)
{
Bounds lBounds = node.getLayoutBounds();
return new Rectangle2D(
node.getLayoutX(),
node.getLayoutY(),
lBounds.getWidth(),
lBounds.getHeight()
);
}
代码示例来源:origin: eu.mihosoft.vrl.workflow/vworkflows-fx
@Override
protected void layoutChildren() {
getParent().requestLayout();
super.layoutChildren();
for (Node n : getManagedChildren()) {
if (n instanceof Region) {
Region p = (Region) n;
double width = Math.max(p.getMinWidth(), p.getPrefWidth());
double height = Math.max(p.getMinHeight(), p.getPrefHeight());
n.resize(width, height);
double nX = Math.min(0, n.getLayoutX());
double nY = Math.min(0, n.getLayoutY());
n.relocate(nX, nY);
}
}
}
代码示例来源:origin: org.jfxtras/jfxtras-test-support
public AssertNode assertXYWH(double x, double y, double w, double h, double accuracy) {
Assert.assertEquals(description + ", X", x, node.getLayoutX(), accuracy);
Assert.assertEquals(description + ", Y", y, node.getLayoutY(), accuracy);
Assert.assertEquals(description + ", W", w, width(node), accuracy);
Assert.assertEquals(description + ", H", h, height(node), accuracy);
return this;
}
代码示例来源:origin: stackoverflow.com
EventHandler<MouseEvent> onMouseReleasedEventHandler = new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent t) {
fixPosition((Node) t.getSource());
}
};
resource.setOnMouseReleased(onMouseReleasedEventHandler);
private void fixPosition( Node node) {
double x = node.getTranslateX();
double y = node.getTranslateY();
node.relocate(node.getLayoutX() + x, node.getLayoutY() + y);
node.setTranslateX(0);
node.setTranslateY(0);
}
代码示例来源:origin: com.guigarage/ui-basics
public static Group convertTo3D(Node node, int depth) {
Group root = new Group();
root.setTranslateX(node.getLayoutX());
root.setTranslateY(node.getLayoutY());
root.setTranslateZ(-20);
System.out.println("Layer " + depth + " - Node Type: " + node.getClass());
Box box = new Box(node.getBoundsInParent().getWidth(), node.getBoundsInParent().getHeight(), 0.1);
box.setTranslateX(node.getLayoutX());
box.setTranslateY(node.getLayoutY());
SnapshotParameters snapshotParameters = new SnapshotParameters();
snapshotParameters.setFill(Color.TRANSPARENT);
box.setMaterial(new PhongMaterial(Color.WHITE, node.snapshot(snapshotParameters, new WritableImage((int) node.getBoundsInParent().getWidth(), (int) node.getBoundsInParent().getHeight())), null, null, null));
root.getChildren().add(box);
if (node instanceof Parent) {
for (Node child : ((Parent) node).getChildrenUnmodifiable()) {
root.getChildren().add(convertTo3D(child, depth + 1));
}
}
return root;
}
代码示例来源:origin: eu.mihosoft.vrl.workflow/vworkflows-fx
protected void initSenderAndReceiver() {
receiverConnectorUI = new Circle(15);
final VNode sender = getSender().getNode();
final FXFlowNodeSkin senderSkin = (FXFlowNodeSkin) getController().
getNodeSkinLookup().getById(skinFactory, sender.getId());
senderShape = senderSkin.getConnectorShape(getSender());
final Node senderNode = senderShape.getNode();
senderConnectorUI = senderShape;
receiverConnectorUI.setLayoutX(senderNode.getLayoutX()
+receiverConnectorUI.getRadius());
receiverConnectorUI.setLayoutY(senderNode.getLayoutY()
+receiverConnectorUI.getRadius());
}
代码示例来源:origin: eu.mihosoft.vrl.workflow/vworkflows-fx
public void performDragBegin(
Node n, MouseEvent event) {
final double parentScaleX = n.getParent().
localToSceneTransformProperty().getValue().getMxx();
final double parentScaleY = n.getParent().
localToSceneTransformProperty().getValue().getMyy();
// record the current mouse X and Y position on Node
mouseX = event.getSceneX();
mouseY = event.getSceneY();
if (centerNode) {
Point2D p2d = n.getParent().sceneToLocal(mouseX, mouseY);
nodeX = p2d.getX();
nodeY = p2d.getY();
} else {
nodeX = n.getLayoutX() * parentScaleX;
nodeY = n.getLayoutY() * parentScaleY;
}
n.toFront();
}
}
代码示例来源: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: com.jfoenix/jfoenix
public VerticalTransition(boolean topDirection, Node contentContainer, Node overlay) {
super(contentContainer, new Timeline(
new KeyFrame(Duration.ZERO,
new KeyValue(contentContainer.translateYProperty(),
(contentContainer.getLayoutY() + contentContainer.getLayoutBounds().getMaxY())
* (topDirection? -1 : 1), Interpolator.LINEAR),
new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH),
new KeyValue(contentContainer.translateYProperty(), 0, Interpolator.EASE_OUT)
)));
// reduce the number to increase the shifting , increase number to reduce shifting
setCycleDuration(Duration.seconds(0.4));
setDelay(Duration.seconds(0));
}
}
内容来源于网络,如有侵权,请联系作者删除!