Search in sources :

Example 51 with FXMLLoader

use of javafx.fxml.FXMLLoader in project arquivoProject by fader-azevedo.

the class ListaDocumentoController method rightClik.

private ContextMenu rightClik(JFXButton button) {
    final ContextMenu contextMenu = new ContextMenu();
    MenuItem verDoc = new MenuItem("Ver Pauta");
    MaterialDesignIconView iconEye = new MaterialDesignIconView(MaterialDesignIcon.EYE, "20");
    verDoc.setGraphic(iconEye);
    contextMenu.getItems().addAll(verDoc);
    verDoc.setOnAction(e -> {
        try {
            System.out.println(button.getText());
            FXMLLoader loader = new FXMLLoader();
            loader.load(getClass().getResource("/view/PdfViewer.fxml").openStream());
            Parent parent = loader.getRoot();
            File pdfCaminho = new File("documentos/pautas/" + button.getText());
            PdfViewerController pdfController = loader.getController();
            pdfController.initialize();
            pdfController.loadFile(pdfCaminho.toString());
            final Stage dialog = new Stage();
            dialog.initModality(Modality.APPLICATION_MODAL);
            Scene dialogScene = new Scene(parent, 500, 620);
            dialog.setScene(dialogScene);
            dialog.setTitle(button.getText());
            dialog.setResizable(false);
            dialog.show();
        } catch (IOException ex) {
            Logger.getLogger(ListaDocumentoController.class.getName()).log(Level.SEVERE, null, ex);
        }
    });
    return contextMenu;
}
Also used : Parent(javafx.scene.Parent) Stage(javafx.stage.Stage) ContextMenu(javafx.scene.control.ContextMenu) MenuItem(javafx.scene.control.MenuItem) IOException(java.io.IOException) Scene(javafx.scene.Scene) FXMLLoader(javafx.fxml.FXMLLoader) File(java.io.File) MaterialDesignIconView(de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIconView)

Example 52 with FXMLLoader

use of javafx.fxml.FXMLLoader in project arquivoProject by fader-azevedo.

the class ListaPastaController method playThis.

