|
|
|
|
@ -19,14 +19,17 @@ import info.clearthought.layout.TableLayoutConstraints;
|
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
|
import java.awt.event.ActionListener;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Vector;
|
|
|
|
|
import javax.swing.*;
|
|
|
|
|
import javax.swing.event.ChangeEvent;
|
|
|
|
|
import javax.swing.event.ChangeListener;
|
|
|
|
|
import siprp.medicina.MedicinaConstants;
|
|
|
|
|
import siprp.medicina.processo.ProcessoDataProvider;
|
|
|
|
|
import siprp.medicina.processo.ProcessoEvent;
|
|
|
|
|
import siprp.medicina.processo.ProcessoListener;
|
|
|
|
|
import siprp.medicina.processo.data.TrabalhadoresConsultasData;
|
|
|
|
|
import siprp.medicina.processo.data.TrabalhadoresConsultasDatasData;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
@ -46,8 +49,10 @@ public class ConsultaPanel extends JPanel
|
|
|
|
|
protected JDOProvider JDO;
|
|
|
|
|
protected ProcessoDataProvider provider;
|
|
|
|
|
|
|
|
|
|
protected TrabalhadoresConsultasData consulta;
|
|
|
|
|
protected Integer trabalhadorID;
|
|
|
|
|
protected Integer processoID;
|
|
|
|
|
protected TrabalhadoresConsultasData consulta;
|
|
|
|
|
protected TrabalhadoresConsultasDatasData consultaData;
|
|
|
|
|
|
|
|
|
|
/** Creates a new instance of ConsultaPanel */
|
|
|
|
|
public ConsultaPanel( JFrame owner )
|
|
|
|
|
@ -133,6 +138,7 @@ public class ConsultaPanel extends JPanel
|
|
|
|
|
if( texto != null )
|
|
|
|
|
{
|
|
|
|
|
provider.saveObservacoesConsultaData( dataID, texto );
|
|
|
|
|
notifyListeners( ProcessoEvent.ACCAO_ESCREVER_OBSERVACOES );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch( Exception ex )
|
|
|
|
|
@ -217,4 +223,28 @@ public class ConsultaPanel extends JPanel
|
|
|
|
|
{
|
|
|
|
|
this.trabalhadorID = trabalhadorID;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setProcessoID( Integer processoID )
|
|
|
|
|
{
|
|
|
|
|
this.processoID = processoID;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void notifyListeners( int accao )
|
|
|
|
|
{
|
|
|
|
|
HashMap<Integer,Integer> ids = new HashMap<Integer,Integer>();
|
|
|
|
|
ids.put( ProcessoEvent.TIPO_PROCESSO, processoID );
|
|
|
|
|
if( consulta != null )
|
|
|
|
|
{
|
|
|
|
|
ids.put( ProcessoEvent.TIPO_CONSULTA, ( Integer ) consulta.get( TrabalhadoresConsultasData.ID ) );
|
|
|
|
|
}
|
|
|
|
|
if( consultaData != null )
|
|
|
|
|
{
|
|
|
|
|
ids.put( ProcessoEvent.TIPO_DATA, ( Integer ) consulta.get( TrabalhadoresConsultasDatasData.ID ) );
|
|
|
|
|
}
|
|
|
|
|
ProcessoEvent event = new ProcessoEvent( this, accao, ids );
|
|
|
|
|
for( int n = 0; n < PROCESSO_LISTENERS.size(); n++ )
|
|
|
|
|
{
|
|
|
|
|
PROCESSO_LISTENERS.get( n ).processoStateChanged( event );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|