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


Java GuiUtils类代码示例

本文整理汇总了Java中wallettemplate.utils.GuiUtils的典型用法代码示例。如果您正苦于以下问题:Java GuiUtils类的具体用法?Java GuiUtils怎么用?Java GuiUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: overlayUI

import wallettemplate.utils.GuiUtils; //导入依赖的package包/类
/** Loads the FXML file with the given name, blurs out the main UI and puts this one on top. */
public <T> OverlayUI<T> overlayUI(String name) {
    try {
        checkGuiThread();
        // Load the UI from disk.
        URL location = GuiUtils.getResource(name);
        FXMLLoader loader = new FXMLLoader(location);
        Pane ui = loader.load();
        T controller = loader.getController();
        OverlayUI<T> pair = new OverlayUI<T>(ui, controller);
        // Auto-magically set the overlayUI member, if it's there.
        try {
            if (controller != null)
                controller.getClass().getField("overlayUI").set(controller, pair);
        } catch (IllegalAccessException | NoSuchFieldException ignored) {
            ignored.printStackTrace();
        }
        pair.show();
        return pair;
    } catch (IOException e) {
        throw new RuntimeException(e);  // Can't happen.
    }
}
 
开发者ID:creativechain,项目名称:creacoinj,代码行数:24,代码来源:Main.java

示例2: send

import wallettemplate.utils.GuiUtils; //导入依赖的package包/类
public void send (ActionEvent event) {

        ByteBuffer byteBuffer = ByteBuffer.wrap(Tools.hexStringToByteArray(address.getText()));

        amount = byteBuffer.getLong();
        byteBuffer.get(hash);
        byteBuffer.get(destination);

        Main.thunderContext.makePayment(destination, amount, new PaymentSecret(null, hash), result -> {
            if (!result.wasSuccessful()) {
                GuiUtils.informationalAlert("Error", result.getMessage(), null);
            }
        });

        overlayUI.done();

    }
 
开发者ID:blockchain,项目名称:thunder,代码行数:18,代码来源:SendMoneyController.java

示例3: prepareUI

import wallettemplate.utils.GuiUtils; //导入依赖的package包/类
private void prepareUI (Stage mainWindow) throws IOException {
    this.mainWindow = mainWindow;
    // Show the crash dialog for any exceptions that we don't handle and that hit the main loop.
    GuiUtils.handleCrashesOnThisThread();

    // Load the GUI. The MainController class will be automagically created and wired up.
    File file = new File("main.fxml");
    URL location = getClass().getResource("main.fxml");
    FXMLLoader loader = new FXMLLoader(location);
    mainUI = loader.load();
    controller = loader.getController();
    // Configure the window with a StackPane so we can overlay things on top of the main UI, and a
    // NotificationBarPane so we can slide messages and progress bars in from the bottom. Note that
    // ordering of the construction and connection matters here, otherwise we get (harmless) CSS error
    // spew to the logs.
    notificationBar = new NotificationBarPane(mainUI);
    mainWindow.setTitle(APP_NAME);
    uiStack = new StackPane();
    Scene scene = new Scene(uiStack);
    TextFieldValidator.configureScene(scene);   // Add CSS that we need.
    scene.getStylesheets().add(getClass().getResource("wallet.css").toString());
    uiStack.getChildren().add(notificationBar);
    mainWindow.setScene(scene);
}
 
开发者ID:blockchain,项目名称:thunder,代码行数:25,代码来源:Main.java

示例4: overlayUI

import wallettemplate.utils.GuiUtils; //导入依赖的package包/类
/**
 * Loads the FXML file with the given name, blurs out the main UI and puts this one on top.
 */
