Package javafx.geometry

Examples of javafx.geometry.Bounds


      textView.setCacheHint(CacheHint.SPEED);
      textView.widthProperty().addListener(new ChangeListener<Number>() {
      @Override
      public void changed(ObservableValue<? extends Number> observable,
          Number oldValue, Number newValue) {
        final Bounds textViewBounds = textView.getBoundsInLocal();
        mainRec.setX(textViewBounds.getMinX());
        mainRec.setWidth(textViewBounds.getWidth());
        middleRec.setWidth(mainRec.getWidth() / 2);
      }
    });
      textView.heightProperty().addListener(new ChangeListener<Number>() {
      @Override
      public void changed(ObservableValue<? extends Number> observable,
          Number oldValue, Number newValue) {
        final Bounds textViewBounds = textView.getBoundsInLocal();
        mainRec.setY(textViewBounds.getMinY());
        mainRec.setHeight(textViewBounds.getHeight());
        middleRec.setHeight(mainRec.getHeight());
      }
    });
     
        final Label onLabel = new Label();
View Full Code Here


  public static void setCursor(Component c) {
    if (!(c instanceof HChild)) {
      return;
    }
    HChild hc = (HChild) c;
    Bounds b = hc.getCBounds();
    hc.setCNodesBG(CNodeState.FOCUSED);
    cNode = hc;
    Cursor.prompt.setHeight(b.getHeight());
//    Cursor.prompt.relocate(b.getMinX() + b.getWidth(), b.getMinY());
    Cursor.prompt.setVisible(true);
    hc.addCursor();
  }
View Full Code Here

    });
    hbox.setOnMouseDragged(mEvent -> {
      mEvent.consume();
      FormulaFrame.isSelecting = true;
      // Bounds b = hbox.localToScene(hbox.getLayoutBounds());
      Bounds b = hbox.getLayoutBounds();
      double minX = b.getMinX();
      double minY = b.getMinY();
      double maxX = b.getMinX() + b.getWidth();
      double maxY = b.getMinY() + b.getHeight();
      if (mEvent.getX() < initX) {
        FormulaFrame.rect.setX(Math.max(mEvent.getX(), minX));
        FormulaFrame.rect.setWidth(initX
            - Math.max(mEvent.getX(), minX));
      } else {
View Full Code Here

      @Override
      public void handle(MouseEvent event) {
        Point2D scenePoint = chart.localToScene(event.getSceneX(), event.getSceneY());
        Point2D position = chartWrap.sceneToLocal(scenePoint.getX(), scenePoint.getY());
       
        Bounds chartAreaBounds = chartArea.localToScene(chartArea.getBoundsInLocal());
        valueMarker.setStartY(0);
        valueMarker.setEndY(chartWrap.sceneToLocal(chartAreaBounds).getMaxY()-chartWrap.sceneToLocal(chartAreaBounds).getMinY());
       
        valueMarker.setStartX(0);
        valueMarker.setEndX(0);
View Full Code Here

    // circularPane.setShowDebug(javafx.scene.paint.Color.GREEN);
     
        // hide when the mouse moves out of the menu
      EventHandler<MouseEvent> mouseMovedOutsideCircularPaneEventHandler = mouseEvent -> {
            if(isShown()) {
                Bounds screenBounds = circularPane.localToScreen(circularPane.getBoundsInLocal());
                if(!screenBounds.contains(mouseEvent.getScreenX(), mouseEvent.getScreenY())) {
                    hide();
                }
            }
        };
        // register to the scene when node is added there
View Full Code Here

            final double scaleX = n.localToSceneTransformProperty().
                    getValue().getMxx();
            final double scaleY = n.localToSceneTransformProperty().
                    getValue().getMyy();

            Bounds boundsInScene =
                    control.localToScene(control.getBoundsInLocal());

            double sceneX = boundsInScene.getMinX();
            double sceneY = boundsInScene.getMinY();

            double offsetX = event.getSceneX() - mouseX;
            double offsetY = event.getSceneY() - mouseY;

            if (resizeMode == ResizeMode.NONE && control.isMovable()) {
View Full Code Here

        return fxPath.toString();
    }

    public static String convertRectangle(final Rectangle RECTANGLE) {
        final StringBuilder fxPath = new StringBuilder();
        final Bounds bounds = RECTANGLE.getBoundsInLocal();
        if (Double.compare(RECTANGLE.getArcWidth(), 0.0) == 0 && Double.compare(RECTANGLE.getArcHeight(), 0.0) == 0) {
            fxPath.append("M ").append(bounds.getMinX()).append(" ").append(bounds.getMinY()).append(" ")
                  .append("H ").append(bounds.getMaxX()).append(" ")
                  .append("V ").append(bounds.getMaxY()).append(" ")
                  .append("H ").append(bounds.getMinX()).append(" ")
                  .append("V ").append(bounds.getMinY()).append(" ")
                  .append("Z");
        } else {
            double x         = bounds.getMinX();
            double y         = bounds.getMinY();
            double width     = bounds.getWidth();
            double height    = bounds.getHeight();
            double arcWidth  = RECTANGLE.getArcWidth();
            double arcHeight = RECTANGLE.getArcHeight();
            double r         = x + width;
            double b         = y + height;
            fxPath.append("M ").append(x + arcWidth).append(" ").append(y).append(" ")
View Full Code Here

    //---------------------------------------------------------------------------------------------

    @Test
    public void boundsInSceneFor_nodeInsideOfScene() {
        // when:
        Bounds bounds = boundsLocator.boundsInSceneFor(nodeInsideOfScene);

        // then:
        assertThat(bounds, equalTo(bounds(50, 50, 100, 100)));
    }
View Full Code Here

    }

    @Test
    public void boundsInSceneFor_nodePartyOutsideOfScene() {
        // when:
        Bounds bounds = boundsLocator.boundsInSceneFor(nodePartyOutsideOfScene);

        // then:
        assertThat(bounds, not(equalTo(bounds(550, 350, 100, 100))));
        assertThat(bounds, equalTo(bounds(550, 350, 50, 50)));
    }
View Full Code Here

    }

    @Test(expected=BoundsLocatorException.class)
    public void boundsInSceneFor_nodeOutsideOfScene() {
        // when:
        Bounds bounds = boundsLocator.boundsInSceneFor(nodeOutsideOfScene);

        // then:
        assertThat(bounds, equalTo(null));
    }
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.