|  |  | @ -9,17 +9,22 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | package siprp.medicina.processo.detalhes; |  |  |  | package siprp.medicina.processo.detalhes; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.evolute.utils.Singleton; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.evolute.utils.jdo.JDOProvider; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.evolute.utils.ui.DialogException; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.evolute.utils.ui.calendar.JCalendarPanel; |  |  |  | import com.evolute.utils.ui.calendar.JCalendarPanel; | 
			
		
	
		
		
			
				
					
					|  |  |  | import info.clearthought.layout.TableLayout; |  |  |  | import info.clearthought.layout.TableLayout; | 
			
		
	
		
		
			
				
					
					|  |  |  | import info.clearthought.layout.TableLayoutConstraints; |  |  |  | import info.clearthought.layout.TableLayoutConstraints; | 
			
		
	
		
		
			
				
					
					|  |  |  | import java.awt.event.ActionEvent; |  |  |  | import java.awt.event.ActionEvent; | 
			
		
	
		
		
			
				
					
					|  |  |  | import java.awt.event.ActionListener; |  |  |  | import java.awt.event.ActionListener; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import java.util.Date; | 
			
		
	
		
		
			
				
					
					|  |  |  | import java.util.Vector; |  |  |  | import java.util.Vector; | 
			
		
	
		
		
			
				
					
					|  |  |  | import javax.swing.*; |  |  |  | import javax.swing.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import javax.swing.event.ChangeEvent; |  |  |  | import javax.swing.event.ChangeEvent; | 
			
		
	
		
		
			
				
					
					|  |  |  | import javax.swing.event.ChangeListener; |  |  |  | import javax.swing.event.ChangeListener; | 
			
		
	
		
		
			
				
					
					|  |  |  | import siprp.medicina.MedicinaConstants; |  |  |  | import siprp.medicina.MedicinaConstants; | 
			
		
	
		
		
			
				
					
					|  |  |  | import siprp.medicina.processo.ProcessoListener; |  |  |  | import siprp.medicina.processo.ProcessoListener; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import siprp.medicina.processo.data.TrabalhadoresConsultasData; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | /** |  |  |  | /** | 
			
		
	
		
		
			
				
					
					|  |  |  |  * |  |  |  |  * | 
			
		
	
	
		
		
			
				
					|  |  | @ -33,15 +38,19 @@ public class ConsultaPanel extends JPanel | 
			
		
	
		
		
			
				
					
					|  |  |  | 	protected JButton estadoButton; |  |  |  | 	protected JButton estadoButton; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	protected JButton emailButton; |  |  |  | 	protected JButton emailButton; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	protected JButton observacoesButton; |  |  |  | 	protected JButton observacoesButton; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 	protected ObservacoesDialog observacoesDialog; |  |  |  | 	protected ObservacoesDialog observacoesDialog; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	private final Vector<ProcessoListener> PROCESSO_LISTENERS = new Vector<ProcessoListener>(); |  |  |  | 	protected final Vector<ProcessoListener> PROCESSO_LISTENERS = new Vector<ProcessoListener>(); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	protected JDOProvider JDO; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	protected TrabalhadoresConsultasData consulta; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	protected Integer trabalhadorID; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	/** Creates a new instance of ConsultaPanel */ |  |  |  | 	/** Creates a new instance of ConsultaPanel */ | 
			
		
	
		
		
			
				
					
					|  |  |  | 	public ConsultaPanel( JFrame owner ) |  |  |  | 	public ConsultaPanel( JFrame owner ) | 
			
		
	
		
		
			
				
					
					|  |  |  | 	{ |  |  |  | 	{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 		this.owner = owner; |  |  |  | 		this.owner = owner; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		JDO = ( JDOProvider ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		setupComponents(); |  |  |  | 		setupComponents(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 |  |  |  | 	 | 
			
		
	
	
		
		
			
				
					|  |  | @ -92,7 +101,6 @@ public class ConsultaPanel extends JPanel | 
			
		
	
		
		
			
				
					
					|  |  |  | 		{ |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 			observacoesDialog = new ObservacoesDialog( owner ); |  |  |  | 			observacoesDialog = new ObservacoesDialog( owner ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  | 		 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	public void addProcessoListener( ProcessoListener listener ) |  |  |  | 	public void addProcessoListener( ProcessoListener listener ) | 
			
		
	
	
		
		
			
				
					|  |  | @ -104,4 +112,44 @@ public class ConsultaPanel extends JPanel | 
			
		
	
		
		
			
				
					
					|  |  |  | 	{ |  |  |  | 	{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 		PROCESSO_LISTENERS.remove( listener ); |  |  |  | 		PROCESSO_LISTENERS.remove( listener ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	public void clear() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		dataConsultaPanel.setDate( null ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		estadoButton.setText( " " ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	public void fill( Object value ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		clear(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		if( value != null ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			try | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				consulta = ( TrabalhadoresConsultasData ) JDO.load( TrabalhadoresConsultasData.class, ( Integer ) value ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				Date data = ( Date ) consulta.get( TrabalhadoresConsultasData.DATA ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				Integer estado = ( Integer ) consulta.get( TrabalhadoresConsultasData.ESTADO ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				dataConsultaPanel.setDate( data ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				if( estado != null ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					estadoButton.setText( ESTADOS_CONSULTA_STR[ estado.intValue() ] ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				else | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					estadoButton.setText( " " ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 						 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			catch( Exception ex ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				DialogException.showExceptionMessage( ex, "Erro a carregar dados da consulta", true ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	public void setTrabalhadorID( Integer trabalhadorID ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		this.trabalhadorID = trabalhadorID; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |