use of model.dao.RequisitoDAO in project specify by rhebecaabreu.
the class CartaoEstoria method criaPDF.
public void criaPDF(JTable table_1, java.util.List<Integer> codigosReq) throws FileNotFoundException, DocumentException {
Document document = new Document();
try {
document.setPageSize(PageSize.A4);
document.setMargins(50, 50, 50, 50);
nomepdf = MeusProjetos.getNome_pdf() + ".pdf";
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(nomepdf));
ModelPDFRodape mf = new ModelPDFRodape();
mf.setTopo("Specify");
writer.setPageEvent(mf);
document.open();
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
Date date = new Date();
String data = dateFormat.format(date);
RequisitoDAO rdao = new RequisitoDAO();
Font f = FontFactory.getFont(FontFactory.HELVETICA, 13, Font.NORMAL);
Font ff = FontFactory.getFont(FontFactory.HELVETICA, 13, Font.BOLD);
Paragraph title2 = new Paragraph("Cartões de Estória", FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLD));
title2.setAlignment(Element.ALIGN_CENTER);
Chapter chapter2 = new Chapter(title2, 2);
chapter2.setNumberDepth(0);
ProjetoDAO pread = new ProjetoDAO();
for (Requisito r : rdao.readOrderBy()) {
for (Projeto p : pread.read()) {
for (int i = 0; i < codigosReq.size(); i++) {
if (r.getProjcodigo() == p.getCodigo() && r.getCodigo() == codigosReq.get(0)) {
Paragraph title_project2 = new Paragraph("Projeto: " + p.getNome(), FontFactory.getFont(FontFactory.HELVETICA, 16, Font.BOLD));
title_project2.setAlignment(Element.ALIGN_CENTER);
chapter2.add(title_project2);
break;
}
}
}
}
Paragraph data_hora2 = new Paragraph("Gerado em " + data, FontFactory.getFont(FontFactory.HELVETICA, 14, Font.NORMAL));
data_hora2.setAlignment(Element.ALIGN_CENTER);
chapter2.add(data_hora2);
Paragraph listUserStories = new Paragraph("Lista de Cartões de Estória", FontFactory.getFont(FontFactory.HELVETICA, 14, Font.NORMAL));
Section section2 = chapter2.addSection(listUserStories);
for (Requisito r : rdao.readOrderBy()) {
if (table_1.getSelectedRow() != -1) {
for (int j = 0; j < (codigosReq.size()); j++) {
if (r.getCodigo() == codigosReq.get(j)) {
Paragraph p = new Paragraph();
Paragraph q = new Paragraph();
Paragraph rr = new Paragraph();
Paragraph s = new Paragraph();
Paragraph t = new Paragraph();
p.setFont(ff);
p.add("Identificador: ");
p.setFont(f);
p.add(r.getId());
p.setFont(ff);
p.add(" Código: ");
p.setFont(f);
p.add(String.valueOf(r.getCodigo()));
q.setFont(ff);
q.add("Como um " + r.getSujeito() + " eu quero " + r.getAcaoRestricao() + " a fim de " + r.getValorRazao());
Paragraph qq = new Paragraph();
qq.setFont(ff);
qq.add("Estimativa: ");
qq.setFont(f);
qq.add(r.getEstimativa() + " hora(s)");
rr.setFont(ff);
rr.add("Grau Prioridade: ");
rr.setFont(f);
rr.add(r.getGrauPrioridade().toString());
s.setFont(ff);
s.add("Grau Dificuldade: ");
s.setFont(f);
s.add(r.getGrauDificuldade().toString());
t = new Paragraph(" ");
section2.add(p);
section2.add(q);
section2.add(rr);
section2.add(s);
section2.add(t);
}
}
}
}
document.add(chapter2);
document.add(Chunk.NEXTPAGE);
} catch (DocumentException ex) {
System.out.println("Error:" + ex);
} catch (FileNotFoundException ex) {
System.out.println("Error:" + ex);
} finally {
document.close();
}
try {
Desktop.getDesktop().open(new File(nomepdf));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
use of model.dao.RequisitoDAO in project specify by rhebecaabreu.
the class DocumentoReqCartaoEstoria method criaPDF.
/**
* @param args
* @throws FileNotFoundException
* @throws DocumentException
* @throws IOException
* @throws MalformedURLException
*/
public void criaPDF(JTable table_1, java.util.List<Integer> codigosReq) throws FileNotFoundException, DocumentException {
// Listing 1. Instantiation of document object
Document document = new Document();
try {
document.setPageSize(PageSize.A4);
document.setMargins(50, 50, 50, 50);
nomepdf = MeusProjetos.getNome_pdf() + ".pdf";
// Listing 2. Creation of PdfWriter object
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(nomepdf));
ModelPDFRodape mf = new ModelPDFRodape();
mf.setTopo("Specify");
writer.setPageEvent(mf);
document.open();
// Listing 3. Creation of chapter object
Paragraph title1 = new Paragraph("Documento de Requisitos", FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLD));
title1.setAlignment(Element.ALIGN_CENTER);
Chapter chapter1 = new Chapter(title1, 1);
chapter1.setNumberDepth(0);
// Listing 4. Creation of section object
RequisitoDAO rrdao = new RequisitoDAO();
// Listing 4. Creation of section object
ProjetoDAO pread = new ProjetoDAO();
for (Requisito r : rrdao.readOrderBy()) {
for (Projeto p : pread.read()) {
for (int i = 0; i < codigosReq.size(); i++) {
if (r.getProjcodigo() == p.getCodigo() && r.getCodigo() == codigosReq.get(0)) {
Paragraph title_project2 = new Paragraph("Projeto: " + p.getNome(), FontFactory.getFont(FontFactory.HELVETICA, 16, Font.BOLD));
title_project2.setAlignment(Element.ALIGN_CENTER);
chapter1.add(title_project2);
break;
}
}
}
}
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
Date date = new Date();
String data = dateFormat.format(date);
Paragraph data_hora = new Paragraph("Gerado em " + data, FontFactory.getFont(FontFactory.HELVETICA, 14, Font.NORMAL));
data_hora.setAlignment(Element.ALIGN_CENTER);
chapter1.add(data_hora);
Paragraph listRequirement = new Paragraph("Lista de Requisitos", FontFactory.getFont(FontFactory.HELVETICA, 14, Font.NORMAL));
Section section1 = chapter1.addSection(listRequirement);
RequisitoDAO rdao = new RequisitoDAO();
Font f = FontFactory.getFont(FontFactory.HELVETICA, 13, Font.NORMAL);
Font ff = FontFactory.getFont(FontFactory.HELVETICA, 13, Font.BOLD);
for (Requisito r : rdao.readOrderBy()) {
if (table_1.getSelectedRow() != -1) {
for (int j = 0; j < (codigosReq.size()); j++) {
if (r.getCodigo() == codigosReq.get(j)) {
if (r.getTipoReq().toString().equals("FUNCIONAL")) {
Paragraph o = new Paragraph();
o.setFont(ff);
o.add("Tipo de Requisito: ");
o.setFont(f);
o.add("Funcional" + " ");
o.setFont(ff);
o.add(" Código: ");
o.setFont(f);
o.add(String.valueOf(r.getCodigo()));
section1.add(o);
}
if (r.getTipoReq().toString().equals("NAOFUNCIONAL")) {
Paragraph o = new Paragraph();
o.setFont(ff);
o.add("Tipo de Requisito: ");
o.setFont(f);
o.add("Não-funcional" + " ");
o.setFont(ff);
o.add(" Código: ");
o.setFont(f);
o.add(String.valueOf(r.getCodigo()));
section1.add(o);
}
if (r.getTipoReq().toString().equals("USUARIO")) {
Paragraph o = new Paragraph();
o.setFont(ff);
o.add("Tipo de Requisito: ");
o.setFont(f);
o.add(" Usuário" + " ");
o.setFont(ff);
o.add(" Código: ");
o.setFont(f);
o.add(String.valueOf(r.getCodigo()));
section1.add(o);
}
if (r.getTipoReq().toString().equals("NEGOCIO")) {
Paragraph o = new Paragraph();
o.setFont(ff);
o.add("Tipo de Requisito: ");
o.setFont(f);
o.add(" Negócio" + " ");
o.setFont(ff);
o.add(" Código: ");
o.setFont(f);
o.add(String.valueOf(r.getCodigo()));
section1.add(o);
}
Paragraph p = new Paragraph();
Paragraph q = new Paragraph();
Paragraph rr = new Paragraph();
Paragraph s = new Paragraph();
Paragraph t = new Paragraph();
p.setFont(ff);
p.add("Identificador: ");
p.setFont(f);
p.add(r.getId());
q.setFont(ff);
q.add("O(a) " + r.getSujeito() + " deve ser capaz de " + r.getAcaoRestricao() + " para " + r.getValorRazao());
rr.setFont(ff);
rr.add("Grau Prioridade: ");
rr.setFont(f);
rr.add(r.getGrauPrioridade().toString());
s.setFont(ff);
s.add("Grau Dificuldade: ");
s.setFont(f);
s.add(r.getGrauDificuldade().toString());
t = new Paragraph(" ");
section1.add(p);
section1.add(q);
section1.add(rr);
section1.add(s);
section1.add(t);
}
}
}
}
// Listing 3. Creation of chapter object
Paragraph title2 = new Paragraph("Cartões de Estória", FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLD));
title2.setAlignment(Element.ALIGN_CENTER);
Chapter chapter2 = new Chapter(title2, 2);
chapter2.setNumberDepth(0);
for (Requisito r : rrdao.readOrderBy()) {
for (Projeto p : pread.read()) {
for (int i = 0; i < codigosReq.size(); i++) {
if (r.getProjcodigo() == p.getCodigo() && r.getCodigo() == codigosReq.get(0)) {
Paragraph title_project2 = new Paragraph("Projeto: " + p.getNome(), FontFactory.getFont(FontFactory.HELVETICA, 16, Font.BOLD));
title_project2.setAlignment(Element.ALIGN_CENTER);
chapter2.add(title_project2);
break;
}
}
}
}
Paragraph data_hora2 = new Paragraph("Gerado em " + data, FontFactory.getFont(FontFactory.HELVETICA, 14, Font.NORMAL));
data_hora2.setAlignment(Element.ALIGN_CENTER);
chapter2.add(data_hora2);
Paragraph listUserStories = new Paragraph("Lista de Cartões de Estória", FontFactory.getFont(FontFactory.HELVETICA, 14, Font.NORMAL));
Section section2 = chapter2.addSection(listUserStories);
for (Requisito r : rdao.readOrderBy()) {
if (table_1.getSelectedRow() != -1) {
for (int j = 0; j < (codigosReq.size()); j++) {
if (r.getCodigo() == codigosReq.get(j)) {
Paragraph p = new Paragraph();
Paragraph q = new Paragraph();
Paragraph rr = new Paragraph();
Paragraph s = new Paragraph();
Paragraph t = new Paragraph();
p.setFont(ff);
p.add("Identificador: ");
p.setFont(f);
p.add(r.getId());
p.setFont(ff);
p.add(" Código: ");
p.setFont(f);
p.add(String.valueOf(r.getCodigo()));
q.setFont(ff);
q.add("Como um " + r.getSujeito() + " eu quero " + r.getAcaoRestricao() + " a fim de " + r.getValorRazao());
Paragraph qq = new Paragraph();
qq.setFont(ff);
qq.add("Estimativa: ");
qq.setFont(f);
qq.add(r.getEstimativa() + " hora(s)");
rr.setFont(ff);
rr.add("Grau Prioridade: ");
rr.setFont(f);
rr.add(r.getGrauPrioridade().toString());
s.setFont(ff);
s.add("Grau Dificuldade: ");
s.setFont(f);
s.add(r.getGrauDificuldade().toString());
t = new Paragraph(" ");
// Paragraph p = new Paragraph();
section2.add(p);
section2.add(q);
section2.add(qq);
section2.add(rr);
section2.add(s);
section2.add(t);
}
}
}
}
// Listing 5. Addition of a chapter to the main document
document.add(chapter1);
document.add(chapter2);
document.add(Chunk.NEXTPAGE);
} catch (DocumentException ex) {
System.out.println("Error:" + ex);
} catch (FileNotFoundException ex) {
System.out.println("Error:" + ex);
} finally {
document.close();
}
try {
Desktop.getDesktop().open(new File(nomepdf));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
use of model.dao.RequisitoDAO in project specify by rhebecaabreu.
the class PopupHandler method deletarProjeto.
private void deletarProjeto(String recebenode) {
// TreePath path = ((JTree) nodeInfo).getPathForLocation ( getX (), getY () );
ProjetoDAO dao = new ProjetoDAO();
RequisitoDAO rdao = new RequisitoDAO();
MeusProjetos mp = new MeusProjetos();
InteressadoProjetoDAO ipdao = new InteressadoProjetoDAO();
for (Projeto p : dao.readName()) {
if (recebenode.equals(p.getNome())) {
int resposta = JOptionPane.showConfirmDialog(null, "Ao deletar um projeto todos os requisitos e interessados associados a ele serão removidos. \nDeseja realmente deletar o projeto " + p.getNome() + "?", "Atenção", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if (resposta == JOptionPane.YES_OPTION) {
// deletar primeiro os requisitos ligados ao projeto
for (Requisito r : rdao.readID()) {
if (p.getCodigo() == r.getProjcodigo()) {
rdao.delete(r.getId());
}
}
// deletar os interessados
for (InteressadoProjeto ip : ipdao.buscaInteressados()) {
if (p.getCodigo() == (ip.getCodProj())) {
ipdao.delete(ip.getCodProj());
}
}
// deletar o projeto
dao.delete(p.getCodigo());
mp.atualizaArvore(tree);
mp.atualizaProjeto(tableproj);
}
}
}
}
use of model.dao.RequisitoDAO in project specify by rhebecaabreu.
the class CadastrarRequisito method save.
// Salva os dados digitados pelo usuário no banco de dados
public void save(JComboBox comboBox, String rf, String rnf, String ru, String rn, JRadioButton gpBaixa, JRadioButton gpMedia, JRadioButton gpAlta, JRadioButton gdBaixa, JRadioButton gdMdia, JRadioButton gdAlta) {
RequisitoDAO dao = new RequisitoDAO();
ProjetoDAO pdao = new ProjetoDAO();
int codeProj = 0;
if (tree.isSelectionEmpty()) {
JOptionPane.showMessageDialog(null, "Por favor, primeiro clique em um dos projetos ao lado!", "Erro", JOptionPane.ERROR_MESSAGE);
dispose();
} else {
String nodeSelected = tree.getLastSelectedPathComponent().toString();
node5 = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
Object nodeInfo = node5.getParent();
for (Projeto p : pdao.readName()) {
if (nodeSelected.equals(p.getNome())) {
nreq.setProjcodigo(p.getCodigo());
codeProj = p.getCodigo();
break;
}
if (nodeSelected.equals("Requisitos") && nodeInfo.toString().equals(p.getNome())) {
nreq.setProjcodigo(p.getCodigo());
codeProj = p.getCodigo();
break;
}
}
if (recebeID.getText().toString() == null || recebeID.getText().toString().isEmpty()) {
JOptionPane.showMessageDialog(null, "Insira a identificação do requisito!", "Erro", JOptionPane.ERROR_MESSAGE);
recebeID.setBorder(new LineBorder(Color.RED));
} else {
nreq.setId(recebeID.getText());
recebeID.setBorder(new LineBorder(Color.GRAY));
if (recebeSujeito.getText().toString() == null || recebeSujeito.getText().toString().isEmpty()) {
JOptionPane.showMessageDialog(null, "Insira o sujeito do requisito!", "Erro", JOptionPane.ERROR_MESSAGE);
recebeSujeito.setBorder(new LineBorder(Color.RED));
} else {
nreq.setSujeito(recebeSujeito.getText());
recebeSujeito.setBorder(new LineBorder(Color.GRAY));
if (recebeAcaoRestri.getText().toString() == null || recebeAcaoRestri.getText().toString().isEmpty()) {
JOptionPane.showMessageDialog(null, "Insira a ação e/ou restrição do requisito!", "Erro", JOptionPane.ERROR_MESSAGE);
recebeAcaoRestri.setBorder(new LineBorder(Color.RED));
} else {
nreq.setAcaoRestricao(recebeAcaoRestri.getText());
recebeAcaoRestri.setBorder(new LineBorder(Color.GRAY));
if (recebeValorRazao.getText().toString() == null || recebeValorRazao.getText().toString().isEmpty()) {
JOptionPane.showMessageDialog(null, "Insira o valor ou razão do requisito!", "Erro", JOptionPane.ERROR_MESSAGE);
recebeValorRazao.setBorder(new LineBorder(Color.RED));
} else {
recebeValorRazao.setBorder(new LineBorder(Color.GRAY));
if (((!gpBaixa.isSelected()) && (!gpMedia.isSelected()) && (!gpAlta.isSelected())) || ((!gdBaixa.isSelected()) && (!gdMdia.isSelected()) && (!gdAlta.isSelected()))) {
JOptionPane.showMessageDialog(null, "Insira o grau de prioridade e/ou grau de dificuldade!", "Erro", JOptionPane.ERROR_MESSAGE);
} else {
nreq.setValorRazao(recebeValorRazao.getText());
if (comboBox.getSelectedItem() == rf) {
nreq.setTipoReq(TipoReq.FUNCIONAL);
}
if (comboBox.getSelectedItem() == rnf) {
nreq.setTipoReq(TipoReq.NAOFUNCIONAL);
}
if (comboBox.getSelectedItem() == ru) {
nreq.setTipoReq(TipoReq.USUARIO);
}
if (comboBox.getSelectedItem() == rn) {
nreq.setTipoReq(TipoReq.NEGOCIO);
}
// setando grau de dificuldade
if (gdBaixa.isSelected()) {
nreq.setGrauDificuldade(GrauD.BAIXA);
}
if (gdMdia.isSelected()) {
nreq.setGrauDificuldade(GrauD.MEDIA);
}
if (gdAlta.isSelected()) {
nreq.setGrauDificuldade(GrauD.ALTA);
}
// setando grau de prioridade
if (gpBaixa.isSelected()) {
nreq.setGrauPrioridade(GrauP.BAIXA);
}
if (gpMedia.isSelected()) {
nreq.setGrauPrioridade(GrauP.MEDIA);
}
if (gpAlta.isSelected()) {
nreq.setGrauPrioridade(GrauP.ALTA);
}
if (recebeEstimativa.getText().toString().isEmpty()) {
recebeEstimativa.setText("0");
}
nreq.setEstimativa(Integer.parseInt(recebeEstimativa.getText().toString()));
nreq.setId_usuario(Login.getId_usuario());
dao.create(nreq);
MeusProjetos mp = new MeusProjetos();
mp.atualizaRequisito(codeProj, tableModel);
int resposta = JOptionPane.showConfirmDialog(null, "Deseja cadastrar um novo requisito para este mesmo projeto?", "Cadastrar novo requisito", JOptionPane.YES_NO_OPTION);
if (resposta == JOptionPane.YES_OPTION) {
// limpa campos para cadastrar novo requisito
recebeID.setText("");
recebeSujeito.setText("");
recebeAcaoRestri.setText("");
recebeValorRazao.setText("");
recebeEstimativa.setText("");
}
if (resposta == JOptionPane.NO_OPTION) {
dispose();
}
}
}
}
}
}
}
}
use of model.dao.RequisitoDAO in project specify by rhebecaabreu.
the class DocumentoReq method criaPDF.
/**
* @param args
* @throws FileNotFoundException
* @throws DocumentException
* @throws IOException
* @throws MalformedURLException
*/
public void criaPDF(JTable table_1, java.util.List<Integer> codigosReq) throws FileNotFoundException, DocumentException {
// Listing 1. Instantiation of document object
Document document = new Document();
try {
document.setPageSize(PageSize.A4);
document.setMargins(50, 50, 50, 50);
nomepdf = MeusProjetos.getNome_pdf() + ".pdf";
// Listing 2. Creation of PdfWriter object
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(nomepdf));
ModelPDFRodape mf = new ModelPDFRodape();
mf.setTopo("Specify");
writer.setPageEvent(mf);
document.open();
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
Date date = new Date();
String data = dateFormat.format(date);
// Listing 3. Creation of chapter object
Paragraph title1 = new Paragraph("JTFieldOnlyNumbers de Requisitos", FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLD));
title1.setAlignment(Element.ALIGN_CENTER);
Chapter chapter1 = new Chapter(title1, 1);
chapter1.setNumberDepth(0);
RequisitoDAO rdao = new RequisitoDAO();
// Listing 4. Creation of section object
ProjetoDAO pread = new ProjetoDAO();
for (Requisito r : rdao.readOrderBy()) {
for (Projeto p : pread.read()) {
for (int i = 0; i < codigosReq.size(); i++) {
if (r.getProjcodigo() == p.getCodigo() && r.getCodigo() == codigosReq.get(0)) {
Paragraph title_project2 = new Paragraph("Projeto: " + p.getNome(), FontFactory.getFont(FontFactory.HELVETICA, 16, Font.BOLD));
title_project2.setAlignment(Element.ALIGN_CENTER);
chapter1.add(title_project2);
break;
}
}
}
}
Paragraph data_hora = new Paragraph("Gerado em " + data, FontFactory.getFont(FontFactory.HELVETICA, 14, Font.NORMAL));
data_hora.setAlignment(Element.ALIGN_CENTER);
chapter1.add(data_hora);
Paragraph listRequirement = new Paragraph("Lista de Requisitos", FontFactory.getFont(FontFactory.HELVETICA, 14, Font.NORMAL));
Section section1 = chapter1.addSection(listRequirement);
RequisitoDAO rrdao = new RequisitoDAO();
Font f = FontFactory.getFont(FontFactory.HELVETICA, 13, Font.NORMAL);
Font ff = FontFactory.getFont(FontFactory.HELVETICA, 13, Font.BOLD);
for (Requisito r : rrdao.readOrderBy()) {
if (table_1.getSelectedRow() != -1) {
for (int j = 0; j < (codigosReq.size()); j++) {
if (r.getCodigo() == codigosReq.get(j)) {
if (r.getTipoReq().toString().equals("FUNCIONAL")) {
Paragraph o = new Paragraph();
o.setFont(ff);
o.add("Tipo de Requisito: ");
o.setFont(f);
o.add("Funcional" + " ");
o.setFont(ff);
o.add(" Código: ");
o.setFont(f);
o.add(String.valueOf(r.getCodigo()));
section1.add(o);
}
if (r.getTipoReq().toString().equals("NAOFUNCIONAL")) {
Paragraph o = new Paragraph();
o.setFont(ff);
o.add("Tipo de Requisito: ");
o.setFont(f);
o.add("Não-funcional" + " ");
o.setFont(ff);
o.add(" Código: ");
o.setFont(f);
o.add(String.valueOf(r.getCodigo()));
section1.add(o);
}
if (r.getTipoReq().toString().equals("USUARIO")) {
Paragraph o = new Paragraph();
o.setFont(ff);
o.add("Tipo de Requisito: ");
o.setFont(f);
o.add(" Usuário" + " ");
o.setFont(ff);
o.add(" Código: ");
o.setFont(f);
o.add(String.valueOf(r.getCodigo()));
section1.add(o);
}
if (r.getTipoReq().toString().equals("NEGOCIO")) {
Paragraph o = new Paragraph();
o.setFont(ff);
o.add("Tipo de Requisito: ");
o.setFont(f);
o.add(" Negócio" + " ");
o.setFont(ff);
o.add(" Código: ");
o.setFont(f);
o.add(String.valueOf(r.getCodigo()));
section1.add(o);
}
Paragraph p = new Paragraph();
Paragraph q = new Paragraph();
Paragraph rr = new Paragraph();
Paragraph s = new Paragraph();
Paragraph t = new Paragraph();
p.setFont(ff);
p.add("Identificador: ");
p.setFont(f);
p.add(r.getId());
q.setFont(ff);
q.add("O(a) " + r.getSujeito() + " deve ser capaz de " + r.getAcaoRestricao() + " para " + r.getValorRazao());
rr.setFont(ff);
rr.add("Grau Prioridade: ");
rr.setFont(f);
rr.add(r.getGrauPrioridade().toString());
s.setFont(ff);
s.add("Grau Dificuldade: ");
s.setFont(f);
s.add(r.getGrauDificuldade().toString());
t = new Paragraph(" ");
section1.add(p);
section1.add(q);
section1.add(rr);
section1.add(s);
section1.add(t);
}
}
}
}
// Listing 5. Addition of a chapter to the main document
document.add(chapter1);
document.add(Chunk.NEXTPAGE);
} catch (DocumentException ex) {
System.out.println("Error:" + ex);
} catch (FileNotFoundException ex) {
System.out.println("Error:" + ex);
} finally {
document.close();
}
try {
Desktop.getDesktop().open(new File(nomepdf));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Aggregations