Search in sources :

Example 41 with AnchorPane

use of javafx.scene.layout.AnchorPane in project arquivoProject by fader-azevedo.

the class ListaPratileiraController method playThis.

private void playThis(JFXButton button) {
    Timeline timeline = new Timeline(new KeyFrame(Duration.millis(250), ev -> {
        clipRectNextPasta.setHeight(pnCarregaPasta.getHeight());
        if (clipRectNextPasta.widthProperty().get() != 0) {
            Timeline timelineUp = new Timeline();
            final KeyValue kvUp1 = new KeyValue(clipRectNextPasta.widthProperty(), 0);
            final KeyValue kvUp2 = new KeyValue(clipRectNextPasta.translateXProperty(), pnCarregaPasta.getWidth());
            final KeyValue kvUp4 = new KeyValue(pnCarregaPasta.prefWidthProperty(), 0);
            final KeyValue kvUp3 = new KeyValue(pnCarregaPasta.translateXProperty(), pnCarregaPasta.getWidth());
            final KeyFrame kfUp = new KeyFrame(Duration.millis(1000), kvUp1, kvUp2, kvUp3, kvUp4);
            timelineUp.getKeyFrames().add(kfUp);
            timelineUp.play();
        } else {
            try {
                if (b == true) {
                    // quando e clicado a pratileira sem estante
                    Pratileira prt = (Pratileira) db.getEstOrPratOrPastByCodigo(button.getText(), Pratileira.class);
                    Estante es = (Estante) db.buscarPorId(Estante.class, prt.getEstante());
                    codigoEstanteLb.setText(es.getCodigo());
                }
                clipRectNextPasta.setHeight(pnCarregaPasta.getHeight());
                pnCarregaPasta.toFront();
                FXMLLoader fxmlLoader = new FXMLLoader();
                fxmlLoader.load(getClass().getResource("/view/ListaPasta.fxml").openStream());
                ListaPastaController lpastaController = fxmlLoader.getController();
                lpastaController.btnBack.setOnAction(xs -> {
                    this.playThis(button);
                });
                lpastaController.scrollBtnPasta(codigoEstanteLb.getText(), button.getText());
                lpastaController.removeClass();
                lpastaController.boxCaminho.setVisible(true);
                lpastaController.btnBack.setVisible(true);
                lpastaController.btnClosePasta.setVisible(false);
                btnClosePratileira.toFront();
                AnchorPane root = fxmlLoader.getRoot();
                pnCarregaPasta.getChildren().clear();
                pnCarregaPasta.getChildren().add(root);
                Timeline timeDireita = new Timeline();
                final KeyValue kvDwn1 = new KeyValue(clipRectNextPasta.widthProperty(), pnCarregaPasta.getWidth());
                final KeyValue kvDwn2 = new KeyValue(clipRectNextPasta.translateXProperty(), 0);
                final KeyValue kvDwn4 = new KeyValue(pnCarregaPasta.prefWidthProperty(), pnCarregaPasta.getWidth());
                final KeyValue kvDwn3 = new KeyValue(pnCarregaPasta.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(ListaPratileiraController.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) FXMLLoader(javafx.fxml.FXMLLoader) KeyValue(javafx.animation.KeyValue) GridPane(javafx.scene.layout.GridPane) Pane(javafx.scene.layout.Pane) HBox(javafx.scene.layout.HBox) KeyFrame(javafx.animation.KeyFrame) Label(javafx.scene.control.Label) 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) FXMLLoader(javafx.fxml.FXMLLoader) AnchorPane(javafx.scene.layout.AnchorPane) IOException(java.io.IOException) Estante(model.Estante)

Example 42 with AnchorPane

use of javafx.scene.layout.AnchorPane in project arquivoProject by fader-azevedo.

the class MenuController method getEstantesPane.

public void getEstantesPane() throws IOException {
    Timeline timeline = new Timeline(new KeyFrame(Duration.millis(250), ev -> {
        try {
            pnCarregador.toFront();
            FXMLLoader fxmlLoader = new FXMLLoader();
            fxmlLoader.load(getClass().getResource("/view/ListaEstante.fxml").openStream());
            AnchorPane root = fxmlLoader.getRoot();
            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 43 with AnchorPane

use of javafx.scene.layout.AnchorPane in project arquivoProject by fader-azevedo.

the class MenuController method getPastasPane.

public void getPastasPane() throws IOException {
    Timeline timeline = new Timeline(new KeyFrame(Duration.millis(250), ev -> {
        try {
            pnCarregador.toFront();
            FXMLLoader fxmlLoader = new FXMLLoader();
            fxmlLoader.load(getClass().getResource("/view/ListaPasta.fxml").openStream());
            AnchorPane root = fxmlLoader.getRoot();
            ListaPastaController listPastCont = fxmlLoader.getController();
            listPastCont.scrollBtnPasta("", "");
            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 44 with AnchorPane

use of javafx.scene.layout.AnchorPane in project arquivoProject by fader-azevedo.

the class PaginaInicialController method initialize.

@Override
public void initialize(URL url, ResourceBundle rb) {
    btnInicio.getStyleClass().add("butCriar");
    btnRegistar.getStyleClass().add("begin");
    pnPesquisa.getChildren().clear();
    txtPesquisa.setFocusTraversable(false);
    txtPesquisa.focusedProperty().addListener(new ChangeListener<Boolean>() {

        @Override
        public void changed(ObservableValue<? extends Boolean> arg0, Boolean oldPropertyValue, Boolean newPropertyValue) {
            if (newPropertyValue) {
                try {
                    pnInicio.getChildren().clear();
                    pnPesquisa.toFront();
                    FXMLLoader fxmlLoader = new FXMLLoader();
                    fxmlLoader.load(getClass().getResource("/view/PanePesquisa.fxml").openStream());
                    PanePesquisaController pesqController = fxmlLoader.getController();
                    AnchorPane root = fxmlLoader.getRoot();
                    if (pnPesquisa.getChildren().isEmpty()) {
                        pnPesquisa.getChildren().add(root);
                    }
                    pesqController.filtar(txtPesquisa);
                } catch (IOException ex) {
                    Logger.getLogger(PaginaInicialController.class.getName()).log(Level.SEVERE, null, ex);
                }
            } else {
                System.out.println("Textfield out focus");
            }
        }
    });
}
Also used : IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader) AnchorPane(javafx.scene.layout.AnchorPane)

Example 45 with AnchorPane

use of javafx.scene.layout.AnchorPane in project arquivoProject by fader-azevedo.

the class PaginaInicialController method listaTodosDocumentos.

@FXML
private void listaTodosDocumentos() throws IOException {
    Timeline timeline = new Timeline(new KeyFrame(Duration.millis(250), ev -> {
        try {
            btnInicio.getStyleClass().clear();
            btnEstante.getStyleClass().clear();
            btnPratileira.getStyleClass().clear();
            btnPasta.getStyleClass().clear();
            btnPauta.getStyleClass().add("butCriar");
            btnRegistar.getStyleClass().clear();
            btnRegistar.getStyleClass().add("begin");
            pnInicio.toFront();
            pnPesquisa.getChildren().clear();
            FXMLLoader fxmlLoader = new FXMLLoader();
            fxmlLoader.load(getClass().getResource("/view/ListaDocumento.fxml").openStream());
            AnchorPane root = fxmlLoader.getRoot();
            ListaDocumentoController listDocController = fxmlLoader.getController();
            listDocController.scrollBtnPauta("", "", "");
            pnInicio.getChildren().clear();
            pnInicio.getChildren().add(root);
        } catch (Exception e) {
        }
    }));
    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) FXMLLoader(javafx.fxml.FXMLLoader) AnchorPane(javafx.scene.layout.AnchorPane) IOException(java.io.IOException) FXML(javafx.fxml.FXML)

Aggregations

AnchorPane (javafx.scene.layout.AnchorPane)66 IOException (java.io.IOException)26 Scene (javafx.scene.Scene)23 FXMLLoader (javafx.fxml.FXMLLoader)22 ChangeListener (javafx.beans.value.ChangeListener)18 Label (javafx.scene.control.Label)16 ImageView (javafx.scene.image.ImageView)16 FXML (javafx.fxml.FXML)15 Insets (javafx.geometry.Insets)15 Pane (javafx.scene.layout.Pane)14 URL (java.net.URL)13 GridPane (javafx.scene.layout.GridPane)12 Inject (javax.inject.Inject)12 JFXButton (com.jfoenix.controls.JFXButton)11 ResourceBundle (java.util.ResourceBundle)11 KeyFrame (javafx.animation.KeyFrame)11 Timeline (javafx.animation.Timeline)11 Initializable (javafx.fxml.Initializable)11 Duration (javafx.util.Duration)11 Button (javafx.scene.control.Button)10