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


Java Platform.isFxApplicationThread方法代码示例

本文整理汇总了Java中javafx.application.Platform.isFxApplicationThread方法的典型用法代码示例。如果您正苦于以下问题:Java Platform.isFxApplicationThread方法的具体用法?Java Platform.isFxApplicationThread怎么用?Java Platform.isFxApplicationThread使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.application.Platform的用法示例。


在下文中一共展示了Platform.isFxApplicationThread方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateObjectList

import javafx.application.Platform; //导入方法依赖的package包/类
private void updateObjectList() {
	if (Platform.isFxApplicationThread()) {
		this.players.setText(Integer.toString(this.list.players.size()));
		this.guilds.setText(Integer.toString(this.list.guilds.size()));
	} else
		Platform.runLater(this::updateObjectList);
}
 
开发者ID:Yeregorix,项目名称:EpiStats,代码行数:8,代码来源:ObjectListPanel.java

示例2: image

import javafx.application.Platform; //导入方法依赖的package包/类
public void image(Image img,
                  double sx, double sy, double sw, double sh,
                  double dx, double dy, double dw, double dh) throws InterruptedException,ExecutionException{
    if (Platform.isFxApplicationThread()) {
        imageBase(img,sx,sy,sw,sh,dx,dy,dw,dh);
    }else {

        counter++;
        if(counter>maxCounter){
            throw new ExecutionException(new Exception(hint));
        }

        Platform.runLater(() -> imageBase(img, sx, sy, sw, sh, dx, dy, dw, dh));
    }
}
 
开发者ID:whitewoodcity,项目名称:xbrowser,代码行数:16,代码来源:Canvas.java

示例3: trackProgress

