本文整理汇总了Java中com.sun.glass.ui.Application.invokeAndWait方法的典型用法代码示例。如果您正苦于以下问题:Java Application.invokeAndWait方法的具体用法?Java Application.invokeAndWait怎么用?Java Application.invokeAndWait使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.glass.ui.Application
的用法示例。
在下文中一共展示了Application.invokeAndWait方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: show
import com.sun.glass.ui.Application; //导入方法依赖的package包/类
public void show(Window window) {
if(window == null) {
return;
}
Application.invokeAndWait(new Runnable() {
@Override
public void run() {
long viewPointer = JavaFXUtils.getViewPointer(window);
JTouchBarJNI.setTouchBar0(viewPointer, JTouchBar.this);
}
});
}
示例2: closeDialogWindowByClosingWindow
import com.sun.glass.ui.Application; //导入方法依赖的package包/类
protected void closeDialogWindowByClosingWindow() {
Application.invokeAndWait(() -> {
final Robot robot = Application.GetApplication().createRobot();
Wrap<? extends com.sun.glass.ui.Window> dialogWindow = Root.ROOT.lookup(new ByWindowType(Window.class)).lookup(Scene.class).wrap(0);
robot.mouseMove(dialogWindow.getScreenBounds().x + dialogWindow.getScreenBounds().width - 2, dialogWindow.getScreenBounds().y - 20);
robot.mousePress(1);
robot.mouseRelease(1);
});
}
示例3: doFactoryChange
import com.sun.glass.ui.Application; //导入方法依赖的package包/类
protected void doFactoryChange(final CellsApp.CellType cellType) {
final Wrap<? extends ComboBox<CellType>> comboBox = parent.lookup(ComboBox.class, new ByID(choiceID)).wrap();
Application.invokeAndWait(new Runnable() {
@Override
public void run() {
try {
comboBox.getControl().getSelectionModel().select(cellType);
} catch (Throwable ex) {
ex.printStackTrace();
}
}
});
}
示例4: getInitialSize
import com.sun.glass.ui.Application; //导入方法依赖的package包/类
private Dimension getInitialSize() {
final AtomicReference<Dimension> sizeRef = new AtomicReference<Dimension>();
Application.invokeAndWait(new Runnable() {
@Override
public void run() {
sizeRef.set(new Dimension(image.getWidth(), image.getHeight()));
}
});
return sizeRef.get();
}
示例5: getInitialData
import com.sun.glass.ui.Application; //导入方法依赖的package包/类
private ByteBuffer getInitialData() {
final AtomicReference<ByteBuffer> dataRef = new AtomicReference<ByteBuffer>();
Application.invokeAndWait(new Runnable() {
@Override
public void run() {
dataRef.set(image.asByteBuffer());
}
});
return dataRef.get();
}