From c4857e60d7b0a94c75cbfd36cca66d63f59b4402 Mon Sep 17 00:00:00 2001 From: Frederico Palma Date: Fri, 2 Mar 2007 19:09:06 +0000 Subject: [PATCH] no message git-svn-id: https://svn.coded.pt/svn/SIPRP@332 bb69d46d-e84e-40c8-a05a-06db0d633741 --- .../locais_realizacao/FaxPrinter.java | 67 +++++++++++++++++-- .../LocaisRealizacaoWindow.java | 27 ++++++++ 2 files changed, 90 insertions(+), 4 deletions(-) diff --git a/trunk/siprp/medicina/locais_realizacao/FaxPrinter.java b/trunk/siprp/medicina/locais_realizacao/FaxPrinter.java index b88ff27e..392f8f25 100644 --- a/trunk/siprp/medicina/locais_realizacao/FaxPrinter.java +++ b/trunk/siprp/medicina/locais_realizacao/FaxPrinter.java @@ -9,16 +9,21 @@ package siprp.medicina.locais_realizacao; +import com.evolute.utils.data.IDObject; +import com.evolute.utils.data.MappableObject; import com.evolute.utils.ui.CustomJDialog; +import com.evolute.utils.ui.panel.CheckBoxPanel; import info.clearthought.layout.TableLayout; import info.clearthought.layout.TableLayoutConstraints; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; +import javax.swing.JToggleButton; import javax.swing.SwingUtilities; /** @@ -33,17 +38,35 @@ public class FaxPrinter extends CustomJDialog private JTextField deFaxText; private JTextField deTelefoneText; private JTextField assuntoText; + private JTextField localText; + private JToggleButton localAutoButton; + private JTextField perfil1Text; + private CheckBoxPanel perfil1Panel; + private JTextField perfil2Text; + private CheckBoxPanel perfil2Panel; + private JTextField horaText; + private JButton imprimirButton; private JButton cancelarButton; + public static void main( String args[] ) + { + FaxPrinter d = new FaxPrinter(); + d.setVisible( true ); + } + /** Creates a new instance of FaxPrinter */ public FaxPrinter() { + super( null, true ); setupComponents(); } private void setupComponents() { + setTitle( "Por favor preencha os detalhes do Fax" ); + setSize( 800, 600 ); + JLabel deLabel = new JLabel( "De" ); deText = new JTextField(); JLabel deEmailLabel = new JLabel( "E-mail" ); @@ -54,18 +77,33 @@ public class FaxPrinter extends CustomJDialog deTelefoneText = new JTextField(); JLabel assuntoLabel = new JLabel( "Assunto" ); assuntoText = new JTextField(); + localAutoButton = new JToggleButton( "Local Autom\u00e1tico" ); + localText = new JTextField(); + JLabel perfil1Label = new JLabel( "Nome" ); + perfil1Text = new JTextField(); + perfil1Panel = new CheckBoxPanel( new IDObject[]{ new MappableObject( new Integer( 1 ), "teste1" ), + new MappableObject( new Integer( 3 ), "teste3" ) } ); + JLabel perfil2Label = new JLabel( "Nome" ); + perfil2Text = new JTextField(); + perfil2Panel = new CheckBoxPanel( new IDObject[]{ new MappableObject( new Integer( 2 ), "teste2" ) } ); imprimirButton = new JButton( "Imprimir" ); imprimirButton.addActionListener( this ); cancelarButton = new JButton( "Cancelar" ); cancelarButton.addActionListener( this ); JPanel buttonPanel = new JPanel(); + JPanel perfil1OuterPanel = new JPanel(); + perfil1OuterPanel.setBorder( BorderFactory.createTitledBorder( + BorderFactory.createEtchedBorder(), "Perfil 1" ) ); + JPanel perfil2OuterPanel = new JPanel(); + perfil2OuterPanel.setBorder( BorderFactory.createTitledBorder( + BorderFactory.createEtchedBorder(), "Perfil 2" ) ); double cols[] = - new double[]{ TableLayout.MINIMUM, TableLayout.PREFERRED, TableLayout.MINIMUM, - TableLayout.PREFERRED, }; + new double[]{ TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM, + TableLayout.FILL, }; double rows[] = new double[]{ TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, - TableLayout.PREFERRED, }; + TableLayout.PREFERRED, TableLayout.FILL, TableLayout.PREFERRED }; TableLayout tableLayout = new TableLayout( cols,rows ); setLayout( tableLayout ); @@ -80,7 +118,28 @@ public class FaxPrinter extends CustomJDialog add( deTelefoneText, new TableLayoutConstraints( 3, 1 ) ); add( assuntoLabel, new TableLayoutConstraints( 0, 2 ) ); add( assuntoText, new TableLayoutConstraints( 1, 2, 3, 2 ) ); - add( buttonPanel, new TableLayoutConstraints( 0, 3, 3, 3 ) ); + add( localAutoButton, new TableLayoutConstraints( 0, 3 ) ); + add( localText, new TableLayoutConstraints( 1, 3, 3, 3 ) ); + add( perfil1OuterPanel, new TableLayoutConstraints( 0, 4, 1, 4 ) ); + add( perfil2OuterPanel, new TableLayoutConstraints( 2, 4, 3, 4 ) ); + add( buttonPanel, new TableLayoutConstraints( 0, 5, 3, 5 ) ); + + cols = new double[]{ TableLayout.MINIMUM, TableLayout.FILL }; + rows = new double[]{ TableLayout.PREFERRED, TableLayout.FILL }; + + tableLayout = new TableLayout( cols,rows ); + perfil1OuterPanel.setLayout( tableLayout ); + + perfil1OuterPanel.add( perfil1Label, new TableLayoutConstraints( 0, 0 ) ); + perfil1OuterPanel.add( perfil1Text, new TableLayoutConstraints( 1, 0 ) ); + perfil1OuterPanel.add( perfil1Panel, new TableLayoutConstraints( 0, 1, 1, 1 ) ); + + tableLayout = new TableLayout( cols,rows ); + perfil2OuterPanel.setLayout( tableLayout ); + + perfil2OuterPanel.add( perfil2Label, new TableLayoutConstraints( 0, 0 ) ); + perfil2OuterPanel.add( perfil2Text, new TableLayoutConstraints( 1, 0 ) ); + perfil2OuterPanel.add( perfil2Panel, new TableLayoutConstraints( 0, 1, 1, 1 ) ); buttonPanel.setLayout( new FlowLayout( FlowLayout.CENTER ) ); buttonPanel.add( imprimirButton ); diff --git a/trunk/siprp/medicina/locais_realizacao/LocaisRealizacaoWindow.java b/trunk/siprp/medicina/locais_realizacao/LocaisRealizacaoWindow.java index 604241c5..84c7900c 100644 --- a/trunk/siprp/medicina/locais_realizacao/LocaisRealizacaoWindow.java +++ b/trunk/siprp/medicina/locais_realizacao/LocaisRealizacaoWindow.java @@ -68,9 +68,11 @@ public class LocaisRealizacaoWindow extends JFrame protected JLabel numeroConsultasLabel; protected JComboBox prestadoresConsultasCombo; protected JButton enviarConsultasButton; + protected JButton faxConsultasButton; protected JLabel numeroECDsLabel; protected JComboBox prestadoresECDsCombo; protected JButton enviarECDsButton; + protected JButton faxECDsButton; protected LocaisRealizacaoDataProvider provider; @@ -119,6 +121,8 @@ public class LocaisRealizacaoWindow extends JFrame prestadoresConsultasCombo = new JComboBox(); enviarConsultasButton = new JButton( "Atribuir" ); enviarConsultasButton.addActionListener( this ); + faxConsultasButton = new JButton( "Fax" ); + faxConsultasButton.addActionListener( this ); JPanel ecdsPanel = new JPanel(); ecdsPanel.setBorder( BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), "ECDs" ) ); @@ -128,6 +132,8 @@ public class LocaisRealizacaoWindow extends JFrame prestadoresECDsCombo = new JComboBox(); enviarECDsButton = new JButton( "Atribuir" ); enviarECDsButton.addActionListener( this ); + faxECDsButton = new JButton( "Fax" ); + faxECDsButton.addActionListener( this ); dataPanel.addChangeListener( new ChangeListener(){ public void stateChanged(ChangeEvent e) { @@ -168,7 +174,10 @@ public class LocaisRealizacaoWindow extends JFrame 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 ) ); +// consultasPanel.add( faxConsultasButton, new TableLayoutConstraints( 0, 3, 1, 3 ) ); + rows = new double[]{ TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.MINIMUM }; + tableLayout = new TableLayout( cols,rows ); ecdsPanel.setLayout( tableLayout ); @@ -176,6 +185,7 @@ public class LocaisRealizacaoWindow extends JFrame 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 ) ); + ecdsPanel.add( faxECDsButton, new TableLayoutConstraints( 0, 3, 1, 3 ) ); cols = new double[]{ TableLayout.FILL }; rows = new double[]{ TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.FILL }; @@ -245,10 +255,18 @@ public class LocaisRealizacaoWindow extends JFrame { enviarConsultas(); } + else if( source.equals( faxConsultasButton ) ) + { + faxConsultas(); + } else if( source.equals( enviarECDsButton ) ) { enviarECDs(); } + else if( source.equals( faxECDsButton ) ) + { + faxECDs(); + } } @@ -474,6 +492,11 @@ public class LocaisRealizacaoWindow extends JFrame } } + protected void faxECDs() + { + + } + protected void enviarConsultas() { Date data = dataPanel.getDate(); @@ -498,4 +521,8 @@ public class LocaisRealizacaoWindow extends JFrame DialogException.showExceptionMessage( ex, "Erro a atribuir", true ); } } + + protected void faxConsultas() + { + } }