本文整理汇总了Java中com.sun.glass.ui.Application.invokeLater方法的典型用法代码示例。如果您正苦于以下问题:Java Application.invokeLater方法的具体用法?Java Application.invokeLater怎么用?Java Application.invokeLater使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.glass.ui.Application
的用法示例。
在下文中一共展示了Application.invokeLater方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: moveTo
import com.sun.glass.ui.Application; //导入方法依赖的package包/类
public void moveTo(Main.Location loc) {
walking = new Timeline(Animation.INDEFINITE,
new KeyFrame(Duration.seconds(.001), new KeyValue(direction, location.getValue().directionTo(loc))),
new KeyFrame(Duration.seconds(.002), new KeyValue(location, loc)),
new KeyFrame(Duration.seconds(1), new KeyValue(translateXProperty(), loc.getX() * Main.CELL_SIZE)),
new KeyFrame(Duration.seconds(1), new KeyValue(translateYProperty(), loc.getY() * Main.CELL_SIZE)),
new KeyFrame(Duration.seconds(.25), new KeyValue(frame, 0)),
new KeyFrame(Duration.seconds(.5), new KeyValue(frame, 1)),
new KeyFrame(Duration.seconds(.75), new KeyValue(frame, 2)),
new KeyFrame(Duration.seconds(1), new KeyValue(frame, 1))
);
walking.setOnFinished(e -> {
if (arrivalHandler != null) {
arrivalHandler.handle(e);
}
});
Application.invokeLater(walking::play);
}
示例2: processMemoryViewUpdates
import com.sun.glass.ui.Application; //导入方法依赖的package包/类
private void processMemoryViewUpdates() {
if (!Emulator.computer.getRunningProperty().get()) {
return;
}
GraphicsContext context = memoryViewCanvas.getGraphicsContext2D();
Set<MemoryCell> draw = new HashSet<>(redrawNodes);
redrawNodes.clear();
Application.invokeLater(() -> {
draw.stream().forEach((jace.cheat.MemoryCell cell) -> {
if (showValuesCheckbox.isSelected()) {
int val = cell.value.get() & 0x0ff;
context.setFill(Color.rgb(val, val, val));
} else {
context.setFill(Color.rgb(
cell.writeCount.get(),
cell.readCount.get(),
cell.execCount.get()));
}
context.fillRect(cell.getX(), cell.getY(), cell.getWidth(), cell.getHeight());
});
});
}
示例3: displayNotification
import com.sun.glass.ui.Application; //导入方法依赖的package包/类
public void displayNotification(String message) {
Label oldNotification = currentNotification;
Label notification = new Label(message);
currentNotification = notification;
notification.setEffect(new DropShadow(2.0, Color.BLACK));
notification.setTextFill(Color.WHITE);
notification.setBackground(new Background(new BackgroundFill(Color.rgb(0, 0, 80, 0.7), new CornerRadii(5.0), new Insets(-5.0))));
Application.invokeLater(() -> {
stackPane.getChildren().remove(oldNotification);
stackPane.getChildren().add(notification);
});
notificationExecutor.schedule(() -> {
Application.invokeLater(() -> {
stackPane.getChildren().remove(notification);
});
}, 4, TimeUnit.SECONDS);
}
示例4: pauseClicked
import com.sun.glass.ui.Application; //导入方法依赖的package包/类
@FXML
void pauseClicked(ActionEvent event) {
Application.invokeLater(() -> {
if (Emulator.computer.isRunning()) {
Emulator.computer.pause();
} else {
Emulator.computer.resume();
}
});
}
示例5: registerMetacheatEngine
import com.sun.glass.ui.Application; //导入方法依赖的package包/类
public void registerMetacheatEngine(MetaCheat engine) {
cheatEngine = engine;
cheatsTableView.setItems(cheatEngine.getCheats());
searchResultsListView.setItems(cheatEngine.getSearchResults());
snapshotsListView.setItems(cheatEngine.getSnapshots());
searchTypeSigned.selectedProperty().bindBidirectional(cheatEngine.signedProperty());
searchStartAddressField.textProperty().bindBidirectional(cheatEngine.startAddressProperty());
searchEndAddressField.textProperty().bindBidirectional(cheatEngine.endAddressProperty());
searchValueField.textProperty().bindBidirectional(cheatEngine.searchValueProperty());
searchChangeByField.textProperty().bindBidirectional(cheatEngine.searchChangeByProperty());
Application.invokeLater(this::redrawMemoryView);
}
示例6: addIndicator
import com.sun.glass.ui.Application; //导入方法依赖的package包/类
void addIndicator(Label icon, long TTL) {
if (!iconTTL.containsKey(icon)) {
Application.invokeLater(() -> {
if (!notificationBox.getChildren().contains(icon)) {
notificationBox.getChildren().add(icon);
}
});
}
trackTTL(icon, TTL);
}
示例7: removeIndicator
import com.sun.glass.ui.Application; //导入方法依赖的package包/类
void removeIndicator(Label icon) {
Application.invokeLater(() -> {
notificationBox.getChildren().remove(icon);
iconTTL.remove(icon);
});
}