From 12cc18689cb8fbc19b7bbb3f470874b4f465e7ef Mon Sep 17 00:00:00 2001 From: P Santos Date: Mon, 19 Apr 2004 11:45:52 +0000 Subject: [PATCH] no message git-svn-id: https://svn.coded.pt/svn/SIPRP@61 bb69d46d-e84e-40c8-a05a-06db0d633741 --- trunk/siprp/ficha/ExamePDF.java | 76 +++++++-------------------------- 1 file changed, 16 insertions(+), 60 deletions(-) diff --git a/trunk/siprp/ficha/ExamePDF.java b/trunk/siprp/ficha/ExamePDF.java index 5172f925..1a6859ce 100644 --- a/trunk/siprp/ficha/ExamePDF.java +++ b/trunk/siprp/ficha/ExamePDF.java @@ -8,8 +8,6 @@ import com.lowagie.text.*; import com.lowagie.text.pdf.*; public class ExamePDF { -// private static final Font FONT_BOLD = new Font( Font.TIMES_ROMAN, 9, Font.BOLD, new Color( 0, 0, 0 ) ); -// private static final Font FONT_NORMAL = new Font( Font.TIMES_ROMAN, 9, Font.NORMAL, new Color( 0, 0, 0 ) ); private static final Font FONT_BOLD = FontFactory.getFont( "Arial", 8, Font.BOLD ); private static final Font FONT_NORMAL = FontFactory.getFont( "Arial", 8, Font.NORMAL ); private static final Font FONT_ZAPFDINGBATS = new Font( Font.ZAPFDINGBATS , 12, Font.NORMAL, new Color( 0, 0, 0 ) ); @@ -122,10 +120,8 @@ public class ExamePDF { Paragraph conteudo = new Paragraph(); conteudo.add( new Chunk( "FICHA DE APTID\u00c3O\n", -// new Font( Font.TIMES_ROMAN, 10, Font.BOLD, new Color( 0, 0, 0 ) ) ) ); FontFactory.getFont( "Arial", 10, Font.BOLD ) ) ); conteudo.add( new Chunk( "(Portaria n\u00ba1031/2002, de 10 de Agosto)", -// new Font( Font.TIMES_ROMAN, 7, Font.NORMAL, new Color( 0, 0, 0 ) ) ) ); FontFactory.getFont( "Arial", 7, Font.BOLD ) ) ); conteudo.setAlignment( Element.ALIGN_CENTER ); @@ -188,7 +184,6 @@ public class ExamePDF { ph.add( new Chunk( texto.toString(), FONT_NORMAL ) ); cell.addElement( ph ); - //cell.addElement( new Phrase( 12f, texto.toString(), FONT_NORMAL ) ); table.addCell( cell ); document.add( table ); @@ -251,45 +246,25 @@ public class ExamePDF { texto.append( "TIPO\n" ); ph.add( new Chunk( texto.toString(), FONT_NORMAL ) ); - //texto = new StringBuffer( "ADMISS\u00c3O ...................................................................................... " ); - texto = new StringBuffer( "ADMISS\u00c3O\n" ); - ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_admissao" ) != null ) ); + ph.add( doCheckedPhrase( "ADMISS\u00c3O\n", values.get( "tipo_admissao" ) != null ) ); - //texto = new StringBuffer( "PERI\u00d3DICO ..................................................................................... " ); - texto = new StringBuffer( "PERI\u00d3DICO\n" ); - ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_periodico" ) != null ) ); + ph.add( doCheckedPhrase( "PERI\u00d3DICO\n", values.get( "tipo_periodico" ) != null ) ); - //texto = new StringBuffer( "OCASIONAL .................................................................................... " ); - texto = new StringBuffer( "OCASIONAL\n" ); - ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_ocasional" ) != null ) ); + ph.add( doCheckedPhrase( "OCASIONAL\n", values.get( "tipo_ocasional" ) != null ) ); - //texto = new StringBuffer( " AP\u00d3S DOEN\u00c7A ...................................................................... " ); - texto = new StringBuffer( "AP\u00d3S DOEN\u00c7A\n" ); - ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_apos_doenca" ) != null, true ) ); + ph.add( doCheckedPhrase( "AP\u00d3S DOEN\u00c7A\n", values.get( "tipo_apos_doenca" ) != null, true ) ); - //texto = new StringBuffer( " AP\u00d3S ACIDENTE ................................................................... " ); - texto = new StringBuffer( "AP\u00d3S ACIDENTE\n" ); - ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_apos_acidente" ) != null, true ) ); + ph.add( doCheckedPhrase( "AP\u00d3S ACIDENTE\n", values.get( "tipo_apos_acidente" ) != null, true ) ); - //texto = new StringBuffer( " A PEDIDO DO TRABALHADOR ............................................. " ); - texto = new StringBuffer( "A PEDIDO DO TRABALHADOR\n" ); - ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_pedido_trabalhador" ) != null, true ) ); + ph.add( doCheckedPhrase( "A PEDIDO DO TRABALHADOR\n", values.get( "tipo_pedido_trabalhador" ) != null, true ) ); - //texto = new StringBuffer( " A PEDIDO DO SERVI\u00c7O ........................................................ " ); - texto = new StringBuffer( "A PEDIDO DO SERVI\u00c7O\n" ); - ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_pedido_empresa" ) != null, true ) ); + ph.add( doCheckedPhrase( "A PEDIDO DO SERVI\u00c7O\n", values.get( "tipo_pedido_empresa" ) != null, true ) ); - //texto = new StringBuffer( " POR MUDAN\u00c7A DE FUN\u00c7\u00c3O ................................................ " ); - texto = new StringBuffer( "POR MUDAN\u00c7A DE FUN\u00c7\u00c3O\n" ); - ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_mudanca_funcao" ) != null, true ) ); + ph.add( doCheckedPhrase( "POR MUDAN\u00c7A DE FUN\u00c7\u00c3O\n", values.get( "tipo_mudanca_funcao" ) != null, true ) ); - //texto = new StringBuffer( " POR ALTERA\u00c7\u00c3O DAS CONDI\u00c7\u00d5ES DE TRABALHO ......... " ); - texto = new StringBuffer( "POR ALTERA\u00c7\u00c3O DAS CONDI\u00c7\u00d5ES DE TRABALHO\n" ); - ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_trabalho" ) != null, true ) ); + ph.add( doCheckedPhrase( "POR ALTERA\u00c7\u00c3O DAS CONDI\u00c7\u00d5ES DE TRABALHO\n", values.get( "tipo_trabalho" ) != null, true ) ); - //texto = new StringBuffer( "OUTRO ............................................................................................ " ); - texto = new StringBuffer( "OUTRO\n" ); - ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_outro" ) != null ) ); + ph.add( doCheckedPhrase( "OUTRO\n", values.get( "tipo_outro" ) != null ) ); texto = new StringBuffer(); texto.append( "ESPECIFIQUE: " @@ -298,27 +273,16 @@ public class ExamePDF { ph.add( new Chunk( texto.toString(), FONT_NORMAL ) ); table.addCell( ph ); - //table.addCell( new Phrase( texto.toString(), FONT_NORMAL ) ); - texto = new StringBuffer(); ph = new Phrase( 12f ); - texto.append( "RESULTADO\n" ); - ph.add( new Chunk( texto.toString(), FONT_NORMAL ) ); - //texto = new StringBuffer( "\nAPTO ............................................................................................ " ); - texto = new StringBuffer( "APTO\n" ); - ph.add( doCheckedPhrase( texto.toString(), values.get( "resultado_apto" ) != null ) ); + ph.add( new Chunk( "RESULTADO\n", FONT_NORMAL ) ); + ph.add( doCheckedPhrase( "APTO\n", values.get( "resultado_apto" ) != null ) ); - //texto = new StringBuffer( "\nAPTO CONDICIONALMENTE ..................................................... " ); - texto = new StringBuffer( "APTO CONDICIONALMENTE\n\n" ); - ph.add( doCheckedPhrase( texto.toString(), values.get( "resultado_apto_condicionalmente" ) != null ) ); + ph.add( doCheckedPhrase( "APTO CONDICIONALMENTE\n\n", values.get( "resultado_apto_condicionalmente" ) != null ) ); - //texto = new StringBuffer( "INAPTO TEMPORARIAMENTE ................................................... " ); - texto = new StringBuffer( "INAPTO TEMPORARIAMENTE\n" ); - ph.add( doCheckedPhrase( texto.toString(), values.get( "resultado_inapto_temp" ) != null ) ); + ph.add( doCheckedPhrase( "INAPTO TEMPORARIAMENTE\n", values.get( "resultado_inapto_temp" ) != null ) ); - //texto = new StringBuffer( "INAPTO DEFINITIVAMENTE ....................................................... " ); - texto = new StringBuffer( "INAPTO DEFINITIVAMENTE\n\n" ); - ph.add( doCheckedPhrase( texto.toString(), values.get( "resultado_inapto_def" ) != null ) ); + ph.add( doCheckedPhrase( "INAPTO DEFINITIVAMENTE\n\n", values.get( "resultado_inapto_def" ) != null ) ); texto = new StringBuffer(); texto.append( "OUTRAS FUN\u00c7\u00d5ES QUE PODE DESEMPENHAR\n" ); @@ -331,7 +295,6 @@ public class ExamePDF { texto.append( " 4 " + ( ( values.get( "outra_funcao_4" ) == null ) ? "" : values.get( "outra_funcao_4" ) ) + "" ); ph.add( new Chunk( texto.toString(), FONT_NORMAL ) ); -// table.addCell( new Phrase( 14f, texto.toString(), FONT_NORMAL ) ); table.addCell( ph ); document.add( table ); @@ -384,14 +347,7 @@ public class ExamePDF { private Phrase doCheckedPhrase( String text, boolean checked, boolean indent ) { Phrase p = new Phrase( 12f ); - if( indent ) - { - p.add( new Chunk( " " + ( char )( checked? 110: 111) + " ", FONT_ZAPFDINGBATS ) ); - } - else - { - p.add( new Chunk( "" + ( char )( checked? 110: 111) + " ", FONT_ZAPFDINGBATS ) ); - } + p.add( new Chunk( ( indent ? " " : "" ) + ( char )( checked? 110: 111) + " ", FONT_ZAPFDINGBATS ) ); p.add( new Chunk( text, FONT_NORMAL ) ); return p; }