Exemplo n.º 1
0
  public void addChild(Node node, NodePosition position) {
    if (node == null || position == null) {
      throw new IllegalArgumentException();
    }

    if (getChildren().contains(node) == false) {
      getChildren().add(node);
      getManagedChildren().add(node);
      node.toFront();
    }

    setPosition(node, position);

    layoutChildren();
  }
 /**
  * Create new FadeInUpTransition
  *
  * @param node The node to affect
  */
 public FadeInUpTransition(final Node node) {
   super(
       node,
       TimelineBuilder.create()
           .keyFrames(
               new KeyFrame(
                   Duration.millis(0),
                   new KeyValue(node.opacityProperty(), 0, WEB_EASE),
                   new KeyValue(node.translateYProperty(), 20, WEB_EASE)),
               new KeyFrame(
                   Duration.millis(500),
                   new KeyValue(node.opacityProperty(), 1, WEB_EASE),
                   new KeyValue(node.translateYProperty(), 0, WEB_EASE)))
           .build());
   setCycleDuration(Duration.seconds(1));
   setDelay(Duration.seconds(0));
   node.toFront();
 }
  public void registerLayer(Class<? extends Layer> clazz, Layer layer, Node layerNode) {
    layers.put(clazz, layer);

    if (layerNode != null) {
      pane.getChildren().add(layerNode);
      layerNode.toFront();

      hvalueProperty()
          .addListener(
              (ov, n, o) ->
                  layerNode
                      .translateXProperty()
                      .set(o.doubleValue() * (pane.getWidth() - getViewportBounds().getWidth())));
      vvalueProperty()
          .addListener(
              (ov, n, o) ->
                  layerNode
                      .translateYProperty()
                      .set(o.doubleValue() * (pane.getHeight() - getViewportBounds().getHeight())));
    }
  }