类javafx.scene.transform.Rotate源码实例Demo

下面列出了怎么用javafx.scene.transform.Rotate的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: latexdraw   文件: ViewArrow.java
@Override
public void updatePath(final boolean isShadow) {
	path.setStrokeLineCap(StrokeLineCap.BUTT);
	path.getElements().clear();
	path.fillProperty().unbind();
	path.strokeWidthProperty().unbind();
	path.getTransforms().clear();
	ellipse.getTransforms().clear();
	arc.getTransforms().clear();

	GenericViewArrow.super.updatePath(isShadow);

	final Line line = arrow.getArrowLine();
	final double lineAngle = (-line.getLineAngle() + Math.PI * 2d) % (Math.PI * 2d);

	if(arrow.getArrowStyle() != ArrowStyle.NONE && !MathUtils.INST.equalsDouble(lineAngle, 0d)) {
		final Rotate rotate = new Rotate(Math.toDegrees(lineAngle), 0d, 0d);
		path.getTransforms().add(rotate);
		ellipse.getTransforms().add(rotate);
		arc.getTransforms().add(rotate);
	}
}
 
源代码2 项目: OpenLabeler   文件: TagBase.java
public void move(HorizontalDirection horizontal, VerticalDirection vertical, double deltaX, double deltaY) {
    Rotate rotate = AppUtils.getTransform(this, Rotate.class);
    double x = horizontal == null ? 0 : (horizontal == HorizontalDirection.LEFT ? -deltaX : deltaX);
    double y = vertical == null ? 0 : (vertical == VerticalDirection.UP ? -deltaY : deltaY);
    final double x1 = horizontal == null ? 0 : (horizontal == HorizontalDirection.LEFT ? deltaX : -deltaX);
    final double y1 = vertical == null ? 0 : (vertical == VerticalDirection.UP ? deltaY : -deltaY);
    switch ((int)rotate.getAngle()) {
        case 90:
            x = y;
            y = x1;
            break;
        case 180:
            x = x1;
            y = y1;
            break;
        case 270:
            x = y1;
            y = x;
            break;
    }
    setLocation(shapeItem.getX() + x, shapeItem.getY() + y);
    shapeProperty.set(shapeItem.createCopy());
}
 
源代码3 项目: JavaFXSmartGraph   文件: SmartGraphEdgeCurve.java
@Override
public void attachArrow(SmartArrow arrow) {
    this.attachedArrow = arrow;

    /* attach arrow to line's endpoint */
    arrow.translateXProperty().bind(endXProperty());
    arrow.translateYProperty().bind(endYProperty());

    /* rotate arrow around itself based on this line's angle */
    Rotate rotation = new Rotate();
    rotation.pivotXProperty().bind(translateXProperty());
    rotation.pivotYProperty().bind(translateYProperty());
    rotation.angleProperty().bind(UtilitiesBindings.toDegrees(
            UtilitiesBindings.atan2(endYProperty().subtract(controlY2Property()),
                    endXProperty().subtract(controlX2Property()))
    ));

    arrow.getTransforms().add(rotation);

    /* add translation transform to put the arrow touching the circle's bounds */
    Translate t = new Translate(-outbound.getRadius(), 0);
    arrow.getTransforms().add(t);
}
 
源代码4 项目: JavaFX-Tutorial-Codes   文件: JavaFX3D.java
private void initMouseControl(SmartGroup group, Scene scene) {
    Rotate xRotate;
    Rotate yRotate;
    group.getTransforms().addAll(
            xRotate = new Rotate(0, Rotate.X_AXIS),
            yRotate = new Rotate(0, Rotate.Y_AXIS)
    );
    xRotate.angleProperty().bind(angleX);
    yRotate.angleProperty().bind(angleY);

    scene.setOnMousePressed(event -> {
        anchorX = event.getSceneX();
        anchorY = event.getSceneY();
        anchorAngleX = angleX.get();
        anchorAngleY = angleY.get();
    });

    scene.setOnMouseDragged(event -> {
        angleX.set(anchorAngleX - (anchorY - event.getSceneY()));
        angleY.set(anchorAngleY + anchorX - event.getSceneX());
    });
}
 
