Package javafx.geometry

Examples of javafx.geometry.Bounds


    public Optional<Bounds> getSelectionBoundsOnScreen() {
        if(selection.get().getLength() == 0) {
            return Optional.empty();
        } else {
            layout(); // ensure layout, is a no-op if not dirty
            Bounds localBounds = selectionShape.getBoundsInLocal();
            return Optional.of(selectionShape.localToScreen(localBounds));
        }
    }
View Full Code Here


                }
                cell = cellMap.get(newFileID);

            }

            final Bounds gridViewBounds = gridView.localToScene(gridView.getBoundsInLocal());

            Bounds tileBounds = cell.localToScene(cell.getBoundsInLocal());

            //while the cell is not within the visisble bounds of the gridview, scroll based on screen coordinates
            int i = 0;

            while (gridViewBounds.contains(tileBounds)
                    == false && (i++ < 100)) {

                if (tileBounds.getMinY() < gridViewBounds.getMinY()) {
                    scrollBar.decrement();
                } else if (tileBounds.getMaxY() > gridViewBounds.getMaxY()) {
                    scrollBar.increment();
                }
                tileBounds = cell.localToScene(cell.getBoundsInLocal());
            }
        });
View Full Code Here

   * The asParentCoordinates determines if the position is transformed into the parent coordinate system.
   * @param asParentCoordinates determines if the position is transformed into the parent coordinate system
   * @return the center position
   */
  public Point2D getCenter(boolean asParentCoordinates) {
    Bounds bounds = getBoundsInLocal();
    Point2D center = new Point2D((bounds.getMaxX() + bounds.getMinX()) / 2, (bounds.getMaxY() + bounds.getMinY()) / 2);
    if (asParentCoordinates) {
      center = localToParent(center);
    }
    return center;
  }
View Full Code Here

//   
//  }
// 
  public Point getLocation () {
    checkWidget();
    Bounds b = internal_getNativeObject().getBoundsInParent();
    return new Point((int)b.getMinX(), (int)b.getMinY());
  }
View Full Code Here

   
    final Node curNode = pane.getCenter();
   
    pane.setCenter(null);
   
    Bounds b = curNode.getBoundsInParent();
    newNode.resizeRelocate(b.getMinX(), b.getMinY(), b.getWidth(), b.getHeight());

    pane.getChildren().add(0,newNode);
    pane.getChildren().add(1,curNode);
   
    if (imageView != null) {
View Full Code Here

//  }
 
  @Override
  protected Animation createAndPrepareAnimation(Node curNode, Node newNode) {
    Node p = curNode.getParent();
    Bounds b = curNode.getBoundsInLocal();
    double cX = b.getMinX() + b.getWidth()/2;
    double cY = b.getMinY() + b.getHeight()/2;
   
    double val = 200;
   
    CubicCurve cIn = new CubicCurve(cX - val, cY, cX - val, cY - val, cX, cY - val, cX, cY);
    CubicCurve cOut = new CubicCurve(cX, cY, cX, cY + val, cX + val, cY + val, cX + val, cY + 0);
View Full Code Here

    pane.setCenter(null);
   
    final Group area = new Group();
    area.setDepthTest(DepthTest.ENABLE);
   
    Bounds b = curNode.getBoundsInParent();
    newNode.resizeRelocate(b.getMinX(), b.getMinY(), b.getWidth(), b.getHeight());
    area.getChildren().add(newNode);
    area.getChildren().add(curNode);
   
    newNode.setTranslateZ(0.1);
    curNode.setTranslateZ(-0.1);
View Full Code Here

  BorderPane right;
 
  Rectangle rect;
 
  private void doIt() {
    Bounds leftBounds = left.getBoundsInParent();
   
    Bounds rightBounds = right.getBoundsInParent();
   
   
    FadeTransition fadeOut = FadeTransitionBuilder.create()
      .duration(new Duration(100))
      .fromValue(1)
      .toValue(0.3)
      .build();
   
    FadeTransition fadeIn = FadeTransitionBuilder.create()
      .duration(new Duration(100))
      .fromValue(0.3)
      .toValue(1)
      .build();
   
    TranslateTransition moveA = TranslateTransitionBuilder.create()
      .byX(leftBounds.getMinX()-rightBounds.getMinX())
      .byY(leftBounds.getMinY()-rightBounds.getMinY())
      .duration(new Duration(500))
      .node(right)
      .build();
   
    SequentialTransition a = SequentialTransitionBuilder.create()
      .node(right)
      .children(fadeOut, moveA, fadeIn)
      .build();
   
    TranslateTransition moveB = TranslateTransitionBuilder.create()
        .byX(rightBounds.getMinX()-leftBounds.getMinX())
        .byY(rightBounds.getMinY()-leftBounds.getMinY())
        .duration(new Duration(500))
        .node(left)
        .build();
   
    SequentialTransition b = SequentialTransitionBuilder.create()
View Full Code Here

  }

  @Override
  protected void layoutChildren() {
    super.layoutChildren();
    Bounds clientArea = getLayoutBounds();
    if (type.get() == Type.HORIZONTAL) {
      layoutHorizontal(true, wrap.get(), clientArea.getWidth(), true);
    } else {
      layoutVertical(true, wrap.get(), clientArea.getHeight(), true);
    }
  }
View Full Code Here

      }
      maxHeight = childHeight;
    }
    double clientX = 0, clientY = 0;
    if (move) {
      Bounds rect = getLayoutBounds();
      clientX = rect.getMinX();
      clientY = rect.getMinY();
    }
    double[] wraps = null;
    boolean wrapped = false;
    Bounds[] bounds = null;
    if (move && (justify.get() || fill.get() || center.get())) {
View Full Code Here

TOP

Related Classes of javafx.geometry.Bounds

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.