diff --git a/trunk/SIPRPSoft/src/siprp/higiene/gestao/equipamentos/AdicionarEquipamentosPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/gestao/equipamentos/AdicionarEquipamentosPanel.java index 639d4a91..d79dd5c8 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/gestao/equipamentos/AdicionarEquipamentosPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/gestao/equipamentos/AdicionarEquipamentosPanel.java @@ -24,7 +24,6 @@ import leaf.ui.TreeTools; import siprp.database.cayenne.objects.HsEquipamento; import siprp.database.cayenne.objects.HsRelatorio; import siprp.database.cayenne.objects.HsRelatorioEquipamento; -import siprp.higiene.HigieneDataProvider; import siprp.logic.HigieneSegurancaLogic; import siprp.logic.node.EquipamentoNode; @@ -74,9 +73,9 @@ public class AdicionarEquipamentosPanel extends JPanel private void setupLayout() { TableLayout layout = new TableLayout( new double[] { - TableLayout.MINIMUM, TableLayout.FILL + TableLayout.FILL }, new double[] { - TableLayout.FILL + TableLayout.MINIMUM, TableLayout.FILL } ); layout.setHGap( 5 ); layout.setVGap( 5 ); @@ -87,18 +86,18 @@ public class AdicionarEquipamentosPanel extends JPanel { JPanel panel = new JPanel(); TableLayout layout = new TableLayout( new double[] { - TableLayout.MINIMUM + TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL }, new double[] { - TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL + TableLayout.MINIMUM } ); layout.setHGap( 5 ); layout.setVGap( 5 ); panel.setLayout( layout ); panel.add( buttonAdicionar, new TableLayoutConstraints( 0, 0 ) ); - panel.add( buttonRemover, new TableLayoutConstraints( 0, 1 ) ); + panel.add( buttonRemover, new TableLayoutConstraints( 1, 0 ) ); add( panel, new TableLayoutConstraints( 0, 0 ) ); - add( scroll, new TableLayoutConstraints( 1, 0 ) ); + add( scroll, new TableLayoutConstraints( 0, 1 ) ); } private void startupListeners() diff --git a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/GerirMedidasRelatorioPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/GerirMedidasRelatorioPanel.java index d975e781..e81c714a 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/GerirMedidasRelatorioPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/GerirMedidasRelatorioPanel.java @@ -7,7 +7,6 @@ import java.awt.Color; import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.Currency; import javax.swing.JPanel; import javax.swing.JScrollPane; @@ -22,8 +21,8 @@ import javax.swing.tree.TreeSelectionModel; import leaf.ui.LeafButton; import leaf.ui.LeafError; +import leaf.ui.LeafIconButton; import leaf.ui.TreeTools; -import siprp.database.cayenne.objects.HsMedida; import siprp.database.cayenne.objects.HsRelatorioMedida; import siprp.database.cayenne.objects.HsRelatorioPosto; import siprp.database.cayenne.objects.HsRelatorioPostoMedida; @@ -42,9 +41,13 @@ public class GerirMedidasRelatorioPanel extends JPanel public static final String VALUE_CHANGED = "VALUE_CHANGED"; - private final LeafButton buttonAdicionar = new LeafButton( "Adicionar" ); + private static final String ICON_NAME_SAVE = "siprp/higiene/gestao/add.png"; - private final LeafButton buttonRemover = new LeafButton( "Remover" ); + private static final String ICON_NAME_REVERT = "siprp/higiene/gestao/delete.png"; + + private final LeafButton buttonAdicionar = LeafIconButton.createButton( ICON_NAME_SAVE ); + + private final LeafButton buttonRemover = LeafIconButton.createButton( ICON_NAME_REVERT ); private final DefaultMutableTreeNode root = new DefaultMutableTreeNode(); @@ -137,7 +140,7 @@ public class GerirMedidasRelatorioPanel extends JPanel { JPanel panel = new JPanel(); TableLayout layout = new TableLayout( new double[] { - TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM + TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL }, new double[] { TableLayout.MINIMUM } ); @@ -145,7 +148,7 @@ public class GerirMedidasRelatorioPanel extends JPanel layout.setVGap( 5 ); panel.setLayout( layout ); panel.add( buttonAdicionar, new TableLayoutConstraints( 0, 0 ) ); - panel.add( buttonRemover, new TableLayoutConstraints( 2, 0 ) ); + panel.add( buttonRemover, new TableLayoutConstraints( 1, 0 ) ); add( panel, new TableLayoutConstraints( 0, 0 ) ); add( scroll, new TableLayoutConstraints( 0, 1 ) ); @@ -315,6 +318,7 @@ public class GerirMedidasRelatorioPanel extends JPanel } } setEnabled(); + TreeTools.sort( root ); TreeTools.refreshTree( tree, root ); if( selectedMedida != null ) { diff --git a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/PanelRelatorio.java b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/PanelRelatorio.java index 8cc35192..e11e3f42 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/PanelRelatorio.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/PanelRelatorio.java @@ -10,9 +10,12 @@ import info.clearthought.layout.TableLayout; import info.clearthought.layout.TableLayoutConstraints; import java.awt.Component; +import java.awt.Cursor; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.io.File; +import java.io.FileOutputStream; import java.text.SimpleDateFormat; import java.util.Date; import java.util.EventObject; @@ -20,6 +23,8 @@ import java.util.List; import javax.swing.BorderFactory; import javax.swing.ButtonGroup; +import javax.swing.JFileChooser; +import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; @@ -38,7 +43,8 @@ import siprp.database.cayenne.objects.HsRelatorio; import siprp.database.cayenne.objects.MarcacoesEstabelecimento; import siprp.database.cayenne.objects.MarcacoesTecnicosHst; import siprp.higiene.gestao.equipamentos.AdicionarEquipamentosPanel; -import siprp.medicina.processo.mail.MailSender; +import siprp.medicina.processo.mail.MailDialog; +import siprp.planoactuacao.print.PlanoActuacaoPDFCreator; import com.evolute.utils.ui.calendar.JCalendarPanel; @@ -50,6 +56,7 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe private static final String ICON_NAME_SAVE = "siprp/higiene/gestao/riscos/save.png"; private static final String ICON_NAME_REVERT = "siprp/higiene/gestao/riscos/revert.png"; private static final String ICON_NAME_SUBMIT = "siprp/higiene/relatorio/submit.png"; + private static final String ICON_NAME_PDF = "siprp/higiene/relatorio/adobe_reader.png"; private final JCalendarPanel dataRelatorio = new JCalendarPanel( null ); @@ -69,6 +76,8 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe private final LeafIconButton buttonSave = LeafIconButton.createButton( ICON_NAME_SAVE ); private final LeafIconButton buttonRevert = LeafIconButton.createButton( ICON_NAME_REVERT ); private final LeafIconButton buttonSubmit = LeafIconButton.createButton( "Submeter plano de actua" + ccedil + atilde + "o", ICON_NAME_SUBMIT ); + private final LeafIconButton buttonPdfPlano = LeafIconButton.createButton( "Plano de actua" + ccedil + atilde + "o", ICON_NAME_PDF ); + private final LeafIconButton buttonPdfRelatorio = LeafIconButton.createButton( "Relat" + oacute + "rio", ICON_NAME_PDF ); private final AdicionarEquipamentosPanel panelEquipamentos = new AdicionarEquipamentosPanel(); @@ -92,6 +101,7 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe private void startupComponents() { + buttonPdfRelatorio.setEnabled( false ); dataRelatorio.setPreferredSize( new Dimension( 150, 0 ) ); panelEquipamentos.setPreferredSize( new Dimension( 400, 0 ) ); bg.add( radioInicial ); @@ -135,7 +145,7 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe panelAcompanhantes.add( fieldFuncao2, new TableLayoutConstraints( 3, 1 ) ); TableLayout layout = new TableLayout( new double[] { - TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM + TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.MINIMUM }, new double[] { TableLayout.MINIMUM } ); @@ -146,7 +156,9 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe panel.add( buttonSave, new TableLayoutConstraints( 0, 0 ) ); panel.add( buttonRevert, new TableLayoutConstraints( 1, 0 ) ); - panel.add( buttonSubmit, new TableLayoutConstraints( 3, 0 ) ); + panel.add( buttonPdfRelatorio, new TableLayoutConstraints( 3, 0 ) ); + panel.add( buttonPdfPlano, new TableLayoutConstraints( 4, 0 ) ); + panel.add( buttonSubmit, new TableLayoutConstraints( 5, 0 ) ); add( panel, new TableLayoutConstraints( 0, 0, 7, 0 ) ); add( new JLabel( "Data do relat" + oacute + "rio" ), new TableLayoutConstraints( 0, 1, 2, 1 ) ); @@ -199,6 +211,14 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe } } } ); + buttonPdfPlano.addActionListener( new ActionListener() + { + @Override + public void actionPerformed( ActionEvent e ) + { + pdf(); + } + } ); } private boolean isValidPlano() @@ -225,7 +245,7 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe { relatorio.setIsSubmetido( new Date() ); relatorio.save(); -// sendMail( relatorio ); + sendMail( relatorio ); refresh(); setRelatorio( relatorio, false ); } @@ -235,62 +255,132 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe } } + private boolean confirmDelete( File file ) + { + boolean result = false; + result = JOptionPane.OK_OPTION == JOptionPane.showConfirmDialog( this, "Ficheiro j" + aacute + " existente, deseja substituir?", "Aviso", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null ); + return result; + } + + private void pdf() + { + try + { + setCursor( new Cursor(Cursor.WAIT_CURSOR) ); + PlanoActuacaoPDFCreator creator = new PlanoActuacaoPDFCreator(); + byte [] pdf = creator.createPDF( relatorio.getId(), false ); + if( pdf != null ) + { + JFileChooser fileChooser = new JFileChooser( ); + if( fileChooser.showSaveDialog( this ) == JFileChooser.APPROVE_OPTION ) + { + File file = fileChooser.getSelectedFile(); + String path = file.getAbsolutePath(); + if( !path.toUpperCase().endsWith( ".PDF" ) ) + { + path += ".pdf"; + file = new File( path ); + } + if( file != null ) + { + if( file.exists() && confirmDelete( file ) ) + { + file.delete(); + } + FileOutputStream a = new FileOutputStream(file); + a.write( pdf ); + a.close(); + } + } + } + } + catch( Exception e ) + { + LeafError.error( e ); + } + finally + { + setCursor( new Cursor(Cursor.DEFAULT_CURSOR) ); + } + } + + private JFrame getFrame( ) + { + Component comp = this; + JFrame frame = null; + while( comp != null ) + { + if( comp.getParent() instanceof JFrame ) + { + frame = (JFrame) comp.getParent(); + break; + } + comp = comp.getParent(); + } + return frame; + } + private void sendMail( HsRelatorio relatorio ) { try { - MailSender sender = new MailSender(); - String nomeEstabelecimento = relatorio.getToHsMarcacoesEstabelecimento().getToEstabelecimentos().getNome(); - MarcacoesTecnicosHst tecnico = relatorio.getToHsMarcacoesEstabelecimento().getToMarcacoesTecnicosHst(); - String nomeTecnico = tecnico == null ? "" : tecnico.getNome(); - Date dataVisita = relatorio.getToHsMarcacoesEstabelecimento().getData(); - String dataVisitaString = new SimpleDateFormat("dd/MM/yyyy").format( dataVisita ); - String subject = "Relatório da Avaliação de Riscos Laborais e Plano de Actuação de " + nomeEstabelecimento + " - auditoria de " + dataVisitaString; - String body = "Exmos. Senhores" + - "
" + - "
" + - "
" + - "Junto enviamos o relatório de avaliação de riscos laborais e " + - "respectivo plano de actuação da auditoria realizada no dia " + - dataVisitaString + - "ao vosso estabelecimento de " + - nomeEstabelecimento + - ". Aconselhamos que tenham em conta as não conformidades indicadas " + - "nestes documentos e que preencham o plano de actuação por forma a " + - "auxiliar-vos na planificação das medidas correctivas e para poderem " + - "apresentá-los em caso de inspecção da ACT – Autoridade para as Condições do Trabalho." + - "
" + - "
" + - "
" + - "Caso pretendam o nosso apoio ou necessitem de qualquer esclarecimento, contactem-nos, por favor, através do telefone (+351) 213 504 540." + - "
" + - "
" + - "
" + - "Com os melhores cumprimentos, " + - "
" + - "
" + - "
" + - nomeTecnico + - "
" + - "SIPRP - Sociedade Ibérica de Prevenção de Riscos Profissionais " + - "
" + - "Atrium Saldanha - Praça Duque de Saldanha, 1 - 9º G - 1050-094 Lisboa " + - "
" + - "Telefone: (+351) 213 504 540 " + - "
" + - "Fax: (+351) 213 504 549 " + - "
" + - "E-mail: geral@siprp.pt " + - "
" + - "URL: www.siprp.com " + - "
" + - "
" + - "
" + - "Esta é uma mensagem gerada automaticamente pelo nosso sistema, por favor não responda"; + List rels = relatorio.getToHsMarcacoesEstabelecimento().getToEstabelecimentos().getHsEmailEstabelecimento(); + String to = ""; for( HsEmailEstabelecimento rel : rels ) { - sender.send( rel.getToHsEmail().getEmail(), "", subject, body, null, null ); + to += rel.getToHsEmail().getEmail() + (to.length() == 0 ? "" : ", "); + } + if( to.length() > 0 && to.contains( "@" ) ) + { + String nomeEstabelecimento = relatorio.getToHsMarcacoesEstabelecimento().getToEstabelecimentos().getNome(); + MarcacoesTecnicosHst tecnico = relatorio.getToHsMarcacoesEstabelecimento().getToMarcacoesTecnicosHst(); + String nomeTecnico = tecnico == null ? "" : tecnico.getNome(); + Date dataVisita = relatorio.getToHsMarcacoesEstabelecimento().getData(); + String dataVisitaString = new SimpleDateFormat("dd/MM/yyyy").format( dataVisita ); + String subject = "Relatório da Avaliação de Riscos Laborais e Plano de Actuação de " + nomeEstabelecimento + " - auditoria de " + dataVisitaString; + String body = "Exmos. Senhores" + + "
" + + "
" + + "
" + + "Junto enviamos o relatório de avaliação de riscos laborais e " + + "respectivo plano de actuação da auditoria realizada no dia " + + dataVisitaString + + "ao vosso estabelecimento de(o) " + + nomeEstabelecimento + + ". Aconselhamos que tenham em conta as não conformidades indicadas " + + "nestes documentos e que preencham o plano de actuação por forma a " + + "auxiliar-vos na planificação das medidas correctivas e para poderem " + + "apresentá-los em caso de inspecção da ACT – Autoridade para as Condições do Trabalho." + + "
" + + "
" + + "
" + + "Caso pretendam o nosso apoio ou necessitem de qualquer esclarecimento, contactem-nos, por favor, através do telefone (+351) 213 504 540." + + "
" + + "
" + + "
" + + "Com os melhores cumprimentos, " + + "
" + + "
" + + "
" + + nomeTecnico + + "
" + + "SIPRP - Sociedade Ibérica de Prevenção de Riscos Profissionais " + + "
" + + "Atrium Saldanha - Praça Duque de Saldanha, 1 - 9º G - 1050-094 Lisboa " + + "
" + + "Telefone: (+351) 213 504 540 " + + "
" + + "Fax: (+351) 213 504 549 " + + "
" + + "E-mail: geral@siprp.pt " + + "
" + + "URL: www.siprp.com " + + "
" + + "
" + + "
" + + "Esta é uma mensagem gerada automaticamente pelo nosso sistema, por favor não responda."; + new MailDialog( getFrame(), to, "", subject, body ); } } catch( Exception ex ) @@ -374,6 +464,7 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe fieldFuncao1.setEnabled( enabled ); fieldFuncao2.setEnabled( enabled ); buttonSubmit.setEnabled( enabled ); + buttonPdfPlano.setEnabled( enabled ); } public void setRelatorio( HsRelatorio relatorio,boolean create ) diff --git a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/PlanoActuacaoPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/PlanoActuacaoPanel.java index 5f5f178a..5964b3b3 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/PlanoActuacaoPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/PlanoActuacaoPanel.java @@ -168,13 +168,13 @@ public class PlanoActuacaoPanel extends JPanel private void placeComponents() { - valoresPanel.add( valoresRisco, RISCO_PANEL); + valoresPanel.add( valoresRisco, RISCO_PANEL ); valoresPanel.add( valoresMedida, MEDIDA_PANEL ); valoresPanel.add( emptyPanel, EMPTY_PANEL ); - add(buttonRevert,new TableLayoutConstraints(0,0)); - add(areas,new TableLayoutConstraints(1,0,1,1)); - add(riscos,new TableLayoutConstraints(2,0,2,1)); - add(valoresPanel,new TableLayoutConstraints(3,0,3,1)); + add( buttonRevert, new TableLayoutConstraints( 0, 0 ) ); + add( areas, new TableLayoutConstraints( 0, 1, 1, 1 ) ); + add( riscos, new TableLayoutConstraints( 2, 1 ) ); + add( valoresPanel, new TableLayoutConstraints( 3, 1 ) ); } private void setEnabled() diff --git a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/VerAreasRelatorioPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/VerAreasRelatorioPanel.java index 65df1732..b12da697 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/VerAreasRelatorioPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/VerAreasRelatorioPanel.java @@ -115,8 +115,6 @@ public class VerAreasRelatorioPanel extends JPanel layout.setHGap( 5 ); layout.setVGap( 5 ); panel.setLayout( layout ); -// panel.add( buttonAdicionar, new TableLayoutConstraints( 0, 0 ) ); -// panel.add( buttonRemover, new TableLayoutConstraints( 2, 0 ) ); add( panel, new TableLayoutConstraints( 0, 0 ) ); add( scroll, new TableLayoutConstraints( 0, 1 ) ); @@ -128,7 +126,6 @@ public class VerAreasRelatorioPanel extends JPanel @Override public void valueChanged( TreeSelectionEvent e ) { - setEnabled(); TreePath path = tree.getSelectionPath(); Object object = path == null ? null : path.getLastPathComponent(); HsRelatorioPosto posto = object == null ? null : ( (object instanceof PostoRelatorioNode) ? (HsRelatorioPosto) ((PostoRelatorioNode) object).getUserObject() : null); @@ -137,12 +134,6 @@ public class VerAreasRelatorioPanel extends JPanel } ); } - private void setEnabled() - { -// buttonAdicionar.setEnabled( false ); -// buttonRemover.setEnabled( false ); - } - public void refresh() { root.removeAllChildren(); @@ -150,7 +141,7 @@ public class VerAreasRelatorioPanel extends JPanel { TreeTools.merge( root, HigieneSegurancaLogic.getAreasRelatorioTree( relatorio ) ); } - setEnabled(); + TreeTools.sort( root ); TreeTools.refreshTree( tree, root ); } diff --git a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/adobe_reader.png b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/adobe_reader.png new file mode 100644 index 00000000..613bda10 Binary files /dev/null and b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/adobe_reader.png differ diff --git a/trunk/SIPRPSoft/src/siprp/medicina/processo/mail/MailDialog.java b/trunk/SIPRPSoft/src/siprp/medicina/processo/mail/MailDialog.java index cc1a0e57..5769bac1 100644 --- a/trunk/SIPRPSoft/src/siprp/medicina/processo/mail/MailDialog.java +++ b/trunk/SIPRPSoft/src/siprp/medicina/processo/mail/MailDialog.java @@ -189,7 +189,7 @@ public class MailDialog extends CustomJDialog FileDialog fd = new FileDialog( owner, "Escolha um ficheiro", FileDialog.LOAD ); fd.setDirectory( System.getProperty( "user.home" ) ); fd.setVisible( true ); - //String filename = "c:\\test.xls"; + // String filename = "c:\\test.xls"; String filename = fd.getFile(); if( filename != null ) { diff --git a/trunk/SIPRPSoft/src/siprp/planoactuacao/print/PlanoActuacaoPDFCreator.java b/trunk/SIPRPSoft/src/siprp/planoactuacao/print/PlanoActuacaoPDFCreator.java index 18097c61..890e996a 100644 --- a/trunk/SIPRPSoft/src/siprp/planoactuacao/print/PlanoActuacaoPDFCreator.java +++ b/trunk/SIPRPSoft/src/siprp/planoactuacao/print/PlanoActuacaoPDFCreator.java @@ -12,8 +12,8 @@ import com.evolute.utils.xml.XSLTransformer; public class PlanoActuacaoPDFCreator { - public byte[] createPDF( Integer planoId, boolean web ) - throws Exception + + public byte[] createPDF( Integer planoId, boolean web ) throws Exception { PlanoActuacaoToPrint plano = PlanoActuacaoPrintDataProvider.getProvider( web ).getPlanoToPrint( planoId ); Document foDoc = new Document( plano.toJdomElement() ); @@ -31,11 +31,11 @@ public class PlanoActuacaoPDFCreator return pdf; } - public byte[] applyTemplate( InputStream xsl, InputStream dataStream ) - throws Exception + public byte[] applyTemplate( InputStream xsl, InputStream dataStream ) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); XSLTransformer.getXSLTransformer().transform( dataStream, xsl, baos ); return baos.toByteArray(); } + } diff --git a/trunk/common/src/leaf/ui/TreeTools.java b/trunk/common/src/leaf/ui/TreeTools.java index 487e69b8..38e405c0 100644 --- a/trunk/common/src/leaf/ui/TreeTools.java +++ b/trunk/common/src/leaf/ui/TreeTools.java @@ -11,6 +11,8 @@ import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreePath; +import com.evolute.utils.strings.StringPlainer; + public class TreeTools { @@ -25,7 +27,7 @@ public class TreeTools } else { - return o2 == null ? 1 : o1.toString().compareTo( o2.toString() ); + return o2 == null ? 1 : StringPlainer.convertString( o1.toString() ).compareTo( StringPlainer.convertString( o2.toString() ) ); } }