当前位置: 首页>>代码示例>>Java>>正文


Java Node.setLayoutY方法代码示例

本文整理汇总了Java中javafx.scene.Node.setLayoutY方法的典型用法代码示例。如果您正苦于以下问题:Java Node.setLayoutY方法的具体用法?Java Node.setLayoutY怎么用?Java Node.setLayoutY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.Node的用法示例。


在下文中一共展示了Node.setLayoutY方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SeparatedStage

import javafx.scene.Node; //导入方法依赖的package包/类
SeparatedStage(Node node){
	super();
	position = new Point2D(node.getLayoutX(),node.getLayoutY());
	root.getChildren().add(node);
	//scene.setFill(Color.WHITE);
	this.node = node;
	setOnShowing(showHandler);
	setOnHiding(showHandler);
	root.setOnMouseDragged(startDragHandler);
	root.setOnMouseExited(stopDragHandler);
	root.setOnMouseReleased(stopDragHandler);
	setAlwaysOnTop();
	try {
		node.setLayoutX(0);
		node.setLayoutY(0);
	} catch (Exception e){ }
	show();
	stage.setX(position.getX());
	stage.setY(position.getY());
	Bounds bounds = node.getLayoutBounds();
	stage.setHeight(bounds.getHeight()+5);
	stage.setWidth(bounds.getWidth()+5);

}
 
开发者ID:DeskChan,项目名称:DeskChan,代码行数:25,代码来源:OverlayStage.java

示例2: layoutChildren

import javafx.scene.Node; //导入方法依赖的package包/类
@Override protected void layoutChildren() {
    final double w = getWidth();
    final double h = getHeight();
    clipRect.setWidth(w);
    clipRect.setHeight(h);
    for (Node child : getChildren()) {
        if (child == postView) {
            postView.relocate(w - 15 - postView.getLayoutBounds().getWidth(), 0);
        } else if (child.getLayoutX() == 0 && child.getLayoutY() == 0) {
            final double iw = child.getBoundsInParent().getWidth();
            final double ih = child.getBoundsInParent().getHeight();
            child.setLayoutX((w - iw) * Math.random() + 100);
            child.setLayoutY((h - ih) * Math.random() + 100);
        }
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:17,代码来源:MultiTouchSample.java

示例3: drag

import javafx.scene.Node; //导入方法依赖的package包/类
private void drag(MouseEvent e) {
  Node node = get();
  if (isEnable() && pressedCorner != null && e.isConsumed() == false && node != null) {
    double dx = e.getScreenX() - startX;
    if (pressedCorner.horizontal == HorizontalDirection.RIGHT) {
      width.set(MathUtil.toRange(startWidth + dx, minWidth.get(), maxWidth.get()));
    } else if (pressedCorner.horizontal == HorizontalDirection.LEFT) {
      width.set(MathUtil.toRange(startWidth - dx, minWidth.get(), maxWidth.get()));
      node.setLayoutX(startWidth + startPosX - width.get());
    }

    double dy = e.getScreenY() - startY;
    if (pressedCorner.vertical == VerticalDirection.DOWN) {
      height.set(MathUtil.toRange(startHeight + dy, minHeight.get(), maxHeight.get()));
    } else if (pressedCorner.vertical == VerticalDirection.UP) {
      height.set(MathUtil.toRange(startHeight - dy, minHeight.get(), maxHeight.get()));
      node.setLayoutY(startHeight + startPosY - height.get());
    }
    e.consume();
  }
}
 
开发者ID:XDean,项目名称:JavaFX-EX,代码行数:22,代码来源:ResizeSupport.java

示例4: drag

import javafx.scene.Node; //导入方法依赖的package包/类
@Override
public void drag(MouseEvent e) {
  Node node = get();
  if (pressed && isEnable() && e.isConsumed() == false && node != null) {
    node.setLayoutX(MathUtil.toRange(e.getScreenX() - startX, minX.get(), maxX.get()));
    node.setLayoutY(MathUtil.toRange(e.getScreenY() - startY, minY.get(), maxY.get()));
    e.consume();
  }
}
 
开发者ID:XDean,项目名称:JavaFX-EX,代码行数:10,代码来源:DragSupport.java

示例5: slice

import javafx.scene.Node; //导入方法依赖的package包/类
private static void slice(Node node, double layoutFromX, double layoutFromY, double layoutToX, double layoutToY,
                          double opacity, EventHandler<ActionEvent> handler) {
    FadeTransition fadeTransition = new FadeTransition(Duration.millis(200), node);
    fadeTransition.setFromValue(opacity);
    fadeTransition.setToValue(1D - opacity);
    Path path = new Path();
    path.getElements().add(new MoveTo(node.getLayoutX() + layoutToX, node.getLayoutY() + layoutToY));
    node.setLayoutX(node.getLayoutX() + layoutFromX);
    node.setLayoutY(node.getLayoutY() + layoutFromY);
    PathTransition pathTransition = new PathTransition(Duration.millis(200), path, node);
    ParallelTransition parallelTransition = new ParallelTransition(fadeTransition, pathTransition);
    parallelTransition.setOnFinished(handler);
    parallelTransition.play();
}
 
开发者ID:IzzelAliz,项目名称:LCL,代码行数:15,代码来源:SliceTransition.java

示例6: relocate

import javafx.scene.Node; //导入方法依赖的package包/类
void relocate(Node node, double x, double y){
	node.setLayoutX(x - this.getX());
	node.setLayoutY(y - this.getY());
}
 
开发者ID:DeskChan,项目名称:DeskChan,代码行数:5,代码来源:OverlayStage.java


注:本文中的javafx.scene.Node.setLayoutY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。