|
|
|
|
@ -30,6 +30,7 @@ import java.awt.event.WindowEvent;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.Vector;
|
|
|
|
|
import javax.swing.BorderFactory;
|
|
|
|
|
import javax.swing.JButton;
|
|
|
|
|
import javax.swing.JComboBox;
|
|
|
|
|
import javax.swing.JFrame;
|
|
|
|
|
@ -109,13 +110,19 @@ public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
|
estabelecimentosTable.getSelectionModel().addListSelectionListener( this );
|
|
|
|
|
JScrollPane estabelecimentosScp = new JScrollPane( estabelecimentosTable, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
|
|
|
|
|
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER );
|
|
|
|
|
JLabel consultasLabel = new JLabel( "Consultas " );
|
|
|
|
|
JPanel consultasPanel = new JPanel();
|
|
|
|
|
consultasPanel.setBorder( BorderFactory.createTitledBorder(
|
|
|
|
|
BorderFactory.createEtchedBorder(), "Consultas" ) );
|
|
|
|
|
JLabel consultasLabel = new JLabel( "Quantidade " );
|
|
|
|
|
numeroConsultasLabel = new JLabel( " " );
|
|
|
|
|
numeroConsultasLabel.setForeground( Color.green.darker() );
|
|
|
|
|
prestadoresConsultasCombo = new JComboBox();
|
|
|
|
|
enviarConsultasButton = new JButton( "Atribuir" );
|
|
|
|
|
enviarConsultasButton.addActionListener( this );
|
|
|
|
|
JLabel ecdsLabel = new JLabel( "ECDs " );
|
|
|
|
|
JPanel ecdsPanel = new JPanel();
|
|
|
|
|
ecdsPanel.setBorder( BorderFactory.createTitledBorder(
|
|
|
|
|
BorderFactory.createEtchedBorder(), "ECDs" ) );
|
|
|
|
|
JLabel ecdsLabel = new JLabel( "Quantidade " );
|
|
|
|
|
numeroECDsLabel = new JLabel( " " );
|
|
|
|
|
numeroECDsLabel.setForeground( Color.green.darker() );
|
|
|
|
|
prestadoresECDsCombo = new JComboBox();
|
|
|
|
|
@ -150,22 +157,34 @@ public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
|
centerPanel.add( detalhesPanel );
|
|
|
|
|
|
|
|
|
|
double cols[] =
|
|
|
|
|
new double[]{ TableLayout.MINIMUM, TableLayout.PREFERRED, TableLayout.FILL, TableLayout.MINIMUM };
|
|
|
|
|
new double[]{ TableLayout.MINIMUM, TableLayout.FILL };
|
|
|
|
|
double rows[] =
|
|
|
|
|
new double[]{ TableLayout.FILL, TableLayout.MINIMUM, TableLayout.MINIMUM,
|
|
|
|
|
TableLayout.FILL };
|
|
|
|
|
new double[]{ TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.MINIMUM };
|
|
|
|
|
|
|
|
|
|
TableLayout tableLayout = new TableLayout( cols,rows );
|
|
|
|
|
detalhesPanel.setLayout( tableLayout );
|
|
|
|
|
consultasPanel.setLayout( tableLayout );
|
|
|
|
|
|
|
|
|
|
consultasPanel.add( consultasLabel, new TableLayoutConstraints( 0, 0 ) );
|
|
|
|
|
consultasPanel.add( numeroConsultasLabel, new TableLayoutConstraints( 1, 0 ) );
|
|
|
|
|
consultasPanel.add( prestadoresConsultasCombo, new TableLayoutConstraints( 0, 1, 1, 1 ) );
|
|
|
|
|
consultasPanel.add( enviarConsultasButton, new TableLayoutConstraints( 0, 2, 1, 2 ) );
|
|
|
|
|
|
|
|
|
|
tableLayout = new TableLayout( cols,rows );
|
|
|
|
|
ecdsPanel.setLayout( tableLayout );
|
|
|
|
|
|
|
|
|
|
detalhesPanel.add( consultasLabel, new TableLayoutConstraints( 0, 1 ) );
|
|
|
|
|
detalhesPanel.add( numeroConsultasLabel, new TableLayoutConstraints( 1, 1 ) );
|
|
|
|
|
detalhesPanel.add( prestadoresConsultasCombo, new TableLayoutConstraints( 2, 1 ) );
|
|
|
|
|
detalhesPanel.add( enviarConsultasButton, new TableLayoutConstraints( 3, 1 ) );
|
|
|
|
|
ecdsPanel.add( ecdsLabel, new TableLayoutConstraints( 0, 0 ) );
|
|
|
|
|
ecdsPanel.add( numeroECDsLabel, new TableLayoutConstraints( 1, 0 ) );
|
|
|
|
|
ecdsPanel.add( prestadoresECDsCombo, new TableLayoutConstraints( 0, 1, 1, 1 ) );
|
|
|
|
|
ecdsPanel.add( enviarECDsButton, new TableLayoutConstraints( 0, 2, 1, 2 ) );
|
|
|
|
|
|
|
|
|
|
detalhesPanel.add( ecdsLabel, new TableLayoutConstraints( 0, 2 ) );
|
|
|
|
|
detalhesPanel.add( numeroECDsLabel, new TableLayoutConstraints( 1, 2 ) );
|
|
|
|
|
detalhesPanel.add( prestadoresECDsCombo, new TableLayoutConstraints( 2, 2 ) );
|
|
|
|
|
detalhesPanel.add( enviarECDsButton, new TableLayoutConstraints( 3, 2 ) );
|
|
|
|
|
cols = new double[]{ TableLayout.FILL };
|
|
|
|
|
rows = new double[]{ TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.FILL };
|
|
|
|
|
|
|
|
|
|
tableLayout = new TableLayout( cols,rows );
|
|
|
|
|
detalhesPanel.setLayout( tableLayout );
|
|
|
|
|
|
|
|
|
|
detalhesPanel.add( consultasPanel, new TableLayoutConstraints( 0, 0 ) );
|
|
|
|
|
detalhesPanel.add( ecdsPanel, new TableLayoutConstraints( 0, 1 ) );
|
|
|
|
|
|
|
|
|
|
setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE );
|
|
|
|
|
addWindowListener( new WindowAdapter(){
|
|
|
|
|
@ -180,8 +199,9 @@ public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
|
|
dataPanel.setDate( new Date() );
|
|
|
|
|
recarregarPrestadores();
|
|
|
|
|
carregar();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void refresh()
|
|
|
|
|
@ -392,7 +412,7 @@ public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
|
IDObject prestador = ( IDObject ) prestadoresECDsCombo.getItemAt( p );
|
|
|
|
|
if( prestador.getID().equals( escolhidos[ e ] ) )
|
|
|
|
|
{
|
|
|
|
|
prestadoresECDsCombo.setSelectedIndex( e );
|
|
|
|
|
prestadoresECDsCombo.setSelectedIndex( p );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|