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

项目:incubator-netbeans    文件:StopWatch.java   
private void myLayout() {
    mainDial.setLayoutX(140);
    mainDial.setLayoutY(140);

    minutesDial.setLayoutX(100);
    minutesDial.setLayoutY(100);

    tenthsDial.setLayoutX(180);
    tenthsDial.setLayoutY(100);

    digitalClock.setLayoutX(79);
    digitalClock.setLayoutY(195);

    startButton.setLayoutX(223);
    startButton.setLayoutY(1);
    Rotate rotateRight = new Rotate(360 / 12);
    startButton.getTransforms().add(rotateRight);

    stopButton.setLayoutX(59.5);
    stopButton.setLayoutY(0);
    Rotate rotateLeft = new Rotate(-360 / 12);
    stopButton.getTransforms().add(rotateLeft);
}
项目:marathonv5    文件:StopWatchSample.java   
private void myLayout() {
    mainDial.setLayoutX(140);
    mainDial.setLayoutY(140);

    minutesDial.setLayoutX(100);
    minutesDial.setLayoutY(100);

    tenthsDial.setLayoutX(180);
    tenthsDial.setLayoutY(100);

    digitalClock.setLayoutX(79);
    digitalClock.setLayoutY(195);

    startButton.setLayoutX(223);
    startButton.setLayoutY(1);
    Rotate rotateRight = new Rotate(360 / 12);
    startButton.getTransforms().add(rotateRight);

    stopButton.setLayoutX(59.5);
    stopButton.setLayoutY(0);
    Rotate rotateLeft = new Rotate(-360 / 12);
    stopButton.getTransforms().add(rotateLeft);
}
项目:marathonv5    文件:StopWatchSample.java   
private void myLayout() {
    mainDial.setLayoutX(140);
    mainDial.setLayoutY(140);

    minutesDial.setLayoutX(100);
    minutesDial.setLayoutY(100);

    tenthsDial.setLayoutX(180);
    tenthsDial.setLayoutY(100);

    digitalClock.setLayoutX(79);
    digitalClock.setLayoutY(195);

    startButton.setLayoutX(223);
    startButton.setLayoutY(1);
    Rotate rotateRight = new Rotate(360 / 12);
    startButton.getTransforms().add(rotateRight);

    stopButton.setLayoutX(59.5);
    stopButton.setLayoutY(0);
    Rotate rotateLeft = new Rotate(-360 / 12);
    stopButton.getTransforms().add(rotateLeft);
}
项目:dynamo    文件:SwitchSkin.java   
private void initGraphics() {
    background = new Region();
    background.getStyleClass().setAll("background");

    upBar = new Region();
    upBar.getStyleClass().setAll("up-bar");

    downBar = new Region();
    downBar.getStyleClass().setAll("down-bar");

    barRotate = new Rotate(ANGLE_IN_CLOSED_POSITION);

    mobileBar = new Region();
    mobileBar.getStyleClass().setAll("mobile-bar");
    mobileBar.getTransforms().add(barRotate);

    name = new Text(getSkinnable().getName());
    name.getStyleClass().setAll("name-text");

    pane = new Pane(background, upBar, downBar, mobileBar, name);

    getChildren().add(pane);
    resize();
}
项目:GazePlay    文件:Metronome.java   
public Metronome() {
    // création du fond du métronome
    ImageView fond_metronome = new ImageView(
            new Image(Metronome.class.getResourceAsStream("images/metronome.png")));
    fond_metronome.setFitHeight(40);
    fond_metronome.setPreserveRatio(true);

    // création de l'aiguille du métronome
    ImageView aiguille = new ImageView(new Image(Metronome.class.getResourceAsStream("images/aiguille.png")));
    aiguille.setFitHeight(32);
    aiguille.setPreserveRatio(true);
    aiguille.setTranslateX(16);
    aiguille.setTranslateY(2);

    // on applique une transformation à l'aiguille
    Rotate rotation = new Rotate(0, 3, 29);
    aiguille.getTransforms().add(rotation);

    // création de l'animation de l'aiguille
    Timeline timeline = new Timeline();
    timeline.getKeyFrames().addAll(new KeyFrame(Duration.ZERO, new KeyValue(rotation.angleProperty(), 45)),
            new KeyFrame(new Duration(1000), new KeyValue(rotation.angleProperty(), -45)));
    timeline.setAutoReverse(true);
    timeline.setCycleCount(Timeline.INDEFINITE);
    timeline.play();

    this.getChildren().add(fond_metronome);
    this.getChildren().add(aiguille);
    this.setTranslateX(400);
    this.setTranslateY(200);
}
项目:fxexperience2    文件:RotateInDownRightTransition.java   
@Override protected void starting() {
    super.starting();
    rotate = new Rotate(0,
            node.getBoundsInLocal().getWidth(),
            node.getBoundsInLocal().getHeight());
    timeline = new Timeline(
            new KeyFrame(Duration.millis(0),    
                new KeyValue(node.opacityProperty(), 0, WEB_EASE),
                new KeyValue(rotate.angleProperty(), 90, WEB_EASE)
            ),
            new KeyFrame(Duration.millis(1000),    
                new KeyValue(node.opacityProperty(), 1, WEB_EASE),
                new KeyValue(rotate.angleProperty(), 0, WEB_EASE)
            )
        );
    node.getTransforms().add(rotate);
}
项目:fxexperience2    文件:RotateOutUpRightTransition.java   
@Override protected void starting() {
    super.starting();
    rotate = new Rotate(0,
            node.getBoundsInLocal().getWidth(),
            node.getBoundsInLocal().getHeight());
    timeline = new Timeline(
            new KeyFrame(Duration.millis(0),    
                new KeyValue(node.opacityProperty(), 1, WEB_EASE),
                new KeyValue(rotate.angleProperty(), 0, WEB_EASE)
            ),
            new KeyFrame(Duration.millis(1000),    
                new KeyValue(node.opacityProperty(), 0, WEB_EASE),
                new KeyValue(rotate.angleProperty(), 90, WEB_EASE)
            )
        );
    node.getTransforms().add(rotate);
}
项目:fxexperience2    文件:RotateInUpRightTransition.java   
@Override protected void starting() {
    super.starting();
    rotate = new Rotate(0,
            node.getBoundsInLocal().getWidth(),
            node.getBoundsInLocal().getHeight());
  timeline = new Timeline(
            new KeyFrame(Duration.millis(0),    
                new KeyValue(node.opacityProperty(), 0, WEB_EASE),
                new KeyValue(rotate.angleProperty(), -90, WEB_EASE)
            ),
            new KeyFrame(Duration.millis(1000),    
                new KeyValue(node.opacityProperty(), 1, WEB_EASE),
                new KeyValue(rotate.angleProperty(), 0, WEB_EASE)
            )
        );
    node.getTransforms().add(rotate);
}
项目:fxexperience2    文件:RotateOutDownRightTransition.java   
@Override protected void starting() {
    super.starting();
    rotate = new Rotate(0,
            node.getBoundsInLocal().getWidth(),
            node.getBoundsInLocal().getHeight());
    timeline = new Timeline(
            new KeyFrame(Duration.millis(0),    
                new KeyValue(node.opacityProperty(), 1, WEB_EASE),
                new KeyValue(rotate.angleProperty(), 0, WEB_EASE)
            ),
            new KeyFrame(Duration.millis(1000),    
                new KeyValue(node.opacityProperty(), 0, WEB_EASE),
                new KeyValue(rotate.angleProperty(), -90, WEB_EASE)
            )
        );
    node.getTransforms().add(rotate);
}
项目:fxexperience2    文件:FlipTransition.java   
@Override
protected void interpolate(double d) {
    if (first) { // setup
        flipNode.setRotationAxis(Rotate.Y_AXIS);
        oldCamera = flipNode.getScene().getCamera();
        flipNode.getScene().setCamera(new PerspectiveCamera());
        first = false;
    }
    super.interpolate(d);
    if (d == 1) { // restore
        first = true;
        flipNode.setRotate(0);
        flipNode.setRotationAxis(Rotate.Z_AXIS);
        flipNode.getScene().setCamera(oldCamera);
    }
}
项目:gatepass    文件:MainWindow.java   
public void rotateHer(Label labelHer, ImageView iv)
{
    RotateTransition rotation = new RotateTransition(Duration.seconds(2), iv);
    rotation.setCycleCount(Animation.INDEFINITE);
    rotation.setByAngle(360);

    iv.setTranslateZ(iv.getBoundsInLocal().getWidth() / 2.0);
    iv.setRotationAxis(Rotate.Y_AXIS);

    labelHer.setOnMouseEntered(e ->
    { 
        rotation.play();
        iv.setRotate(180);
    });
    labelHer.setOnMouseExited(e ->
    { 
        rotation.pause();
        iv.setRotate(0);
    });
}
项目:gatepass    文件:ExDetails.java   
public void rotateHer(Label labelHer, ImageView iv)
{
    RotateTransition rotation = new RotateTransition(Duration.seconds(2), iv);
    rotation.setCycleCount(Animation.INDEFINITE);
    rotation.setByAngle(360);

    iv.setTranslateZ(iv.getBoundsInLocal().getWidth() / 2.0);
    iv.setRotationAxis(Rotate.Y_AXIS);

    labelHer.setOnMouseEntered(e ->
    { 
        rotation.play();
        iv.setRotate(180);
    });
    labelHer.setOnMouseExited(e ->
    { 
        rotation.pause();
        iv.setRotate(0);
    });
}
项目:gatepass    文件:SysSettings.java   
public void rotateHer(Label labelHer, ImageView iv)
{
    RotateTransition rotation = new RotateTransition(Duration.seconds(2.3), iv);
    rotation.setCycleCount(Animation.INDEFINITE);
    rotation.setByAngle(360);

    iv.setTranslateZ(iv.getBoundsInLocal().getWidth() / 2.0);
    iv.setRotationAxis(Rotate.Y_AXIS);

    labelHer.setOnMouseEntered(e ->
    { 
        rotation.play();
        iv.setRotate(180);
    });
    labelHer.setOnMouseExited(e ->
    { 
        rotation.pause();
        iv.setRotate(0);
    });
}
项目:Incubator    文件:FlipPanel.java   
public FlipPanel(final Orientation FLIP_DIRECTION) {
    rotate = new Rotate(0, Rotate.Y_AXIS);
    getTransforms().add(rotate);

    backRotate = new Rotate(180, Orientation.HORIZONTAL == FLIP_DIRECTION ? Rotate.Y_AXIS : Rotate.X_AXIS);

    front = new StackPane();
    back  = new StackPane();

    back.setVisible(false);

    getChildren().setAll(back, front);

    flipToFront   = new Timeline();
    flipToBack    = new Timeline();
    flipTime      = 700;
    flipDirection = FLIP_DIRECTION;

    registerListeners();
}
项目:Gargoyle    文件:ClockNaSkin.java   
/**
 * 시간 UI를 갱신시킨다.
 *
 * @작성자 : KYJ
 * @작성일 : 2016. 4. 12.
 * @param date
 */
