本文整理汇总了Java中javafx.animation.AnimationTimer.stop方法的典型用法代码示例。如果您正苦于以下问题:Java AnimationTimer.stop方法的具体用法?Java AnimationTimer.stop怎么用?Java AnimationTimer.stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.animation.AnimationTimer
的用法示例。
在下文中一共展示了AnimationTimer.stop方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Smoke
import javafx.animation.AnimationTimer; //导入方法依赖的package包/类
public Smoke() {
running = false;
ctx = getGraphicsContext2D();
width = getWidth();
height = getHeight();
particles = new CopyOnWriteArrayList<>();
lastTimerCall = System.nanoTime();
timer = new AnimationTimer() {
@Override public void handle(final long NOW) {
if (NOW > lastTimerCall + GENERATION_RATE) {
if (running && particles.size() < NO_OF_PARTICLES) particles.add(new ImageParticle());
if (particles.isEmpty()) timer.stop();
lastTimerCall = NOW;
}
draw();
}
};
registerListeners();
}
示例2: VuMeterSkin
import javafx.animation.AnimationTimer; //导入方法依赖的package包/类
public VuMeterSkin(final VuMeter CONTROL) {
super(CONTROL);
active = false;
lastTimerCall = 0l;
stepSize = new SimpleDoubleProperty((getSkinnable().getMaxValue() - getSkinnable().getMinValue()) / getSkinnable().getNoOfLeds());
timer = new AnimationTimer() {
@Override public void handle(final long NOW) {
if (NOW > lastTimerCall + PEAK_TIMEOUT) {
leds.get(peakLedIndex).getStyleClass().remove("led-peak");
peakLedIndex = Orientation.HORIZONTAL == getSkinnable().getOrientation() ? 0 : leds.size() - 1;
timer.stop();
}
}
};
init();
initGraphics();
registerListeners();
}
示例3: LedBargraphSkin
import javafx.animation.AnimationTimer; //导入方法依赖的package包/类
public LedBargraphSkin(final LedBargraph CONTROL) {
super(CONTROL);
ledList = new ArrayList<>(getSkinnable().getNoOfLeds());
stepSize = new SimpleDoubleProperty(1.0 / getSkinnable().getNoOfLeds());
lastTimerCall = 0l;
peakLedIndex = 0;
timer = new AnimationTimer() {
@Override public void handle(final long NOW) {
if (NOW > lastTimerCall + PEAK_TIMEOUT) {
ledList.get(peakLedIndex).setOn(false);
peakLedIndex = 0;
timer.stop();
}
}
};
init();
initGraphics();
registerListeners();
}
示例4: init
import javafx.animation.AnimationTimer; //导入方法依赖的package包/类
public ChromaFxPreviewWindow init() {
Pane previewPane = new Pane();
final WritableImage img = new WritableImage(width, height);
ImageView imageView = new ImageView();
imageView.setScaleY(-1.0);
imageView.setImage(img);
previewPane.getChildren().add(imageView);
// TODO: parallelize?
animationTimer = new AnimationTimer() {
@Override
public void handle(long now) {
if (chroma.hasChanges()) {
img.getPixelWriter().setPixels(0, 0, width, height, PixelFormat.getByteRgbInstance(), chroma.getCurrentFrame(), 0, height * 3);
}
}
};
animationTimer.stop();
setOnHiding(event -> animationTimer.stop());
setOnShowing(event -> animationTimer.start());
setTitle("Chroma Preview");
setScene(new Scene(previewPane, width, height));
return this;
}
示例5: Led
import javafx.animation.AnimationTimer; //导入方法依赖的package包/类
public Led(final Color LED_COLOR, final boolean FRAME_VISIBLE, final long INTERVAL, final boolean BLINKING) {
getStylesheets().add(Led.class.getResource("led.css").toExternalForm());
getStyleClass().add("led");
_ledColor = LED_COLOR;
_frameVisible = FRAME_VISIBLE;
_interval = INTERVAL;
_blinking = BLINKING;
toggle = false;
lastTimerCall = System.nanoTime();
timer = new AnimationTimer() {
@Override public void handle(final long NOW) {
if (NOW > lastTimerCall + getInterval()) {
toggle ^= true;
setOn(toggle);
lastTimerCall = NOW;
}
}
};
init();
initGraphics();
registerListeners();
if (_blinking) {
timer.start();
} else {
timer.stop();
}
}