public <T> OverlayUI<T> overlayUI (String name) {
    try {
        checkGuiThread();
        // Load the UI from disk.
        URL location = GuiUtils.getResource(name);
        FXMLLoader loader = new FXMLLoader(location);
        Pane ui = loader.load();
        T controller = loader.getController();
        OverlayUI<T> pair = new OverlayUI<T>(ui, controller);
        // Auto-magically set the overlayUI member, if it's there.
        try {
            if (controller != null) {
                controller.getClass().getField("overlayUI").set(controller, pair);
            }
        } catch (IllegalAccessException | NoSuchFieldException ignored) {
            ignored.printStackTrace();
        }
        pair.show();
        return pair;
    } catch (IOException e) {
        throw new RuntimeException(e);  // Can't happen.
    }
}
 
开发者ID:blockchain,项目名称:thunder,代码行数:27,代码来源:Main.java

示例5: start

import wallettemplate.utils.GuiUtils; //导入依赖的package包/类
@Override
public void start(Stage mainWindow) throws Exception {
    instance = this;
    // Show the crash dialog for any exceptions that we don't handle and that hit the main loop.
    GuiUtils.handleCrashesOnThisThread();
    try {
        init(mainWindow);
    } catch (Throwable t) {
        // Nicer message for the case where the block store file is locked.
        if (Throwables.getRootCause(t) instanceof BlockStoreException) {
            GuiUtils.informationalAlert("Already running", "This application is already running and cannot be started twice.");
        } else {
            throw t;
        }
    }
}
 
开发者ID:HashEngineering,项目名称:megacoinj,代码行数:17,代码来源:Main.java

示例6: deleteAvatar

import wallettemplate.utils.GuiUtils; //导入依赖的package包/类
@FXML protected void deleteAvatar (ActionEvent event){
	if(Authenticator.getWalletOperation().isOnenameAvatarSet()) {
		boolean result = false;
		try {
			result = Authenticator.getWalletOperation().deleteOneNameAvatar();
		} catch (IOException e) {
			e.printStackTrace();
			GuiUtils.informationalAlert("Could not delete OneName profile", "");
		}
		if(result == false) {
			GuiUtils.informationalAlert("Could not delete OneName profile", "");
		}
		else {
			Authenticator.fireonOneNameIdentityChanged(null, null);
			done();
		}
	}
}
 
开发者ID:BitcoinAuthenticator,项目名称:Wallet,代码行数:19,代码来源:OneNameController.java

示例7: addAccount

import wallettemplate.utils.GuiUtils; //导入依赖的package包/类
@FXML protected void addAccount(ActionEvent event){
	if((!Main.UI_ONLY_WALLET_PW.hasPassword() && Authenticator.getWalletOperation().isWalletEncrypted())
			&& txfPassword.getText().length() == 0) {
		informationalAlert("Your wallet is locked",
				"Please enter your wallet's password");
		return;
	}
	
	if(txfNewAccountName.getText().length() == 0)
	{
		informationalAlert("Error",
				"Please enter an account name");
		return;
	}
	
	try {
		BAPassword pass = new BAPassword(txfPassword.getText());
		ATAccount newAcc = Authenticator.getWalletOperation().generateNewStandardAccount(NetworkType.MAIN_NET, txfNewAccountName.getText(), pass);
		setupContent();
	
	} catch (IOException | NoWalletPasswordException e) {
		e.printStackTrace();
		GuiUtils.informationalAlert("Error !", "Error occured while creating the account.\n"
				+ "The password may be wrong");
	}
}
 
开发者ID:BitcoinAuthenticator,项目名称:Wallet,代码行数:27,代码来源:AccountsController.java

示例8: newWallet

import wallettemplate.utils.GuiUtils; //导入依赖的package包/类
@FXML protected void newWallet(ActionEvent event) throws IOException {
 
 createWallet(null);
 createAuthenticatorObject();
 
 shouldCreateNewAccountOnFinish = true;
 
 // update params in main
 Main.returnedParamsFromSetup = appParams;
 
 for (String word : walletSeed.getMnemonicCode()){mnemonic = mnemonic + word + " ";}
 lblSeed.setText(mnemonic);
 
 Animation ani = GuiUtils.fadeOut(MainPane);
 GuiUtils.fadeIn(SetPasswordPane);
 MainPane.setVisible(false);
 SetPasswordPane.setVisible(true);
}
 
