|
|
|
|
@ -37,19 +37,14 @@ public class ProcessoPanel extends JPanel
|
|
|
|
|
implements ActionListener, ControllableComponent,
|
|
|
|
|
MedicinaConstants, ProcessoConstants, SaveExameListener
|
|
|
|
|
{
|
|
|
|
|
private static final String ECDS_ICON_PATH = "siprp/medicina/processo/icons/ecds.png";
|
|
|
|
|
private static final String CONSULTA_ICON_PATH = "siprp/medicina/processo/icons/consulta.png";
|
|
|
|
|
private static final String FICHA_APTIDAO_ICON_PATH = "siprp/medicina/processo/icons/fichaaptidao.png";
|
|
|
|
|
private static final String FECHAR_ICON_PATH = "siprp/medicina/processo/icons/lock.png";
|
|
|
|
|
|
|
|
|
|
private static final DateFormat D_F = DateFormat.getDateInstance( DateFormat.SHORT, new Locale( "pt", "PT" ) );
|
|
|
|
|
|
|
|
|
|
private JTextField estadoText;
|
|
|
|
|
private JTextField inicioText;
|
|
|
|
|
private JTextField fimText;
|
|
|
|
|
private JButton motivoButton;
|
|
|
|
|
private JButton novoECDButton;
|
|
|
|
|
private JButton novaConsultaButton;
|
|
|
|
|
// private JButton novoECDButton;
|
|
|
|
|
// private JButton novaConsultaButton;
|
|
|
|
|
private JButton emitirFAButton;
|
|
|
|
|
private JButton fecharButton;
|
|
|
|
|
|
|
|
|
|
@ -75,27 +70,28 @@ public class ProcessoPanel extends JPanel
|
|
|
|
|
|
|
|
|
|
private void setupComponents()
|
|
|
|
|
{
|
|
|
|
|
motivoButton = new JButton( "Motivo" );
|
|
|
|
|
JLabel motivoLabel = new JLabel( "Motivo" );
|
|
|
|
|
motivoButton = new JButton( "Escolher" );
|
|
|
|
|
motivoButton.addActionListener( this );
|
|
|
|
|
JLabel estadoLabel = new JLabel( "Estado" );
|
|
|
|
|
estadoText = new JTextField();
|
|
|
|
|
estadoText.setPreferredSize( new Dimension( 120, 20 ) );
|
|
|
|
|
estadoText.setPreferredSize( new Dimension( 150, 20 ) );
|
|
|
|
|
estadoText.setEditable( false );
|
|
|
|
|
JLabel inicioLabel = new JLabel( "In\u00edcio" );
|
|
|
|
|
inicioText = new JTextField();
|
|
|
|
|
inicioText.setPreferredSize( new Dimension( 120, 20 ) );
|
|
|
|
|
inicioText.setPreferredSize( new Dimension( 150, 20 ) );
|
|
|
|
|
inicioText.setEditable( false );
|
|
|
|
|
JLabel fimLabel = new JLabel( "Fim" );
|
|
|
|
|
fimText = new JTextField();
|
|
|
|
|
fimText.setPreferredSize( new Dimension( 120, 20 ) );
|
|
|
|
|
fimText.setPreferredSize( new Dimension( 150, 20 ) );
|
|
|
|
|
fimText.setEditable( false );
|
|
|
|
|
novoECDButton = new JButton( "Marcar ECDs" );
|
|
|
|
|
novoECDButton.setIcon( getIcon( ECDS_ICON_PATH ) );
|
|
|
|
|
novoECDButton.addActionListener( this );
|
|
|
|
|
novaConsultaButton = new JButton( "Marcar Consulta" );
|
|
|
|
|
novaConsultaButton.setIcon( getIcon( CONSULTA_ICON_PATH ) );
|
|
|
|
|
novaConsultaButton.addActionListener( this );
|
|
|
|
|
emitirFAButton = new JButton( "Ficha de Aptid\u00e3o" );
|
|
|
|
|
// novoECDButton = new JButton( "Marcar ECDs" );
|
|
|
|
|
// novoECDButton.setIcon( getIcon( ECDS_ICON_PATH ) );
|
|
|
|
|
// novoECDButton.addActionListener( this );
|
|
|
|
|
// novaConsultaButton = new JButton( "Marcar Consulta" );
|
|
|
|
|
// novaConsultaButton.setIcon( getIcon( CONSULTA_ICON_PATH ) );
|
|
|
|
|
// novaConsultaButton.addActionListener( this );
|
|
|
|
|
emitirFAButton = new JButton( "Emitir Ficha de Aptid\u00e3o" );
|
|
|
|
|
emitirFAButton.setIcon( getIcon( FICHA_APTIDAO_ICON_PATH ) );
|
|
|
|
|
emitirFAButton.addActionListener( this );
|
|
|
|
|
fecharButton = new JButton( "Fechar Processo" );
|
|
|
|
|
@ -104,28 +100,30 @@ public class ProcessoPanel extends JPanel
|
|
|
|
|
JPanel buttonPanel = new JPanel();
|
|
|
|
|
|
|
|
|
|
double cols[] =
|
|
|
|
|
new double[]{ TableLayout.MINIMUM, TableLayout.PREFERRED, TableLayout.FILL };
|
|
|
|
|
new double[]{ TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM, TableLayout.FILL };
|
|
|
|
|
double rows[] =
|
|
|
|
|
new double[]{ TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED,
|
|
|
|
|
TableLayout.PREFERRED, TableLayout.FILL };
|
|
|
|
|
new double[]{ TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.FILL };
|
|
|
|
|
|
|
|
|
|
TableLayout tableLayout = new TableLayout( cols, rows );
|
|
|
|
|
setLayout( tableLayout );
|
|
|
|
|
|
|
|
|
|
add( motivoButton, new TableLayoutConstraints( 0, 0, 2, 0 ) );
|
|
|
|
|
add( estadoLabel, new TableLayoutConstraints( 0, 1 ) );
|
|
|
|
|
add( estadoText, new TableLayoutConstraints( 1, 1 ) );
|
|
|
|
|
add( inicioLabel, new TableLayoutConstraints( 0, 2 ) );
|
|
|
|
|
add( inicioText, new TableLayoutConstraints( 1, 2 ) );
|
|
|
|
|
add( fimLabel, new TableLayoutConstraints( 0, 3 ) );
|
|
|
|
|
add( fimText, new TableLayoutConstraints( 1, 3 ) );
|
|
|
|
|
add( buttonPanel, new TableLayoutConstraints( 2, 1, 2, 3 ) );
|
|
|
|
|
add( motivoLabel, new TableLayoutConstraints( 0, 0 ) );
|
|
|
|
|
add( motivoButton, new TableLayoutConstraints( 1, 0 ) );
|
|
|
|
|
add( estadoLabel, new TableLayoutConstraints( 2, 0 ) );
|
|
|
|
|
add( estadoText, new TableLayoutConstraints( 3, 0 ) );
|
|
|
|
|
add( inicioLabel, new TableLayoutConstraints( 0, 1 ) );
|
|
|
|
|
add( inicioText, new TableLayoutConstraints( 1, 1 ) );
|
|
|
|
|
add( fimLabel, new TableLayoutConstraints( 2, 1 ) );
|
|
|
|
|
add( fimText, new TableLayoutConstraints( 3, 1 ) );
|
|
|
|
|
add( emitirFAButton, new TableLayoutConstraints( 0, 2, 1, 2 ) );
|
|
|
|
|
add( fecharButton, new TableLayoutConstraints( 2, 2, 3, 2 ) );
|
|
|
|
|
//add( buttonPanel, new TableLayoutConstraints( 0, 2, 3, 2 ) );
|
|
|
|
|
|
|
|
|
|
buttonPanel.setLayout( new GridLayout( 2, 2 ) );
|
|
|
|
|
buttonPanel.add( novoECDButton );
|
|
|
|
|
buttonPanel.add( novaConsultaButton );
|
|
|
|
|
buttonPanel.add( emitirFAButton );
|
|
|
|
|
buttonPanel.add( fecharButton );
|
|
|
|
|
// buttonPanel.setLayout( new GridLayout( 1, 2 ) );
|
|
|
|
|
//// buttonPanel.add( novoECDButton );
|
|
|
|
|
//// buttonPanel.add( novaConsultaButton );
|
|
|
|
|
// buttonPanel.add( emitirFAButton );
|
|
|
|
|
// buttonPanel.add( fecharButton );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e)
|
|
|
|
|
@ -135,14 +133,14 @@ public class ProcessoPanel extends JPanel
|
|
|
|
|
{
|
|
|
|
|
escolherMotivo();
|
|
|
|
|
}
|
|
|
|
|
else if( source.equals( novoECDButton ) )
|
|
|
|
|
{
|
|
|
|
|
novoECD();
|
|
|
|
|
}
|
|
|
|
|
else if( source.equals( novaConsultaButton ) )
|
|
|
|
|
{
|
|
|
|
|
novaConsulta();
|
|
|
|
|
}
|
|
|
|
|
// else if( source.equals( novoECDButton ) )
|
|
|
|
|
// {
|
|
|
|
|
// novoECD();
|
|
|
|
|
// }
|
|
|
|
|
// else if( source.equals( novaConsultaButton ) )
|
|
|
|
|
// {
|
|
|
|
|
// novaConsulta();
|
|
|
|
|
// }
|
|
|
|
|
else if( source.equals( emitirFAButton ) )
|
|
|
|
|
{
|
|
|
|
|
emitirFA();
|
|
|
|
|
@ -246,7 +244,7 @@ public class ProcessoPanel extends JPanel
|
|
|
|
|
estadoText.setText( "" );
|
|
|
|
|
inicioText.setText( "" );
|
|
|
|
|
fimText.setText( "" );
|
|
|
|
|
motivoButton.setText( "Motivo" );
|
|
|
|
|
motivoButton.setText( "Escolher" );
|
|
|
|
|
enableButtons();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -275,8 +273,8 @@ public class ProcessoPanel extends JPanel
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// novoECDButton.setEnabled( processo != null && motivo != null );
|
|
|
|
|
novoECDButton.setEnabled( false );
|
|
|
|
|
novaConsultaButton.setEnabled( processo != null && motivo != null && !consultasPorRealizar );
|
|
|
|
|
// novoECDButton.setEnabled( false );
|
|
|
|
|
// novaConsultaButton.setEnabled( processo != null && motivo != null && !consultasPorRealizar );
|
|
|
|
|
emitirFAButton.setEnabled( processo != null && motivo != null );
|
|
|
|
|
fecharButton.setEnabled( processo != null && motivo != null && PROCESSO_ABERTO_CODE.equals( estado ) );
|
|
|
|
|
motivoButton.setEnabled( processo != null );
|
|
|
|
|
|