源代码5 项目: Medusa   文件: PearClockSkin.java
public PearClockSkin(Clock clock) {
    super(clock);

    minuteRotate      = new Rotate();
    hourRotate        = new Rotate();
    secondRotate      = new Rotate();

    sections          = clock.getSections();
    areas             = clock.getAreas();

    sections          = clock.getSections();
    highlightSections = clock.isHighlightSections();
    sectionsVisible   = clock.getSectionsVisible();
    areas             = clock.getAreas();
    highlightAreas    = clock.isHighlightAreas();
    areasVisible      = clock.getAreasVisible();

    dateTimeFormatter = DateTimeFormatter.ofPattern("EEEE\ndd.MM.YYYY\nHH:mm:ss").withLocale(clock.getLocale());
    dateTextFormatter = DateTimeFormatter.ofPattern("EE").withLocale(clock.getLocale());

    updateAlarms();

    initGraphics();
    registerListeners();
}
 
源代码6 项目: AnimateFX   文件: RotateInDownLeft.java
@Override
void initTimeline() {
    getNode().setRotationAxis(Rotate.Z_AXIS);
    Rotate rotate = new Rotate(0, 0, getNode().getBoundsInLocal().getHeight());
    getNode().getTransforms().add(rotate);
    setTimeline(new Timeline(
            new KeyFrame(Duration.millis(0),
                    new KeyValue(rotate.angleProperty(), -45, AnimateFXInterpolator.EASE),
                    new KeyValue(getNode().opacityProperty(), 0, AnimateFXInterpolator.EASE)
            ),
            new KeyFrame(Duration.millis(1000),
                    new KeyValue(rotate.angleProperty(), 0, AnimateFXInterpolator.EASE),
                    new KeyValue(getNode().opacityProperty(), 1, AnimateFXInterpolator.EASE)
            )
    ));
}
 
源代码7 项目: AnimateFX   文件: RotateInUpLeft.java
@Override
void initTimeline() {
    getNode().setRotationAxis(Rotate.Z_AXIS);
    Rotate rotate = new Rotate(0, 0, getNode().getBoundsInLocal().getHeight());
    getNode().getTransforms().add(rotate);
    setTimeline(new Timeline(
            new KeyFrame(Duration.millis(0),
                    new KeyValue(rotate.angleProperty(), 45, AnimateFXInterpolator.EASE),
                    new KeyValue(getNode().opacityProperty(), 0, AnimateFXInterpolator.EASE)
            ),
            new KeyFrame(Duration.millis(1000),
                    new KeyValue(rotate.angleProperty(), 0, AnimateFXInterpolator.EASE),
                    new KeyValue(getNode().opacityProperty(), 1, AnimateFXInterpolator.EASE)
            )
    ));
}
 
源代码8 项目: AnimateFX   文件: JackInTheBox.java
@Override
void initTimeline() {
    Rotate rotate = new Rotate(30, getNode().getBoundsInParent().getWidth() / 2, getNode().getBoundsInParent().getHeight());
    getNode().getTransforms().add(rotate);
    setTimeline(new Timeline(
            new KeyFrame(Duration.millis(0),
                    new KeyValue(rotate.angleProperty(), 30, AnimateFXInterpolator.EASE),
                    new KeyValue(getNode().scaleXProperty(), 0.1, AnimateFXInterpolator.EASE),
                    new KeyValue(getNode().scaleYProperty(), 0.1, AnimateFXInterpolator.EASE),
                    new KeyValue(getNode().opacityProperty(), 0, AnimateFXInterpolator.EASE)
            ),
            new KeyFrame(Duration.millis(500),
                    new KeyValue(rotate.angleProperty(), -10, AnimateFXInterpolator.EASE)
            ),
            new KeyFrame(Duration.millis(700),
                    new KeyValue(rotate.angleProperty(), 3, AnimateFXInterpolator.EASE)
            ),
            new KeyFrame(Duration.millis(1000),
                    new KeyValue(getNode().scaleXProperty(), 1, AnimateFXInterpolator.EASE),
                    new KeyValue(getNode().scaleYProperty(), 1, AnimateFXInterpolator.EASE),
                    new KeyValue(rotate.angleProperty(), 0, AnimateFXInterpolator.EASE),
                    new KeyValue(getNode().opacityProperty(), 1, AnimateFXInterpolator.EASE)
            )
    ));
}
 