开发者ID:BitcoinAuthenticator,项目名称:Wallet,代码行数:19,代码来源:StartupController.java

示例9: saveWalletFolderAsZip

import wallettemplate.utils.GuiUtils; //导入依赖的package包/类
@FXML protected void saveWalletFolderAsZip(ActionEvent event) throws IOException{
 FileChooser fileChooser = new FileChooser();
 fileChooser.setTitle("Save Wallet");
 fileChooser.setInitialFileName(appParams.getAppName() + ".zip");
 File destination = fileChooser.showSaveDialog(Main.startup);
 File walletFolder = new File(appParams.getApplicationDataFolderAbsolutePath());
 if(!walletFolder.isDirectory() || !walletFolder.exists()) {
	 Platform.runLater(() -> GuiUtils.informationalAlert("Error !", "Could not load wallet data directory"));
	 return;
 }
 
 if(this.backupMode) {
	 if(FileUtils.ZipHelper.zipDir(walletFolder.getAbsolutePath(), destination.getAbsolutePath()))
		 Platform.runLater(() -> GuiUtils.informationalAlert("Success !", "Saved wallet files to:\n" + destination.getAbsolutePath()));
	 else {
		 Platform.runLater(() -> GuiUtils.informationalAlert("Error !", "Could not save wallet files"));
	 }
 }
 else {
	 Main.destination = destination;
	 Main.walletFolder = walletFolder;
	 GuiUtils.informationalAlert("Take note !", "The backup files will be saved to:\n" + destination.getAbsolutePath() + " after you complete the setup.");
 }		 
}
 
开发者ID:BitcoinAuthenticator,项目名称:Wallet,代码行数:25,代码来源:StartupController.java

示例10: printSSS

import wallettemplate.utils.GuiUtils; //导入依赖的package包/类
@FXML protected void printSSS(ActionEvent event) {
 if(shares == null || shares.size() == 0) {
	 GuiUtils.informationalAlert("Error !", "Make sure you split the wallet's seed and then print the pieces");
	 return;
 }
 
 DirectoryChooser dirChooser = new DirectoryChooser();
 dirChooser.setTitle("Save Pieces");
 File destination = dirChooser.showDialog(Main.startup);
 if(!destination.exists())
	 destination.mkdir();

 for(Share s: shares) {
	 try {
		PaperSSSController.createAndSavePaperSSS(s, walletSeed.getCreationTimeSeconds(), destination);
	} catch (IOException e) {
		e.printStackTrace();
		GuiUtils.informationalAlert("Error !", "Failed to print all the pieces.");
		return;
	}
 }
 
 GuiUtils.informationalAlert("Done !", "Saved all pieces to " + destination.getAbsolutePath() + "\n" +
		 							   "We suggest you give the pieces to close friends and family for safe keeping.");
}
 
开发者ID:BitcoinAuthenticator,项目名称:Wallet,代码行数:26,代码来源:StartupController.java

示例11: goRestoreFromSSSDatePicker

import wallettemplate.utils.GuiUtils; //导入依赖的package包/类
@FXML protected void goRestoreFromSSSDatePicker(ActionEvent event){
 LocalDate date = seedSSSRestoreCreationDatePicker.getValue();
 if(date != null){
	 try {
		 long unix = date.atStartOfDay().toEpochSecond(ZoneOffset.UTC);
		 walletSeed = reconstructSeed(lblSeedFromSSS.getText(), date);
		 createWallet(walletSeed);
		 RestoreFromSSSDatePane.setVisible(false);		 
		 launchRestoreAccoutns(RestoreFromSSSDatePane);
	} catch (IOException e) {
		e.printStackTrace();
	}
	
 }
 else
 {
	 GuiUtils.informationalAlert("Error", "Please Choose Seed Creation time");
 }
}
 
