Java Code Examples for javafx.scene.shape.Line#setRotationAxis()

The following examples show how to use javafx.scene.shape.Line#setRotationAxis() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Fx3DStageController.java    From mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
private void setMzAxis() {
  axes.getMzAxisLabels().getChildren().clear();
  axes.getMzAxisTicks().getChildren().clear();
  double mzDelta = (mzRange.upperEndpoint() - mzRange.lowerEndpoint()) / 7;
  double mzScaleValue = mzRange.lowerEndpoint();
  Text mzLabel = new Text("m/z");
  mzLabel.setRotationAxis(Rotate.X_AXIS);
  mzLabel.setRotate(-45);
  mzLabel.setTranslateX(SIZE / 2);
  mzLabel.setTranslateZ(-5);
  mzLabel.setTranslateY(8);
  axes.getMzAxisLabels().getChildren().add(mzLabel);
  for (int y = 0; y <= SIZE; y += SIZE / 7) {
    Line tickLineZ = new Line(0, 0, 0, 9);
    tickLineZ.setRotationAxis(Rotate.X_AXIS);
    tickLineZ.setRotate(-90);
    tickLineZ.setTranslateY(-4);
    tickLineZ.setTranslateX(y - 2);
    float roundOff = (float) (Math.round(mzScaleValue * 100.0) / 100.0);
    Text text = new Text("" + roundOff);
    text.setRotationAxis(Rotate.X_AXIS);
    text.setRotate(-45);
    text.setTranslateY(8);
    text.setTranslateX(y - 10);
    text.setTranslateZ(20);
    mzScaleValue += mzDelta;
    axes.getMzAxisTicks().getChildren().add(tickLineZ);
    axes.getMzAxisLabels().getChildren().add(text);
  }
  axes.getMzAxisLabels().setRotate(270);
  axes.getMzAxisLabels().setTranslateX(SIZE / 2 + SIZE / 30);
  axes.getMzAxisTicks().setTranslateX(SIZE / 2 + 10);
  axes.getMzAxisTicks().setTranslateY(-1);
  axes.getMzAxis().setTranslateX(SIZE);
}
 
Example 2
Source File: Fx3DStageController.java    From mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
private void setRtAxis() {
  axes.getRtAxis().getChildren().clear();
  double rtDelta = (rtRange.upperEndpoint() - rtRange.lowerEndpoint()) / 7;
  double rtScaleValue = rtRange.upperEndpoint();
  Text rtLabel = new Text("Retention Time");
  rtLabel.setRotationAxis(Rotate.X_AXIS);
  rtLabel.setRotate(-45);
  rtLabel.setTranslateX(SIZE * 3 / 8);
  rtLabel.setTranslateZ(-25);
  rtLabel.setTranslateY(13);
  axes.getRtAxis().getChildren().add(rtLabel);
  for (int y = 0; y <= SIZE; y += SIZE / 7) {
    Line tickLineX = new Line(0, 0, 0, 9);
    tickLineX.setRotationAxis(Rotate.X_AXIS);
    tickLineX.setRotate(-90);
    tickLineX.setTranslateY(-5);
    tickLineX.setTranslateX(y);
    tickLineX.setTranslateZ(-3.5);
    float roundOff = (float) (Math.round(rtScaleValue * 10.0) / 10.0);
    Text text = new Text("" + roundOff);
    text.setRotationAxis(Rotate.X_AXIS);
    text.setRotate(-45);
    text.setTranslateY(9);
    text.setTranslateX(y - 5);
    text.setTranslateZ(-15);
    rtScaleValue -= rtDelta;
    axes.getRtAxis().getChildren().addAll(text, tickLineX);
  }
  Line lineX = new Line(0, 0, SIZE, 0);
  axes.getRtAxis().getChildren().add(lineX);
  axes.getRtRotate().setAngle(180);
  axes.getRtTranslate().setZ(-SIZE);
  axes.getRtTranslate().setX(-SIZE);
}
 