private void playThis(JFXButton button) {
    Timeline timeline = new Timeline(new KeyFrame(Duration.millis(250), ev -> {
        clipRectNextDocument.setHeight(pnCarregaDocumentos.getHeight());
        if (clipRectNextDocument.widthProperty().get() != 0) {
            Timeline timelineUp = new Timeline();
            final KeyValue kvUp1 = new KeyValue(clipRectNextDocument.widthProperty(), 0);
            final KeyValue kvUp2 = new KeyValue(clipRectNextDocument.translateXProperty(), pnCarregaDocumentos.getWidth());
            final KeyValue kvUp4 = new KeyValue(pnCarregaDocumentos.prefWidthProperty(), 0);
            final KeyValue kvUp3 = new KeyValue(pnCarregaDocumentos.translateXProperty(), pnCarregaDocumentos.getWidth());
            final KeyFrame kfUp = new KeyFrame(Duration.millis(1000), kvUp1, kvUp2, kvUp3, kvUp4);
            timelineUp.getKeyFrames().add(kfUp);
            timelineUp.play();
        } else {
            try {
                if (b == true) {
                    Pasta past = (Pasta) db.getEstOrPratOrPastByCodigo(button.getText(), Pasta.class);
                    Pratileira prat = (Pratileira) db.buscarPorId(Pratileira.class, past.getPratileira());
                    codigoPratileiraLb.setText(prat.getCodigo());
                    Estante es = (Estante) db.buscarPorId(Estante.class, prat.getEstante());
                    codigoEstanteLb.setText(es.getCodigo());
                }
                clipRectNextDocument.setHeight(pnCarregaDocumentos.getHeight());
                pnCarregaDocumentos.toFront();
                FXMLLoader fxmlLoader = new FXMLLoader();
                fxmlLoader.load(getClass().getResource("/view/ListaDocumento.fxml").openStream());
                ListaDocumentoController lDocController = fxmlLoader.getController();
                lDocController.btnBack.setOnAction(xs -> {
                    this.playThis(button);
                });
                lDocController.scrollBtnPauta(codigoEstanteLb.getText(), codigoPratileiraLb.getText(), button.getText());
                lDocController.removeClass();
                lDocController.boxCaminho.setVisible(true);
                lDocController.btnBack.setVisible(true);
                lDocController.btnCloseDoc.setVisible(false);
                clipRectNextDocument.toFront();
                AnchorPane root = fxmlLoader.getRoot();
                pnCarregaDocumentos.getChildren().clear();
                pnCarregaDocumentos.getChildren().add(root);
                Timeline timeDireita = new Timeline();
                final KeyValue kvDwn1 = new KeyValue(clipRectNextDocument.widthProperty(), pnCarregaDocumentos.getWidth());
                final KeyValue kvDwn2 = new KeyValue(clipRectNextDocument.translateXProperty(), 0);
                final KeyValue kvDwn4 = new KeyValue(pnCarregaDocumentos.prefWidthProperty(), pnCarregaDocumentos.getWidth());
                final KeyValue kvDwn3 = new KeyValue(pnCarregaDocumentos.translateXProperty(), 0);
                final KeyFrame kfDwn = new KeyFrame(Duration.millis(600), kvDwn1, kvDwn2, kvDwn3, kvDwn4);
                timeDireita.getKeyFrames().add(kfDwn);
                timeDireita.play();
            } catch (Exception ex) {
                Logger.getLogger(ListaDocumentoController.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }));
    timeline.play();
}
Also used : JFXButton(com.jfoenix.controls.JFXButton) MaterialDesignIconView(de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIconView) Initializable(javafx.fxml.Initializable) URL(java.net.URL) SQLQuery(org.hibernate.SQLQuery) Session(org.hibernate.Session) Pratileira(model.Pratileira) Level(java.util.logging.Level) Insets(javafx.geometry.Insets) ScrollPane(javafx.scene.control.ScrollPane) ResourceBundle(java.util.ResourceBundle) Pasta(model.Pasta) FXMLLoader(javafx.fxml.FXMLLoader) KeyValue(javafx.animation.KeyValue) GridPane(javafx.scene.layout.GridPane) OctIconView(de.jensd.fx.glyphs.octicons.OctIconView) Pane(javafx.scene.layout.Pane) HBox(javafx.scene.layout.HBox) KeyFrame(javafx.animation.KeyFrame) Label(javafx.scene.control.Label) OctIcon(de.jensd.fx.glyphs.octicons.OctIcon) Timeline(javafx.animation.Timeline) Rectangle(javafx.scene.shape.Rectangle) IOException(java.io.IOException) Logger(java.util.logging.Logger) Estante(model.Estante) FXML(javafx.fxml.FXML) List(java.util.List) Duration(javafx.util.Duration) AnchorPane(javafx.scene.layout.AnchorPane) Paint(javafx.scene.paint.Paint) MaterialDesignIcon(de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon) ContentDisplay(javafx.scene.control.ContentDisplay) Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) Pratileira(model.Pratileira) KeyFrame(javafx.animation.KeyFrame) Pasta(model.Pasta) FXMLLoader(javafx.fxml.FXMLLoader) AnchorPane(javafx.scene.layout.AnchorPane) IOException(java.io.IOException) Estante(model.Estante)

Example 53 with FXMLLoader

use of javafx.fxml.FXMLLoader in project arquivoProject by fader-azevedo.

the class MenuController method getPratileirasPane.

public void getPratileirasPane() throws IOException {
    Timeline timeline = new Timeline(new KeyFrame(Duration.millis(150), ev -> {
        try {
            pnCarregador.toFront();
            FXMLLoader fxmlLoader = new FXMLLoader();
            fxmlLoader.load(getClass().getResource("/view/ListaPratileira.fxml").openStream());
            AnchorPane root = fxmlLoader.getRoot();
            ListaPratileiraController listaPrat = fxmlLoader.getController();
            listaPrat.scrollBtnPratileira("");
            pnCarregador.getChildren().clear();
            pnCarregador.getChildren().add(root);
        } catch (Exception e) {
        }
    }));
    timeline.play();
}
Also used : JFXButton(com.jfoenix.controls.JFXButton) KeyFrame(javafx.animation.KeyFrame) Initializable(javafx.fxml.Initializable) URL(java.net.URL) Timeline(javafx.animation.Timeline) IOException(java.io.IOException) FXML(javafx.fxml.FXML) ActionEvent(javafx.event.ActionEvent) Duration(javafx.util.Duration) ResourceBundle(java.util.ResourceBundle) AnchorPane(javafx.scene.layout.AnchorPane) FXMLLoader(javafx.fxml.FXMLLoader) Pane(javafx.scene.layout.Pane) Timeline(javafx.animation.Timeline) KeyFrame(javafx.animation.KeyFrame) FXMLLoader(javafx.fxml.FXMLLoader) AnchorPane(javafx.scene.layout.AnchorPane) IOException(java.io.IOException)

Example 54 with FXMLLoader

use of javafx.fxml.FXMLLoader in project arquivoProject by fader-azevedo.

the class LoginController method logIn.

public void logIn() {
    Timeline timeline = new Timeline(new KeyFrame(Duration.millis(250), ev -> {
        try {
            FXMLLoader loader = new FXMLLoader();
            loader.setLocation(getClass().getResource("/view/PaginaInicial.fxml"));
            loader.load();
            Parent parent = loader.getRoot();
            Scene adminPanelScene = new Scene(parent);
            Stage adminPanelStage = new Stage();
            adminPanelStage.setScene(adminPanelScene);
            adminPanelStage.setResizable(false);
            adminPanelStage.setHeight(700);
            PaginaInicialController pag = loader.getController();
            pag.refresh();
            adminPanelStage.setOnCloseRequest(e -> {
                Platform.exit();
                System.exit(0);
            });
            adminPanelStage.show();
            Stage stage = (Stage) btnLogin.getScene().getWindow();
            stage.close();
        } catch (IOException ex) {
            Logger.getLogger(LoginController.class.getName()).log(Level.SEVERE, null, ex);
        }
    }));
    timeline.play();
}
Also used : JFXButton(com.jfoenix.controls.JFXButton) Scene(javafx.scene.Scene) KeyFrame(javafx.animation.KeyFrame) Initializable(javafx.fxml.Initializable) URL(java.net.URL) Timeline(javafx.animation.Timeline) IOException(java.io.IOException) Logger(java.util.logging.Logger) Level(java.util.logging.Level) Platform(javafx.application.Platform) FXML(javafx.fxml.FXML) Parent(javafx.scene.Parent) Duration(javafx.util.Duration) ResourceBundle(java.util.ResourceBundle) Stage(javafx.stage.Stage) FXMLLoader(javafx.fxml.FXMLLoader) Tooltip(javafx.scene.control.Tooltip) Timeline(javafx.animation.Timeline) Parent(javafx.scene.Parent) KeyFrame(javafx.animation.KeyFrame) Stage(javafx.stage.Stage) IOException(java.io.IOException) Scene(javafx.scene.Scene) FXMLLoader(javafx.fxml.FXMLLoader)

Example 55 with FXMLLoader

use of javafx.fxml.FXMLLoader in project arquivoProject by fader-azevedo.

the class PaginaInicialController method listaTodasEstantes.

@FXML
private void listaTodasEstantes() {
    Timeline timeline = new Timeline(new KeyFrame(Duration.millis(220), ev -> {
        try {
            btnInicio.getStyleClass().clear();
            btnEstante.getStyleClass().add("butCriar");
            btnPratileira.getStyleClass().clear();
            btnPasta.getStyleClass().clear();
            btnPauta.getStyleClass().clear();
            btnRegistar.getStyleClass().clear();
            btnRegistar.getStyleClass().add("begin");
            pnInicio.toFront();
            pnPesquisa.getChildren().clear();
            FXMLLoader fxmlLoader = new FXMLLoader();
            fxmlLoader.load(getClass().getResource("/view/ListaEstante.fxml").openStream());
            AnchorPane root = fxmlLoader.getRoot();
            pnInicio.getChildren().clear();
            pnInicio.getChildren().add(root);
        } catch (IOException ex) {
            Logger.getLogger(PaginaInicialController.class.getName()).log(Level.SEVERE, null, ex);
        }
    }));
    timeline.play();
}
Also used : JFXButton(com.jfoenix.controls.JFXButton) KeyFrame(javafx.animation.KeyFrame) Initializable(javafx.fxml.Initializable) MenuItem(javafx.scene.control.MenuItem) URL(java.net.URL) Timeline(javafx.animation.Timeline) IOException(java.io.IOException) Logger(java.util.logging.Logger) Level(java.util.logging.Level) FXML(javafx.fxml.FXML) Parent(javafx.scene.Parent) ActionEvent(javafx.event.ActionEvent) Duration(javafx.util.Duration) ResourceBundle(java.util.ResourceBundle) AnchorPane(javafx.scene.layout.AnchorPane) FXMLLoader(javafx.fxml.FXMLLoader) MenuButton(javafx.scene.control.MenuButton) ObservableValue(javafx.beans.value.ObservableValue) ChangeListener(javafx.beans.value.ChangeListener) JFXTextField(com.jfoenix.controls.JFXTextField) Pane(javafx.scene.layout.Pane) Timeline(javafx.animation.Timeline) KeyFrame(javafx.animation.KeyFrame) IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader) AnchorPane(javafx.scene.layout.AnchorPane) FXML(javafx.fxml.FXML)

Aggregations

FXMLLoader (javafx.fxml.FXMLLoader)113 IOException (java.io.IOException)67 Scene (javafx.scene.Scene)37 Parent (javafx.scene.Parent)33 Stage (javafx.stage.Stage)28 URL (java.net.URL)24 FXML (javafx.fxml.FXML)24 Pane (javafx.scene.layout.Pane)24 ActionEvent (javafx.event.ActionEvent)18 AnchorPane (javafx.scene.layout.AnchorPane)18 ResourceBundle (java.util.ResourceBundle)16 BorderPane (javafx.scene.layout.BorderPane)16 Initializable (javafx.fxml.Initializable)14 JFXButton (com.jfoenix.controls.JFXButton)13 StackPane (javafx.scene.layout.StackPane)13 KeyFrame (javafx.animation.KeyFrame)12 Timeline (javafx.animation.Timeline)12 Duration (javafx.util.Duration)12 Level (java.util.logging.Level)11 Logger (java.util.logging.Logger)11