Agrege Trabajadores!
This commit is contained in:
BIN
biblioteca.vpp
BIN
biblioteca.vpp
Binary file not shown.
5
pom.xml
5
pom.xml
@@ -38,6 +38,11 @@
|
|||||||
<artifactId>forms_rt</artifactId>
|
<artifactId>forms_rt</artifactId>
|
||||||
<version>7.0.3</version>
|
<version>7.0.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.lgooddatepicker</groupId>
|
||||||
|
<artifactId>LGoodDatePicker</artifactId>
|
||||||
|
<version>10.3.1</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -304,9 +304,11 @@ create table libro_arriendo
|
|||||||
|
|
||||||
create table usuario
|
create table usuario
|
||||||
(
|
(
|
||||||
id int unsigned primary key auto_increment,
|
id int unsigned primary key auto_increment,
|
||||||
nombre varchar(255) not null,
|
nombre varchar(255) not null,
|
||||||
password varbinary(2000) not null
|
password varbinary(2000) not null,
|
||||||
|
trabajador_id int unsigned not null,
|
||||||
|
foreign key (trabajador_id) references trabajador (id) on delete cascade on update cascade
|
||||||
);
|
);
|
||||||
|
|
||||||
#--------------------------------------------------------------------------------#
|
#--------------------------------------------------------------------------------#
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import javax.swing.UnsupportedLookAndFeelException;
|
|||||||
import xyz.danielcortes.controllers.LaunchController;
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
import xyz.danielcortes.login.LoginController;
|
import xyz.danielcortes.login.LoginController;
|
||||||
import xyz.danielcortes.login.LoginPanel;
|
import xyz.danielcortes.login.LoginPanel;
|
||||||
|
import xyz.danielcortes.models.Usuario;
|
||||||
|
|
||||||
public class App {
|
public class App {
|
||||||
|
|
||||||
@@ -14,7 +15,7 @@ public class App {
|
|||||||
setupLookAndFeel();
|
setupLookAndFeel();
|
||||||
LoginController loginController = new LoginController(new LoginPanel());
|
LoginController loginController = new LoginController(new LoginPanel());
|
||||||
loginController.setLoggedListener(e -> {
|
loginController.setLoggedListener(e -> {
|
||||||
LaunchController launchController = new LaunchController(e.getUser());
|
LaunchController launchController = new LaunchController(new Usuario());
|
||||||
launchController.run();
|
launchController.run();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ import xyz.danielcortes.controllers.libro.LibroCreateController;
|
|||||||
import xyz.danielcortes.controllers.libro.LibroSearchController;
|
import xyz.danielcortes.controllers.libro.LibroSearchController;
|
||||||
import xyz.danielcortes.controllers.libro.LibroUpdateController;
|
import xyz.danielcortes.controllers.libro.LibroUpdateController;
|
||||||
import xyz.danielcortes.controllers.libro.LibroViewController;
|
import xyz.danielcortes.controllers.libro.LibroViewController;
|
||||||
|
import xyz.danielcortes.controllers.trabajador.TrabajadorCreateController;
|
||||||
|
import xyz.danielcortes.controllers.trabajador.TrabajadorSearchController;
|
||||||
|
import xyz.danielcortes.controllers.trabajador.TrabajadorUpdateController;
|
||||||
|
import xyz.danielcortes.controllers.trabajador.TrabajadorViewController;
|
||||||
import xyz.danielcortes.framework.BaseController;
|
import xyz.danielcortes.framework.BaseController;
|
||||||
import xyz.danielcortes.framework.PanelName;
|
import xyz.danielcortes.framework.PanelName;
|
||||||
import xyz.danielcortes.models.Usuario;
|
import xyz.danielcortes.models.Usuario;
|
||||||
@@ -51,6 +55,10 @@ import xyz.danielcortes.views.libro.LibroCreatePanel;
|
|||||||
import xyz.danielcortes.views.libro.LibroSearchPanel;
|
import xyz.danielcortes.views.libro.LibroSearchPanel;
|
||||||
import xyz.danielcortes.views.libro.LibroUpdatePanel;
|
import xyz.danielcortes.views.libro.LibroUpdatePanel;
|
||||||
import xyz.danielcortes.views.libro.LibroViewPanel;
|
import xyz.danielcortes.views.libro.LibroViewPanel;
|
||||||
|
import xyz.danielcortes.views.trabajador.TrabajadorCreatePanel;
|
||||||
|
import xyz.danielcortes.views.trabajador.TrabajadorSearchPanel;
|
||||||
|
import xyz.danielcortes.views.trabajador.TrabajadorUpdatePanel;
|
||||||
|
import xyz.danielcortes.views.trabajador.TrabajadorViewPanel;
|
||||||
|
|
||||||
public class LaunchController {
|
public class LaunchController {
|
||||||
|
|
||||||
@@ -97,6 +105,11 @@ public class LaunchController {
|
|||||||
this.controllers.put(PanelName.EDITORIAL_CREATE, new EditorialCreateController(new EditorialCreatePanel(), this));
|
this.controllers.put(PanelName.EDITORIAL_CREATE, new EditorialCreateController(new EditorialCreatePanel(), this));
|
||||||
this.controllers.put(PanelName.EDITORIAL_UPDATE, new EditorialUpdateController(new EditorialUpdatePanel(), this));
|
this.controllers.put(PanelName.EDITORIAL_UPDATE, new EditorialUpdateController(new EditorialUpdatePanel(), this));
|
||||||
|
|
||||||
|
this.controllers.put(PanelName.TRABAJADOR_VIEW, new TrabajadorViewController(new TrabajadorViewPanel(), this));
|
||||||
|
this.controllers.put(PanelName.TRABAJADOR_SEARCH, new TrabajadorSearchController(new TrabajadorSearchPanel(), this));
|
||||||
|
this.controllers.put(PanelName.TRABAJADOR_CREATE, new TrabajadorCreateController(new TrabajadorCreatePanel(), this));
|
||||||
|
this.controllers.put(PanelName.TRABAJADOR_UPDATE, new TrabajadorUpdateController(new TrabajadorUpdatePanel(), this));
|
||||||
|
|
||||||
for (PanelName name : this.controllers.keySet()) {
|
for (PanelName name : this.controllers.keySet()) {
|
||||||
BaseController controller = this.controllers.get(name);
|
BaseController controller = this.controllers.get(name);
|
||||||
this.frame.addCard(controller.getView().getContentPane(), name);
|
this.frame.addCard(controller.getView().getContentPane(), name);
|
||||||
@@ -125,11 +138,15 @@ public class LaunchController {
|
|||||||
JMenuItem editorialesItem = new JMenuItem("Editoriales");
|
JMenuItem editorialesItem = new JMenuItem("Editoriales");
|
||||||
editorialesItem.setMnemonic(KeyEvent.VK_E);
|
editorialesItem.setMnemonic(KeyEvent.VK_E);
|
||||||
|
|
||||||
|
JMenuItem trabajadoresItem = new JMenuItem("Trabajadores");
|
||||||
|
trabajadoresItem.setMnemonic(KeyEvent.VK_T);
|
||||||
|
|
||||||
autoresItem.addActionListener(e -> this.showCard(PanelName.AUTOR_SEARCH));
|
autoresItem.addActionListener(e -> this.showCard(PanelName.AUTOR_SEARCH));
|
||||||
idiomasItem.addActionListener(e -> this.showCard(PanelName.IDIOMA_SEARCH));
|
idiomasItem.addActionListener(e -> this.showCard(PanelName.IDIOMA_SEARCH));
|
||||||
librosItem.addActionListener(e -> this.showCard(PanelName.LIBRO_SEARCH));
|
librosItem.addActionListener(e -> this.showCard(PanelName.LIBRO_SEARCH));
|
||||||
categoriasItem.addActionListener(e -> this.showCard(PanelName.CATEGORIA_SEARCH));
|
categoriasItem.addActionListener(e -> this.showCard(PanelName.CATEGORIA_SEARCH));
|
||||||
editorialesItem.addActionListener(e -> this.showCard(PanelName.EDITORIAL_SEARCH));
|
editorialesItem.addActionListener(e -> this.showCard(PanelName.EDITORIAL_SEARCH));
|
||||||
|
trabajadoresItem.addActionListener(e -> this.showCard(PanelName.TRABAJADOR_SEARCH));
|
||||||
|
|
||||||
menuBar.add(mantenedoresMenu);
|
menuBar.add(mantenedoresMenu);
|
||||||
|
|
||||||
@@ -138,6 +155,7 @@ public class LaunchController {
|
|||||||
mantenedoresMenu.add(idiomasItem);
|
mantenedoresMenu.add(idiomasItem);
|
||||||
mantenedoresMenu.add(categoriasItem);
|
mantenedoresMenu.add(categoriasItem);
|
||||||
mantenedoresMenu.add(editorialesItem);
|
mantenedoresMenu.add(editorialesItem);
|
||||||
|
mantenedoresMenu.add(trabajadoresItem);
|
||||||
|
|
||||||
this.frame.setJMenuBar(menuBar);
|
this.frame.setJMenuBar(menuBar);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,117 @@
|
|||||||
|
package xyz.danielcortes.controllers.trabajador;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.framework.BaseController;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.framework.Hash;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
|
import xyz.danielcortes.framework.ValidationResult;
|
||||||
|
import xyz.danielcortes.models.Trabajador;
|
||||||
|
import xyz.danielcortes.models.Usuario;
|
||||||
|
import xyz.danielcortes.repository.TrabajadorRespository;
|
||||||
|
import xyz.danielcortes.repository.UsuarioRepository;
|
||||||
|
import xyz.danielcortes.validator.TrabajadorValidator;
|
||||||
|
import xyz.danielcortes.validator.UsuarioValidator;
|
||||||
|
import xyz.danielcortes.views.trabajador.TrabajadorCreatePanel;
|
||||||
|
|
||||||
|
public class TrabajadorCreateController extends BaseController {
|
||||||
|
|
||||||
|
private TrabajadorCreatePanel view;
|
||||||
|
private TrabajadorRespository trabajadorRespository;
|
||||||
|
private TrabajadorValidator trabajadorValidator;
|
||||||
|
private UsuarioRepository usuarioRepository;
|
||||||
|
private UsuarioValidator usuarioValidator;
|
||||||
|
|
||||||
|
public TrabajadorCreateController(TrabajadorCreatePanel view, LaunchController parent) {
|
||||||
|
super(parent);
|
||||||
|
this.view = view;
|
||||||
|
this.trabajadorRespository = new TrabajadorRespository();
|
||||||
|
this.trabajadorValidator = new TrabajadorValidator(this.trabajadorRespository);
|
||||||
|
this.usuarioRepository = new UsuarioRepository();
|
||||||
|
this.usuarioValidator = new UsuarioValidator(this.usuarioRepository);
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void show() {
|
||||||
|
this.view.getRutField().requestFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getGuardarButton().addActionListener(e -> save());
|
||||||
|
this.view.getVolverButton().addActionListener(e -> this.getParentController().showCard(PanelName.TRABAJADOR_SEARCH));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void save() {
|
||||||
|
String rut = this.view.getRutField().getText();
|
||||||
|
ValidationResult rutValidation = this.trabajadorValidator.validateRut(rut);
|
||||||
|
if(rutValidation.hasError()){
|
||||||
|
rutValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String nombre = this.view.getNombreField().getText();
|
||||||
|
ValidationResult nombreValidation = this.trabajadorValidator.validateNombre(nombre);
|
||||||
|
if(nombreValidation.hasError()){
|
||||||
|
nombreValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String apellidoPaterno = this.view.getApellidoPaternoField().getText();
|
||||||
|
ValidationResult apellidoPaternoValidation = this.trabajadorValidator.validateApellidoPaterno(apellidoPaterno);
|
||||||
|
if(apellidoPaternoValidation.hasError()){
|
||||||
|
apellidoPaternoValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String apellidoMaterno = this.view.getApellidoMaternoField().getText();
|
||||||
|
ValidationResult apellidoMaternoValidation = this.trabajadorValidator.validateApellidoMaterno(apellidoMaterno);
|
||||||
|
if(apellidoMaternoValidation.hasError()){
|
||||||
|
apellidoMaternoValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LocalDate fechaContrato = this.view.getFechaContratoPicker().getDate();
|
||||||
|
ValidationResult fechaContratoValidation = this.trabajadorValidator.validateFechaContrato(fechaContrato);
|
||||||
|
if(fechaContratoValidation.hasError()){
|
||||||
|
fechaContratoValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String username = this.view.getUsernameField().getText();
|
||||||
|
ValidationResult usernameValidator = this.usuarioValidator.validateUsername(username);
|
||||||
|
if(usernameValidator.hasError()){
|
||||||
|
usernameValidator.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
char[] password = this.view.getPassField().getPassword();
|
||||||
|
ValidationResult passwordValidation = this.usuarioValidator.validatePassword(password);
|
||||||
|
if(passwordValidation.hasError()){
|
||||||
|
passwordValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Trabajador trabajador = new Trabajador();
|
||||||
|
trabajador.setNombre(nombre);
|
||||||
|
trabajador.setApellidoPaterno(apellidoPaterno);
|
||||||
|
trabajador.setApellidoMaterno(apellidoMaterno);
|
||||||
|
trabajador.setFechaContrato(fechaContrato);
|
||||||
|
trabajador.setRut(rut);
|
||||||
|
|
||||||
|
Usuario usuario = new Usuario();
|
||||||
|
usuario.setNombre(username);
|
||||||
|
usuario.setPassword(Hash.sha256(new String(password).getBytes(StandardCharsets.UTF_8)));
|
||||||
|
usuario.setTrabajador(trabajador);
|
||||||
|
|
||||||
|
trabajadorRespository.save(trabajador);
|
||||||
|
usuarioRepository.save(usuario);
|
||||||
|
|
||||||
|
this.getParentController().showCard(PanelName.TRABAJADOR_SEARCH);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasePanel getView() {
|
||||||
|
return this.view;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
package xyz.danielcortes.controllers.trabajador;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.framework.BaseController;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.framework.BaseTableModel;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
|
import xyz.danielcortes.models.Trabajador;
|
||||||
|
import xyz.danielcortes.repository.TrabajadorRespository;
|
||||||
|
import xyz.danielcortes.repository.UsuarioRepository;
|
||||||
|
import xyz.danielcortes.validator.TrabajadorValidator;
|
||||||
|
import xyz.danielcortes.validator.UsuarioValidator;
|
||||||
|
import xyz.danielcortes.views.trabajador.TrabajadorSearchPanel;
|
||||||
|
|
||||||
|
public class TrabajadorSearchController extends BaseController {
|
||||||
|
|
||||||
|
private TrabajadorSearchPanel view;
|
||||||
|
private TrabajadorRespository trabajadorRespository;
|
||||||
|
private UsuarioRepository usuarioRepository;
|
||||||
|
private TrabajadorValidator trabajadorValidator;
|
||||||
|
private UsuarioValidator usuarioValidator;
|
||||||
|
|
||||||
|
public TrabajadorSearchController(TrabajadorSearchPanel view, LaunchController parent) {
|
||||||
|
super(parent);
|
||||||
|
this.view = view;
|
||||||
|
this.trabajadorRespository = new TrabajadorRespository();
|
||||||
|
this.usuarioRepository = new UsuarioRepository();
|
||||||
|
this.trabajadorValidator = new TrabajadorValidator(this.trabajadorRespository);
|
||||||
|
this.usuarioValidator = new UsuarioValidator(this.usuarioRepository);
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void show() {
|
||||||
|
this.reload();
|
||||||
|
this.view.getTrabajadorTable().clearSelection();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void reload() {
|
||||||
|
this.loadTrabajadorTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getCrearButton().addActionListener(e -> this.getParentController().showCard(PanelName.TRABAJADOR_CREATE));
|
||||||
|
this.view.getSearchField().addActionListener(e -> this.search());
|
||||||
|
this.view.getBuscarButton().addActionListener(e -> this.search());
|
||||||
|
this.view.getVerButton().addActionListener(e -> this.view());
|
||||||
|
this.view.getEditarButton().addActionListener(e -> this.edit());
|
||||||
|
this.view.getEliminarButton().addActionListener(e -> this.delete());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void edit() {
|
||||||
|
Trabajador trabajador = this.getSelectedTrabajador();
|
||||||
|
if (trabajador != null) {
|
||||||
|
TrabajadorUpdateController controller = (TrabajadorUpdateController) this.getParentController().getCard(PanelName.TRABAJADOR_UPDATE);
|
||||||
|
controller.setTrabajador(trabajador);
|
||||||
|
this.getParentController().showCard(PanelName.TRABAJADOR_UPDATE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void delete() {
|
||||||
|
Trabajador trabajador = this.getSelectedTrabajador();
|
||||||
|
if (trabajador == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
int option = JOptionPane.showConfirmDialog(
|
||||||
|
null,
|
||||||
|
"¿Estas seguro de que deseas eliminar el trabajador?",
|
||||||
|
"Confirmacion",
|
||||||
|
JOptionPane.YES_NO_OPTION,
|
||||||
|
JOptionPane.QUESTION_MESSAGE
|
||||||
|
);
|
||||||
|
|
||||||
|
if (option == JOptionPane.NO_OPTION)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.trabajadorRespository.delete(trabajador);
|
||||||
|
this.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void view() {
|
||||||
|
Trabajador trabajador = this.getSelectedTrabajador();
|
||||||
|
if (trabajador != null) {
|
||||||
|
TrabajadorViewController controller = (TrabajadorViewController) this.getParentController().getCard(PanelName.TRABAJADOR_VIEW);
|
||||||
|
controller.setTrabajador(trabajador);
|
||||||
|
this.getParentController().showCard(PanelName.TRABAJADOR_VIEW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void search() {
|
||||||
|
String term = this.view.getSearchField().getText();
|
||||||
|
List<Trabajador> trabajadores = this.trabajadorRespository.search(term);
|
||||||
|
this.loadTrabajadorTable(trabajadores);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadTrabajadorTable() {
|
||||||
|
List<Trabajador> trabajadores = this.trabajadorRespository.getAll();
|
||||||
|
loadTrabajadorTable(trabajadores);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadTrabajadorTable(List<Trabajador> trabajadores) {
|
||||||
|
BaseTableModel<Trabajador> model = this.view.getTrabajadorModel();
|
||||||
|
model.setRows(trabajadores);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Trabajador getSelectedTrabajador() {
|
||||||
|
int selectedRow = this.view.getTrabajadorTable().getSelectedRow();
|
||||||
|
if (selectedRow == -1) {
|
||||||
|
JOptionPane.showMessageDialog(
|
||||||
|
null,
|
||||||
|
"No hay trabajador seleccionado",
|
||||||
|
"Error",
|
||||||
|
JOptionPane.ERROR_MESSAGE
|
||||||
|
);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return this.view.getTrabajadorModel().getRow(selectedRow);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasePanel getView() {
|
||||||
|
return this.view;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package xyz.danielcortes.controllers.trabajador;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.framework.BaseController;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
|
import xyz.danielcortes.framework.ValidationResult;
|
||||||
|
import xyz.danielcortes.models.Trabajador;
|
||||||
|
import xyz.danielcortes.repository.TrabajadorRespository;
|
||||||
|
import xyz.danielcortes.validator.TrabajadorValidator;
|
||||||
|
import xyz.danielcortes.views.trabajador.TrabajadorUpdatePanel;
|
||||||
|
|
||||||
|
public class TrabajadorUpdateController extends BaseController {
|
||||||
|
private Trabajador trabajador;
|
||||||
|
private TrabajadorUpdatePanel view;
|
||||||
|
private TrabajadorRespository trabajadorRespository;
|
||||||
|
private TrabajadorValidator trabajadorValidator;
|
||||||
|
|
||||||
|
public TrabajadorUpdateController(TrabajadorUpdatePanel view, LaunchController parent){
|
||||||
|
super(parent);
|
||||||
|
this.view = view;
|
||||||
|
this.trabajadorRespository = new TrabajadorRespository();
|
||||||
|
this.trabajadorValidator = new TrabajadorValidator(this.trabajadorRespository);
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrabajador(Trabajador trabajador) {
|
||||||
|
this.trabajador = trabajador;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void show() {
|
||||||
|
this.fillTrabajador();
|
||||||
|
this.view.getRutField().requestFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fillTrabajador() {
|
||||||
|
if(trabajadorRespository == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.view.getRutField().setText(this.trabajador.getRut());
|
||||||
|
this.view.getNombreField().setText(this.trabajador.getNombre());
|
||||||
|
this.view.getApellidoPaternoField().setText(this.trabajador.getApellidoPaterno());
|
||||||
|
this.view.getApellidoMaternoField().setText(this.trabajador.getApellidoMaterno());
|
||||||
|
this.view.getFechaContratoField().setDate(this.trabajador.getFechaContrato());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getActualizarButton().addActionListener(e -> update());
|
||||||
|
this.view.getVolverButton().addActionListener(e -> this.getParentController().showCard(PanelName.TRABAJADOR_SEARCH));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void update() {
|
||||||
|
String rut = this.view.getRutField().getText();
|
||||||
|
ValidationResult rutValidation = this.trabajadorValidator.validateRut(rut);
|
||||||
|
if(rutValidation.hasError()){
|
||||||
|
rutValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String nombre = this.view.getNombreField().getText();
|
||||||
|
ValidationResult nombreValidation = this.trabajadorValidator.validateNombre(nombre);
|
||||||
|
if(nombreValidation.hasError()){
|
||||||
|
nombreValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String apellidoPaterno = this.view.getApellidoPaternoField().getText();
|
||||||
|
ValidationResult apellidoPaternoValidation = this.trabajadorValidator.validateApellidoPaterno(apellidoPaterno);
|
||||||
|
if(apellidoPaternoValidation.hasError()){
|
||||||
|
apellidoPaternoValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String apellidoMaterno = this.view.getApellidoPaternoField().getText();
|
||||||
|
ValidationResult apellidoMaternoValidation = this.trabajadorValidator.validateApellidoMaterno(apellidoMaterno);
|
||||||
|
if(apellidoMaternoValidation.hasError()){
|
||||||
|
apellidoMaternoValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LocalDate fechaContrato = this.view.getFechaContratoField().getDate();
|
||||||
|
ValidationResult fechaContratoValidation = this.trabajadorValidator.validateFechaContrato(fechaContrato);
|
||||||
|
if(fechaContratoValidation.hasError()){
|
||||||
|
fechaContratoValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
assert this.trabajador != null;
|
||||||
|
this.trabajador.setNombre(nombre);
|
||||||
|
this.trabajador.setApellidoPaterno(apellidoPaterno);
|
||||||
|
this.trabajador.setApellidoMaterno(apellidoMaterno);
|
||||||
|
this.trabajador.setFechaContrato(fechaContrato);
|
||||||
|
this.trabajador.setRut(rut);
|
||||||
|
this.trabajadorRespository.update(this.trabajador);
|
||||||
|
|
||||||
|
this.getParentController().showCard(PanelName.TRABAJADOR_SEARCH);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasePanel getView() { return view; }
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package xyz.danielcortes.controllers.trabajador;
|
||||||
|
|
||||||
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.framework.BaseController;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
|
import xyz.danielcortes.models.Trabajador;
|
||||||
|
import xyz.danielcortes.views.trabajador.TrabajadorViewPanel;
|
||||||
|
|
||||||
|
public class TrabajadorViewController extends BaseController {
|
||||||
|
|
||||||
|
private Trabajador trabajador;
|
||||||
|
private TrabajadorViewPanel view;
|
||||||
|
|
||||||
|
public TrabajadorViewController(TrabajadorViewPanel view, LaunchController parent) {
|
||||||
|
super(parent);
|
||||||
|
this.view = view;
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void show() {
|
||||||
|
this.fillTrabajador();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrabajador(Trabajador trabajador) {
|
||||||
|
this.trabajador = trabajador;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getVolverButton().addActionListener(e -> this.getParentController().showCard(PanelName.TRABAJADOR_SEARCH));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fillTrabajador() {
|
||||||
|
if (trabajador == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.view.getRutField().setText(this.trabajador.getNombre());
|
||||||
|
this.view.getNombreField().setText(this.trabajador.getNombre());
|
||||||
|
this.view.getApellidoPaternoField().setText(this.trabajador.getApellidoPaterno());
|
||||||
|
this.view.getApellidoMaternoField().setText(this.trabajador.getApellidoMaterno());
|
||||||
|
this.view.getFechaContratoPicker().setDate(this.trabajador.getFechaContrato());
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasePanel getView() {
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,4 +27,9 @@ public enum PanelName {
|
|||||||
AUTOR_SEARCH,
|
AUTOR_SEARCH,
|
||||||
AUTOR_CREATE,
|
AUTOR_CREATE,
|
||||||
AUTOR_UPDATE,
|
AUTOR_UPDATE,
|
||||||
|
|
||||||
|
TRABAJADOR_VIEW,
|
||||||
|
TRABAJADOR_SEARCH,
|
||||||
|
TRABAJADOR_CREATE,
|
||||||
|
TRABAJADOR_UPDATE,
|
||||||
}
|
}
|
||||||
|
|||||||
101
src/main/java/xyz/danielcortes/models/Trabajador.java
Normal file
101
src/main/java/xyz/danielcortes/models/Trabajador.java
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
package xyz.danielcortes.models;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.Objects;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "trabajador")
|
||||||
|
public class Trabajador {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Column(name = "rut")
|
||||||
|
private String rut;
|
||||||
|
|
||||||
|
@Column(name = "nombre")
|
||||||
|
private String nombre;
|
||||||
|
|
||||||
|
@Column(name = "apellido_paterno")
|
||||||
|
private String apellidoPaterno;
|
||||||
|
|
||||||
|
@Column(name = "apellido_materno")
|
||||||
|
private String apellidoMaterno;
|
||||||
|
|
||||||
|
@Column(name = "fecha_contrato")
|
||||||
|
private LocalDate fechaContrato;
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRut() {
|
||||||
|
return rut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRut(String rut) {
|
||||||
|
this.rut = rut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNombre() {
|
||||||
|
return nombre;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNombre(String nombre) {
|
||||||
|
this.nombre = nombre;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApellidoPaterno() {
|
||||||
|
return apellidoPaterno;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApellidoPaterno(String apellidoPaterno) {
|
||||||
|
this.apellidoPaterno = apellidoPaterno;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApellidoMaterno() {
|
||||||
|
return apellidoMaterno;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApellidoMaterno(String apellidoMaterno) {
|
||||||
|
this.apellidoMaterno = apellidoMaterno;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getFechaContrato() {
|
||||||
|
return fechaContrato;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFechaContrato(LocalDate fechaContrato) {
|
||||||
|
this.fechaContrato = fechaContrato;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o)
|
||||||
|
return true;
|
||||||
|
if (!(o instanceof Trabajador))
|
||||||
|
return false;
|
||||||
|
Trabajador that = (Trabajador) o;
|
||||||
|
return Objects.equals(id, that.id) &&
|
||||||
|
Objects.equals(rut, that.rut) &&
|
||||||
|
Objects.equals(nombre, that.nombre) &&
|
||||||
|
Objects.equals(apellidoPaterno, that.apellidoPaterno) &&
|
||||||
|
Objects.equals(apellidoMaterno, that.apellidoMaterno) &&
|
||||||
|
Objects.equals(fechaContrato, that.fechaContrato);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(id, rut, nombre, apellidoPaterno, apellidoMaterno, fechaContrato);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,11 +7,14 @@ import javax.persistence.Entity;
|
|||||||
import javax.persistence.GeneratedValue;
|
import javax.persistence.GeneratedValue;
|
||||||
import javax.persistence.GenerationType;
|
import javax.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.OneToOne;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "usuario")
|
@Table(name = "usuario")
|
||||||
public class Usuario {
|
public class Usuario {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Integer id;
|
private Integer id;
|
||||||
@@ -22,6 +25,10 @@ public class Usuario {
|
|||||||
@Column(name = "password", columnDefinition = "varbinary(2000)")
|
@Column(name = "password", columnDefinition = "varbinary(2000)")
|
||||||
private byte[] password;
|
private byte[] password;
|
||||||
|
|
||||||
|
@OneToOne
|
||||||
|
@JoinColumn(name = "trabajador_id", referencedColumnName = "id")
|
||||||
|
private Trabajador trabajador;
|
||||||
|
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@@ -46,6 +53,14 @@ public class Usuario {
|
|||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Trabajador getTrabajador() {
|
||||||
|
return trabajador;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrabajador(Trabajador trabajador) {
|
||||||
|
this.trabajador = trabajador;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package xyz.danielcortes.repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.persistence.TypedQuery;
|
||||||
|
import javax.persistence.criteria.CriteriaBuilder;
|
||||||
|
import javax.persistence.criteria.CriteriaQuery;
|
||||||
|
import javax.persistence.criteria.Root;
|
||||||
|
import xyz.danielcortes.framework.BaseRepository;
|
||||||
|
import xyz.danielcortes.models.Trabajador;
|
||||||
|
|
||||||
|
public class TrabajadorRespository extends BaseRepository<Trabajador> {
|
||||||
|
|
||||||
|
public List<Trabajador> getAll() {
|
||||||
|
TypedQuery<Trabajador> query = em.createQuery("SELECT t FROM Trabajador t", Trabajador.class);
|
||||||
|
return query.getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Trabajador> search(String term) {
|
||||||
|
CriteriaBuilder cb = em.getCriteriaBuilder();
|
||||||
|
CriteriaQuery<Trabajador> query = cb.createQuery(Trabajador.class);
|
||||||
|
Root<Trabajador> r = query.from(Trabajador.class);
|
||||||
|
query.where(
|
||||||
|
cb.or(
|
||||||
|
cb.like(cb.lower(r.get("rut")), "%" + term.toLowerCase() + "%"),
|
||||||
|
cb.like(cb.lower(r.get("nombre")), "%" + term.toLowerCase() + "%"),
|
||||||
|
cb.like(cb.lower(r.get("apellidoPaterno")), "%" + term.toLowerCase() + "%"),
|
||||||
|
cb.like(cb.lower(r.get("apellidoMaterno")), "%" + term.toLowerCase() + "%"),
|
||||||
|
cb.like(r.get("fechaContrato"), "%" + term.toLowerCase() + "%")
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return em.createQuery(query).getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package xyz.danielcortes.validator;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import xyz.danielcortes.framework.ValidationResult;
|
||||||
|
import xyz.danielcortes.repository.TrabajadorRespository;
|
||||||
|
|
||||||
|
public class TrabajadorValidator {
|
||||||
|
|
||||||
|
private TrabajadorRespository trabajadorRespository;
|
||||||
|
|
||||||
|
public TrabajadorValidator(TrabajadorRespository trabajadorRespository) {
|
||||||
|
this.trabajadorRespository = trabajadorRespository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ValidationResult validateNombre(String nombre) {
|
||||||
|
if (nombre == null) {
|
||||||
|
return new ValidationResult("El nombre es nulo");
|
||||||
|
} else if (nombre.isEmpty()) {
|
||||||
|
return new ValidationResult("El nombre esta vacío");
|
||||||
|
}
|
||||||
|
return ValidationResult.NON_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ValidationResult validateApellidoPaterno(String apellidoPaterno) {
|
||||||
|
if (apellidoPaterno == null) {
|
||||||
|
return new ValidationResult("El apellido paterno es nulo");
|
||||||
|
} else if (apellidoPaterno.isEmpty()) {
|
||||||
|
return new ValidationResult("El apellido paterno esta vacío");
|
||||||
|
}
|
||||||
|
return ValidationResult.NON_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ValidationResult validateApellidoMaterno(String apellidoMaterno) {
|
||||||
|
if (apellidoMaterno == null) {
|
||||||
|
return new ValidationResult("El apellido materno es nulo");
|
||||||
|
} else if (apellidoMaterno.isEmpty()) {
|
||||||
|
return new ValidationResult("El apellido materno esta vacío");
|
||||||
|
}
|
||||||
|
return ValidationResult.NON_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ValidationResult validateRut(String rut) {
|
||||||
|
if (rut == null) {
|
||||||
|
return new ValidationResult("El rut es nulo");
|
||||||
|
} else if (rut.isEmpty()) {
|
||||||
|
return new ValidationResult("El rut esta vacío");
|
||||||
|
}
|
||||||
|
if (!rutChecksum(rut)) {
|
||||||
|
return new ValidationResult("El rut es invalido");
|
||||||
|
}
|
||||||
|
|
||||||
|
return ValidationResult.NON_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ValidationResult validateFechaContrato(LocalDate date) {
|
||||||
|
if (date == null) {
|
||||||
|
return new ValidationResult("La fecha es nula");
|
||||||
|
}
|
||||||
|
return ValidationResult.NON_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean rutChecksum(String rut) {
|
||||||
|
rut = rut.toLowerCase().replaceAll("[^\\dkK]", "");
|
||||||
|
int sum = 0;
|
||||||
|
for (int i = rut.length() - 2, j = 2; i >= 0; i--, j++) {
|
||||||
|
int digit = rut.charAt(i) - '0';
|
||||||
|
if (j == 8)
|
||||||
|
j = 2;
|
||||||
|
|
||||||
|
sum += digit * j;
|
||||||
|
}
|
||||||
|
|
||||||
|
int mod11 = 11 - (sum % 11);
|
||||||
|
char lastchar = rut.charAt(rut.length() - 1);
|
||||||
|
|
||||||
|
char digitoVerificador = (char) (mod11 + '0');
|
||||||
|
if (mod11 == 11)
|
||||||
|
digitoVerificador = '0';
|
||||||
|
if (mod11 == 10)
|
||||||
|
digitoVerificador = 'k';
|
||||||
|
|
||||||
|
return lastchar == digitoVerificador;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package xyz.danielcortes.validator;
|
||||||
|
|
||||||
|
import xyz.danielcortes.framework.ValidationResult;
|
||||||
|
import xyz.danielcortes.repository.UsuarioRepository;
|
||||||
|
|
||||||
|
public class UsuarioValidator {
|
||||||
|
|
||||||
|
private UsuarioRepository usuarioRepository;
|
||||||
|
|
||||||
|
public UsuarioValidator(UsuarioRepository usuarioRepository) {
|
||||||
|
this.usuarioRepository = usuarioRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ValidationResult validateUsername(String username) {
|
||||||
|
if (username == null) {
|
||||||
|
return new ValidationResult("El nombre de usuario es nulo");
|
||||||
|
} else if (username.isEmpty()) {
|
||||||
|
return new ValidationResult("El nombre de usuario esta vacío");
|
||||||
|
}
|
||||||
|
return ValidationResult.NON_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ValidationResult validatePassword(char[] password) {
|
||||||
|
if (password == null) {
|
||||||
|
return new ValidationResult("La contraseña es nula");
|
||||||
|
} else if (password.length == 0) {
|
||||||
|
return new ValidationResult("La contraseña esta vacia");
|
||||||
|
} else if (password.length < 6) {
|
||||||
|
return new ValidationResult("La contraseña debe ser de al menos 6 caracteres");
|
||||||
|
}
|
||||||
|
return ValidationResult.NON_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,170 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.trabajador.TrabajadorCreatePanel">
|
||||||
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="16" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="518" height="518"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="e1d53" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Nombre:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="a56da" class="javax.swing.JTextField" binding="nombreField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="b0057" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Apellido Paterno:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="dfe9b" class="javax.swing.JTextField" binding="apellidoPaternoField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="196df" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Apellido Materno:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="cd6a6" class="javax.swing.JTextField" binding="apellidoMaternoField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<vspacer id="8d91b">
|
||||||
|
<constraints>
|
||||||
|
<grid row="15" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</vspacer>
|
||||||
|
<hspacer id="a8101">
|
||||||
|
<constraints>
|
||||||
|
<grid row="15" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<hspacer id="f2d12">
|
||||||
|
<constraints>
|
||||||
|
<grid row="15" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<grid id="4b9e5" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
|
<constraints>
|
||||||
|
<grid row="14" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="a11e3" class="javax.swing.JButton" binding="guardarButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Guardar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="ef3e2" class="javax.swing.JButton" binding="volverButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Volver"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
<component id="8fb77" class="javax.swing.JTextField" binding="rutField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="23030" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Rut:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="17778" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Fecha Contrato:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="17515" class="com.github.lgooddatepicker.components.DatePicker" binding="fechaContratoPicker">
|
||||||
|
<constraints>
|
||||||
|
<grid row="9" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="12321" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="10" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Nombre de usuario:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="8e050" class="javax.swing.JTextField" binding="usernameField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="11" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="230d4" class="javax.swing.JPasswordField" binding="passField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="13" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="86217" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="12" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Contraseña:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,178 @@
|
|||||||
|
package xyz.danielcortes.views.trabajador;
|
||||||
|
|
||||||
|
import com.github.lgooddatepicker.components.DatePicker;
|
||||||
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
|
import com.intellij.uiDesigner.core.Spacer;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Insets;
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JPasswordField;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
|
||||||
|
public class TrabajadorCreatePanel extends BasePanel {
|
||||||
|
|
||||||
|
private JTextField nombreField;
|
||||||
|
private JTextField apellidoPaternoField;
|
||||||
|
private JTextField apellidoMaternoField;
|
||||||
|
private JButton guardarButton;
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JButton volverButton;
|
||||||
|
private JTextField rutField;
|
||||||
|
private DatePicker fechaContratoPicker;
|
||||||
|
private JTextField usernameField;
|
||||||
|
private JPasswordField passField;
|
||||||
|
|
||||||
|
public JTextField getNombreField() {
|
||||||
|
return nombreField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getApellidoPaternoField() {
|
||||||
|
return apellidoPaternoField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getApellidoMaternoField() {
|
||||||
|
return apellidoMaternoField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getGuardarButton() {
|
||||||
|
return guardarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getVolverButton() {
|
||||||
|
return volverButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getRutField() {
|
||||||
|
return rutField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatePicker getFechaContratoPicker() {
|
||||||
|
return fechaContratoPicker;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getUsernameField() {
|
||||||
|
return usernameField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JPasswordField getPassField() {
|
||||||
|
return passField;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||||
|
// >>> IMPORTANT!! <<<
|
||||||
|
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||||
|
$$$setupUI$$$();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
|
||||||
|
*
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
private void $$$setupUI$$$() {
|
||||||
|
contentPane = new JPanel();
|
||||||
|
contentPane.setLayout(new GridLayoutManager(16, 3, new Insets(20, 20, 20, 20), -1, -1));
|
||||||
|
final JLabel label1 = new JLabel();
|
||||||
|
label1.setText("Nombre:");
|
||||||
|
contentPane.add(label1, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
nombreField = new JTextField();
|
||||||
|
contentPane.add(nombreField,
|
||||||
|
new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
final JLabel label2 = new JLabel();
|
||||||
|
label2.setText("Apellido Paterno:");
|
||||||
|
contentPane.add(label2, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
apellidoPaternoField = new JTextField();
|
||||||
|
contentPane.add(apellidoPaternoField,
|
||||||
|
new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
final JLabel label3 = new JLabel();
|
||||||
|
label3.setText("Apellido Materno:");
|
||||||
|
contentPane.add(label3, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
apellidoMaternoField = new JTextField();
|
||||||
|
contentPane.add(apellidoMaternoField,
|
||||||
|
new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
final Spacer spacer1 = new Spacer();
|
||||||
|
contentPane.add(spacer1,
|
||||||
|
new GridConstraints(15, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final Spacer spacer2 = new Spacer();
|
||||||
|
contentPane.add(spacer2,
|
||||||
|
new GridConstraints(15, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
|
||||||
|
null, null, null, 0, false));
|
||||||
|
final Spacer spacer3 = new Spacer();
|
||||||
|
contentPane.add(spacer3,
|
||||||
|
new GridConstraints(15, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
|
||||||
|
null, null, null, 0, false));
|
||||||
|
final JPanel panel1 = new JPanel();
|
||||||
|
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
|
||||||
|
contentPane.add(panel1, new GridConstraints(14, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
|
||||||
|
guardarButton = new JButton();
|
||||||
|
guardarButton.setText("Guardar");
|
||||||
|
panel1.add(guardarButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
volverButton = new JButton();
|
||||||
|
volverButton.setText("Volver");
|
||||||
|
panel1.add(volverButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
rutField = new JTextField();
|
||||||
|
contentPane.add(rutField,
|
||||||
|
new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||||
|
final JLabel label4 = new JLabel();
|
||||||
|
label4.setText("Rut:");
|
||||||
|
contentPane.add(label4, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
final JLabel label5 = new JLabel();
|
||||||
|
label5.setText("Fecha Contrato:");
|
||||||
|
contentPane.add(label5, new GridConstraints(8, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
fechaContratoPicker = new DatePicker();
|
||||||
|
contentPane.add(fechaContratoPicker,
|
||||||
|
new GridConstraints(9, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
final JLabel label6 = new JLabel();
|
||||||
|
label6.setText("Nombre de usuario:");
|
||||||
|
contentPane.add(label6, new GridConstraints(10, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
usernameField = new JTextField();
|
||||||
|
contentPane.add(usernameField,
|
||||||
|
new GridConstraints(11, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||||
|
passField = new JPasswordField();
|
||||||
|
contentPane.add(passField,
|
||||||
|
new GridConstraints(13, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||||
|
final JLabel label7 = new JLabel();
|
||||||
|
label7.setText("Contraseña:");
|
||||||
|
contentPane.add(label7, new GridConstraints(12, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.trabajador.TrabajadorSearchPanel">
|
||||||
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="501" height="443"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<scrollpane id="4cd2">
|
||||||
|
<constraints>
|
||||||
|
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="c98c0" class="javax.swing.JTable" binding="trabajadorTable" custom-create="true">
|
||||||
|
<constraints/>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</scrollpane>
|
||||||
|
<component id="ced19" class="javax.swing.JTextField" binding="searchField" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="d89c0" class="javax.swing.JButton" binding="buscarButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Buscar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<grid id="6e1ed" layout-manager="GridLayoutManager" row-count="1" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
|
<constraints>
|
||||||
|
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="23e34" class="javax.swing.JButton" binding="verButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Ver"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="40732" class="javax.swing.JButton" binding="eliminarButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Eliminar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="99cf5" class="javax.swing.JButton" binding="editarButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Editar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="bdc48" class="javax.swing.JButton" binding="crearButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Crear"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,154 @@
|
|||||||
|
package xyz.danielcortes.views.trabajador;
|
||||||
|
|
||||||
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Insets;
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.JTable;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import javax.swing.ListSelectionModel;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.framework.BaseTableModel;
|
||||||
|
import xyz.danielcortes.models.Trabajador;
|
||||||
|
|
||||||
|
public class TrabajadorSearchPanel extends BasePanel {
|
||||||
|
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JTable trabajadorTable;
|
||||||
|
private JTextField searchField;
|
||||||
|
private JButton buscarButton;
|
||||||
|
private JButton verButton;
|
||||||
|
private JButton eliminarButton;
|
||||||
|
private JButton editarButton;
|
||||||
|
private JButton crearButton;
|
||||||
|
private BaseTableModel<Trabajador> trabajadorModel;
|
||||||
|
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTable getTrabajadorTable() {
|
||||||
|
return trabajadorTable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getSearchField() {
|
||||||
|
return searchField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getBuscarButton() {
|
||||||
|
return buscarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getVerButton() {
|
||||||
|
return verButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getEliminarButton() {
|
||||||
|
return eliminarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getEditarButton() {
|
||||||
|
return editarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getCrearButton() {
|
||||||
|
return crearButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BaseTableModel<Trabajador> getTrabajadorModel() {
|
||||||
|
return trabajadorModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createUIComponents() {
|
||||||
|
this.createTrabajadorTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createTrabajadorTable() {
|
||||||
|
// @formatter:off
|
||||||
|
this.trabajadorModel= new BaseTableModel<>(
|
||||||
|
new String[]{"Rut", "Nombre", "Apellido Paterno", "Apellido Materno", "Fecha Contrato"},
|
||||||
|
(row, rowIndex, colIndex) -> {
|
||||||
|
switch (colIndex) {
|
||||||
|
case 0: return row.get(rowIndex).getRut();
|
||||||
|
case 1: return row.get(rowIndex).getNombre();
|
||||||
|
case 2: return row.get(rowIndex).getApellidoPaterno();
|
||||||
|
case 3: return row.get(rowIndex).getApellidoMaterno();
|
||||||
|
case 4: return row.get(rowIndex).getFechaContrato();
|
||||||
|
default: return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
// @formatter:on
|
||||||
|
this.trabajadorTable = new JTable(this.trabajadorModel);
|
||||||
|
this.trabajadorTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||||
|
// >>> IMPORTANT!! <<<
|
||||||
|
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||||
|
$$$setupUI$$$();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
|
||||||
|
*
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
private void $$$setupUI$$$() {
|
||||||
|
createUIComponents();
|
||||||
|
contentPane = new JPanel();
|
||||||
|
contentPane.setLayout(new GridLayoutManager(3, 2, new Insets(20, 20, 20, 20), -1, -1));
|
||||||
|
final JScrollPane scrollPane1 = new JScrollPane();
|
||||||
|
contentPane.add(scrollPane1, new GridConstraints(1, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
scrollPane1.setViewportView(trabajadorTable);
|
||||||
|
searchField = new JTextField();
|
||||||
|
contentPane.add(searchField,
|
||||||
|
new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||||
|
buscarButton = new JButton();
|
||||||
|
buscarButton.setText("Buscar");
|
||||||
|
contentPane.add(buscarButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
final JPanel panel1 = new JPanel();
|
||||||
|
panel1.setLayout(new GridLayoutManager(1, 4, new Insets(0, 0, 0, 0), -1, -1));
|
||||||
|
contentPane.add(panel1, new GridConstraints(2, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
|
||||||
|
verButton = new JButton();
|
||||||
|
verButton.setText("Ver");
|
||||||
|
panel1.add(verButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
eliminarButton = new JButton();
|
||||||
|
eliminarButton.setText("Eliminar");
|
||||||
|
panel1.add(eliminarButton, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
editarButton = new JButton();
|
||||||
|
editarButton.setText("Editar");
|
||||||
|
panel1.add(editarButton, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
crearButton = new JButton();
|
||||||
|
crearButton.setText("Crear");
|
||||||
|
panel1.add(crearButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,138 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.trabajador.TrabajadorUpdatePanel">
|
||||||
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="12" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="532" height="398"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="c6a4b" class="javax.swing.JTextField" binding="nombreField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="48e89" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Apellido Paterno:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="294b" class="javax.swing.JTextField" binding="apellidoPaternoField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="c0a2b" class="javax.swing.JTextField" binding="apellidoMaternoField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="a4360" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Apellido Materno:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<vspacer id="29de9">
|
||||||
|
<constraints>
|
||||||
|
<grid row="11" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</vspacer>
|
||||||
|
<hspacer id="4e68">
|
||||||
|
<constraints>
|
||||||
|
<grid row="11" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<hspacer id="1cc6d">
|
||||||
|
<constraints>
|
||||||
|
<grid row="11" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<grid id="30754" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
|
<constraints>
|
||||||
|
<grid row="10" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="125a5" class="javax.swing.JButton" binding="volverButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Volver"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="482e0" class="javax.swing.JButton" binding="actualizarButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Actualizar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
<component id="c24c2" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Nombre:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="c684" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Rut:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="c1340" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Fecha contrato:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="b319e" class="com.github.lgooddatepicker.components.DatePicker" binding="fechaContratoField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="9" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="a68a1" class="javax.swing.JTextField" binding="rutField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
package xyz.danielcortes.views.trabajador;
|
||||||
|
|
||||||
|
import com.github.lgooddatepicker.components.DatePicker;
|
||||||
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
|
import com.intellij.uiDesigner.core.Spacer;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Insets;
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
|
||||||
|
public class TrabajadorUpdatePanel extends BasePanel {
|
||||||
|
|
||||||
|
private JTextField nombreField;
|
||||||
|
private JTextField apellidoPaternoField;
|
||||||
|
private JTextField apellidoMaternoField;
|
||||||
|
private JButton actualizarButton;
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JButton volverButton;
|
||||||
|
private JTextField rutField;
|
||||||
|
private DatePicker fechaContratoField;
|
||||||
|
|
||||||
|
public JTextField getNombreField() {
|
||||||
|
return nombreField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getApellidoPaternoField() {
|
||||||
|
return apellidoPaternoField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getApellidoMaternoField() {
|
||||||
|
return apellidoMaternoField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getActualizarButton() {
|
||||||
|
return actualizarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getVolverButton() {
|
||||||
|
return volverButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getRutField() {
|
||||||
|
return rutField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatePicker getFechaContratoField() {
|
||||||
|
return fechaContratoField;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||||
|
// >>> IMPORTANT!! <<<
|
||||||
|
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||||
|
$$$setupUI$$$();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
|
||||||
|
*
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
private void $$$setupUI$$$() {
|
||||||
|
contentPane = new JPanel();
|
||||||
|
contentPane.setLayout(new GridLayoutManager(12, 3, new Insets(20, 20, 20, 20), -1, -1));
|
||||||
|
nombreField = new JTextField();
|
||||||
|
contentPane.add(nombreField,
|
||||||
|
new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
final JLabel label1 = new JLabel();
|
||||||
|
label1.setText("Apellido Paterno:");
|
||||||
|
contentPane.add(label1, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
apellidoPaternoField = new JTextField();
|
||||||
|
contentPane.add(apellidoPaternoField,
|
||||||
|
new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
apellidoMaternoField = new JTextField();
|
||||||
|
contentPane.add(apellidoMaternoField,
|
||||||
|
new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
final JLabel label2 = new JLabel();
|
||||||
|
label2.setText("Apellido Materno:");
|
||||||
|
contentPane.add(label2, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
final Spacer spacer1 = new Spacer();
|
||||||
|
contentPane.add(spacer1,
|
||||||
|
new GridConstraints(11, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final Spacer spacer2 = new Spacer();
|
||||||
|
contentPane.add(spacer2,
|
||||||
|
new GridConstraints(11, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
|
||||||
|
null, null, null, 0, false));
|
||||||
|
final Spacer spacer3 = new Spacer();
|
||||||
|
contentPane.add(spacer3,
|
||||||
|
new GridConstraints(11, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
|
||||||
|
null, null, null, 0, false));
|
||||||
|
final JPanel panel1 = new JPanel();
|
||||||
|
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
|
||||||
|
contentPane.add(panel1, new GridConstraints(10, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
|
||||||
|
volverButton = new JButton();
|
||||||
|
volverButton.setText("Volver");
|
||||||
|
panel1.add(volverButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
actualizarButton = new JButton();
|
||||||
|
actualizarButton.setText("Actualizar");
|
||||||
|
panel1.add(actualizarButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
final JLabel label3 = new JLabel();
|
||||||
|
label3.setText("Nombre:");
|
||||||
|
contentPane.add(label3, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
final JLabel label4 = new JLabel();
|
||||||
|
label4.setText("Rut:");
|
||||||
|
contentPane.add(label4, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
final JLabel label5 = new JLabel();
|
||||||
|
label5.setText("Fecha contrato:");
|
||||||
|
contentPane.add(label5, new GridConstraints(8, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
fechaContratoField = new DatePicker();
|
||||||
|
contentPane.add(fechaContratoField,
|
||||||
|
new GridConstraints(9, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
rutField = new JTextField();
|
||||||
|
contentPane.add(rutField,
|
||||||
|
new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.trabajador.TrabajadorViewPanel">
|
||||||
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="14" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="500" height="454"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="7a2da" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Nombre:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="7e150" class="javax.swing.JTextField" binding="nombreField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<editable value="false"/>
|
||||||
|
<enabled value="true"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="8b4b2" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Apellido Paterno:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="7e46d" class="javax.swing.JTextField" binding="apellidoPaternoField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<editable value="false"/>
|
||||||
|
<enabled value="true"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="e4aeb" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Apellido Materno:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="67fe6" class="javax.swing.JTextField" binding="apellidoMaternoField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<editable value="false"/>
|
||||||
|
<enabled value="true"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<vspacer id="31a4">
|
||||||
|
<constraints>
|
||||||
|
<grid row="13" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</vspacer>
|
||||||
|
<hspacer id="28129">
|
||||||
|
<constraints>
|
||||||
|
<grid row="13" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<hspacer id="69f08">
|
||||||
|
<constraints>
|
||||||
|
<grid row="13" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<component id="7d83d" class="javax.swing.JButton" binding="volverButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="12" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Volver"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="8e275" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Rut:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="90a52" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Fecha Contrato:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="b9ea8" class="javax.swing.JTextField" binding="rutField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="c3b00" class="com.github.lgooddatepicker.components.DatePicker" binding="fechaContratoPicker">
|
||||||
|
<constraints>
|
||||||
|
<grid row="9" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="8351e" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="10" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Nombre de usuario:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="3ebe7" class="javax.swing.JTextField" binding="usernameField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="11" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,155 @@
|
|||||||
|
package xyz.danielcortes.views.trabajador;
|
||||||
|
|
||||||
|
import com.github.lgooddatepicker.components.DatePicker;
|
||||||
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
|
import com.intellij.uiDesigner.core.Spacer;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Insets;
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
|
||||||
|
public class TrabajadorViewPanel extends BasePanel {
|
||||||
|
|
||||||
|
private JTextField nombreField;
|
||||||
|
private JTextField apellidoPaternoField;
|
||||||
|
private JTextField apellidoMaternoField;
|
||||||
|
private JButton volverButton;
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JTextField rutField;
|
||||||
|
private DatePicker fechaContratoPicker;
|
||||||
|
private JTextField usernameField;
|
||||||
|
|
||||||
|
public JTextField getNombreField() {
|
||||||
|
return nombreField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getApellidoPaternoField() {
|
||||||
|
return apellidoPaternoField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getApellidoMaternoField() {
|
||||||
|
return apellidoMaternoField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getVolverButton() {
|
||||||
|
return volverButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getRutField() {
|
||||||
|
return rutField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatePicker getFechaContratoPicker() {
|
||||||
|
return fechaContratoPicker;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getUsernameField() {
|
||||||
|
return usernameField;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||||
|
// >>> IMPORTANT!! <<<
|
||||||
|
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||||
|
$$$setupUI$$$();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
|
||||||
|
*
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
private void $$$setupUI$$$() {
|
||||||
|
contentPane = new JPanel();
|
||||||
|
contentPane.setLayout(new GridLayoutManager(14, 3, new Insets(20, 20, 20, 20), -1, -1));
|
||||||
|
final JLabel label1 = new JLabel();
|
||||||
|
label1.setText("Nombre:");
|
||||||
|
contentPane.add(label1, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
nombreField = new JTextField();
|
||||||
|
nombreField.setEditable(false);
|
||||||
|
nombreField.setEnabled(true);
|
||||||
|
contentPane.add(nombreField,
|
||||||
|
new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
final JLabel label2 = new JLabel();
|
||||||
|
label2.setText("Apellido Paterno:");
|
||||||
|
contentPane.add(label2, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
apellidoPaternoField = new JTextField();
|
||||||
|
apellidoPaternoField.setEditable(false);
|
||||||
|
apellidoPaternoField.setEnabled(true);
|
||||||
|
contentPane.add(apellidoPaternoField,
|
||||||
|
new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
final JLabel label3 = new JLabel();
|
||||||
|
label3.setText("Apellido Materno:");
|
||||||
|
contentPane.add(label3, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
apellidoMaternoField = new JTextField();
|
||||||
|
apellidoMaternoField.setEditable(false);
|
||||||
|
apellidoMaternoField.setEnabled(true);
|
||||||
|
contentPane.add(apellidoMaternoField,
|
||||||
|
new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
final Spacer spacer1 = new Spacer();
|
||||||
|
contentPane.add(spacer1,
|
||||||
|
new GridConstraints(13, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final Spacer spacer2 = new Spacer();
|
||||||
|
contentPane.add(spacer2,
|
||||||
|
new GridConstraints(13, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
|
||||||
|
null, null, null, 0, false));
|
||||||
|
final Spacer spacer3 = new Spacer();
|
||||||
|
contentPane.add(spacer3,
|
||||||
|
new GridConstraints(13, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
|
||||||
|
null, null, null, 0, false));
|
||||||
|
volverButton = new JButton();
|
||||||
|
volverButton.setText("Volver");
|
||||||
|
contentPane.add(volverButton, new GridConstraints(12, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
final JLabel label4 = new JLabel();
|
||||||
|
label4.setText("Rut:");
|
||||||
|
contentPane.add(label4, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
final JLabel label5 = new JLabel();
|
||||||
|
label5.setText("Fecha Contrato:");
|
||||||
|
contentPane.add(label5, new GridConstraints(8, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
rutField = new JTextField();
|
||||||
|
contentPane.add(rutField,
|
||||||
|
new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||||
|
fechaContratoPicker = new DatePicker();
|
||||||
|
contentPane.add(fechaContratoPicker,
|
||||||
|
new GridConstraints(9, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
final JLabel label6 = new JLabel();
|
||||||
|
label6.setText("Nombre de usuario:");
|
||||||
|
contentPane.add(label6, new GridConstraints(10, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
usernameField = new JTextField();
|
||||||
|
contentPane.add(usernameField,
|
||||||
|
new GridConstraints(11, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user