|
|
|
|
@ -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 );
|
|
|
|
|
|