源代码9 项目: Medusa   文件: IndustrialClockSkin.java
public IndustrialClockSkin(Clock clock) {
    super(clock);

    minuteRotate      = new Rotate();
    hourRotate        = new Rotate();
    secondRotate      = new Rotate();

    sections          = clock.getSections();
    areas             = clock.getAreas();

    sections          = clock.getSections();
    highlightSections = clock.isHighlightSections();
    sectionsVisible   = clock.getSectionsVisible();
    areas             = clock.getAreas();
    highlightAreas    = clock.isHighlightAreas();
    areasVisible      = clock.getAreasVisible();

    dateTimeFormatter = DateTimeFormatter.ofPattern("EEEE\ndd.MM.YYYY\nHH:mm:ss").withLocale(clock.getLocale());
    dateTextFormatter = DateTimeFormatter.ofPattern("EE").withLocale(clock.getLocale());

    updateAlarms();

    initGraphics();
    registerListeners();
}
 
源代码10 项目: Medusa   文件: PlainClockSkin.java
public PlainClockSkin(Clock clock) {
    super(clock);

    minuteRotate      = new Rotate();
    hourRotate        = new Rotate();
    secondRotate      = new Rotate();

    sections          = clock.getSections();
    areas             = clock.getAreas();

    sections          = clock.getSections();
    highlightSections = clock.isHighlightSections();
    sectionsVisible   = clock.getSectionsVisible();
    areas             = clock.getAreas();
    highlightAreas    = clock.isHighlightAreas();
    areasVisible      = clock.getAreasVisible();

    updateAlarms();

    initGraphics();
    registerListeners();
}
 
源代码11 项目: narjillos   文件: OrganView.java
private Shape getShape(double zoomLevel, boolean effectsOn) {

		segment.setWidth(organ.getLength() + getOverlap() * 2);
		segment.setHeight(organ.getThickness());

		segment.getTransforms().clear();
		// overlap slightly and shift to center based on thickness
		double widthCenter = organ.getThickness() / 2;
		segment.getTransforms().add(moveToStartPoint());
		segment.getTransforms().add(new Translate(-getOverlap(), -widthCenter));
		segment.getTransforms().add(new Rotate(organ.getAbsoluteAngle(), getOverlap(), widthCenter));

		boolean isHighDetail = hasJoint && zoomLevel >= VERY_HIGH_MAGNIFICATION && effectsOn;

		if (!isHighDetail)
			return segment;

		joint.setRadius(getJointRadius(organ.getThickness()));

		joint.getTransforms().clear();
		joint.getTransforms().add(moveToStartPoint());
		joint.getTransforms().add(new Translate(organ.getLength(), 0));
		joint.getTransforms().add(new Rotate(organ.getAbsoluteAngle(), -organ.getLength(), 0));

		return Path.union(segment, joint);
	}
 
源代码12 项目: SmartCity-ParkingManagement   文件: Curbstone3D.java
public Curbstone(final double size, final Color color, final double shade) {
	getTransforms().addAll(rz, ry, rx);
	getChildren().addAll(
			RectangleBuilder.create() // back face
					.width(2 * size).height(size).fill(color.deriveColor(0.0, 1.0, 1 - 0.5 * shade, 1.0))
					.translateX(-0.5 * size).translateY(-0.5 * size).translateZ(0.5 * size).build(),
			RectangleBuilder.create() // bottom face
					.width(2 * size).height(size).fill(color.deriveColor(0.0, 1.0, 1 - 0.4 * shade, 1.0))
					.translateX(-0.5 * size).translateY(0).rotationAxis(Rotate.X_AXIS).rotate(90).build(),
			RectangleBuilder.create() // right face
					.width(size).height(size).fill(Color.GRAY.deriveColor(0.0, 1.0, 1 - 0.3 * shade, 1.0))
					.translateX(-1 * size).translateY(-0.5 * size).rotationAxis(Rotate.Y_AXIS).rotate(90)
					.build(),
			RectangleBuilder.create() // left face
					.width(size).height(size).fill(Color.GRAY.deriveColor(0.0, 1.0, 1 - 0.2 * shade, 1.0))
					.translateX(size).translateY(-0.5 * size).rotationAxis(Rotate.Y_AXIS).rotate(90).build(),
			RectangleBuilder.create() // top face
					.width(2 * size).height(size).fill(color.deriveColor(0.0, 1.0, 1 - 0.1 * shade, 1.0))
					.translateX(-0.5 * size).translateY(-1 * size).rotationAxis(Rotate.X_AXIS).rotate(90)
					.build(),
			RectangleBuilder.create() // top face
					.width(2 * size).height(size).fill(color).translateX(-0.5 * size).translateY(-0.5 * size)
					.translateZ(-0.5 * size).build());
}
 
