本文整理匯總了Java中javafx.animation.RotateTransition.setFromAngle方法的典型用法代碼示例。如果您正苦於以下問題:Java RotateTransition.setFromAngle方法的具體用法?Java RotateTransition.setFromAngle怎麽用?Java RotateTransition.setFromAngle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.animation.RotateTransition
的用法示例。
在下文中一共展示了RotateTransition.setFromAngle方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handleCurrentValue
import javafx.animation.RotateTransition; //導入方法依賴的package包/類
@Override protected void handleCurrentValue(final double VALUE) {
double deviation = calculateDeviation(VALUE);
updateState(deviation);
valueText.setText(String.format(locale, formatString, VALUE));
deviationText.setText(String.format(locale, "%." + tile.getTickLabelDecimals() + "f", deviation));
RotateTransition rotateTransition = new RotateTransition(Duration.millis(200), triangle);
rotateTransition.setFromAngle(triangle.getRotate());
rotateTransition.setToAngle(state.angle);
FillTransition fillIndicatorTransition = new FillTransition(Duration.millis(200), triangle);
fillIndicatorTransition.setFromValue((Color) triangle.getFill());
fillIndicatorTransition.setToValue(state.color);
FillTransition fillReferenceTransition = new FillTransition(Duration.millis(200), deviationText);
fillReferenceTransition.setFromValue((Color) triangle.getFill());
fillReferenceTransition.setToValue(state.color);
FillTransition fillReferenceUnitTransition = new FillTransition(Duration.millis(200), deviationUnitText);
fillReferenceUnitTransition.setFromValue((Color) triangle.getFill());
fillReferenceUnitTransition.setToValue(state.color);
ParallelTransition parallelTransition = new ParallelTransition(rotateTransition, fillIndicatorTransition, fillReferenceTransition, fillReferenceUnitTransition);
parallelTransition.play();
}
示例2: switchStateAnimation
import javafx.animation.RotateTransition; //導入方法依賴的package包/類
private void switchStateAnimation(TDDState newState){
RotateTransition rotateTransition = new RotateTransition(Duration.millis(800), cycleImage);
rotateTransition.setFromAngle(0);
rotateTransition.setToAngle(-180);
FadeTransition ft = new FadeTransition(Duration.millis(800), cycleImage);
ft.setFromValue(1);
ft.setToValue(0);
RotateTransition rotateTransition2 = new RotateTransition(Duration.millis(800), cycleImageOverlay);
rotateTransition2.setFromAngle(180);
rotateTransition2.setToAngle(0);
Image newImg = getImageOfPhase(newState);
rotateTransition2.setOnFinished(event -> {
cycleImage.setImage(newImg);
});
FadeTransition ft2 = new FadeTransition(Duration.millis(800), cycleImageOverlay);
ft2.setFromValue(0);
ft2.setToValue(1);
ft.play();
cycleImageOverlay.setImage(newImg);
rotateTransition.play();
ft.play();
ft2.play();
rotateTransition2.play();
}
開發者ID:ProPra16,項目名稱:programmierpraktikum-abschlussprojekt-amigos,代碼行數:27,代碼來源:ExerciseController.java
示例3: createFlipEndTransition
import javafx.animation.RotateTransition; //導入方法依賴的package包/類
/**
* Creates a {@link RotateTransition} that is the second/end part of a flip
* animation.
*
* @param pNode the {@link Node}.
* @param pOrientation the {@link Orientation} in which to rotate. Note that
* {@link Orientation#HORIZONTAL} means from right to left.
* @param pRightLeftTopDown {@code true} if the animation should be from
* right to left/top to down. {@code false} if it should be left
* to right/bottom to up.
* @return the created {@link RotateTransition}.
*/
public static RotateTransition createFlipEndTransition(Node pNode, Orientation pOrientation, boolean pRightLeftTopDown)
{
double startingAngle = calculateEdgeAngle(pNode, pOrientation);
RotateTransition endTransition = new RotateTransition(Duration.millis(466), pNode);
endTransition.setAxis(getAxis(pOrientation));
if (pRightLeftTopDown)
{
endTransition.setFromAngle(startingAngle + 180);
endTransition.setToAngle(360);
}
else
{
endTransition.setFromAngle(startingAngle);
endTransition.setToAngle(0);
}
endTransition.setInterpolator(Interpolator.EASE_OUT);
return endTransition;
}
示例4: createFlipStartTransition
import javafx.animation.RotateTransition; //導入方法依賴的package包/類
/**
* Creates a {@link RotateTransition} that is the first/start part of a flip
* animation.
*
* @param pNode the {@link Node}.
* @param pOrientation the {@link Orientation} in which to rotate. Note that
* {@link Orientation#HORIZONTAL} means from right to left.
* @param pRightLeftTopDown {@code true} if the animation should be from
* right to left/top to down. {@code false} if it should be left
* to right/bottom to up.
* @return the created {@link RotateTransition}.
*/
public static RotateTransition createFlipStartTransition(Node pNode, Orientation pOrientation, boolean pRightLeftTopDown)
{
double endingAngle = calculateEdgeAngle(pNode, pOrientation);
RotateTransition transition = new RotateTransition(Duration.millis(466), pNode);
transition.setAxis(getAxis(pOrientation));
if (pRightLeftTopDown)
{
transition.setFromAngle(0);
transition.setToAngle(endingAngle);
}
else
{
transition.setFromAngle(360);
transition.setToAngle(endingAngle + 180);
}
transition.setInterpolator(Interpolator.EASE_IN);
return transition;
}
示例5: flipTo180
import javafx.animation.RotateTransition; //導入方法依賴的package包/類
private void flipTo180(final Domino.Dot DOT, final String STYLE) {
final RotateTransition ROT_0_90 = new RotateTransition(FLIP_TIME.divide(2), dotMap.get(DOT));
ROT_0_90.setAxis(Rotate.Y_AXIS);
ROT_0_90.setFromAngle(0);
ROT_0_90.setToAngle(90);
ROT_0_90.play();
ROT_0_90.setOnFinished(new EventHandler<ActionEvent>() {
@Override public void handle(final ActionEvent EVENT) {
dotMap.get(DOT).getStyleClass().clear();
dotMap.get(DOT).getStyleClass().add(STYLE);
final RotateTransition ROT_90_180 = new RotateTransition(FLIP_TIME.divide(2), dotMap.get(DOT));
ROT_90_180.setAxis(Rotate.Y_AXIS);
ROT_90_180.setFromAngle(90);
ROT_90_180.setToAngle(180);
ROT_90_180.play();
}
});
}
示例6: flipTo0
import javafx.animation.RotateTransition; //導入方法依賴的package包/類
private void flipTo0(final Domino.Dot DOT, final String STYLE) {
final RotateTransition ROT_180_90 = new RotateTransition(FLIP_TIME.divide(2), dotMap.get(DOT));
ROT_180_90.setAxis(Rotate.Y_AXIS);
ROT_180_90.setFromAngle(180);
ROT_180_90.setToAngle(90);
ROT_180_90.play();
ROT_180_90.setOnFinished(new EventHandler<ActionEvent>() {
@Override public void handle(final ActionEvent EVENT) {
dotMap.get(DOT).getStyleClass().clear();
dotMap.get(DOT).getStyleClass().add(STYLE);
final RotateTransition ROT_90_0 = new RotateTransition(FLIP_TIME.divide(2), dotMap.get(DOT));
ROT_90_0.setAxis(Rotate.Y_AXIS);
ROT_90_0.setFromAngle(90);
ROT_90_0.setToAngle(0);
ROT_90_0.play();
}
});
}
示例7: IconRotation
import javafx.animation.RotateTransition; //導入方法依賴的package包/類
/**
* An animation which rotates the icon of a button.
*
* @param graphic The graphic on which the icon should be animated, must not be null.
*/
public IconRotation(Node graphic) {
rotateProperty = graphic.rotateProperty();
rotation = new RotateTransition(DURATION, graphic);
rotation.setInterpolator(EASE_BOTH);
rotation.setCycleCount(INDEFINITE);
rotation.setFromAngle(0);
rotation.setToAngle(360);
}
示例8: rotateAroundYAxis
import javafx.animation.RotateTransition; //導入方法依賴的package包/類
private RotateTransition rotateAroundYAxis(Node node) {
RotateTransition rotate = new RotateTransition(
Duration.seconds(ROTATE_SECS),
node
);
rotate.setAxis(Rotate.Y_AXIS);
rotate.setFromAngle(360);
rotate.setToAngle(0);
rotate.setInterpolator(Interpolator.LINEAR);
rotate.setCycleCount(RotateTransition.INDEFINITE);
return rotate;
}
示例9: rotateGlobe
import javafx.animation.RotateTransition; //導入方法依賴的package包/類
public void rotateGlobe() {
rt = new RotateTransition(Duration.seconds(OrbitInfo.SOLAR_DAY/500D), globe.getWorld());
//rt.setByAngle(360);
rt.setInterpolator(Interpolator.LINEAR);
rt.setCycleCount(Animation.INDEFINITE);
rt.setAxis(Rotate.Y_AXIS);
rt.setFromAngle(360);
rt.setToAngle(0);
rt.play();
}
示例10: selfRotation
import javafx.animation.RotateTransition; //導入方法依賴的package包/類
private RotateTransition selfRotation() {
RotateTransition rotate = new RotateTransition(Duration.seconds(ROTATE_SECS), this);
rotate.setAxis(Rotate.Y_AXIS);
rotate.setFromAngle(clockRotate ? 0 : 360);
rotate.setToAngle(clockRotate ? 360 : 0);
rotate.setInterpolator(Interpolator.LINEAR);
rotate.setCycleCount(RotateTransition.INDEFINITE);
return rotate;
}
示例11: roll
import javafx.animation.RotateTransition; //導入方法依賴的package包/類
public void roll() {
RotateTransition rt = new RotateTransition(Duration.seconds(1), this);
rt.setFromAngle(0);
rt.setToAngle(360);
rt.setOnFinished(event -> {
valueProperty.set((int)(Math.random() * (MAX_VALUE - MIN_VALUE + 1)) + MIN_VALUE);
});
rt.play();
}
示例12: createRotateTransition
import javafx.animation.RotateTransition; //導入方法依賴的package包/類
RotateTransition createRotateTransition(Duration duration, Node node, int startAngle) {
RotateTransition rt = new RotateTransition(duration, node);
rt.setFromAngle(startAngle);
rt.setByAngle(360);
rt.setCycleCount(Animation.INDEFINITE);
rt.setInterpolator(Interpolator.LINEAR);
return rt;
}
示例13: createRotateTransition
import javafx.animation.RotateTransition; //導入方法依賴的package包/類
/**
* 360度回転を繰り返すアニメーションの設定。
*
* @param duration 1回転するのに要する時間
* @param node 回転するノード
* @param startAngle 回転開始角度
* @return 指定下パラメータで初期化したRotateTransitionインスタンス
*/
private RotateTransition createRotateTransition(Duration duration, Node node, double startAngle) {
RotateTransition rt = new RotateTransition(duration, node);
rt.setFromAngle(startAngle);
rt.setByAngle(360);
rt.setCycleCount(Animation.INDEFINITE);
rt.setInterpolator(Interpolator.LINEAR);
return rt;
}
示例14: discardCard
import javafx.animation.RotateTransition; //導入方法依賴的package包/類
public void discardCard(int cardID) {
cardImage = new ImageView(ResManager.getImage(cardID + ".jpg"));
Rectangle rec = new Rectangle(208, 320);
rec.setArcHeight(30);
rec.setArcWidth(30);
cardImage.setClip(rec);
cardImage.toFront();
final Wonders self = this;
getChildren().add(cardImage);
// cardImage.toBack();
cardImage.setScaleX(0.2);
cardImage.setScaleY(0.2);
RotateTransition rt = new RotateTransition(Duration.seconds(1.0), cardImage);
rt.setFromAngle(0);
rt.setToAngle(390);
// rt.setCycleCount(RotateTransition.INDEFINITE);
rt.play();
Timeline tl = new Timeline(new KeyFrame(Duration.ZERO, new KeyValue(cardImage.layoutXProperty(), 250),
new KeyValue(cardImage.layoutYProperty(), -80), new KeyValue(cardImage.opacityProperty(), 0),
new KeyValue(cardImage.scaleXProperty(), 0.2), new KeyValue(cardImage.scaleYProperty(), 0.2)),
new KeyFrame(Duration.seconds(0.5), new KeyValue(cardImage.layoutXProperty(), 250), new KeyValue(
cardImage.layoutYProperty(), -180), new KeyValue(cardImage.opacityProperty(), 1), new KeyValue(
cardImage.scaleXProperty(), 0.45), new KeyValue(cardImage.scaleYProperty(), 0.45)),
// new KeyFrame(Duration.seconds(0.5),act),
new KeyFrame(Duration.seconds(1.0), new KeyValue(cardImage.layoutXProperty(), 250), new KeyValue(
cardImage.layoutYProperty(), -80), new KeyValue(cardImage.opacityProperty(), 1), new KeyValue(
cardImage.scaleXProperty(), 0.6), new KeyValue(cardImage.scaleYProperty(), 0.6)), new KeyFrame(
Duration.seconds(3.0), new KeyValue(cardImage.opacityProperty(), 1), new KeyValue(
cardImage.layoutXProperty(), 290), new KeyValue(cardImage.layoutYProperty(), 0),
new KeyValue(rt.rateProperty(), 0.2)), new KeyFrame(Duration.seconds(3.3), new KeyValue(
cardImage.opacityProperty(), 0), new KeyValue(cardImage.layoutXProperty(), 300), new KeyValue(
cardImage.layoutYProperty(), 80), new KeyValue(cardImage.visibleProperty(), false)));
tl.play();
}
示例15: handleCurrentValue
import javafx.animation.RotateTransition; //導入方法依賴的package包/類
@Override protected void handleCurrentValue(final double VALUE) {
low = Statistics.getMin(dataList);
high = Statistics.getMax(dataList);
if (Helper.equals(low, high)) {
low = minValue;
high = maxValue;
}
range = high - low;
double minX = graphBounds.getX();
double maxX = minX + graphBounds.getWidth();
double minY = graphBounds.getY();
double maxY = minY + graphBounds.getHeight();
double stepX = graphBounds.getWidth() / (noOfDatapoints - 1);
double stepY = graphBounds.getHeight() / range;
double referenceValue = tile.getReferenceValue();
if(!dataList.isEmpty()) {
MoveTo begin = (MoveTo) pathElements.get(0);
begin.setX(minX);
begin.setY(maxY - Math.abs(low - dataList.get(0)) * stepY);
for (int i = 1; i < (noOfDatapoints - 1); i++) {
LineTo lineTo = (LineTo) pathElements.get(i);
lineTo.setX(minX + i * stepX);
lineTo.setY(maxY - Math.abs(low - dataList.get(i)) * stepY);
}
LineTo end = (LineTo) pathElements.get(noOfDatapoints - 1);
end.setX(maxX);
end.setY(maxY - Math.abs(low - dataList.get(noOfDatapoints - 1)) * stepY);
dot.setCenterX(maxX);
dot.setCenterY(end.getY());
updateState(VALUE, referenceValue);
referenceLine.setStartY(maxY - Math.abs(low - referenceValue) * stepY);
referenceLine.setEndY(maxY - Math.abs(low - referenceValue) * stepY);
changeText.setText(String.format(locale, "%." + tile.getTickLabelDecimals() + "f", (VALUE - referenceValue)));
changePercentageText.setText(new StringBuilder().append(String.format(locale, "%." + tile.getTickLabelDecimals() + "f", (VALUE / referenceValue * 100.0) - 100.0)).append("\u0025").toString());
RotateTransition rotateTransition = new RotateTransition(Duration.millis(200), triangle);
rotateTransition.setFromAngle(triangle.getRotate());
rotateTransition.setToAngle(state.angle);
FillTransition fillIndicatorTransition = new FillTransition(Duration.millis(200), triangle);
fillIndicatorTransition.setFromValue((Color) triangle.getFill());
fillIndicatorTransition.setToValue(state.color);
FillTransition fillReferenceTransition = new FillTransition(Duration.millis(200), changePercentageText);
fillReferenceTransition.setFromValue((Color) triangle.getFill());
fillReferenceTransition.setToValue(state.color);
ParallelTransition parallelTransition = new ParallelTransition(rotateTransition, fillIndicatorTransition, fillReferenceTransition);
parallelTransition.play();
}
valueText.setText(String.format(locale, formatString, VALUE));
highText.setText(String.format(locale, formatString, high));
lowText.setText(String.format(locale, formatString, low));
if (!tile.isTextVisible() && null != movingAverage.getTimeSpan()) {
timeSpanText.setText(createTimeSpanText());
text.setText(timeFormatter.format(movingAverage.getLastEntry().getTimestampAsDateTime(tile.getZoneId())));
}
resizeDynamicText();
}