Package business

Examples of business.Arvore


        ProjetoDAO dao = new ProjetoDAO();
        dao.connect();
        Projeto p = new Projeto();
        p.setNome(JOptionPane.showInputDialog(null, "Entre com o nome do projeto"));
        p.setId(dao.getNewId());
        Arvore a = new Arvore(1);
        a.put("DAP", 18.0);
        a.put("H", 19.0);
        p.addArvore(a);
        dao.save(p);
        dao.close();
    }
View Full Code Here


    @Test
    public void testeUpdateProjeto2() throws Exception {
        final ProjetoDAO dao = new ProjetoDAO();
        dao.connect();
        Projeto projeto = dao.find(1);
        Arvore arvore = new Arvore(2);
        arvore.put("DAP", 21.0);
        arvore.put("H", 26.0);
        projeto.addArvore(arvore);
        dao.update(projeto, false, projeto.getId());
        dao.close();
        assertNotNull("Nulo", projeto);
    }
View Full Code Here

                }
            }

            while (itData.hasNext()) {
                String[] dataLine = itData.next();
                Arvore arvore = new Arvore(0);
                for (int i = 0; i < dataAssign.size(); i++) {
                    ArrayList<Integer> valores = new ArrayList<Integer>(dataAssign.values());
                    Set<Integer> chaves = dataAssign.keySet();
                    ArrayList<Integer> keys = new ArrayList<Integer>(chaves);
                    String cabecalho = colunasAImportar.get(valores.get(i));
                    Double valor = 0.0;
                    if (keys.get(i) >= 0 && keys.get(i) < 800) {
                        valor = Double.parseDouble(dataLine[keys.get(i).intValue()]);
                    }
                    arvore.put(cabecalho, valor);
                }
                arvores.add(arvore);
            }
        } else {
            throw new Exception("Importação não realizada");
View Full Code Here

    public List<Arvore> getUpdatedArvores() throws Exception {
        List<Arvore> arvores = Collections.synchronizedList(new ArrayList<Arvore>());

        Vector dv = getDataVector();
        Arvore arvore = null;
        for (Iterator it = dv.iterator(); it.hasNext();) {
            Vector<Double> object = (Vector) it.next();
            Object idArvore = object.get(0);
            if (cenario.getArvoreByID((Long) idArvore) == null) {
                arvore = new Arvore((Long) idArvore);
            } else {
                arvore = cenario.getArvoreByID((Long) idArvore);
            }
            for (int i = 1; i < object.size(); i++) {
                String chave = getColumnName(i);
                Object valor = object.get(i);
                if (valor == null || valor.equals("")) {
                    throw new Exception("Informe um número válido");
                }
                if (valor instanceof Long) {
                    Double value = ((Long) valor).doubleValue();
                    arvore.put(chave, value);
                } else if (valor instanceof String) {
                    Double value = Double.parseDouble((String) valor);
                    arvore.put(chave, value);
                } else {
                    arvore.put(chave, object.get(i));
                }
            }
            arvores.add(arvore);
        }
        return arvores;
View Full Code Here

    }

    public void addLinha() {
        long codArvore = getGreaterIdArv();
        addRow(new Object[]{codArvore});
        view.getPresenter().getContainerArvores().addArvore(new Arvore(codArvore));
        lastIdArv = codArvore;
    }
View Full Code Here

TOP

Related Classes of business.Arvore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.