Java Code Examples for javafx.application.Platform#enterNestedEventLoop()

The following examples show how to use javafx.application.Platform#enterNestedEventLoop() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IOSBarcodeScanService.java    From attach with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Optional<String> scan(String title, String legend, String resultText) {
    result = new SimpleStringProperty();
    startBarcodeScan(title != null ? title : "", legend != null ? legend : "", resultText != null ? resultText : "");
    try {
        Platform.enterNestedEventLoop(result);
    } catch (Exception e) {
        System.out.println("ScanActivity: enterNestedEventLoop failed: " + e);
    }
    return Optional.ofNullable(result.get());
}
 
Example 2
Source File: IOSPicturesService.java    From attach with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Optional<Image> takePhoto(boolean savePhoto) {
    result = new SimpleObjectProperty<>();
    takePicture(savePhoto);
    try {
        Platform.enterNestedEventLoop(result);
    } catch (Exception e) {
        System.out.println("GalleryActivity: enterNestedEventLoop failed: " + e);
    }
    return Optional.ofNullable(result.get());
}
 
Example 3
Source File: IOSPicturesService.java    From attach with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Optional<Image> loadImageFromGallery() {
    result = new SimpleObjectProperty<>();
    selectPicture();
    try {
        Platform.enterNestedEventLoop(result);
    } catch (Exception e) {
        System.out.println("GalleryActivity: enterNestedEventLoop failed: " + e);
    }
    return Optional.ofNullable(result.get());
}
 
Example 4
Source File: AndroidPicturesService.java    From attach with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Optional<Image> takePhoto(boolean savePhoto) {
    result = new SimpleObjectProperty<>();
    takePicture(savePhoto);
    try {
        Platform.enterNestedEventLoop(result);
    } catch (Exception e) {
        LOG.severe("GalleryActivity: enterNestedEventLoop failed: " + e);
    }
    return Optional.ofNullable(result.get());
}
 
Example 5
Source File: AndroidPicturesService.java    From attach with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Optional<Image> loadImageFromGallery() {
    result = new SimpleObjectProperty<>();
    selectPicture();
    try {
        Platform.enterNestedEventLoop(result);
    } catch (Exception e) {
        LOG.severe("GalleryActivity: enterNestedEventLoop failed: " + e);
    }
    return Optional.ofNullable(result.get());
}