private void updateClockAngle(Date date) {
    Calendar calendar = GregorianCalendar.getInstance();

    if (date != null)
        calendar.setTime(date);

    final double seedSecondDegrees = calendar.get(Calendar.SECOND) * (360 / 60);
    final double seedMinuteDegrees = (calendar.get(Calendar.MINUTE) + seedSecondDegrees / 360.0) * (360 / 60);
    final double seedHourDegrees = (calendar.get(Calendar.HOUR) + seedMinuteDegrees / 360.0) * (360 / 12);

    // define rotations to map the analogueClock to the current time.
    final Rotate hourRotate = new Rotate(seedHourDegrees);
    final Rotate minuteRotate = new Rotate(seedMinuteDegrees);
    final Rotate secondRotate = new Rotate(seedSecondDegrees);

    hourHand.getTransforms().clear();
    minuteHand.getTransforms().clear();
    secondHand.getTransforms().clear();

    hourHand.getTransforms().add(hourRotate);
    minuteHand.getTransforms().add(minuteRotate);
    secondHand.getTransforms().add(secondRotate);
}
项目: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());
}
项目:Shapify    文件:Document.java   
public void rotateSelectedObject(double angle, boolean createHistoryPoint) {
    GUIState guiState = mainController.getGUIController().getGuiState();

    FocusOutline focusOutline = guiState.getFocusOutline();

    Rotate rotation = new Rotate();
    rotation.setAngle(angle);

    rotation.setPivotX(focusOutline.getRotateAnchor().getCenterX());
    rotation.setPivotY(focusOutline.getRotateAnchor().getCenterY());

    focusOutline.getFocusRectangle().getTransforms().add(rotation);
    focusOutline.getRotateAnchor().getTransforms().add(rotation);

    guiState.getSelectedObject().getTransforms().add(rotation);

    for (ResizeAnchor resizeAnchor : focusOutline.getResizeAnchors()) {
        resizeAnchor.getTransforms().add(rotation);
    }

    if (createHistoryPoint) {
        HistoryController.getInstance(mainController).createHistoryPoint();
    }
}
项目:Medusa    文件:DBClockSkin.java   
public DBClockSkin(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();
}
项目:Medusa    文件:ClockSkin.java   
public ClockSkin(Clock clock) {
    super(clock);

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

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

    updateAlarms();

    initGraphics();
    registerListeners();
}
项目:Medusa    文件:FatClockSkin.java   
public FatClockSkin(Clock clock) {
    super(clock);

    minuteRotate      = new Rotate();
    hourRotate        = 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();
}
项目: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();

    updateAlarms();

    initGraphics();
    registerListeners();
}
项目: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();

    updateAlarms();

    initGraphics();
    registerListeners();
}
项目: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();
}
项目:singa    文件:StructureViewer.java   
private Cylinder createCylinderConnecting(Vector3D source, Vector3D target) {
    Vector3D delta = target.subtract(source);
    double distance = source.distanceTo(target);

    Cylinder bond = new Cylinder(0.4, distance, 10);
    Vector3D newLocation = delta.divide(2).add(source);

    bond.setTranslateX(newLocation.getX());
    bond.setTranslateY(newLocation.getY());
    bond.setTranslateZ(newLocation.getZ());

    // phi
    bond.getTransforms().add(new Rotate(90 + Math.toDegrees(Math.atan2(delta.getY(), delta.getX())), Rotate.Z_AXIS));
    // theta
    bond.getTransforms().add(new Rotate(90 + Math.toDegrees(Math.acos(delta.getZ() / distance)), Rotate.X_AXIS));

    return bond;
}
项目:j.commons    文件:RadialMenuSkinBase.java   
private void bindCoords() {
    final DoubleExpression radius = model.sizeProperty().multiply(0.5);
    final Translate translation = new Translate();
    translation.xProperty().bind(transformRadius);

    final Rotate rotation = new Rotate();
    rotation.pivotXProperty().bind(transformRadius.subtract(radius).multiply(-1));
    rotation.pivotYProperty().bind(radius);
    rotation.angleProperty().bind(transformAngle);

    button.getTransforms().addAll(translation, rotation);

    final Rotate twist = new Rotate();
    twist.pivotXProperty().bind(radius);
    twist.pivotYProperty().bind(radius);
    twist.angleProperty().bind(transformAngle.multiply(-1.0d));

    button.getTransforms().add(twist);

    model.visibleProperty().addListener((observable) -> {
        updateVisibility();
    });
}
项目:FXGL    文件:GameScene.java   
private void initViewport(double w, double h) {
    Viewport viewport = getViewport();
    gameRoot.layoutXProperty().bind(viewport.xProperty().negate());
    gameRoot.layoutYProperty().bind(viewport.yProperty().negate());

    Scale scale = new Scale();
    scale.pivotXProperty().bind(viewport.xProperty());
    scale.pivotYProperty().bind(viewport.yProperty());
    scale.xProperty().bind(viewport.zoomProperty());
    scale.yProperty().bind(viewport.zoomProperty());
    gameRoot.getTransforms().add(scale);

    Rotate rotate = new Rotate(0, Rotate.Z_AXIS);
    rotate.pivotXProperty().bind(viewport.xProperty().add(w / 2));
    rotate.pivotYProperty().bind(viewport.yProperty().add(h / 2));
    rotate.angleProperty().bind(viewport.angleProperty().negate());
    gameRoot.getTransforms().add(rotate);
}
项目:iso-game-engine    文件:StageInfo.java   
public StageInfo(
    final int w, final int h, final Tile[] data
) throws CorruptDataException {
    this.w = w;
    this.h = h;
    this.data = data;
    if (data.length != w * h)
        throw new CorruptDataException("Incorrect number of tiles in stage");

    // set the camera angle rotations
    final double xPivot = ((double) this.w) / 2.0d;
    final double yPivot = ((double) this.h) / 2.0d;
    rUL = new Rotate();
    rLL = new Rotate(90, xPivot, yPivot);
    rLR = new Rotate(180, xPivot, yPivot);
    rUR = new Rotate(270, xPivot, yPivot);

    // compute the iso coordinate transformation
    // note that javafx transformations appear to compose backwards
    isoTransform = new Affine();
    isoTransform.appendTranslation((0 - TILEW) / 2, 0);
    isoTransform.appendScale(TILEW / Math.sqrt(2), TILEH / Math.sqrt(2));
    isoTransform.appendRotation(45, 0, 0);
}
项目:FXImgurUploader    文件:SplitFlapSkin.java   
public SplitFlapSkin(final SplitFlap CONTROL) {
    super(CONTROL);
    FLIP_FINISHED         = new FlipEvent(this, getSkinnable(), FlipEvent.FLIP_FINISHED);
    selectedSet           = getSkinnable().getSelectedSet();
    currentSelectionIndex = getSkinnable().getSelectedSet().indexOf(getSkinnable().getText());
    nextSelectionIndex    = currentSelectionIndex + 1 > getSkinnable().getSelectedSet().size() ? 0 : currentSelectionIndex + 1;
    aspectRatio           = PREFERRED_HEIGHT / PREFERRED_WIDTH;
    pane                  = new Pane();
    rotateFlap            = new Rotate();
    rotateFlap.setAxis(Rotate.X_AXIS);
    rotateFlap.setAngle(0);
    flapHeight            = 0.49206349206349204 * PREFERRED_HEIGHT;
    timeline              = new Timeline();
    init();
    initGraphics();
    registerListeners();
}
项目:FX3DAndroid    文件:ScadaApplication.java   
private void makePedestal(ObservableList<Node> g) {
    // pedestal
    Box box = new Box(5.5, 0.2, 5);
    box.setMaterial(material2);
    // box.setTranslateY(3);

    double length1 = 4.2;
    // outlet dispatch tube
    Capsule t1 = new Capsule(0.3, length1);
    t1.setCullFace(CullFace.BACK);
    t1.setMaterial(material);
    t1.getTransforms().addAll(new Rotate(90, X_AXIS), new Translate(0, -length1 / 2, -0.4));

    double length2 = 4.4;
    // outlet endpoint supply tube
    Group tg = makePump(length2, 0.3, 0.35, material);
    tg.getTransforms().addAll(new Rotate(90, X_AXIS), new Translate(-2.8, 0, -1.5));

    g.addAll(t1, tg, box);

    // TriangleMesh mesh = createToroidMesh(2f, 0.5f, 100, 100);
    // g.addAll(new MeshView(mesh));
}
项目:LIMES    文件:NodeView.java   
/**
 * Draw the Links on Canvas to the Childs
 */
