本文整理匯總了Java中javafx.scene.transform.Rotate類的典型用法代碼示例。如果您正苦於以下問題:Java Rotate類的具體用法?Java Rotate怎麽用?Java Rotate使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Rotate類屬於javafx.scene.transform包,在下文中一共展示了Rotate類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: Metronome
import javafx.scene.transform.Rotate; //導入依賴的package包/類
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);
}
示例2: myLayout
import javafx.scene.transform.Rotate; //導入依賴的package包/類
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);
}
示例3: initGraphics
import javafx.scene.transform.Rotate; //導入依賴的package包/類
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();
}
示例4: starting
import javafx.scene.transform.Rotate; //導入依賴的package包/類
@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);
}
示例5: starting
import javafx.scene.transform.Rotate; //導入依賴的package包/類
@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);
}
示例6: starting
import javafx.scene.transform.Rotate; //導入依賴的package包/類
@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);
}
示例7: starting
import javafx.scene.transform.Rotate; //導入依賴的package包/類
@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);
}
示例8: interpolate
import javafx.scene.transform.Rotate; //導入依賴的package包/類
@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);
}
}
示例9: rotateHer
import javafx.scene.transform.Rotate; //導入依賴的package包/類
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);
});
}
示例10: rotateHer
import javafx.scene.transform.Rotate; //導入依賴的package包/類
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);
});
}
示例11: FlipPanel
import javafx.scene.transform.Rotate; //導入依賴的package包/類
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();
}
示例12: updateClockAngle
import javafx.scene.transform.Rotate; //導入依賴的package包/類
/**
* 시간 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);
}
示例13: Curbstone
import javafx.scene.transform.Rotate; //導入依賴的package包/類
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());
}
示例14: rotateSelectedObject
import javafx.scene.transform.Rotate; //導入依賴的package包/類
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();
}
}
示例15: DBClockSkin
import javafx.scene.transform.Rotate; //導入依賴的package包/類
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();
}