源代码13 项目: OpenLabeler   文件: TagBoard.java
private void initModel(Annotation model) {
   scale = new Scale(1, 1);
   translate = new Translate(PADDING, PADDING);
   rotate = new Rotate();
   board.getTransforms().setAll(scale, rotate);

   scale.addEventHandler(TransformChangedEvent.TRANSFORM_CHANGED, event -> {
      // Maintain constant padding at different zoom level
      board.setPadding(new Insets(max(PADDING / scale.getX(), PADDING / scale.getY())));

      canvas.setWidth(imageView.getBoundsInLocal().getWidth());
      canvas.setHeight(imageView.getBoundsInLocal().getHeight());
   });

   scale.setX(1);
   scale.setY(1);
   rotate.setAngle(0);
   selectedObjectProperty.setValue(null);
   tagCoordsProperty.set("");
   objectsProperty.clear();
   hintsProperty.clear();
   imageView.setImage(model == null ? null : model.getSize().getImage());
   imageView.setCache(true);
   if (model != null && model.getObjects().size() > 0) {
      model.getObjects().forEach(obj -> createObjectTag(obj));
      statusProperty.set(MessageFormat.format(bundle.getString("msg.objectsCount"), model.getObjects().size()));
   }
   else {
      statusProperty.set(bundle.getString("msg.noObjects"));
   }
   findHints();
}
 
源代码14 项目: OpenLabeler   文件: TagBase.java
private DoubleBinding getNameTranslateXProperty(Rotate rotate) {
    DoubleBinding anchor = shapeItem.getMinXProperty().add(0);
    switch ((int)rotate.getAngle()) {
        case 180: case -180:
            anchor = shapeItem.getMaxXProperty().subtract(name.heightProperty());
            break;
        case -90: case 270:
            anchor = shapeItem.getMaxXProperty().add(0);
            break;
    }
    return translate.xProperty().add(anchor.multiply(scale.xProperty()));
}
 
源代码15 项目: FXTutorials   文件: HangmanMain.java
public void show() {
    RotateTransition rt = new RotateTransition(Duration.seconds(1), bg);
    rt.setAxis(Rotate.Y_AXIS);
    rt.setToAngle(180);
    rt.setOnFinished(event -> text.setVisible(true));
    rt.play();
}
 
源代码16 项目: mzmine3   文件: Fx3DStageController.java
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);
}
 
源代码17 项目: mzmine3   文件: Fx3DStageController.java
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);
}
 
源代码18 项目: Enzo   文件: Gauge.java
public final void setMarkers(final List<Marker> MARKERS) {
    int markerCounter = 0;
    for (Marker marker : MARKERS) {
        Rotate markerRotate = new Rotate(180 - getStartAngle());
        marker.getTransforms().setAll(markerRotate);
        marker.getStyleClass().add("marker" + markerCounter);
        markers.put(marker, markerRotate);
        markerCounter++;
    }
}
 