import javafx.application.Platform; //导入方法依赖的package包/类
@Override public int trackProgress(final SourceLine line, int type) {
    if (scriptConsole != null) {
        return IPlaybackListener.CONTINUE;
    }
    if (getFilePath().equals(line.fileName)) {
        if (Platform.isFxApplicationThread()) {
            currentEditor.highlightLine(line.lineNumber - 1);
        } else {
            Platform.runLater(() -> {
                currentEditor.highlightLine(line.lineNumber - 1);
            });
        }
    }
    if (debugging == false) {
        return IPlaybackListener.CONTINUE;
    }
    callStack.update(type, line);
    BreakPoint bp = new BreakPoint(line.fileName, line.lineNumber - 1);
    if (type == Display.LINE_REACHED && (stepIntoActive || breakpoints.contains(bp)
            || breakStackDepth != -1 && callStack.getStackDepth() <= breakStackDepth)) {
        if (!getFilePath().equals(line.fileName)) {
            File file = new File(line.fileName);
            if (file.exists()) {
                Platform.runLater(new Runnable() {
                    @Override public void run() {
                        goToFile(line.fileName, line.lineNumber - 1);
                    }
                });
            } else {
                return IPlaybackListener.CONTINUE;
            }
        }
        stepIntoActive = false;
        breakStackDepth = -1;
        Platform.runLater(() -> display.pausePlay());
        return IPlaybackListener.PAUSE;
    }
    return IPlaybackListener.CONTINUE;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:40,代码来源:DisplayWindow.java

示例4: getHeight

import javafx.application.Platform; //导入方法依赖的package包/类
public double getHeight() throws InterruptedException,ExecutionException{
    if (Platform.isFxApplicationThread()) {
        return getHeightBase();
    }

    counter++;
    if(counter>maxCounter){
        throw new ExecutionException(new Exception(hint));
    }

    final FutureTask<Double> task = new FutureTask<>(() -> getHeightBase());
    Platform.runLater(task);
    return task.get();
}
 
开发者ID:whitewoodcity,项目名称:xbrowser,代码行数:15,代码来源:Canvas.java

示例5: runSafe

import javafx.application.Platform; //导入方法依赖的package包/类
public static void runSafe(final Runnable runnable) {
    Objects.requireNonNull(runnable, "runnable");
    if (Platform.isFxApplicationThread()) {
        runnable.run();
    } else {
        Platform.runLater(runnable);
    }
}
 
开发者ID:neal1991,项目名称:everywhere,代码行数:9,代码来源:GUIUtils.java

示例6: yawChanged

import javafx.application.Platform; //导入方法依赖的package包/类
@Override
public void yawChanged(final Camera camera, final Angle yaw) {
	final Slider sliderYaw = this.sliderYaw;
	
	if(sliderYaw != null) {
		if(Platform.isFxApplicationThread()) {
			sliderYaw.setValue(yaw.degrees);
		} else {
			Platform.runLater(() -> sliderYaw.setValue(yaw.degrees));
		}
	}
}
 
开发者ID:macroing,项目名称:Dayflower-Path-Tracer,代码行数:13,代码来源:TestApplication.java

示例7: playbackFinished

import javafx.application.Platform; //导入方法依赖的package包/类
@Override public void playbackFinished(final PlaybackResult result, boolean shutdown) {
    this.autShutdown = shutdown;
    displayView.endTest(result);
    if (ddTestRunner != null && ddTestRunner.hasNext() && !playbackStopped) {
        ddTestRunner.next();
        Platform.runLater(new Runnable() {
            @Override public void run() {
                if (result.failureCount() == 0) {
                    shouldClose = !reuseFixture;
                    displayView.trackProgress();
                    ignoreReuse = false;
                } else {
                    ignoreReuse = true;
                    shouldClose = false;
                }
                stopApplicationIfNecessary();
                runTest(debugging);
            }
        });
        return;
    }
    displayView.stopInserting();
    if (Platform.isFxApplicationThread()) {
        showResult(result);
    } else {
        Platform.runLater(() -> showResult(result));
    }
    displayView.endTestRun();
    ddTestRunner = null;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:31,代码来源:Display.java

示例8: notifyObservers

import javafx.application.Platform; //导入方法依赖的package包/类
@Override
public void notifyObservers(Class<?> clazz, Object arg) {
    final CountDownLatch latch = new CountDownLatch(1);
    Platform.runLater(() -> {
        super.notifyObservers(clazz, arg);
        latch.countDown();
    });
    try {
        if(!Platform.isFxApplicationThread()) {
            latch.await();
        }
    } catch(InterruptedException ex) {
        throw new CancellationException();
    }
}
 
开发者ID:kasirgalabs,项目名称:ETUmulator,代码行数:16,代码来源:GUISafeDispatcher.java

示例9: showNotification

import javafx.application.Platform; //导入方法依赖的package包/类
/**
 * Show a notification.
 *
 * @param title
 *            The notification title
 * @param text
 *            The notification text
 * @param d
 *            The duration that notification will be visible
 * @param t
 *            The notification type
 */
public static void showNotification(String title , String text , Duration d , NotificationType t) {
	
	//Check if it is JavaFX Application Thread
	if (!Platform.isFxApplicationThread()) {
		Platform.runLater(() -> showNotification(title, text, d, t));
		return;
	}
	
	Notifications notification1 = Notifications.create().title(title).text(text);
	notification1.hideAfter(d);
	
	switch (t) {
		case CONFIRM:
			notification1.showConfirm();
			break;
		case ERROR:
			notification1.showError();
			break;
		case INFORMATION:
			notification1.showInformation();
			break;
		case SIMPLE:
			notification1.show();
			break;
		case WARNING:
			notification1.showWarning();
			break;
		default:
			break;
	}
	
}
 
开发者ID:goxr3plus,项目名称:JavaFXApplicationAutoUpdater,代码行数:45,代码来源:ActionTool.java

示例10: clear

import javafx.application.Platform; //导入方法依赖的package包/类
/**
 * Clear operation history.
 */
@FromAnyThread
public void clear() {
    if (Platform.isFxApplicationThread()) {
        clearImpl();
    } else {
        final ExecutorManager executorManager = ExecutorManager.getInstance();
        executorManager.addFXTask(this::clearImpl);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:13,代码来源:EditorOperationControl.java

示例11: xProperty

import javafx.application.Platform; //导入方法依赖的package包/类
public DoubleProperty xProperty() throws InterruptedException,ExecutionException{
    if(Platform.isFxApplicationThread()) return body.layoutXProperty();
    final FutureTask<DoubleProperty> task = new FutureTask<>(()->body.layoutXProperty());
    Platform.runLater(task);
    return task.get();
}
 
开发者ID:whitewoodcity,项目名称:xbrowser,代码行数:7,代码来源:Chart.java

示例12: getX

import javafx.application.Platform; //导入方法依赖的package包/类
public double getX() throws InterruptedException,ExecutionException {
    if(Platform.isFxApplicationThread()) return body.getLayoutX();
    final FutureTask<Double> task = new FutureTask<>(()->body.getLayoutX());
    Platform.runLater(task);
    return task.get();
}
 
开发者ID:whitewoodcity,项目名称:xbrowser,代码行数:7,代码来源:Chart.java

示例13: setWidth

import javafx.application.Platform; //导入方法依赖的package包/类
public void setWidth(double width) {
    if (Platform.isFxApplicationThread()) {
        body.setFitWidth(width);
    } else Platform.runLater(() -> body.setFitWidth(width));
}
 
开发者ID:whitewoodcity,项目名称:xbrowser,代码行数:6,代码来源:ImageView.java

示例14: Label

import javafx.application.Platform; //导入方法依赖的package包/类
public Label(String text, javafx.scene.Node graphic) {
    if (Platform.isFxApplicationThread()) body = new javafx.scene.control.Label(text,graphic);
    else Platform.runLater(() -> body = new javafx.scene.control.Label(text,graphic));

}
 
开发者ID:whitewoodcity,项目名称:xbrowser,代码行数:6,代码来源:Label.java

示例15: getY

import javafx.application.Platform; //导入方法依赖的package包/类
public double getY() throws InterruptedException,ExecutionException{
    if(Platform.isFxApplicationThread()) return body.getLayoutY();
    final FutureTask<Double> task = new FutureTask<>(()->body.getLayoutY());
    Platform.runLater(task);
    return task.get();
}
 
开发者ID:whitewoodcity,项目名称:xbrowser,代码行数:7,代码来源:Control.java


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