Search in sources :

Example 1 with FXML

use of javafx.fxml.FXML in project cryptomator by cryptomator.

the class MainController method didClickAddExistingVaults.

@FXML
private void didClickAddExistingVaults(ActionEvent event) {
    final FileChooser fileChooser = new FileChooser();
    fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("Cryptomator Masterkey", "*.cryptomator"));
    final List<File> files = fileChooser.showOpenMultipleDialog(mainWindow);
    if (files != null) {
        for (final File file : files) {
            addVault(file.toPath(), false);
        }
    }
}
Also used : FileChooser(javafx.stage.FileChooser) File(java.io.File) FXML(javafx.fxml.FXML)

Example 2 with FXML

use of javafx.fxml.FXML in project cryptomator by cryptomator.

the class MainController method didClickCreateNewVault.

@FXML
private void didClickCreateNewVault(ActionEvent event) {
    final FileChooser fileChooser = new FileChooser();
    final File file = fileChooser.showSaveDialog(mainWindow);
    if (file == null) {
        return;
    }
    try {
        final Path vaultDir = file.toPath();
        if (!Files.exists(vaultDir)) {
            Files.createDirectory(vaultDir);
        }
        addVault(vaultDir, true);
    } catch (IOException e) {
        LOG.error("Unable to create vault", e);
    }
}
Also used : Path(java.nio.file.Path) FileChooser(javafx.stage.FileChooser) IOException(java.io.IOException) File(java.io.File) FXML(javafx.fxml.FXML)

Example 3 with FXML

use of javafx.fxml.FXML in project cryptomator by cryptomator.

the class UnlockedController method didClickCopyUrl.

@FXML
private void didClickCopyUrl(ActionEvent event) {
    ClipboardContent clipboardContent = new ClipboardContent();
    clipboardContent.putUrl(vault.get().getWebDavUrl());
    clipboardContent.putString(vault.get().getWebDavUrl());
    Clipboard.getSystemClipboard().setContent(clipboardContent);
}
Also used : ClipboardContent(javafx.scene.input.ClipboardContent) FXML(javafx.fxml.FXML)

Example 4 with FXML

use of javafx.fxml.FXML in project PayFile by mikehearn.

the class ClickableBitcoinAddress method showQRCode.

@FXML
protected void showQRCode(MouseEvent event) {
    // Serialize to PNG and back into an image. Pretty lame but it's the shortest code to write and I'm feeling
    // lazy tonight.
    final byte[] imageBytes = QRCode.from(uri()).withSize(320, 240).to(ImageType.PNG).stream().toByteArray();
    Image qrImage = new Image(new ByteArrayInputStream(imageBytes));
    ImageView view = new ImageView(qrImage);
    view.setEffect(new DropShadow());
    // Embed the image in a pane to ensure the drop-shadow interacts with the fade nicely, otherwise it looks weird.
    // Then fix the width/height to stop it expanding to fill the parent, which would result in the image being
    // non-centered on the screen. Finally fade/blur it in.
    Pane pane = new Pane(view);
    pane.setMaxSize(qrImage.getWidth(), qrImage.getHeight());
    final Main.OverlayUI<ClickableBitcoinAddress> overlay = Main.instance.overlayUI(pane, this);
    view.setOnMouseClicked(new EventHandler<MouseEvent>() {

        @Override
        public void handle(MouseEvent event) {
            overlay.done();
        }
    });
}
Also used : MouseEvent(javafx.scene.input.MouseEvent) ByteArrayInputStream(java.io.ByteArrayInputStream) ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image) Pane(javafx.scene.layout.Pane) AnchorPane(javafx.scene.layout.AnchorPane) Main(net.plan99.payfile.gui.Main) DropShadow(javafx.scene.effect.DropShadow) FXML(javafx.fxml.FXML)

Example 5 with FXML

use of javafx.fxml.FXML in project fxexperience2 by EricCanull.

the class DemoController method rotateOutDownLeftAction.

@FXML
private void rotateOutDownLeftAction(ActionEvent event) {
    new RotateOutDownLeftTransition(btn).play();
    bringBackAfter();
}
Also used : RotateOutDownLeftTransition(com.fxexperience.javafx.fxanimations.RotateOutDownLeftTransition) FXML(javafx.fxml.FXML)

Aggregations

FXML (javafx.fxml.FXML)251 Engine (jgnash.engine.Engine)46 InjectFXML (jgnash.uifx.util.InjectFXML)43 File (java.io.File)35 IOException (java.io.IOException)32 Stage (javafx.stage.Stage)30 List (java.util.List)23 ArrayList (java.util.ArrayList)22 Preferences (java.util.prefs.Preferences)18 SimpleObjectProperty (javafx.beans.property.SimpleObjectProperty)18 FXCollections (javafx.collections.FXCollections)16 Button (javafx.scene.control.Button)16 LocalDate (java.time.LocalDate)15 Scene (javafx.scene.Scene)15 BigDecimal (java.math.BigDecimal)14 ObjectProperty (javafx.beans.property.ObjectProperty)14 ObservableList (javafx.collections.ObservableList)13 Node (javafx.scene.Node)13 CurrencyNode (jgnash.engine.CurrencyNode)13 HashMap (java.util.HashMap)12