Search in sources :

Example 1 with MaterialIconView

use of de.jensd.fx.glyphs.materialicons.MaterialIconView in project arquivoProject by fader-azevedo.

the class DBConnector method tooltipPratileira.

public Tooltip tooltipPratileira(String codigo) {
    Pratileira prat = (Pratileira) getEstOrPratOrPastByCodigo(codigo, Pratileira.class);
    String datac = new SimpleDateFormat("dd/MM/yyyy HH:mm").format(prat.getDataCriacao());
    Usuario user = (Usuario) buscarPorId(Usuario.class, prat.getUsuario());
    int numDeDocs = 0;
    List<Pasta> dataPasta = null;
    List<Pauta> dataPauta = null;
    try {
        sessao = HibernateUtil.getSessionFactory().openSession();
        sessao.beginTransaction();
        SQLQuery query = sessao.createSQLQuery("SELECT * FROM  Pasta WHERE  idpratileira =?").addEntity(Pasta.class);
        dataPasta = query.setString(0, prat.getIdpratileira() + "%").list();
        for (Pasta ps : dataPasta) {
            SQLQuery query1 = sessao.createSQLQuery("SELECT * FROM  Pauta WHERE  idpasta =?").addEntity(Pauta.class);
            dataPauta = query1.setString(0, ps.getIdpasta() + "%").list();
            for (Pauta pasta : dataPauta) {
                numDeDocs += 1;
            }
        }
        sessao.getTransaction().commit();
        sessao.close();
    } catch (HibernateException e) {
        alertErro("Erro ao buscar dados " + e);
    }
    Tooltip tooltip = new Tooltip();
    tooltip.setText("Pastas             : " + dataPasta.size() + "\n" + "Documentos   : " + numDeDocs + "\n" + "Data Criada    : " + datac + "\n" + "Criada Por      : " + user.getNome() + " " + user.getApelido());
    MaterialIconView icon = new MaterialIconView(MaterialIcon.INFO, "50");
    icon.setFill(Paint.valueOf("#75B4C9"));
    tooltip.setGraphic(icon);
    return tooltip;
}
Also used : HibernateException(org.hibernate.HibernateException) Tooltip(javafx.scene.control.Tooltip) MaterialIconView(de.jensd.fx.glyphs.materialicons.MaterialIconView) SQLQuery(org.hibernate.SQLQuery) Paint(javafx.scene.paint.Paint) SimpleDateFormat(java.text.SimpleDateFormat)

Example 2 with MaterialIconView

use of de.jensd.fx.glyphs.materialicons.MaterialIconView in project arquivoProject by fader-azevedo.

the class DBConnector method getPastaInfoToolTip.

public Tooltip getPastaInfoToolTip(String codigo) {
    Pasta ps = (Pasta) getEstOrPratOrPastByCodigo(codigo, Pasta.class);
    List<Pauta> dataPauta = null;
    String datac = new SimpleDateFormat("dd/MM/yyyy HH:mm").format(ps.getDataCriacao());
    Usuario user = (Usuario) buscarPorId(Usuario.class, ps.getUsuario());
    try {
        sessao = HibernateUtil.getSessionFactory().openSession();
        sessao.beginTransaction();
        SQLQuery query2 = sessao.createSQLQuery("SELECT * FROM  Pauta WHERE  idpasta =?").addEntity(Pauta.class);
        dataPauta = query2.setString(0, ps.getIdpasta() + "%").list();
        sessao.getTransaction().commit();
        sessao.close();
    } catch (HibernateException e) {
        alertErro("Erro ao buscar dados " + e);
    }
    Tooltip tooltip = new Tooltip();
    tooltip.setText("Documentos   : " + dataPauta.size() + "\n" + "Data Criada    : " + datac + "\n" + "Criada Por      : " + user.getNome() + " " + user.getApelido());
    MaterialIconView icon = new MaterialIconView(MaterialIcon.INFO, "50");
    icon.setFill(Paint.valueOf("#75B4C9"));
    tooltip.setGraphic(icon);
    return tooltip;
}
Also used : HibernateException(org.hibernate.HibernateException) Tooltip(javafx.scene.control.Tooltip) MaterialIconView(de.jensd.fx.glyphs.materialicons.MaterialIconView) SQLQuery(org.hibernate.SQLQuery) SimpleDateFormat(java.text.SimpleDateFormat)

Example 3 with MaterialIconView

use of de.jensd.fx.glyphs.materialicons.MaterialIconView in project arquivoProject by fader-azevedo.

the class PdfViewerController method initialize.

// ************ Initialization *************
public void initialize() {
    hboxButons.setAlignment(Pos.CENTER);
    MaterialIconView iconOut = new MaterialIconView(MaterialIcon.ZOOM_OUT, "20");
    MaterialIconView iconIn = new MaterialIconView(MaterialIcon.ZOOM_IN, "20");
    btnZoomOut.setGraphic(iconOut);
    btnZoomOut.setContentDisplay(ContentDisplay.CENTER);
    btnZoomIn.setGraphic(iconIn);
    btnZoomIn.setContentDisplay(ContentDisplay.CENTER);
    currentZoomLabel.setAlignment(Pos.CENTER);
    createAndConfigureImageLoadService();
    currentFile = new SimpleObjectProperty<>();
    updateWindowTitleWhenFileChanges();
    currentImage = new SimpleObjectProperty<>();
    scroller.contentProperty().bind(currentImage);
    zoom = new SimpleDoubleProperty(1);
    // To implement zooming, we just get a new image from the PDFFile each time.
    // This seems to perform well in some basic tests but may need to be improved
    // E.g. load a larger image and scale in the ImageView, loading a new image only
    // when required.
    zoom.addListener(new ChangeListener<Number>() {

        @Override
        public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
            updateImage(pagination.getCurrentPageIndex());
        }
    });
    currentZoomLabel.textProperty().bind(Bindings.format("%.0f %%", zoom.multiply(100)));
    bindPaginationToCurrentFile();
    createPaginationPageFactory();
}
Also used : SimpleDoubleProperty(javafx.beans.property.SimpleDoubleProperty) MaterialIconView(de.jensd.fx.glyphs.materialicons.MaterialIconView)