源代码19 项目: Enzo   文件: HeatControlSkin.java
private void touchRotate(final double X, final double Y, final Rotate ROTATE) {
    double theta     = getTheta(X, Y);
    interactiveAngle = (theta + 90) % 360;
    double newValue  = Double.compare(interactiveAngle, 180) <= 0 ?
                       (interactiveAngle + 180.0 + getSkinnable().getStartAngle() - 360) / angleStep + getSkinnable().getMinValue():
                       (interactiveAngle - 180.0 + getSkinnable().getStartAngle() - 360) / angleStep + getSkinnable().getMinValue();
    if (Double.compare(newValue, getSkinnable().getMinValue()) >= 0 && Double.compare(newValue, getSkinnable().getMaxValue()) <= 0) {
        ROTATE.setAngle(interactiveAngle);
        value.setText(String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", newValue));
        newTarget = value.getText();
        resizeText();
    }

}
 
源代码20 项目: marathonv5   文件: Sample3D.java
protected Sample3D(double width, double height) {
    super(width, height);
    Group group3d = new Group(create3dContent());
    group3d.setDepthTest(DepthTest.ENABLE);
    group3d.getTransforms().addAll(
            new Translate(width / 2, height / 2),
            new Rotate(180, Rotate.X_AXIS)
    );
    getChildren().add(group3d);
}
 
源代码21 项目: marathonv5   文件: RotateSample.java
public RotateSample() {
    super(220, 270);

    //create 2 rectangles
    Rectangle rect1 = new Rectangle(90, 90, Color.web("#ed4b00", 0.75));
    Rectangle rect2 = new Rectangle(90, 90, Color.web("#ed4b00", 0.5));

    //rotate the second one
    rect2.getTransforms().add(new Rotate(135, 90, 90)); // parameters are angle, pivotX and pivotY

    // rectangle with adjustable rotate
    Rectangle rect3 = new Rectangle(40, 180, 60, 60);
    rect3.setFill(Color.DODGERBLUE);
    rect3.setArcWidth(10);
    rect3.setArcHeight(10);
    rect3.setRotate(45);

    //show the rectangles
    getChildren().addAll(rect2, rect1, rect3);

    // REMOVE ME
    setControls(
            new SimplePropertySheet.PropDesc("Rotate", rect3.rotateProperty(), 0d, 360d)
    );
    // END REMOVE ME
    
    //create arrow
    Polygon polygon = createArrow();
    polygon.setLayoutX(110);
    polygon.setLayoutY(15);
    polygon.setRotate(135);

    getChildren().addAll(polygon);

}
 
源代码22 项目: Enzo   文件: GaugeSkin.java
private void touchRotate(final double X, final double Y, final Rotate ROTATE) {
    double theta     = getTheta(X, Y);
    interactiveAngle = (theta + 90) % 360;
    double newValue  = Double.compare(interactiveAngle, 180) <= 0 ?
                       (interactiveAngle + 180.0 + getSkinnable().getStartAngle() - 360) / angleStep + getSkinnable().getMinValue():
                       (interactiveAngle - 180.0 + getSkinnable().getStartAngle() - 360) / angleStep + getSkinnable().getMinValue();
    if (Double.compare(newValue, getSkinnable().getMinValue()) >= 0 && Double.compare(newValue, getSkinnable().getMaxValue()) <= 0) {
        ROTATE.setAngle(interactiveAngle);
        value.setText(String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", newValue));
        resizeText();
    }

}
 
源代码23 项目: latexdraw   文件: ViewArrow.java
@Override
public void setRotation180() {
	final Rotate rotate = new Rotate(180d, 0d, 0d);
	path.getTransforms().add(rotate);
	ellipse.getTransforms().add(rotate);
	arc.getTransforms().add(rotate);
}
 
源代码24 项目: marathonv5   文件: AudioVisualizerSample.java
@Override public Node create3dContent() {

        Xform sceneRoot = new Xform();

        cubeXform = new Xform[128];
        cube = new Cube[128];

        int i;
        for (i = 0; i < 128; i++) {
            cubeXform[i] = new Xform();
            cubeXform[i].setTranslateX((double) 2);
            cube[i] = new Cube(1.0, Color.hsb((double) i*1.2, 1.0, 1.0, 0.3), 1.0);
            if (i == 0) {
                sceneRoot.getChildren().add(cubeXform[i]);
            }
            else if (i >= 1) {
                cubeXform[i-1].getChildren().add(cubeXform[i]);
            }
            cubeXform[i].getChildren().add(cube[i]);
        }

        audioSpectrumListener = this;
        getAudioMediaPlayer().setAudioSpectrumListener(audioSpectrumListener);
        getAudioMediaPlayer().play();
        getAudioMediaPlayer().setAudioSpectrumInterval(0.02);
        getAudioMediaPlayer().setAudioSpectrumNumBands(128);
        getAudioMediaPlayer().setCycleCount(Timeline.INDEFINITE);

        sceneRoot.setRotationAxis(Rotate.X_AXIS);
        sceneRoot.setRotate(180.0);
        sceneRoot.setTranslateY(-100.0);

        return sceneRoot;
    }
 
源代码25 项目: FXyzLib   文件: Axes.java
public Axes(double scale) {
    axisX.getTransforms().addAll(new Rotate(90, Rotate.Z_AXIS), new Translate(0, 30, 0));
    axisX.setMaterial(new PhongMaterial(Color.RED));
    axisY.getTransforms().add(new Translate(0, 30, 0));
    axisY.setMaterial(new PhongMaterial(Color.GREEN));
    axisZ.setMaterial(new PhongMaterial(Color.BLUE));
    axisZ.getTransforms().addAll(new Rotate(90, Rotate.X_AXIS), new Translate(0, 30, 0));
    getChildren().addAll(axisX, axisY, axisZ);
    getTransforms().add(new Scale(scale, scale, scale));
}
 
源代码26 项目: marathonv5   文件: Sample3D.java
protected Sample3D(double width, double height) {
    super(width, height);
    Group group3d = new Group(create3dContent());
    group3d.setDepthTest(DepthTest.ENABLE);
    group3d.getTransforms().addAll(
            new Translate(width / 2, height / 2),
            new Rotate(180, Rotate.X_AXIS)
    );
    getChildren().add(group3d);
}
 
源代码27 项目: marathonv5   文件: RotateSample.java
public RotateSample() {
    super(220, 270);

    //create 2 rectangles
    Rectangle rect1 = new Rectangle(90, 90, Color.web("#ed4b00", 0.75));
    Rectangle rect2 = new Rectangle(90, 90, Color.web("#ed4b00", 0.5));

    //rotate the second one
    rect2.getTransforms().add(new Rotate(135, 90, 90)); // parameters are angle, pivotX and pivotY

    // rectangle with adjustable rotate
    Rectangle rect3 = new Rectangle(40, 180, 60, 60);
    rect3.setFill(Color.DODGERBLUE);
    rect3.setArcWidth(10);
    rect3.setArcHeight(10);
    rect3.setRotate(45);

    //show the rectangles
    getChildren().addAll(rect2, rect1, rect3);

    // REMOVE ME
    setControls(
            new SimplePropertySheet.PropDesc("Rotate", rect3.rotateProperty(), 0d, 360d)
    );
    // END REMOVE ME
    
    //create arrow
    Polygon polygon = createArrow();
    polygon.setLayoutX(110);
    polygon.setLayoutY(15);
    polygon.setRotate(135);

    getChildren().addAll(polygon);

}
 
源代码28 项目: Enzo   文件: Gauge.java
public final void addMarker(final Marker MARKER) {
    if (!markers.keySet().contains(MARKER)) {
        Rotate markerRotate = new Rotate(180 - getStartAngle());
        MARKER.getTransforms().setAll(markerRotate);
        MARKER.getStyleClass().add("marker" + markers.size());
        markers.put(MARKER, markerRotate);
    }
}
 
源代码29 项目: marathonv5   文件: AudioVisualizerSample.java
@Override public Node create3dContent() {

        Xform sceneRoot = new Xform();

        cubeXform = new Xform[128];
        cube = new Cube[128];

        int i;
        for (i = 0; i < 128; i++) {
            cubeXform[i] = new Xform();
            cubeXform[i].setTranslateX((double) 2);
            cube[i] = new Cube(1.0, Color.hsb((double) i*1.2, 1.0, 1.0, 0.3), 1.0);
            if (i == 0) {
                sceneRoot.getChildren().add(cubeXform[i]);
            }
            else if (i >= 1) {
                cubeXform[i-1].getChildren().add(cubeXform[i]);
            }
            cubeXform[i].getChildren().add(cube[i]);
        }

        audioSpectrumListener = this;
        getAudioMediaPlayer().setAudioSpectrumListener(audioSpectrumListener);
        getAudioMediaPlayer().play();
        getAudioMediaPlayer().setAudioSpectrumInterval(0.02);
        getAudioMediaPlayer().setAudioSpectrumNumBands(128);
        getAudioMediaPlayer().setCycleCount(Timeline.INDEFINITE);

        sceneRoot.setRotationAxis(Rotate.X_AXIS);
        sceneRoot.setRotate(180.0);
        sceneRoot.setTranslateY(-100.0);

        return sceneRoot;
    }
 
源代码30 项目: AnimateFX   文件: RotateIn.java
@Override
void initTimeline() {
    getNode().setRotationAxis(Rotate.Z_AXIS);
    setTimeline(new Timeline(
            new KeyFrame(Duration.millis(0),
                    new KeyValue(getNode().rotateProperty(), -200, AnimateFXInterpolator.EASE),
                    new KeyValue(getNode().opacityProperty(), 0, AnimateFXInterpolator.EASE)
            ),
            new KeyFrame(Duration.millis(1000),
                    new KeyValue(getNode().rotateProperty(), 0, AnimateFXInterpolator.EASE),
                    new KeyValue(getNode().opacityProperty(), 1, AnimateFXInterpolator.EASE)
            )
    ));
}
 
 类所在包
 同包方法