public void drawLink() {
    GraphicsContext gc = gbv.getGraphicsContext2D();
    gc.setStroke(Color.BLACK);
    children.forEach(nodeView -> {
        int x1 = x + this.width / 2;
        int y1 = y + this.height / 2;
        int x2 = nodeView.x + nodeView.width / 2;
        int y2 = nodeView.y + nodeView.height / 2;
        gc.strokeLine(x1, y1, x2, y2);

        double linkMidX = (x1 + x2) / 2.0;
        nodeView.midLinkX = (int) linkMidX;
        double linkMidY = (y1 + y2) / 2.0;
        nodeView.midLinkY = (int) linkMidY;
        double rotate = Math.toDegrees(Math.atan2(y2 - y1, x2 - x1)) + 225;
        gc.setTransform(new Affine(new Rotate(rotate, linkMidX, linkMidY)));
        double arrowX = linkMidX - (arrow.getWidth() * 3 / 4);
        double arrowY = linkMidY - (arrow.getWidth() / 4);
        gc.drawImage(arrow, arrowX, arrowY);
        gc.setTransform(new Affine());
    });
}
项目:Shapify    文件:Document.java   
public void rotateSelectedObject(double angle, boolean createHistoryPoint) {
    GUIState guiState = mainController.getGUIController().getGuiState();

    FocusOutline focusOutline = guiState.getFocusOutline();

    Rotate rotation = new Rotate();
    rotation.setAngle(angle);

    rotation.setPivotX(focusOutline.getRotateAnchor().getCenterX());
    rotation.setPivotY(focusOutline.getRotateAnchor().getCenterY());

    focusOutline.getFocusRectangle().getTransforms().add(rotation);
    focusOutline.getRotateAnchor().getTransforms().add(rotation);

    guiState.getSelectedObject().getTransforms().add(rotation);

    for (ResizeAnchor resizeAnchor : focusOutline.getResizeAnchors()) {
        resizeAnchor.getTransforms().add(rotation);
    }

    if (createHistoryPoint) {
        HistoryController.getInstance(mainController).createHistoryPoint();
    }
}
项目:UDOONeoController    文件:Sensors3DViewController.java   
private void rotate3D(Group shape, float rx, float ry, float rz){
    if (rotationInProgress){
        return;
    }
    //System.out.printf("rotate3D:%s %f | %f | %f\n", shape.getId(), rx, ry, rz);
    rotationInProgress = true;
    Rotate rxBox = new Rotate(0, 0, 0, 0, Rotate.X_AXIS);
    Rotate ryBox = new Rotate(0, 0, 0, 0, Rotate.Y_AXIS);
    Rotate rzBox = new Rotate(0, 0, 0, 0, Rotate.Z_AXIS);

    rxBox.setAngle(rx);
    ryBox.setAngle(ry);
    rzBox.setAngle(rz);
    shape.getTransforms().addAll(rxBox, ryBox, rzBox);
    rotationInProgress = false;
}
项目:FlagMaker-2    文件:OverlayTransformer.java   
private Transform GetTransformation(int width, int height)
{
    double centerX = width * GetDoubleAttribute("X") / MaximumX;
    double centerY = height * GetDoubleAttribute("Y") / MaximumY;

    double skewX = 90 * (GetDoubleAttribute("SkewX") - MaximumX / 2.0) / MaximumX;
    double skewY = 90 * (GetDoubleAttribute("SkewY") - MaximumY / 2.0) / MaximumY;

    double scaleX = GetDoubleAttribute("Width");
    double scaleY = GetDoubleAttribute("Height");

    double rotation = (GetDoubleAttribute("Rotation") / MaximumX) * 360;

    Shear skewTransform = new Shear(skewX, skewY, centerX, centerY);
    Rotate rotateTransform = new Rotate(rotation, centerX, centerY);
    Scale scaleTransform = new Scale(scaleX, scaleY, centerX, centerY);

    return rotateTransform.createConcatenation(scaleTransform).createConcatenation(skewTransform);
}
项目:Elegit    文件:TreeGraph.java   
/**
 * Constructs a new graph using the given model
 * @param m the model of the graph
 */
