当前位置: 首页>>代码示例>>Java>>正文


Java Application.invokeLater方法代码示例

本文整理汇总了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);
}
 
开发者ID:victorrentea,项目名称:training,代码行数:19,代码来源:SpriteView.java

示例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());
        });
    });
}
 
开发者ID:badvision,项目名称:jace,代码行数:23,代码来源:MetacheatUI.java

示例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);
}
 
开发者ID:badvision,项目名称:jace,代码行数:19,代码来源:JaceUIController.java

示例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();
        }
    });
}
 
开发者ID:badvision,项目名称:jace,代码行数:11,代码来源:MetacheatUI.java

示例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);
}
 
开发者ID:badvision,项目名称:jace,代码行数:15,代码来源:MetacheatUI.java

示例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);
}
 
开发者ID:badvision,项目名称:jace,代码行数:11,代码来源:JaceUIController.java

示例7: removeIndicator

import com.sun.glass.ui.Application; //导入方法依赖的package包/类
void removeIndicator(Label icon) {
    Application.invokeLater(() -> {
        notificationBox.getChildren().remove(icon);
        iconTTL.remove(icon);
    });
}
 
开发者ID:badvision,项目名称:jace,代码行数:7,代码来源:JaceUIController.java


注:本文中的com.sun.glass.ui.Application.invokeLater方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。