Example usage for javafx.scene.shape MeshView setScaleY

List of usage examples for javafx.scene.shape MeshView setScaleY

Introduction

In this page you can find the example usage for javafx.scene.shape MeshView setScaleY.

Prototype

public final void setScaleY(double value) 

Source Link

Usage

From source file:eu.mihosoft.vrl.fxscad.MainController.java

private void setMeshScale(MeshContainer meshContainer, Bounds t1, final MeshView meshView) {
    double maxDim = Math.max(meshContainer.getWidth(),
            Math.max(meshContainer.getHeight(), meshContainer.getDepth()));

    double minContDim = Math.min(t1.getWidth(), t1.getHeight());

    double scale = minContDim / (maxDim * 2);

    meshView.setScaleX(scale);/*w  w  w  .  ja va 2s  . c o m*/
    meshView.setScaleY(scale);
    meshView.setScaleZ(scale);
}

From source file:be.makercafe.apps.makerbench.editors.GCodeEditor.java

private void setMeshScale(MeshContainer meshContainer, Bounds t1, final MeshView meshView) {
    if (meshContainer != null) {
        double maxDim = Math.max(meshContainer.getWidth(),
                Math.max(meshContainer.getHeight(), meshContainer.getDepth()));

        double minContDim = Math.min(t1.getWidth(), t1.getHeight());

        double scale = minContDim / (maxDim * 2);

        meshView.setScaleX(scale);/* www . ja  v  a  2s  .c  o  m*/
        meshView.setScaleY(scale);
        meshView.setScaleZ(scale);
    }
}