开发者ID:BitcoinAuthenticator,项目名称:Wallet,代码行数:20,代码来源:StartupController.java

示例12: combineSSSShares

import wallettemplate.utils.GuiUtils; //导入依赖的package包/类
@FXML protected void combineSSSShares(ActionEvent event){
 try {
	 List<Share> shares = new ArrayList<Share>();
	 for(Node n:restoreSSSScrllContent.getChildren()){
		 SSSRestoreCell c = (SSSRestoreCell)n;
		 String shareStr = c.getShareStr();
		 Share s = Share.fromString(shareStr, params);
		 shares.add(s);
	 }
	 
	 // combine shares
	 byte[] entropy = BipSSS.combineSeed(shares);
	 MnemonicCode ms = new MnemonicCode();
	 List<String> mnemonic = ms.toMnemonic(entropy);
	 String mnemonicStr = Joiner.on(" ").join(mnemonic);
	 lblSeedFromSSS.setText(mnemonicStr);
	 
	 btnRestoreFromSeedFromSSSContinue.setDisable(false);
	 
  } catch (Exception e) {
	e.printStackTrace();
	GuiUtils.informationalAlert("Cannot Restore from SSS Shares", "Please make sure you typed the correct share strings");
  }
}
 
开发者ID:BitcoinAuthenticator,项目名称:Wallet,代码行数:25,代码来源:StartupController.java

示例13: playPairingOperation

import wallettemplate.utils.GuiUtils; //导入依赖的package包/类
private void playPairingOperation(String pairName, NetworkType nt, PairingStageUpdater stageListener){
	BAOperation op = OperationsFactory.PAIRING_OPERATION(Authenticator.getWalletOperation(),
   			pairName, 
   			null,
   			null,
   			nt,
   			0,
   			false,
   			stageListener,
   			null);
	
	op.SetOperationUIUpdate(new OperationListenerAdapter() {
		@Override
		public void onError(BAOperation operation, Exception e, Throwable t) {
			Platform.runLater(() -> GuiUtils.informationalAlert("Error !", "We could not create the pairing QR code, please restart wallet."));
		}
	});
	
	boolean result = auth.addOperation(op);
   	if(!result){ 
   		GuiUtils.informationalAlert("Error !", "Could not add operation");
   	}
}
 
开发者ID:BitcoinAuthenticator,项目名称:Wallet,代码行数:24,代码来源:StartupController.java

示例14: realStart

import wallettemplate.utils.GuiUtils; //导入依赖的package包/类
public void realStart(Stage mainWindow) {
    instance = this;
    // Show the crash dialog for any exceptions that we don't handle and that hit the main loop.
    GuiUtils.handleCrashesOnThisThread();
    
    UI_ONLY_WALLET_PW = new BAPassword();
    
    
     try {
     	if(super.BAInit()) {
     		System.out.println(toString());
         	init(mainWindow);
     	}
     	else
         	Runtime.getRuntime().exit(0);
     } catch (Exception t) {
         if(t instanceof WrongOperatingSystemException)
         	GuiUtils.informationalAlert("Error", "Could not find an appropriate OS");
         
         else 
         	Runtime.getRuntime().exit(0);
     }
}
 
开发者ID:BitcoinAuthenticator,项目名称:Wallet,代码行数:24,代码来源:Main.java

示例15: start

import wallettemplate.utils.GuiUtils; //导入依赖的package包/类
@Override
public void start(Stage mainWindow) throws Exception {
    try {
        realStart(mainWindow);
    } catch (Throwable e) {
        GuiUtils.crashAlert(e);
        throw e;
    }
}
 
开发者ID:creativechain,项目名称:creacoinj,代码行数:10,代码来源:Main.java


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