Example 4 with MaterialIconView

use of de.jensd.fx.glyphs.materialicons.MaterialIconView in project arquivoProject by fader-azevedo.

the class CriarPautaController method initialize.

@Override
public void initialize(URL url, ResourceBundle rb) {
    System.out.println("Criar Pauta");
    iconCheck.setVisible(false);
    MaterialIconView icon = new MaterialIconView(MaterialIcon.SCANNER, "35");
    btnScan.setGraphic(icon);
    ObservableList<String> semestre = FXCollections.observableArrayList("1º Semestre", "2º Semestre", "1º e 2º Semestre");
    cbSemestre.setItems(semestre);
    ObservableList<String> periodo = FXCollections.observableArrayList("Manhã", "Tarde", "Noite");
    ObservableList<String> tipo = FXCollections.observableArrayList("A", "B");
    cbTipo.setItems(tipo);
    cbPeriodo.setItems(periodo);
    cbAno.setItems(db.gerrarAnos());
    cbPasta.setItems(db.listarCogigoPasta());
    lista.setItems(db.listarCodigoPauta());
    btnClose.setOnAction(w -> {
        db.backtoMenu(pnPrincipal);
    });
    btnCancelar.setOnAction(w -> {
        limpar();
    });
}
Also used : MaterialIconView(de.jensd.fx.glyphs.materialicons.MaterialIconView)

Example 5 with MaterialIconView

use of de.jensd.fx.glyphs.materialicons.MaterialIconView in project arquivoProject by fader-azevedo.

the class DBConnector method tooltipEstante.

public Tooltip tooltipEstante(String codigo) {
    Estante est = (Estante) getEstOrPratOrPastByCodigo(codigo, Estante.class);
    String datac = new SimpleDateFormat("dd/MM/yyyy HH:mm").format(est.getDataCriacao());
    Usuario user = (Usuario) buscarPorId(Usuario.class, est.getUsuario());
    int numDePastas = 0;
    int numDeDocs = 0;
    List<Pratileira> dataPraliteira = null;
    List<Pasta> dataPasta = null;
    List<Pauta> dataPauta = null;
    try {
        sessao = HibernateUtil.getSessionFactory().openSession();
        sessao.beginTransaction();
        SQLQuery query = sessao.createSQLQuery("SELECT * FROM  Pratileira WHERE  idestante =?").addEntity(Pratileira.class);
        dataPraliteira = query.setString(0, est.getIdestante() + "%").list();
        for (Pratileira pra : dataPraliteira) {
            SQLQuery query1 = sessao.createSQLQuery("SELECT * FROM  Pasta WHERE  idpratileira =?").addEntity(Pasta.class);
            dataPasta = query1.setString(0, pra.getIdpratileira() + "%").list();
            for (Pasta pasta : dataPasta) {
                numDePastas += 1;
                SQLQuery query2 = sessao.createSQLQuery("SELECT * FROM  Pauta WHERE  idpasta =?").addEntity(Pauta.class);
                dataPauta = query2.setString(0, pasta.getIdpasta() + "%").list();
                for (Pauta pauta : dataPauta) {
                    numDeDocs += 1;
                }
            }
        }
        sessao.getTransaction().commit();
        sessao.close();
    } catch (HibernateException e) {
        alertErro("Erro ao buscar dados " + e);
    }
    Tooltip tooltip = new Tooltip();
    tooltip.setText("Pratileiras       : " + dataPraliteira.size() + "\n" + "Pastas             : " + numDePastas + "\n" + "Documentos   : " + numDeDocs + "\n" + "Data Criada    : " + datac + "\n" + "Criada Por      : " + user.getNome() + " " + user.getApelido());
    MaterialIconView icon = new MaterialIconView(MaterialIcon.INFO, "50");
    icon.setFill(Paint.valueOf("#75B4C9"));
    tooltip.setGraphic(icon);
    return tooltip;
}
Also used : HibernateException(org.hibernate.HibernateException) Tooltip(javafx.scene.control.Tooltip) MaterialIconView(de.jensd.fx.glyphs.materialicons.MaterialIconView) SQLQuery(org.hibernate.SQLQuery) Paint(javafx.scene.paint.Paint) SimpleDateFormat(java.text.SimpleDateFormat)

Aggregations

MaterialIconView (de.jensd.fx.glyphs.materialicons.MaterialIconView)5 SimpleDateFormat (java.text.SimpleDateFormat)3 Tooltip (javafx.scene.control.Tooltip)3 HibernateException (org.hibernate.HibernateException)3 SQLQuery (org.hibernate.SQLQuery)3 Paint (javafx.scene.paint.Paint)2 SimpleDoubleProperty (javafx.beans.property.SimpleDoubleProperty)1