Añado los fuentes de java
This commit is contained in:
+130
@@ -0,0 +1,130 @@
|
||||
package com.tarisan.chipcard.tpvvs.webservicetrayicon;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
import com.tarisan.chipcard.gui.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tarisan.chipcard.tpvvs.webservicetrayicon.accesodatos.*;
|
||||
import java.awt.event.*;
|
||||
/***
|
||||
* Panel que muestra info de las Especialidades sanitarias dadas de alta en el sistema
|
||||
* @author jjrider
|
||||
*/
|
||||
public class EspecialidadesSanitariasPanel extends JPanel{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1308026484400302032L;
|
||||
private JPanel jpPrincipal=new JPanel();
|
||||
private ImageComboBox cmbImageComboEspecialidades=new ImageComboBox();
|
||||
|
||||
private JLabel jlblCodigoEspecialidad=new javax.swing.JLabel("");
|
||||
|
||||
public EspecialidadesSanitariasPanel(){
|
||||
super();
|
||||
init();
|
||||
}
|
||||
|
||||
private void init(){
|
||||
setLayout(new BorderLayout());
|
||||
initProductsPane();
|
||||
JPanel pn=new JPanel();
|
||||
pn.setLayout(new java.awt.GridBagLayout());
|
||||
java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
|
||||
pn.add(jpPrincipal, gridBagConstraints);
|
||||
gridBagConstraints.gridx = 1;
|
||||
add(pn, java.awt.BorderLayout.CENTER);
|
||||
|
||||
cmbImageComboEspecialidades.addActionListener(new ActionListener(){
|
||||
public void actionPerformed(ActionEvent evt){
|
||||
//System.out.println();
|
||||
EspecialidadSanitaria p=(EspecialidadSanitaria)cmbImageComboEspecialidades.getSelectedItem();
|
||||
showEspecialidadSanitaria(p);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void showEspecialidadSanitaria(EspecialidadSanitaria p){
|
||||
if(p!=null){
|
||||
getComboEspecialidades().setSelectedItem(p);
|
||||
String sCode=String.valueOf(p.getCodigoEspecialidad());
|
||||
getjlblCodigoEspecialidad().setText(sCode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void initProductsPane(){
|
||||
jpPrincipal.setLayout(new java.awt.GridBagLayout());
|
||||
jpPrincipal.setBorder(new javax.swing.border.TitledBorder("Especialidades Sanitarias"));
|
||||
java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
|
||||
|
||||
gridBagConstraints.gridwidth = 1;
|
||||
gridBagConstraints.gridy++;
|
||||
|
||||
JLabel label=new javax.swing.JLabel("Nombre Especialidad:");
|
||||
jpPrincipal.add(label, gridBagConstraints);
|
||||
gridBagConstraints.gridx++;
|
||||
jpPrincipal.add(getComboEspecialidades(), gridBagConstraints);
|
||||
|
||||
gridBagConstraints.gridy++;
|
||||
gridBagConstraints.gridx=0;
|
||||
|
||||
label=new javax.swing.JLabel("Código Especialidad:");
|
||||
jpPrincipal.add(label, gridBagConstraints);
|
||||
gridBagConstraints.gridx++;
|
||||
jpPrincipal.add(jlblCodigoEspecialidad, gridBagConstraints);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void update(){
|
||||
getComboEspecialidades().removeAllItems();
|
||||
EspecialidadSanitariaBean b=new EspecialidadSanitariaBean();
|
||||
Vector v=b.getEspecialidadesSanitarias();
|
||||
for(int i=0;i<v.size();i++){
|
||||
EspecialidadSanitaria p=(EspecialidadSanitaria)v.elementAt(i);
|
||||
getComboEspecialidades().addItem(p);
|
||||
}
|
||||
}
|
||||
|
||||
public void showOn(){
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
update();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void showOff(){}
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public ImageComboBox getComboEspecialidades() {
|
||||
return cmbImageComboEspecialidades;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public JLabel getjlblCodigoEspecialidad() {
|
||||
return jlblCodigoEspecialidad;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user