Example usage for javafx.scene.control Label getScene

List of usage examples for javafx.scene.control Label getScene

Introduction

In this page you can find the example usage for javafx.scene.control Label getScene.

Prototype

public final Scene getScene() 

Source Link

Usage

From source file:com.toyota.carservice.config.config2.java

public Object newStage3(Stage stage, Label lb, String load, String judul, boolean resize, StageStyle style,
        boolean maximized) {
    try {/*from   www .  j ava  2s .  com*/
        Stage st = new Stage();
        stage = (Stage) lb.getScene().getWindow();
        FXMLLoader root = new FXMLLoader(getClass().getResource(load));

        Scene scene = new Scene(root.load());
        st.initStyle(style);
        st.setResizable(resize);
        st.setMaximized(maximized);
        st.setTitle(judul);
        st.setScene(scene);
        ApplicationContext appContex = config.getInstance().getApplicationContext();
        Resource resource = appContex.getResource("classpath:com/toyota/carservice/img/kallatoyota.png");
        st.getIcons().add(new Image(resource.getURI().toString()));
        st.show();
        return root.getController();
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}

From source file:com.toyota.carservice.config.config2.java

public Object newStage(Stage stage, Label lb, String load, String judul, boolean resize, StageStyle style,
        boolean maximized) {
    try {/*from  www.  jav a2s .c  o m*/
        Stage st = new Stage();
        stage = (Stage) lb.getScene().getWindow();
        FXMLLoader root = new FXMLLoader(getClass().getResource(load));

        Scene scene = new Scene(root.load());
        st.initStyle(style);
        st.setResizable(resize);
        st.setMaximized(maximized);
        st.setTitle(judul);
        st.setScene(scene);
        ApplicationContext appContex = config.getInstance().getApplicationContext();
        Resource resource = appContex.getResource("classpath:com/toyota/carservice/img/kallatoyota.png");
        st.getIcons().add(new Image(resource.getURI().toString()));
        st.show();
        stage.close();
        return root.getController();
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}

From source file:Methods.ManageKey.java

/**
 * Mtodo encargado de abrir una clave guardada 
 * y devolver una lista con los primos p, q y la clave pblica.
 * @param label nodo cualquiera de la escena que 
 * se usa para ir escalando y obtener la ventana.
 * @return //from www.ja  v  a2  s  .  c o m
 */
public String[] open(Label label) {
    //Pos0: primo P, Pos1: primo Q, Pos2: clave e, Pos3: unidades
    String[] keys = null;
    File keyFile;

    this.fileChooser.setTitle("Seleccionar clave guardada");
    keyFile = this.fileChooser.showOpenDialog(label.getScene().getWindow());

    if (keyFile != null) {
        //para que la primera vez que se elija una ruta se acuerde 
        //de cual es esa ruta para las siguientes busquedas
        this.fileChooser.setInitialDirectory(keyFile.getParentFile());
        keys = processFile(keyFile);

    } else {
        this.errorDialog.FileToOpen();
    }

    return keys;
}

From source file:Methods.ManageKey.java

/**
* Mtodo encargado de guardar la clave generada
* @param label nodo cualquiera de la escena que se usa para ir escalando y obtener la ventana. 
* @param RSA /*w  w  w  .  j  a  va 2  s  .c  o m*/
*/
public void saveKey(Label label, ComponentesRSA RSA) {
    File keyFile;
    SaveKey saveKey;

    if (RSA == null) {
        this.errorDialog.RSAnotGenerated();
        return;
    }

    this.fileChooser.setTitle("Seleccionar directorio donde guardar la clave");
    this.fileChooser.setInitialFileName("Clave genRSA");
    keyFile = this.fileChooser.showSaveDialog(label.getScene().getWindow());

    if (keyFile != null) {
        this.fileChooser.setInitialDirectory(keyFile.getParentFile());

        saveKey = new SaveKey(keyFile);
        saveKey.generateHTML(RSA, this.radix);
        this.infoDialog.KeySaved();

    } else {
        this.errorDialog.FileToSave();
    }
}