/* * ConsultaPanel.java * * Created on March 22, 2007, 10:58 AM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package siprp.medicina.processo.detalhes; import com.evolute.utils.ui.calendar.JCalendarPanel; import info.clearthought.layout.TableLayout; import info.clearthought.layout.TableLayoutConstraints; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; 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.ProcessoListener; /** * * @author fpalma */ public class ConsultaPanel extends JPanel implements ActionListener, MedicinaConstants, ChangeListener { protected JFrame owner; protected JCalendarPanel dataConsultaPanel; protected JButton estadoButton; protected JButton emailButton; protected JButton observacoesButton; protected ObservacoesDialog observacoesDialog; private final Vector PROCESSO_LISTENERS = new Vector(); /** Creates a new instance of ConsultaPanel */ public ConsultaPanel( JFrame owner ) { this.owner = owner; setupComponents(); } private void setupComponents() { JLabel dataLabel = new JLabel( "Data" ); dataConsultaPanel = new JCalendarPanel( null ); dataConsultaPanel.addChangeListener( this ); estadoButton = new JButton( " " ); estadoButton.addActionListener( this ); emailButton = new JButton( "Email" ); emailButton.addActionListener( this ); observacoesButton = new JButton( "Coment\u00e1rio" ); observacoesButton.addActionListener( this ); double cols[] = new double[]{ TableLayout.MINIMUM, TableLayout.FILL }; double rows[] = new double[]{ TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.MINIMUM }; TableLayout tableLayout = new TableLayout( cols, rows ); tableLayout.setVGap( 5 ); setLayout( tableLayout ); add( dataLabel, new TableLayoutConstraints( 0, 0 ) ); add( dataConsultaPanel, new TableLayoutConstraints( 1, 0 ) ); add( estadoButton, new TableLayoutConstraints( 0, 1, 1, 1 ) ); add( emailButton, new TableLayoutConstraints( 0, 2, 1, 2 ) ); add( observacoesButton, new TableLayoutConstraints( 0, 3, 1, 3 ) ); } public void actionPerformed(ActionEvent e) { Object source = e.getSource(); if( source.equals( observacoesButton ) ) { } } public void stateChanged(ChangeEvent e) { } protected void editarObservacoes() { if( observacoesDialog == null ) { observacoesDialog = new ObservacoesDialog( owner ); } } public void addProcessoListener( ProcessoListener listener ) { PROCESSO_LISTENERS.add( listener ); } public void removeProcessoListener( ProcessoListener listener ) { PROCESSO_LISTENERS.remove( listener ); } }