|
|
|
|
@ -195,12 +195,6 @@ public class EstruturaProcessoPanel extends JPanel
|
|
|
|
|
{
|
|
|
|
|
consultaNode = new ConsultaMutableTreeNode( id, desc );
|
|
|
|
|
consultaNode.setData( data );
|
|
|
|
|
// DataMutableTreeNode dataNode = new DataMutableTreeNode( new Integer( 1 ), "2006/01/01 - Desmarcado pelo trabalhador" );
|
|
|
|
|
// dataNode.add( new ObservacoesMutableTreeNode( new Integer( 25 ), "N\u00e3o podia vir neste dia" ) );
|
|
|
|
|
// dataNode.add( new MailMutableTreeNode( new Integer( 25 ), "2006/01/01 - fpalma@evolute.pt - Aviso de MArca\u00e7\u00e3o" ) );
|
|
|
|
|
// consultaNode.add( dataNode );
|
|
|
|
|
// dataNode = new DataMutableTreeNode( new Integer( 1 ), "2006/01/01 - Realizado" );
|
|
|
|
|
// consultaNode.add( dataNode );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@ -209,7 +203,19 @@ public class EstruturaProcessoPanel extends JPanel
|
|
|
|
|
consultaNode.setDescricao( desc );
|
|
|
|
|
consultaNode.setData( data );
|
|
|
|
|
}
|
|
|
|
|
( ( DefaultTreeModel ) mainTree.getModel() ).nodeStructureChanged( rootNode );
|
|
|
|
|
consultaNode.removeAllChildren();
|
|
|
|
|
Object datas[][] = provider.getDatasConsulta( id );
|
|
|
|
|
for( int n = 0; n < datas.length; n++ )
|
|
|
|
|
{
|
|
|
|
|
Integer dataID = ( Integer ) datas[ n ][ 0 ];
|
|
|
|
|
Date dataData = ( Date ) datas[ n ][ 1 ];
|
|
|
|
|
Integer dataEstado = ( Integer ) datas[ n ][ 2 ];
|
|
|
|
|
String dataEstadoStr = MedicinaConstants.ESTADOS_CONSULTA_STR[ dataEstado != null ? dataEstado.intValue() : 0 ];
|
|
|
|
|
String dataDesc = D_F.format( dataData ) + ": " + dataEstadoStr;
|
|
|
|
|
consultaNode.add( new DataMutableTreeNode( dataID, dataDesc ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
( ( DefaultTreeModel ) mainTree.getModel() ).nodeStructureChanged( consultaNode );
|
|
|
|
|
return consultaNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -251,35 +257,38 @@ public class EstruturaProcessoPanel extends JPanel
|
|
|
|
|
for( int n = 0; components != null && n < components.length; n++ )
|
|
|
|
|
{
|
|
|
|
|
Integer id = ( ( EstruturaProcessoMutableTreeNode ) components[ n ] ).getID();
|
|
|
|
|
if( components[ components.length - 1 ] instanceof ProcessoMutableTreeNode )
|
|
|
|
|
System.out.println( id );
|
|
|
|
|
if( components[ n ] instanceof ProcessoMutableTreeNode )
|
|
|
|
|
{
|
|
|
|
|
System.out.println( "Processo: " + id );
|
|
|
|
|
ids.put( ProcessoEvent.TIPO_PROCESSO, id );
|
|
|
|
|
}
|
|
|
|
|
else if( components[ components.length - 1 ] instanceof ConsultaMutableTreeNode )
|
|
|
|
|
else if( components[ n ] instanceof ConsultaMutableTreeNode )
|
|
|
|
|
{
|
|
|
|
|
ids.put( ProcessoEvent.TIPO_CONSULTA, id );
|
|
|
|
|
}
|
|
|
|
|
else if( components[ components.length - 1 ] instanceof ECDsMutableTreeNode )
|
|
|
|
|
else if( components[ n ] instanceof ECDsMutableTreeNode )
|
|
|
|
|
{
|
|
|
|
|
ids.put( ProcessoEvent.TIPO_ECDS, id );
|
|
|
|
|
}
|
|
|
|
|
else if( components[ components.length - 1 ] instanceof FichaAptidaoMutableTreeNode )
|
|
|
|
|
else if( components[ n ] instanceof FichaAptidaoMutableTreeNode )
|
|
|
|
|
{
|
|
|
|
|
ids.put( ProcessoEvent.TIPO_FICHA_APTIDAO, id );
|
|
|
|
|
}
|
|
|
|
|
else if( components[ components.length - 1 ] instanceof DataMutableTreeNode )
|
|
|
|
|
else if( components[ n ] instanceof DataMutableTreeNode )
|
|
|
|
|
{
|
|
|
|
|
ids.put( ProcessoEvent.TIPO_DATA, id );
|
|
|
|
|
}
|
|
|
|
|
else if( components[ components.length - 1 ] instanceof ObservacoesMutableTreeNode )
|
|
|
|
|
else if( components[ n ] instanceof ObservacoesMutableTreeNode )
|
|
|
|
|
{
|
|
|
|
|
ids.put( ProcessoEvent.TIPO_OBSERVACOES, id );
|
|
|
|
|
}
|
|
|
|
|
else if( components[ components.length - 1 ] instanceof MailMutableTreeNode )
|
|
|
|
|
else if( components[ n ] instanceof MailMutableTreeNode )
|
|
|
|
|
{
|
|
|
|
|
ids.put( ProcessoEvent.TIPO_MAIL, id );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
System.out.println( ids );
|
|
|
|
|
ProcessoEvent event = new ProcessoEvent( this, tipo, ids );
|
|
|
|
|
for( int n = 0; n < PROCESSO_LISTENERS.size(); n++ )
|
|
|
|
|
{
|
|
|
|
|
@ -342,10 +351,15 @@ public class EstruturaProcessoPanel extends JPanel
|
|
|
|
|
public void actualizarMarcacaoEscolhida( Integer processoID, Integer marcacaoID )
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
actualizarProcessoEscolhido( processoID );
|
|
|
|
|
TreePath path = mainTree.getSelectionPath();
|
|
|
|
|
ProcessoMutableTreeNode processoNode = ( ProcessoMutableTreeNode ) path.getPathComponent( 1 );
|
|
|
|
|
( ( DefaultTreeModel ) mainTree.getModel() ).nodeStructureChanged( processoNode ) ;
|
|
|
|
|
int countOld = processoNode.getChildCount();
|
|
|
|
|
actualizarProcessoEscolhido( processoID );
|
|
|
|
|
int count = processoNode.getChildCount();
|
|
|
|
|
if( count > countOld )
|
|
|
|
|
{
|
|
|
|
|
( ( DefaultTreeModel ) mainTree.getModel() ).nodesWereInserted( processoNode, new int[]{ countOld } ) ;
|
|
|
|
|
}
|
|
|
|
|
// TreePath path = mainTree.getSelectionPath();
|
|
|
|
|
// MarcacaoMutableTreeNode processoNode = ( ProcessoMutableTreeNode ) path.getPathComponent( 1 );
|
|
|
|
|
// boolean vazio = processoNode.getID().intValue() == -1;
|
|
|
|
|
|