本文整理了Java中javafx.scene.Node.getLayoutX()
方法的一些代码示例,展示了Node.getLayoutX()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getLayoutX()
方法的具体详情如下:
包路径:javafx.scene.Node
类名称:Node
方法名:getLayoutX
暂无
代码示例来源:origin: jfoenixadmin/JFoenix
@Override
public void initAnimation(Node contentContainer, Node overlay) {
overlay.setOpacity(0);
contentContainer.setTranslateX(-(contentContainer.getLayoutX()
+ contentContainer.getLayoutBounds().getMaxX()));
}
代码示例来源:origin: jfoenixadmin/JFoenix
@Override
public void initAnimation(Node contentContainer, Node overlay) {
overlay.setOpacity(0);
contentContainer.setTranslateX(contentContainer.getLayoutX()
+ contentContainer.getLayoutBounds().getMaxX());
}
代码示例来源:origin: jfoenixadmin/JFoenix
((Parent) child).layout();
double alignedWidth = alignToChild.getLayoutBounds().getWidth();
double alignedX = alignToChild.getLayoutX();
if(childWidth / 2 > alignedX + alignedWidth){
alignedWidth = -(childWidth / 2 - (alignedWidth/2 + alignedX));
代码示例来源:origin: jfoenixadmin/JFoenix
public HorizontalTransition(boolean leftDirection, Node contentContainer, Node overlay) {
super(contentContainer, new Timeline(
new KeyFrame(Duration.ZERO,
new KeyValue(contentContainer.translateXProperty(),
(contentContainer.getLayoutX() + contentContainer.getLayoutBounds().getMaxX())
* (leftDirection? -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.translateXProperty(), 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: stackoverflow.com
double minX = Double.MAX_VALUE;
double maxX = Double.MIN_VALUE;
for (int i = 0; i < children.size(); i++) {
Node node = children.get(i);
if (node.isManaged()) {
final double x = node.getLayoutBounds().getMinX() + node.getLayoutX();
minX = Math.min(minX, x);
maxX = Math.max(maxX, x + node.minWidth(-1));
}
}
代码示例来源:origin: org.fxmisc.flowless/flowless
@Override
public double layoutY(Node node) {
return node.getLayoutX();
}
代码示例来源:origin: org.fxmisc.flowless/flowless
@Override
public double layoutX(Node node) {
return node.getLayoutX();
}
代码示例来源: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.getLayoutX()
+ senderNode.getTranslateX()
+ senderShape.getRadius();
}
};
代码示例来源:origin: com.jfoenix/jfoenix
@Override
public void initAnimation(Node contentContainer, Node overlay) {
overlay.setOpacity(0);
contentContainer.setTranslateX(-(contentContainer.getLayoutX()
+ contentContainer.getLayoutBounds().getMaxX()));
}
代码示例来源:origin: com.jfoenix/jfoenix
@Override
public void initAnimation(Node contentContainer, Node overlay) {
overlay.setOpacity(0);
contentContainer.setTranslateX(contentContainer.getLayoutX()
+ contentContainer.getLayoutBounds().getMaxX());
}
代码示例来源: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: nl.cloudfarming.client/calendar-api
protected void mouseClicked(MouseEvent mouseEvent) {
if (axisEventHandler != null) {
Node node = (Node) mouseEvent.getSource();
double position = node.getLayoutX() + node.getLayoutBounds().getWidth() / 2;
DateTime clickedDate = getValueForDisplay(position);
AxisEvent<DateTime> event = new AxisEvent<>(clickedDate);
axisEventHandler.handle(event);
}
}
代码示例来源: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: 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: com.jfoenix/jfoenix
public HorizontalTransition(boolean leftDirection, Node contentContainer, Node overlay) {
super(contentContainer, new Timeline(
new KeyFrame(Duration.ZERO,
new KeyValue(contentContainer.translateXProperty(),
(contentContainer.getLayoutX() + contentContainer.getLayoutBounds().getMaxX())
* (leftDirection? -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.translateXProperty(), 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));
}
}
内容来源于网络,如有侵权,请联系作者删除!