Example 3
Source File: Fx3DStageController.java    From mzmine2 with GNU General Public License v2.0 5 votes vote down vote up
private void setMzAxis() {
    axes.getMzAxisLabels().getChildren().clear();
    axes.getMzAxisTicks().getChildren().clear();
    double mzDelta = (mzRange.upperEndpoint() - mzRange.lowerEndpoint())
            / 7;
    double mzScaleValue = mzRange.lowerEndpoint();
    Text mzLabel = new Text("m/z");
    mzLabel.setRotationAxis(Rotate.X_AXIS);
    mzLabel.setRotate(-45);
    mzLabel.setTranslateX(SIZE / 2);
    mzLabel.setTranslateZ(-5);
    mzLabel.setTranslateY(8);
    axes.getMzAxisLabels().getChildren().add(mzLabel);
    for (int y = 0; y <= SIZE; y += SIZE / 7) {
        Line tickLineZ = new Line(0, 0, 0, 9);
        tickLineZ.setRotationAxis(Rotate.X_AXIS);
        tickLineZ.setRotate(-90);
        tickLineZ.setTranslateY(-4);
        tickLineZ.setTranslateX(y - 2);
        float roundOff = (float) (Math.round(mzScaleValue * 100.0) / 100.0);
        Text text = new Text("" + (float) roundOff);
        text.setRotationAxis(Rotate.X_AXIS);
        text.setRotate(-45);
        text.setTranslateY(8);
        text.setTranslateX(y - 10);
        text.setTranslateZ(20);
        mzScaleValue += mzDelta;
        axes.getMzAxisTicks().getChildren().add(tickLineZ);
        axes.getMzAxisLabels().getChildren().add(text);
    }
    axes.getMzAxisLabels().setRotate(270);
    axes.getMzAxisLabels().setTranslateX(SIZE / 2 + SIZE / 30);
    axes.getMzAxisTicks().setTranslateX(SIZE / 2 + 10);
    axes.getMzAxisTicks().setTranslateY(-1);
    axes.getMzAxis().setTranslateX(SIZE);
}
 
Example 4
Source File: Fx3DStageController.java    From mzmine2 with GNU General Public License v2.0 5 votes vote down vote up
private void setRtAxis() {
    axes.getRtAxis().getChildren().clear();
    double rtDelta = (rtRange.upperEndpoint() - rtRange.lowerEndpoint())
            / 7;
    double rtScaleValue = rtRange.upperEndpoint();
    Text rtLabel = new Text("Retention Time");
    rtLabel.setRotationAxis(Rotate.X_AXIS);
    rtLabel.setRotate(-45);
    rtLabel.setTranslateX(SIZE * 3 / 8);
    rtLabel.setTranslateZ(-25);
    rtLabel.setTranslateY(13);
    axes.getRtAxis().getChildren().add(rtLabel);
    for (int y = 0; y <= SIZE; y += SIZE / 7) {
        Line tickLineX = new Line(0, 0, 0, 9);
        tickLineX.setRotationAxis(Rotate.X_AXIS);
        tickLineX.setRotate(-90);
        tickLineX.setTranslateY(-5);
        tickLineX.setTranslateX(y);
        tickLineX.setTranslateZ(-3.5);
        float roundOff = (float) (Math.round(rtScaleValue * 10.0) / 10.0);
        Text text = new Text("" + (float) roundOff);
        text.setRotationAxis(Rotate.X_AXIS);
        text.setRotate(-45);
        text.setTranslateY(9);
        text.setTranslateX(y - 5);
        text.setTranslateZ(-15);
        rtScaleValue -= rtDelta;
        axes.getRtAxis().getChildren().addAll(text, tickLineX);
    }
    Line lineX = new Line(0, 0, SIZE, 0);
    axes.getRtAxis().getChildren().add(lineX);
    axes.getRtRotate().setAngle(180);
    axes.getRtTranslate().setZ(-SIZE);
    axes.getRtTranslate().setX(-SIZE);
}