Search in sources :

Example 1 with Exame

use of model.Exame in project arquivoProject by fader-azevedo.

the class ListaDocumentoController method scrollBtnPauta.

public void scrollBtnPauta(String codigoEstante, String codigoPratileira, String codigoPasta) {
    GridPane gr = new GridPane();
    gr.setHgap(12);
    gr.setVgap(16);
    gr.setPadding(new Insets(5, 5, 5, 5));
    sessao = HibernateUtil.getSessionFactory().openSession();
    sessao.beginTransaction();
    List<Pauta> dataPauta = null;
    List<Exame> dataExame = null;
    if (!codigoEstante.equalsIgnoreCase("") && !codigoEstante.equalsIgnoreCase("") && !codigoPasta.equals("")) {
        codigoEstanteLb.setText(codigoEstante);
        codigoPratileiraLb.setText(codigoPratileira);
        codigoPastaLb.setText(codigoPasta);
        codigoEstanteLb.getStyleClass().add("lbCamiho");
        codigoPratileiraLb.getStyleClass().add("lbCamiho");
        codigoPastaLb.getStyleClass().add("lbCamiho");
        MaterialDesignIconView iconEstant = new MaterialDesignIconView(MaterialDesignIcon.BOOK, "20");
        boxCaminho.getChildren().add(iconEstant);
        boxCaminho.getChildren().add(codigoEstanteLb);
        OctIconView iconNext = new OctIconView(OctIcon.CHEVRON_RIGHT, "20");
        iconNext.setFill(Paint.valueOf("#0078D7"));
        boxCaminho.getChildren().add(iconNext);
        MaterialDesignIconView iconPrat = new MaterialDesignIconView(MaterialDesignIcon.LIBRARY_BOOKS, "20");
        boxCaminho.getChildren().add(iconPrat);
        boxCaminho.getChildren().add(codigoPratileiraLb);
        OctIconView iconNext2 = new OctIconView(OctIcon.CHEVRON_RIGHT, "20");
        iconNext2.setFill(Paint.valueOf("#0078D7"));
        boxCaminho.getChildren().add(iconNext2);
        MaterialDesignIconView iconPasta = new MaterialDesignIconView(MaterialDesignIcon.FOLDER, "20");
        boxCaminho.getChildren().add(iconPasta);
        boxCaminho.getChildren().add(codigoPastaLb);
        Pasta es = (Pasta) db.getEstOrPratOrPastByCodigo(codigoPasta, Pasta.class);
        int idPasta = es.getIdpasta();
        SQLQuery query = sessao.createSQLQuery("SELECT * FROM  Pauta WHERE  idpasta =?").addEntity(Pauta.class);
        dataPauta = query.setString(0, idPasta + "%").list();
    } else {
        verificador = true;
        this.lbInfo.setVisible(false);
        dataPauta = sessao.createCriteria(Pauta.class).list();
        sessao.getTransaction().commit();
    }
    int numColunas = 0;
    int numLinha = 0;
    for (Pauta obj : dataPauta) {
        JFXButton button = new JFXButton(obj.getScan());
        MaterialDesignIconView icon = new MaterialDesignIconView(MaterialDesignIcon.FILE_EXCEL, "40");
        icon.setFill(Paint.valueOf("#A17878"));
        button.setGraphic(icon);
        button.setContentDisplay(ContentDisplay.TOP);
        button.setPrefSize(99, 96);
        button.setButtonType(JFXButton.ButtonType.RAISED);
        button.setDefaultButton(true);
        button.setContextMenu(this.rightClik(button));
        if (numColunas < 6) {
            gr.add(button, numColunas, numLinha);
            numColunas += 1;
        } else {
            numColunas = 0;
            numLinha += 1;
            gr.add(button, numColunas, numLinha);
            numColunas += 1;
        }
    }
    ScrollPane scroll = new ScrollPane(gr);
    scroll.setStyle("-fx-background-color:transparent;");
    scroll.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    scroll.setPrefSize(680, 331);
    scroll.setPadding(new Insets(2, 0, 0, 2));
    if (dataPauta.isEmpty()) {
        lbInfo.setVisible(true);
    } else {
        pnButoes.getChildren().add(scroll);
    }
}
Also used : Exame(model.Exame) GridPane(javafx.scene.layout.GridPane) Insets(javafx.geometry.Insets) Pauta(model.Pauta) OctIconView(de.jensd.fx.glyphs.octicons.OctIconView) JFXButton(com.jfoenix.controls.JFXButton) SQLQuery(org.hibernate.SQLQuery) Paint(javafx.scene.paint.Paint) ScrollPane(javafx.scene.control.ScrollPane) Pasta(model.Pasta) MaterialDesignIconView(de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIconView)

Aggregations

JFXButton (com.jfoenix.controls.JFXButton)1 MaterialDesignIconView (de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIconView)1 OctIconView (de.jensd.fx.glyphs.octicons.OctIconView)1 Insets (javafx.geometry.Insets)1 ScrollPane (javafx.scene.control.ScrollPane)1 GridPane (javafx.scene.layout.GridPane)1 Paint (javafx.scene.paint.Paint)1 Exame (model.Exame)1 Pasta (model.Pasta)1 Pauta (model.Pauta)1 SQLQuery (org.hibernate.SQLQuery)1