public TreeGraph(TreeGraphModel m) {
    this.treeGraphModel = m;

    cellLayer = new Pane();
    cellLayer.setRotationAxis(Rotate.X_AXIS);
    cellLayer.setRotate(180);
    cellLayer.setPadding(new Insets(0,0,Cell.BOX_SIZE+TreeLayout.V_PAD,0));
    cellLayer.boundsInLocalProperty().addListener((observable, oldValue, newValue) -> cellLayer.setMinWidth(newValue.getMaxX()));

    scrollPane = new CommitTreeScrollPane(cellLayer);

    scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
    scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);

    scrollPane.NumItemsProperty.bind(m.numCellsProperty);

    queuedToAdd = new LinkedList<>();
    queuedToRemove = new LinkedList<>();
}
项目:Consume    文件:PlayerHUD.java   
public void setBossBar(Entity boss) {
    getChildren().remove(bossHealthBar);

    bossHealthBar = new ValueBar(95, 20, boss.<Enemy>getProperty(Property.DATA).curHealth, boss.<Enemy>getProperty(Property.DATA).maxHealth, Color.YELLOW);
    bossHealthBar.getTransforms().add(new Rotate(270));
    bossHealthBar.getTransforms().add(new Translate(-10, 580, 0));
    boss.<Enemy>getProperty(Property.DATA).curHealth.addListener(new ChangeListener<Number>() {
        @Override
        public void changed(ObservableValue<? extends Number> arg0, Number arg1, Number arg2) {
            if (arg2.intValue() <= 0) {
                FadeTransition ft = new FadeTransition(Duration.seconds(1), bossHealthBar);
                ft.setFromValue(1);
                ft.setToValue(0);
                ft.setOnFinished((event) -> bossHealthBar.setVisible(false));
                ft.play();
            }
        }
    });
    getChildren().add(bossHealthBar);
}
项目:incubator-netbeans    文件:Cube3D.java   
private void init(Stage primaryStage) {
    Group root = new Group();
    root.setDepthTest(DepthTest.ENABLE);
    primaryStage.setResizable(false);
    primaryStage.setScene(new Scene(root, 400, 150, true));
    primaryStage.getScene().setCamera(new PerspectiveCamera());
    root.getTransforms().addAll(
        new Translate(400 / 2, 150 / 2),
        new Rotate(180, Rotate.X_AXIS)
    );
    root.getChildren().add(create3dContent());
}
项目:incubator-netbeans    文件:CubeSystem3D.java   
private void init(Stage primaryStage) {
    Group root = new Group();
    root.setDepthTest(DepthTest.ENABLE);
    primaryStage.setResizable(false);
    primaryStage.setScene(new Scene(root, 500, 500, true));
    primaryStage.getScene().setCamera(new PerspectiveCamera());
    root.getTransforms().addAll(
        new Translate(500 / 2, 500 / 2),
        new Rotate(180, Rotate.X_AXIS)
    );
    root.getChildren().add(create3dContent());
}
项目:incubator-netbeans    文件:AudioVisualizer3D.java   
private void init(Stage primaryStage) {
    Group root = new Group();
    root.setDepthTest(DepthTest.ENABLE);
    primaryStage.setResizable(false);
    primaryStage.setScene(new Scene(root, 400, 500, true));
    primaryStage.getScene().setCamera(new PerspectiveCamera());
    root.getTransforms().addAll(
        new Translate(400 / 2, 500 / 2 + 100),
        new Rotate(180, Rotate.X_AXIS)
    );
    root.getChildren().add(create3dContent());
}
项目:incubator-netbeans    文件:AudioVisualizer3D.java   
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;
    }
项目: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);
}