diff --git a/src/main/java/xyz/danielcortes/controllers/LaunchController.java b/src/main/java/xyz/danielcortes/controllers/LaunchController.java index ffe7ed8..6c02454 100644 --- a/src/main/java/xyz/danielcortes/controllers/LaunchController.java +++ b/src/main/java/xyz/danielcortes/controllers/LaunchController.java @@ -1,6 +1,5 @@ package xyz.danielcortes.controllers; -import java.awt.event.KeyEvent; import java.util.HashMap; import java.util.Map; import javax.swing.JMenu; @@ -15,18 +14,18 @@ import xyz.danielcortes.controllers.mantenedores.categoria.CategoriaCreateContro import xyz.danielcortes.controllers.mantenedores.categoria.CategoriaSearchController; import xyz.danielcortes.controllers.mantenedores.categoria.CategoriaUpdateController; import xyz.danielcortes.controllers.mantenedores.categoria.CategoriaViewController; -import xyz.danielcortes.controllers.mantenedores.trabajador.correo.CorreoCreateController; -import xyz.danielcortes.controllers.mantenedores.trabajador.correo.CorreoSearchController; -import xyz.danielcortes.controllers.mantenedores.trabajador.correo.CorreoUpdateController; -import xyz.danielcortes.controllers.mantenedores.trabajador.correo.CorreoViewController; -import xyz.danielcortes.controllers.mantenedores.trabajador.direccion.DireccionCreateController; -import xyz.danielcortes.controllers.mantenedores.trabajador.direccion.DireccionSearchController; -import xyz.danielcortes.controllers.mantenedores.trabajador.direccion.DireccionUpdateController; -import xyz.danielcortes.controllers.mantenedores.trabajador.direccion.DireccionViewController; +import xyz.danielcortes.controllers.mantenedores.distribuidor.DistribuidorCreateController; +import xyz.danielcortes.controllers.mantenedores.distribuidor.DistribuidorSearchController; +import xyz.danielcortes.controllers.mantenedores.distribuidor.DistribuidorUpdateController; +import xyz.danielcortes.controllers.mantenedores.distribuidor.DistribuidorViewController; import xyz.danielcortes.controllers.mantenedores.editorial.EditorialCreateController; import xyz.danielcortes.controllers.mantenedores.editorial.EditorialSearchController; import xyz.danielcortes.controllers.mantenedores.editorial.EditorialUpdateController; import xyz.danielcortes.controllers.mantenedores.editorial.EditorialViewController; +import xyz.danielcortes.controllers.mantenedores.empresa.EmpresaCreateController; +import xyz.danielcortes.controllers.mantenedores.empresa.EmpresaSearchController; +import xyz.danielcortes.controllers.mantenedores.empresa.EmpresaUpdateController; +import xyz.danielcortes.controllers.mantenedores.empresa.EmpresaViewController; import xyz.danielcortes.controllers.mantenedores.idioma.IdiomaCreateController; import xyz.danielcortes.controllers.mantenedores.idioma.IdiomaSearchController; import xyz.danielcortes.controllers.mantenedores.idioma.IdiomaUpdateController; @@ -35,14 +34,22 @@ import xyz.danielcortes.controllers.mantenedores.libro.LibroCreateController; import xyz.danielcortes.controllers.mantenedores.libro.LibroSearchController; import xyz.danielcortes.controllers.mantenedores.libro.LibroUpdateController; import xyz.danielcortes.controllers.mantenedores.libro.LibroViewController; -import xyz.danielcortes.controllers.mantenedores.trabajador.telefono.TelefonoCreateController; -import xyz.danielcortes.controllers.mantenedores.trabajador.telefono.TelefonoSearchController; -import xyz.danielcortes.controllers.mantenedores.trabajador.telefono.TelefonoUpdateController; -import xyz.danielcortes.controllers.mantenedores.trabajador.telefono.TelefonoViewController; import xyz.danielcortes.controllers.mantenedores.trabajador.TrabajadorCreateController; import xyz.danielcortes.controllers.mantenedores.trabajador.TrabajadorSearchController; import xyz.danielcortes.controllers.mantenedores.trabajador.TrabajadorUpdateController; import xyz.danielcortes.controllers.mantenedores.trabajador.TrabajadorViewController; +import xyz.danielcortes.controllers.mantenedores.trabajador.correo.CorreoCreateController; +import xyz.danielcortes.controllers.mantenedores.trabajador.correo.CorreoSearchController; +import xyz.danielcortes.controllers.mantenedores.trabajador.correo.CorreoUpdateController; +import xyz.danielcortes.controllers.mantenedores.trabajador.correo.CorreoViewController; +import xyz.danielcortes.controllers.mantenedores.trabajador.direccion.DireccionCreateController; +import xyz.danielcortes.controllers.mantenedores.trabajador.direccion.DireccionSearchController; +import xyz.danielcortes.controllers.mantenedores.trabajador.direccion.DireccionUpdateController; +import xyz.danielcortes.controllers.mantenedores.trabajador.direccion.DireccionViewController; +import xyz.danielcortes.controllers.mantenedores.trabajador.telefono.TelefonoCreateController; +import xyz.danielcortes.controllers.mantenedores.trabajador.telefono.TelefonoSearchController; +import xyz.danielcortes.controllers.mantenedores.trabajador.telefono.TelefonoUpdateController; +import xyz.danielcortes.controllers.mantenedores.trabajador.telefono.TelefonoViewController; import xyz.danielcortes.controllers.mantenedores.trabajador.usuario.UsuarioCreateController; import xyz.danielcortes.controllers.mantenedores.trabajador.usuario.UsuarioUpdateController; import xyz.danielcortes.controllers.mantenedores.trabajador.usuario.UsuarioViewController; @@ -58,18 +65,26 @@ import xyz.danielcortes.views.mantenedores.categoria.CategoriaCreatePanel; import xyz.danielcortes.views.mantenedores.categoria.CategoriaSearchPanel; import xyz.danielcortes.views.mantenedores.categoria.CategoriaUpdatePanel; import xyz.danielcortes.views.mantenedores.categoria.CategoriaViewPanel; -import xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoCreatePanel; -import xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoSearchPanel; -import xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoUpdatePanel; -import xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoViewPanel; -import xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionCreatePanel; -import xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionSearchPanel; -import xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionUpdatePanel; -import xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionViewPanel; +import xyz.danielcortes.views.mantenedores.correo.CorreoCreatePanel; +import xyz.danielcortes.views.mantenedores.correo.CorreoSearchPanel; +import xyz.danielcortes.views.mantenedores.correo.CorreoUpdatePanel; +import xyz.danielcortes.views.mantenedores.correo.CorreoViewPanel; +import xyz.danielcortes.views.mantenedores.direccion.DireccionCreatePanel; +import xyz.danielcortes.views.mantenedores.direccion.DireccionSearchPanel; +import xyz.danielcortes.views.mantenedores.direccion.DireccionUpdatePanel; +import xyz.danielcortes.views.mantenedores.direccion.DireccionViewPanel; +import xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorCreatePanel; +import xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorSearchPanel; +import xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorUpdatePanel; +import xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorViewPanel; import xyz.danielcortes.views.mantenedores.editorial.EditorialCreatePanel; import xyz.danielcortes.views.mantenedores.editorial.EditorialSearchPanel; import xyz.danielcortes.views.mantenedores.editorial.EditorialUpdatePanel; import xyz.danielcortes.views.mantenedores.editorial.EditorialViewPanel; +import xyz.danielcortes.views.mantenedores.empresa.EmpresaCreatePanel; +import xyz.danielcortes.views.mantenedores.empresa.EmpresaSearchPanel; +import xyz.danielcortes.views.mantenedores.empresa.EmpresaUpdatePanel; +import xyz.danielcortes.views.mantenedores.empresa.EmpresaViewPanel; import xyz.danielcortes.views.mantenedores.idioma.IdiomaCreatePanel; import xyz.danielcortes.views.mantenedores.idioma.IdiomaSearchPanel; import xyz.danielcortes.views.mantenedores.idioma.IdiomaUpdatePanel; @@ -78,17 +93,17 @@ import xyz.danielcortes.views.mantenedores.libro.LibroCreatePanel; import xyz.danielcortes.views.mantenedores.libro.LibroSearchPanel; import xyz.danielcortes.views.mantenedores.libro.LibroUpdatePanel; import xyz.danielcortes.views.mantenedores.libro.LibroViewPanel; -import xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoCreatePanel; -import xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoSearchPanel; -import xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoUpdatePanel; -import xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoViewPanel; +import xyz.danielcortes.views.mantenedores.telefono.TelefonoCreatePanel; +import xyz.danielcortes.views.mantenedores.telefono.TelefonoSearchPanel; +import xyz.danielcortes.views.mantenedores.telefono.TelefonoUpdatePanel; +import xyz.danielcortes.views.mantenedores.telefono.TelefonoViewPanel; import xyz.danielcortes.views.mantenedores.trabajador.TrabajadorCreatePanel; import xyz.danielcortes.views.mantenedores.trabajador.TrabajadorSearchPanel; import xyz.danielcortes.views.mantenedores.trabajador.TrabajadorUpdatePanel; import xyz.danielcortes.views.mantenedores.trabajador.TrabajadorViewPanel; -import xyz.danielcortes.views.mantenedores.trabajador.usuario.UsuarioCreatePanel; -import xyz.danielcortes.views.mantenedores.trabajador.usuario.UsuarioUpdatePanel; -import xyz.danielcortes.views.mantenedores.trabajador.usuario.UsuarioViewPanel; +import xyz.danielcortes.views.mantenedores.usuario.UsuarioCreatePanel; +import xyz.danielcortes.views.mantenedores.usuario.UsuarioUpdatePanel; +import xyz.danielcortes.views.mantenedores.usuario.UsuarioViewPanel; public class LaunchController { @@ -140,6 +155,16 @@ public class LaunchController { this.controllers.put(PanelName.TRABAJADOR_CREATE, new TrabajadorCreateController(new TrabajadorCreatePanel(), this)); this.controllers.put(PanelName.TRABAJADOR_UPDATE, new TrabajadorUpdateController(new TrabajadorUpdatePanel(), this)); + this.controllers.put(PanelName.DISTRIBUIDOR_VIEW, new DistribuidorViewController(new DistribuidorViewPanel(), this)); + this.controllers.put(PanelName.DISTRIBUIDOR_SEARCH, new DistribuidorSearchController(new DistribuidorSearchPanel(), this)); + this.controllers.put(PanelName.DISTRIBUIDOR_CREATE, new DistribuidorCreateController(new DistribuidorCreatePanel(), this)); + this.controllers.put(PanelName.DISTRIBUIDOR_UPDATE, new DistribuidorUpdateController(new DistribuidorUpdatePanel(), this)); + + this.controllers.put(PanelName.EMPRESA_VIEW, new EmpresaViewController(new EmpresaViewPanel(), this)); + this.controllers.put(PanelName.EMPRESA_SEARCH, new EmpresaSearchController(new EmpresaSearchPanel(), this)); + this.controllers.put(PanelName.EMPRESA_CREATE, new EmpresaCreateController(new EmpresaCreatePanel(), this)); + this.controllers.put(PanelName.EMPRESA_UPDATE, new EmpresaUpdateController(new EmpresaUpdatePanel(), this)); + this.controllers.put(PanelName.USUARIO_VIEW, new UsuarioViewController(new UsuarioViewPanel(), this)); this.controllers.put(PanelName.USUARIO_CREATE, new UsuarioCreateController(new UsuarioCreatePanel(), this)); this.controllers.put(PanelName.USUARIO_UPDATE, new UsuarioUpdateController(new UsuarioUpdatePanel(), this)); @@ -177,20 +202,15 @@ public class LaunchController { private JMenu createMantenedoresMenu() { JMenu mantenedoresMenu = new JMenu("Mantenedores"); - mantenedoresMenu.setMnemonic(KeyEvent.VK_M); JMenuItem librosItem = new JMenuItem("Libros"); - librosItem.setMnemonic(KeyEvent.VK_L); JMenuItem autoresItem = new JMenuItem("Autores"); - autoresItem.setMnemonic(KeyEvent.VK_A); JMenuItem idiomasItem = new JMenuItem("Idiomas"); - idiomasItem.setMnemonic(KeyEvent.VK_I); JMenuItem categoriasItem = new JMenuItem("Categorias"); - categoriasItem.setMnemonic(KeyEvent.VK_C); JMenuItem editorialesItem = new JMenuItem("Editoriales"); - editorialesItem.setMnemonic(KeyEvent.VK_E); JMenuItem trabajadoresItem = new JMenuItem("Trabajadores"); - trabajadoresItem.setMnemonic(KeyEvent.VK_T); + JMenuItem empresasItem = new JMenuItem("Empresas"); + JMenuItem distribuidoresItem = new JMenuItem("Distribuidores"); autoresItem.addActionListener(e -> this.showCard(PanelName.AUTOR_SEARCH)); idiomasItem.addActionListener(e -> this.showCard(PanelName.IDIOMA_SEARCH)); @@ -198,6 +218,8 @@ public class LaunchController { categoriasItem.addActionListener(e -> this.showCard(PanelName.CATEGORIA_SEARCH)); editorialesItem.addActionListener(e -> this.showCard(PanelName.EDITORIAL_SEARCH)); trabajadoresItem.addActionListener(e -> this.showCard(PanelName.TRABAJADOR_SEARCH)); + empresasItem.addActionListener(e -> this.showCard(PanelName.EMPRESA_SEARCH)); + distribuidoresItem.addActionListener(e -> this.showCard(PanelName.DISTRIBUIDOR_SEARCH)); mantenedoresMenu.add(librosItem ); mantenedoresMenu.add(autoresItem); @@ -205,6 +227,8 @@ public class LaunchController { mantenedoresMenu.add(categoriasItem); mantenedoresMenu.add(editorialesItem); mantenedoresMenu.add(trabajadoresItem); + mantenedoresMenu.add(empresasItem); + mantenedoresMenu.add(distribuidoresItem); return mantenedoresMenu; } diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/distribuidor/DistribuidorCreateController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/distribuidor/DistribuidorCreateController.java new file mode 100644 index 0000000..23e4843 --- /dev/null +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/distribuidor/DistribuidorCreateController.java @@ -0,0 +1,73 @@ +package xyz.danielcortes.controllers.mantenedores.distribuidor; + +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.Distribuidor; +import xyz.danielcortes.models.Empresa; +import xyz.danielcortes.repository.DistribuidorRepository; +import xyz.danielcortes.repository.EmpresaRepository; +import xyz.danielcortes.validator.DistribuidorValidator; +import xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorCreatePanel; + +public class DistribuidorCreateController extends BaseController { + + private DistribuidorCreatePanel view; + private DistribuidorRepository respository; + private EmpresaRepository empresaRepository; + private DistribuidorValidator validator; + + public DistribuidorCreateController(DistribuidorCreatePanel view, LaunchController parent) { + super(parent); + this.view = view; + this.respository = new DistribuidorRepository(); + this.empresaRepository = new EmpresaRepository(); + this.validator = new DistribuidorValidator(this.respository); + this.setupListeners(); + } + + public void show() { + this.fillEmpresasCombobox(); + this.view.getRutField().requestFocus(); + } + + private void setupListeners() { + this.view.getGuardarButton().addActionListener(e -> save()); + this.view.getVolverButton().addActionListener(e -> this.getParentController().showCard(PanelName.DISTRIBUIDOR_SEARCH)); + } + + private void fillEmpresasCombobox() { + this.view.getEmpresaModel().removeAllElements(); + this.view.getEmpresaModel().addAll(empresaRepository.getAll()); + } + + private void save() { + String rut = this.view.getRutField().getText(); + ValidationResult rutValidation = this.validator.validateRut(rut); + if(rutValidation.hasError()){ + rutValidation.showErrorDialog(); + return; + } + + Empresa empresa = (Empresa) this.view.getEmpresaCombobox().getSelectedItem(); + ValidationResult empresaValidation = this.validator.validateEmpresa(empresa); + if(empresaValidation.hasError()){ + empresaValidation.showErrorDialog(); + return; + } + + Distribuidor distribuidor = new Distribuidor(); + distribuidor.setRut(rut); + distribuidor.setEmpresa(empresa); + + respository.save(distribuidor); + + this.getParentController().showCard(PanelName.DISTRIBUIDOR_SEARCH); + } + + public BasePanel getView() { + return this.view; + } +} diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/distribuidor/DistribuidorSearchController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/distribuidor/DistribuidorSearchController.java new file mode 100644 index 0000000..da80a2d --- /dev/null +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/distribuidor/DistribuidorSearchController.java @@ -0,0 +1,119 @@ +package xyz.danielcortes.controllers.mantenedores.distribuidor; + +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.Distribuidor; +import xyz.danielcortes.repository.DistribuidorRepository; +import xyz.danielcortes.validator.DistribuidorValidator; +import xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorSearchPanel; + +public class DistribuidorSearchController extends BaseController { + + private DistribuidorSearchPanel view; + private DistribuidorRepository distribuidorRepository; + private DistribuidorValidator distribuidorValidator; + + public DistribuidorSearchController(DistribuidorSearchPanel view, LaunchController parent) { + super(parent); + this.view = view; + this.distribuidorRepository = new DistribuidorRepository(); + this.distribuidorValidator = new DistribuidorValidator(this.distribuidorRepository); + this.setupListeners(); + } + + public void show() { + this.reload(); + this.view.getDistribuidorTable().clearSelection(); + } + + private void reload() { + this.loadDistribuidorTable(); + } + + private void setupListeners() { + this.view.getCrearButton().addActionListener(e -> this.getParentController().showCard(PanelName.DISTRIBUIDOR_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() { + Distribuidor distribuidor = this.getSelectedDistribuidor(); + if (distribuidor != null) { + DistribuidorUpdateController controller = (DistribuidorUpdateController) this.getParentController().getCard(PanelName.DISTRIBUIDOR_UPDATE); + controller.setDistribuidor(distribuidor); + this.getParentController().showCard(PanelName.DISTRIBUIDOR_UPDATE); + } + } + + private void delete() { + Distribuidor distribuidor = this.getSelectedDistribuidor(); + if (distribuidor == null) + return; + + int option = JOptionPane.showConfirmDialog( + null, + "¿Estas seguro de que deseas eliminar el distribuidor?", + "Confirmacion", + JOptionPane.YES_NO_OPTION, + JOptionPane.QUESTION_MESSAGE + ); + + if (option == JOptionPane.NO_OPTION) + return; + + this.distribuidorRepository.delete(distribuidor); + this.reload(); + } + + private void view() { + Distribuidor distribuidor = this.getSelectedDistribuidor(); + if (distribuidor != null) { + DistribuidorViewController controller = (DistribuidorViewController) this.getParentController().getCard(PanelName.DISTRIBUIDOR_VIEW); + controller.setDistribuidor(distribuidor); + this.getParentController().showCard(PanelName.DISTRIBUIDOR_VIEW); + } + } + + private void search() { + String term = this.view.getSearchField().getText(); + List distribuidores = this.distribuidorRepository.search(term); + this.loadDistribuidorTable(distribuidores); + } + + private void loadDistribuidorTable() { + List distribuidores = this.distribuidorRepository.getAll(); + loadDistribuidorTable(distribuidores); + } + + private void loadDistribuidorTable(List distribuidores) { + BaseTableModel model = this.view.getDistribuidorModel(); + model.setRows(distribuidores); + } + + private Distribuidor getSelectedDistribuidor() { + int selectedRow = this.view.getDistribuidorTable().getSelectedRow(); + if (selectedRow == -1) { + JOptionPane.showMessageDialog( + null, + "No hay distribuidor seleccionado", + "Error", + JOptionPane.ERROR_MESSAGE + ); + return null; + } + return this.view.getDistribuidorModel().getRow(selectedRow); + } + + public BasePanel getView() { + return this.view; + } + +} diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/distribuidor/DistribuidorUpdateController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/distribuidor/DistribuidorUpdateController.java new file mode 100644 index 0000000..2953dba --- /dev/null +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/distribuidor/DistribuidorUpdateController.java @@ -0,0 +1,91 @@ +package xyz.danielcortes.controllers.mantenedores.distribuidor; + +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.Distribuidor; +import xyz.danielcortes.models.Empresa; +import xyz.danielcortes.repository.DistribuidorRepository; +import xyz.danielcortes.repository.EmpresaRepository; +import xyz.danielcortes.validator.DistribuidorValidator; +import xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorUpdatePanel; + +public class DistribuidorUpdateController extends BaseController { + private Distribuidor distribuidor; + private DistribuidorUpdatePanel view; + private DistribuidorRepository distribuidorRepository; + private EmpresaRepository empresaRepository; + private DistribuidorValidator distribuidorValidator; + + public DistribuidorUpdateController(DistribuidorUpdatePanel view, LaunchController parent){ + super(parent); + this.view = view; + this.distribuidorRepository = new DistribuidorRepository(); + this.empresaRepository = new EmpresaRepository(); + this.distribuidorValidator = new DistribuidorValidator(this.distribuidorRepository); + this.setupListeners(); + } + + public void setDistribuidor(Distribuidor distribuidor) { + this.distribuidor = distribuidor; + } + + public void show() { + this.fillEmpresaCombobox(); + this.fillDistribuidor(); + this.view.getRutField().requestFocus(); + } + + private void fillEmpresaCombobox() { + this.view.getEmpresaModel().removeAllElements(); + this.view.getEmpresaModel().addAll(this.empresaRepository.getAll()); + } + + private void fillDistribuidor() { + if(distribuidorRepository == null) + return; + + this.view.getRutField().setText(this.distribuidor.getRut()); + this.view.getEmpresaCombobox().setSelectedItem(this.distribuidor.getEmpresa()); + } + + private void setupListeners() { + this.view.getActualizarButton().addActionListener(e -> update()); + this.view.getVolverButton().addActionListener(e -> this.getParentController().showCard(PanelName.DISTRIBUIDOR_SEARCH)); + } + + private void update() { + ValidationResult originalValidation = this.distribuidorValidator.validateOriginal(this.distribuidor); + if(originalValidation.hasError()){ + originalValidation.showErrorDialog(); + return; + } + + String rut = this.view.getRutField().getText(); + ValidationResult rutValidation = this.distribuidorValidator.validateRut(rut); + if(rutValidation.hasError()){ + rutValidation.showErrorDialog(); + return; + } + + Empresa empresa = (Empresa) this.view.getEmpresaCombobox().getSelectedItem(); + ValidationResult empresaValidation = this.distribuidorValidator.validateEmpresa(empresa); + if(empresaValidation.hasError()){ + empresaValidation.showErrorDialog(); + return; + } + + + assert this.distribuidor != null; + this.distribuidor.setRut(rut); + this.distribuidor.setEmpresa(empresa); + this.distribuidorRepository.update(this.distribuidor); + + this.getParentController().showCard(PanelName.DISTRIBUIDOR_SEARCH); + } + + public BasePanel getView() { return view; } + +} diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/distribuidor/DistribuidorViewController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/distribuidor/DistribuidorViewController.java new file mode 100644 index 0000000..8cfae65 --- /dev/null +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/distribuidor/DistribuidorViewController.java @@ -0,0 +1,65 @@ +package xyz.danielcortes.controllers.mantenedores.distribuidor; + +import xyz.danielcortes.controllers.LaunchController; +import xyz.danielcortes.framework.BaseController; +import xyz.danielcortes.framework.BasePanel; +import xyz.danielcortes.framework.PanelName; +import xyz.danielcortes.models.Distribuidor; +import xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorViewPanel; + +public class DistribuidorViewController extends BaseController { + + private Distribuidor distribuidor; + private DistribuidorViewPanel view; + + public DistribuidorViewController(DistribuidorViewPanel view, LaunchController parent) { + super(parent); + this.view = view; + this.setupListeners(); + } + + public void show() { + this.fillDistribuidor(); + } + + public void setDistribuidor(Distribuidor distribuidor) { + this.distribuidor = distribuidor; + } + + private void setupListeners() { + this.view.getVolverButton().addActionListener(e -> this.getParentController().showCard(PanelName.DISTRIBUIDOR_SEARCH)); +// this.view.getCorreosButton().addActionListener(e -> this.gotoCorreosView()); +// this.view.getTelefonosButton().addActionListener(e -> this.gotoTelefonoView()); +// this.view.getDireccionesButton().addActionListener(e -> this.gotoDireccionView()); + } + +// private void gotoDireccionView() { +// DireccionSearchController controller = (DireccionSearchController) this.getParentController().getCard(PanelName.DIRECCION_SEARCH); +// controller.setDistribuidor(distribuidor); +// this.getParentController().showCard(PanelName.DIRECCION_SEARCH); +// } +// +// private void gotoTelefonoView() { +// TelefonoSearchController controller = (TelefonoSearchController) this.getParentController().getCard(PanelName.TELEFONO_SEARCH); +// controller.setDistribuidor(distribuidor); +// this.getParentController().showCard(PanelName.TELEFONO_SEARCH); +// } +// +// private void gotoCorreosView() { +// CorreoSearchController controller = (CorreoSearchController) this.getParentController().getCard(PanelName.CORREO_SEARCH); +// controller.setDistribuidor(distribuidor); +// this.getParentController().showCard(PanelName.CORREO_SEARCH); +// } + + private void fillDistribuidor() { + if (distribuidor == null) + return; + + this.view.getRutField().setText(this.distribuidor.getRut()); + this.view.getEmpresaField().setText(this.distribuidor.getEmpresa().getNombre()); + } + + public BasePanel getView() { + return view; + } +} diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/empresa/EmpresaCreateController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/empresa/EmpresaCreateController.java new file mode 100644 index 0000000..ae7edbd --- /dev/null +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/empresa/EmpresaCreateController.java @@ -0,0 +1,59 @@ +package xyz.danielcortes.controllers.mantenedores.empresa; + +import xyz.danielcortes.framework.BaseController; +import xyz.danielcortes.controllers.LaunchController; +import xyz.danielcortes.framework.PanelName; +import xyz.danielcortes.framework.ValidationResult; +import xyz.danielcortes.models.Empresa; +import xyz.danielcortes.repository.EmpresaRepository; +import xyz.danielcortes.validator.EmpresaValidator; +import xyz.danielcortes.framework.BasePanel; +import xyz.danielcortes.views.mantenedores.empresa.EmpresaCreatePanel; + +public class EmpresaCreateController extends BaseController { + + private EmpresaRepository empresaRepository; + private EmpresaCreatePanel view; + private EmpresaValidator validator; + + public EmpresaCreateController(EmpresaCreatePanel view, LaunchController parent) { + super(parent); + this.view = view; + this.empresaRepository = new EmpresaRepository(); + this.validator = new EmpresaValidator(this.empresaRepository); + + this.setupListeners(); + } + + @Override + public void show() { + this.view.getNombreField().requestFocus(); + } + + private void setupListeners() { + this.view.getGuardarButton().addActionListener(e -> save()); + this.view.getNombreField().addActionListener(e -> save()); + this.view.getVolverButton().addActionListener(e -> this.getParentController().showCard(PanelName.EMPRESA_SEARCH)); + } + + private void save() { + String nombre = this.view.getNombreField().getText(); + ValidationResult nombreValidation = this.validator.validateNombre(nombre); + if(nombreValidation.hasError()){ + nombreValidation.showErrorDialog(); + return; + } + + Empresa empresa = new Empresa(); + empresa.setNombre(nombre); + + this.empresaRepository.save(empresa); + + this.view.getNombreField().setText(""); + this.view.getNombreField().requestFocus(); + } + + public BasePanel getView() { + return view; + } +} diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/empresa/EmpresaSearchController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/empresa/EmpresaSearchController.java new file mode 100644 index 0000000..8779bf5 --- /dev/null +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/empresa/EmpresaSearchController.java @@ -0,0 +1,118 @@ +package xyz.danielcortes.controllers.mantenedores.empresa; + +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.Empresa; +import xyz.danielcortes.repository.EmpresaRepository; +import xyz.danielcortes.validator.EmpresaValidator; +import xyz.danielcortes.views.mantenedores.empresa.EmpresaSearchPanel; + +public class EmpresaSearchController extends BaseController { + private EmpresaSearchPanel view; + private EmpresaRepository empresaRepository; + private EmpresaValidator validator; + + public EmpresaSearchController(EmpresaSearchPanel view, LaunchController parent) { + super(parent); + this.view = view; + this.empresaRepository = new EmpresaRepository(); + this.validator = new EmpresaValidator(this.empresaRepository); + this.loadEmpresaTable(); + this.setupListeners(); + } + + @Override + public void show() { + this.reload(); + } + + public void reload() { + this.loadEmpresaTable(); + } + + private void setupListeners(){ + this.view.getCrearButton().addActionListener(e -> this.getParentController().showCard(PanelName.EMPRESA_CREATE)); + this.view.getBuscarButton().addActionListener(e -> search()); + this.view.getBuscarField().addActionListener(e -> search()); + this.view.getEliminarButton().addActionListener(e -> delete()); + this.view.getEditarButton().addActionListener(e -> edit()); + this.view.getVerButton().addActionListener(e -> view()); + } + + private void view() { + Empresa empresa = this.getSelectedEmpresa(); + if(empresa != null) { + EmpresaViewController controller = (EmpresaViewController) this.getParentController().getCard(PanelName.EMPRESA_VIEW); + controller.setEmpresa(empresa); + this.getParentController().showCard(PanelName.EMPRESA_VIEW); + } + } + + private void edit() { + Empresa empresa = this.getSelectedEmpresa(); + if(empresa != null) { + EmpresaUpdateController controller = (EmpresaUpdateController) this.getParentController().getCard(PanelName.EMPRESA_UPDATE); + controller.setEmpresa(empresa); + this.getParentController().showCard(PanelName.EMPRESA_UPDATE); + } + } + + private void delete() { + Empresa empresa = this.getSelectedEmpresa(); + if (empresa == null) + return; + + int option = JOptionPane.showConfirmDialog( + null, + "¿Estas seguro de que deseas eliminar la empresa?", + "Confirmacion", + JOptionPane.YES_NO_OPTION, + JOptionPane.QUESTION_MESSAGE + ); + if (option == JOptionPane.NO_OPTION) + return; + + this.empresaRepository.delete(empresa); + this.reload(); + } + + private void search() { + String term = this.view.getBuscarField().getText(); + List empresaes = this.empresaRepository.search(term); + this.loadEmpresaTable(empresaes); + } + + private void loadEmpresaTable(List empresas){ + BaseTableModel model = this.view.getEmpresaModel(); + model.setRows(empresas); + } + + private void loadEmpresaTable(){ + List empresas = this.empresaRepository.getAll(); + loadEmpresaTable(empresas); + } + + private Empresa getSelectedEmpresa() { + int selectedRow = this.view.getEmpresaTable().getSelectedRow(); + if (selectedRow == -1) { + JOptionPane.showMessageDialog( + null, + "No hay empresa seleccionada", + "Error", + JOptionPane.ERROR_MESSAGE + ); + return null; + } + + return this.view.getEmpresaModel().getRow(selectedRow); + } + + public BasePanel getView() { + return view; + } +} diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/empresa/EmpresaUpdateController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/empresa/EmpresaUpdateController.java new file mode 100644 index 0000000..d7fdef4 --- /dev/null +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/empresa/EmpresaUpdateController.java @@ -0,0 +1,70 @@ +package xyz.danielcortes.controllers.mantenedores.empresa; + +import xyz.danielcortes.framework.BaseController; +import xyz.danielcortes.controllers.LaunchController; +import xyz.danielcortes.framework.PanelName; +import xyz.danielcortes.framework.ValidationResult; +import xyz.danielcortes.models.Empresa; +import xyz.danielcortes.repository.EmpresaRepository; +import xyz.danielcortes.validator.EmpresaValidator; +import xyz.danielcortes.framework.BasePanel; +import xyz.danielcortes.views.mantenedores.empresa.EmpresaUpdatePanel; + +public class EmpresaUpdateController extends BaseController { + + private EmpresaUpdatePanel view; + private EmpresaRepository empresaRepository; + private EmpresaValidator validator; + private Empresa empresa; + + public EmpresaUpdateController(EmpresaUpdatePanel view, LaunchController parent) { + super(parent); + this.view = view; + this.empresaRepository = new EmpresaRepository(); + this.validator = new EmpresaValidator(this.empresaRepository); + this.setupListeners(); + } + + @Override + public void show() { + if(this.empresa == null) + return; + + this.view.getNombreField().setText(this.empresa.getNombre()); + this.view.getNombreField().requestFocus(); + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + private void setupListeners() { + this.view.getNombreField().addActionListener(e -> this.update()); + this.view.getActualizarButton().addActionListener(e -> this.update()); + } + + private void update() { + ValidationResult originalValidation = this.validator.validateOriginal(this.empresa); + if(originalValidation.hasError()){ + originalValidation.showErrorDialog(); + return; + } + + String nombre = this.view.getNombreField().getText(); + ValidationResult nombreValidation = this.validator.validateNombre(nombre); + if(nombreValidation.hasError()){ + nombreValidation.showErrorDialog(); + return; + } + + assert this.empresa != null; + this.empresa.setNombre(nombre); + this.empresaRepository.update(this.empresa); + + this.getParentController().showCard(PanelName.EMPRESA_SEARCH); + } + + public BasePanel getView() { + return view; + } +} diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/empresa/EmpresaViewController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/empresa/EmpresaViewController.java new file mode 100644 index 0000000..4dc728a --- /dev/null +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/empresa/EmpresaViewController.java @@ -0,0 +1,46 @@ +package xyz.danielcortes.controllers.mantenedores.empresa; + +import xyz.danielcortes.framework.BaseController; +import xyz.danielcortes.controllers.LaunchController; +import xyz.danielcortes.framework.PanelName; +import xyz.danielcortes.models.Empresa; +import xyz.danielcortes.framework.BasePanel; +import xyz.danielcortes.views.mantenedores.empresa.EmpresaViewPanel; + +public class EmpresaViewController extends BaseController { + private Empresa empresa; + private EmpresaViewPanel view; + + public EmpresaViewController(EmpresaViewPanel view, LaunchController parent) { + super(parent); + this.view = view; + this.setupListeners(); + } + + @Override + public void show() { + this.fillEmpresa(); + } + + public void setEmpresa(Empresa empresa){ + this.empresa = empresa; + } + + private void setupListeners(){ + this.view.getVolverButton().addActionListener(e -> { + this.getParentController().showCard(PanelName.EMPRESA_SEARCH); + }); + } + + private void fillEmpresa() { + if(empresa == null) + return; + + this.view.getNombreField().setText(this.empresa.getNombre()); + } + + @Override + public BasePanel getView() { + return this.view; + } +} diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/correo/CorreoCreateController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/correo/CorreoCreateController.java index 5c7b536..a30b8b5 100644 --- a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/correo/CorreoCreateController.java +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/correo/CorreoCreateController.java @@ -9,7 +9,7 @@ import xyz.danielcortes.models.Correo; import xyz.danielcortes.models.Trabajador; import xyz.danielcortes.repository.CorreoRepository; import xyz.danielcortes.validator.CorreoValidator; -import xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoCreatePanel; +import xyz.danielcortes.views.mantenedores.correo.CorreoCreatePanel; public class CorreoCreateController extends BaseController { diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/correo/CorreoSearchController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/correo/CorreoSearchController.java index df91d6b..8c1f56e 100644 --- a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/correo/CorreoSearchController.java +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/correo/CorreoSearchController.java @@ -12,7 +12,7 @@ import xyz.danielcortes.models.Correo; import xyz.danielcortes.models.Trabajador; import xyz.danielcortes.repository.CorreoRepository; import xyz.danielcortes.validator.CorreoValidator; -import xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoSearchPanel; +import xyz.danielcortes.views.mantenedores.correo.CorreoSearchPanel; public class CorreoSearchController extends BaseController { diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/correo/CorreoUpdateController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/correo/CorreoUpdateController.java index 4c73e67..a1c9968 100644 --- a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/correo/CorreoUpdateController.java +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/correo/CorreoUpdateController.java @@ -9,7 +9,7 @@ import xyz.danielcortes.models.Correo; import xyz.danielcortes.models.Trabajador; import xyz.danielcortes.repository.CorreoRepository; import xyz.danielcortes.validator.CorreoValidator; -import xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoUpdatePanel; +import xyz.danielcortes.views.mantenedores.correo.CorreoUpdatePanel; public class CorreoUpdateController extends BaseController { diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/correo/CorreoViewController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/correo/CorreoViewController.java index 72ac29a..fa1fcd6 100644 --- a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/correo/CorreoViewController.java +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/correo/CorreoViewController.java @@ -6,7 +6,7 @@ import xyz.danielcortes.framework.BasePanel; import xyz.danielcortes.framework.PanelName; import xyz.danielcortes.models.Correo; import xyz.danielcortes.models.Trabajador; -import xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoViewPanel; +import xyz.danielcortes.views.mantenedores.correo.CorreoViewPanel; public class CorreoViewController extends BaseController { diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/direccion/DireccionCreateController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/direccion/DireccionCreateController.java index f58795f..b05bd05 100644 --- a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/direccion/DireccionCreateController.java +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/direccion/DireccionCreateController.java @@ -9,7 +9,7 @@ import xyz.danielcortes.models.Direccion; import xyz.danielcortes.models.Trabajador; import xyz.danielcortes.repository.DireccionRepository; import xyz.danielcortes.validator.DireccionValidator; -import xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionCreatePanel; +import xyz.danielcortes.views.mantenedores.direccion.DireccionCreatePanel; public class DireccionCreateController extends BaseController { diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/direccion/DireccionSearchController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/direccion/DireccionSearchController.java index 1b4c946..1e5110f 100644 --- a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/direccion/DireccionSearchController.java +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/direccion/DireccionSearchController.java @@ -12,7 +12,7 @@ import xyz.danielcortes.models.Direccion; import xyz.danielcortes.models.Trabajador; import xyz.danielcortes.repository.DireccionRepository; import xyz.danielcortes.validator.DireccionValidator; -import xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionSearchPanel; +import xyz.danielcortes.views.mantenedores.direccion.DireccionSearchPanel; public class DireccionSearchController extends BaseController { diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/direccion/DireccionUpdateController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/direccion/DireccionUpdateController.java index 531a4dd..a973461 100644 --- a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/direccion/DireccionUpdateController.java +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/direccion/DireccionUpdateController.java @@ -9,7 +9,7 @@ import xyz.danielcortes.models.Direccion; import xyz.danielcortes.models.Trabajador; import xyz.danielcortes.repository.DireccionRepository; import xyz.danielcortes.validator.DireccionValidator; -import xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionUpdatePanel; +import xyz.danielcortes.views.mantenedores.direccion.DireccionUpdatePanel; public class DireccionUpdateController extends BaseController { diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/direccion/DireccionViewController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/direccion/DireccionViewController.java index fa38afb..7bc01d7 100644 --- a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/direccion/DireccionViewController.java +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/direccion/DireccionViewController.java @@ -6,7 +6,7 @@ import xyz.danielcortes.framework.BasePanel; import xyz.danielcortes.framework.PanelName; import xyz.danielcortes.models.Direccion; import xyz.danielcortes.models.Trabajador; -import xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionViewPanel; +import xyz.danielcortes.views.mantenedores.direccion.DireccionViewPanel; public class DireccionViewController extends BaseController { diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/telefono/TelefonoCreateController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/telefono/TelefonoCreateController.java index 3733fe5..ab37d20 100644 --- a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/telefono/TelefonoCreateController.java +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/telefono/TelefonoCreateController.java @@ -9,7 +9,7 @@ import xyz.danielcortes.models.Telefono; import xyz.danielcortes.models.Trabajador; import xyz.danielcortes.repository.TelefonoRepository; import xyz.danielcortes.validator.TelefonoValidator; -import xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoCreatePanel; +import xyz.danielcortes.views.mantenedores.telefono.TelefonoCreatePanel; public class TelefonoCreateController extends BaseController { diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/telefono/TelefonoSearchController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/telefono/TelefonoSearchController.java index ece51bf..91fb681 100644 --- a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/telefono/TelefonoSearchController.java +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/telefono/TelefonoSearchController.java @@ -12,7 +12,7 @@ import xyz.danielcortes.models.Telefono; import xyz.danielcortes.models.Trabajador; import xyz.danielcortes.repository.TelefonoRepository; import xyz.danielcortes.validator.TelefonoValidator; -import xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoSearchPanel; +import xyz.danielcortes.views.mantenedores.telefono.TelefonoSearchPanel; public class TelefonoSearchController extends BaseController { diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/telefono/TelefonoUpdateController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/telefono/TelefonoUpdateController.java index 2acedb2..0ba7e41 100644 --- a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/telefono/TelefonoUpdateController.java +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/telefono/TelefonoUpdateController.java @@ -9,7 +9,7 @@ import xyz.danielcortes.models.Telefono; import xyz.danielcortes.models.Trabajador; import xyz.danielcortes.repository.TelefonoRepository; import xyz.danielcortes.validator.TelefonoValidator; -import xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoUpdatePanel; +import xyz.danielcortes.views.mantenedores.telefono.TelefonoUpdatePanel; public class TelefonoUpdateController extends BaseController { diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/telefono/TelefonoViewController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/telefono/TelefonoViewController.java index 0f03701..c575461 100644 --- a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/telefono/TelefonoViewController.java +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/telefono/TelefonoViewController.java @@ -6,7 +6,7 @@ import xyz.danielcortes.framework.BasePanel; import xyz.danielcortes.framework.PanelName; import xyz.danielcortes.models.Telefono; import xyz.danielcortes.models.Trabajador; -import xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoViewPanel; +import xyz.danielcortes.views.mantenedores.telefono.TelefonoViewPanel; public class TelefonoViewController extends BaseController { diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/usuario/UsuarioCreateController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/usuario/UsuarioCreateController.java index 84bdbf8..37e5d75 100644 --- a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/usuario/UsuarioCreateController.java +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/usuario/UsuarioCreateController.java @@ -11,7 +11,7 @@ import xyz.danielcortes.models.Trabajador; import xyz.danielcortes.models.Usuario; import xyz.danielcortes.repository.UsuarioRepository; import xyz.danielcortes.validator.UsuarioValidator; -import xyz.danielcortes.views.mantenedores.trabajador.usuario.UsuarioCreatePanel; +import xyz.danielcortes.views.mantenedores.usuario.UsuarioCreatePanel; public class UsuarioCreateController extends BaseController { private Trabajador trabajador; diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/usuario/UsuarioUpdateController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/usuario/UsuarioUpdateController.java index cda5c11..4f587ab 100644 --- a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/usuario/UsuarioUpdateController.java +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/usuario/UsuarioUpdateController.java @@ -10,7 +10,7 @@ import xyz.danielcortes.framework.ValidationResult; import xyz.danielcortes.models.Trabajador; import xyz.danielcortes.repository.UsuarioRepository; import xyz.danielcortes.validator.UsuarioValidator; -import xyz.danielcortes.views.mantenedores.trabajador.usuario.UsuarioUpdatePanel; +import xyz.danielcortes.views.mantenedores.usuario.UsuarioUpdatePanel; public class UsuarioUpdateController extends BaseController { private Trabajador trabajador; diff --git a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/usuario/UsuarioViewController.java b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/usuario/UsuarioViewController.java index d8a0c2e..6d3fc0f 100644 --- a/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/usuario/UsuarioViewController.java +++ b/src/main/java/xyz/danielcortes/controllers/mantenedores/trabajador/usuario/UsuarioViewController.java @@ -8,7 +8,7 @@ import xyz.danielcortes.framework.BasePanel; import xyz.danielcortes.framework.PanelName; import xyz.danielcortes.models.Trabajador; import xyz.danielcortes.repository.UsuarioRepository; -import xyz.danielcortes.views.mantenedores.trabajador.usuario.UsuarioViewPanel; +import xyz.danielcortes.views.mantenedores.usuario.UsuarioViewPanel; public class UsuarioViewController extends BaseController { diff --git a/src/main/java/xyz/danielcortes/framework/PanelName.java b/src/main/java/xyz/danielcortes/framework/PanelName.java index c2bba23..530ae10 100644 --- a/src/main/java/xyz/danielcortes/framework/PanelName.java +++ b/src/main/java/xyz/danielcortes/framework/PanelName.java @@ -33,6 +33,16 @@ public enum PanelName { TRABAJADOR_CREATE, TRABAJADOR_UPDATE, + EMPRESA_VIEW, + EMPRESA_SEARCH, + EMPRESA_CREATE, + EMPRESA_UPDATE, + + DISTRIBUIDOR_VIEW, + DISTRIBUIDOR_SEARCH, + DISTRIBUIDOR_CREATE, + DISTRIBUIDOR_UPDATE, + USUARIO_VIEW, USUARIO_CREATE, USUARIO_UPDATE, diff --git a/src/main/java/xyz/danielcortes/models/Correo.java b/src/main/java/xyz/danielcortes/models/Correo.java index d95165a..8f0da35 100644 --- a/src/main/java/xyz/danielcortes/models/Correo.java +++ b/src/main/java/xyz/danielcortes/models/Correo.java @@ -16,6 +16,7 @@ import javax.persistence.Table; @Entity @Table(name = "correo") public class Correo { + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id", nullable = false) @@ -32,6 +33,14 @@ public class Correo { ) private List trabajadores; + @ManyToMany + @JoinTable( + name = "distribuidor_direccion", + joinColumns = @JoinColumn(name = "direccion_id", referencedColumnName = "id"), + inverseJoinColumns = @JoinColumn(name = "distribuidor_id", referencedColumnName = "id") + ) + private List distribuidores; + public Integer getId() { return id; } @@ -49,7 +58,7 @@ public class Correo { } public List getTrabajadores() { - if(trabajadores == null){ + if (trabajadores == null) { this.trabajadores = new ArrayList<>(); } return trabajadores; @@ -59,6 +68,16 @@ public class Correo { this.trabajadores = trabajador; } + public List getDistribuidores() { + if(distribuidores == null) + distribuidores = new ArrayList<>(); + return distribuidores; + } + + public void setDistribuidores(List distribuidores) { + this.distribuidores = distribuidores; + } + @Override public boolean equals(Object o) { if (this == o) diff --git a/src/main/java/xyz/danielcortes/models/Direccion.java b/src/main/java/xyz/danielcortes/models/Direccion.java index d1abee3..8f7b46c 100644 --- a/src/main/java/xyz/danielcortes/models/Direccion.java +++ b/src/main/java/xyz/danielcortes/models/Direccion.java @@ -36,6 +36,14 @@ public class Direccion { ) private List trabajadores; + @ManyToMany + @JoinTable( + name = "distribuidor_direccion", + joinColumns = @JoinColumn(name = "direccion_id", referencedColumnName = "id"), + inverseJoinColumns = @JoinColumn(name = "distribuidor_id", referencedColumnName = "id") + ) + private List distribuidores; + public Integer getId() { return id; } @@ -71,6 +79,16 @@ public class Direccion { this.trabajadores = trabajador; } + public List getDistribuidores() { + if(distribuidores == null) + distribuidores = new ArrayList<>(); + return distribuidores; + } + + public void setDistribuidores(List distribuidores) { + this.distribuidores = distribuidores; + } + @Override public boolean equals(Object o) { if (this == o) diff --git a/src/main/java/xyz/danielcortes/models/Distribuidor.java b/src/main/java/xyz/danielcortes/models/Distribuidor.java new file mode 100644 index 0000000..0177daa --- /dev/null +++ b/src/main/java/xyz/danielcortes/models/Distribuidor.java @@ -0,0 +1,61 @@ +package xyz.danielcortes.models; + +import java.util.List; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToMany; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "distribuidor") +public class Distribuidor { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @Column(name="rut") + private String rut; + + @ManyToOne + @JoinColumn(name = "empresa_id") + private Empresa empresa; + + @ManyToMany(mappedBy = "distribuidores") + private List correos; + + @ManyToMany(mappedBy = "distribuidores") + private List telefonos; + + @ManyToMany(mappedBy = "distribuidores") + private List direcciones; + + 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 Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } +} diff --git a/src/main/java/xyz/danielcortes/models/Empresa.java b/src/main/java/xyz/danielcortes/models/Empresa.java new file mode 100644 index 0000000..ae2c60d --- /dev/null +++ b/src/main/java/xyz/danielcortes/models/Empresa.java @@ -0,0 +1,59 @@ +package xyz.danielcortes.models; + +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "empresa") +public class Empresa { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @Column(name = "nombre") + private String nombre; + + @OneToMany(mappedBy = "empresa") + private List distribuidores; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getNombre() { + return nombre; + } + + public void setNombre(String nombre) { + this.nombre = nombre; + } + + public List getDistribuidores() { + if(distribuidores == null){ + distribuidores = new ArrayList<>(); + } + + return distribuidores; + } + + public void setDistribuidores(List distribuidores) { + this.distribuidores = distribuidores; + } + + @Override + public String toString() { + return this.nombre; + } +} diff --git a/src/main/java/xyz/danielcortes/models/Telefono.java b/src/main/java/xyz/danielcortes/models/Telefono.java index e290e4b..7416a8b 100644 --- a/src/main/java/xyz/danielcortes/models/Telefono.java +++ b/src/main/java/xyz/danielcortes/models/Telefono.java @@ -32,6 +32,14 @@ public class Telefono { ) private List trabajadores; + @ManyToMany + @JoinTable( + name = "distribuidor_direccion", + joinColumns = @JoinColumn(name = "direccion_id", referencedColumnName = "id"), + inverseJoinColumns = @JoinColumn(name = "distribuidor_id", referencedColumnName = "id") + ) + private List distribuidores; + public Integer getId() { return id; } @@ -59,6 +67,16 @@ public class Telefono { this.trabajadores = trabajadores; } + public List getDistribuidores() { + if(distribuidores == null) + distribuidores = new ArrayList<>(); + return distribuidores; + } + + public void setDistribuidores(List distribuidores) { + this.distribuidores = distribuidores; + } + @Override public boolean equals(Object o) { if (this == o) diff --git a/src/main/java/xyz/danielcortes/repository/DistribuidorRepository.java b/src/main/java/xyz/danielcortes/repository/DistribuidorRepository.java new file mode 100644 index 0000000..1400ace --- /dev/null +++ b/src/main/java/xyz/danielcortes/repository/DistribuidorRepository.java @@ -0,0 +1,22 @@ +package xyz.danielcortes.repository; + +import java.util.List; +import javax.persistence.Query; +import javax.persistence.TypedQuery; +import xyz.danielcortes.framework.BaseRepository; +import xyz.danielcortes.models.Distribuidor; + +public class DistribuidorRepository extends BaseRepository { + + public List getAll() { + TypedQuery query = em.createQuery("SELECT d FROM Distribuidor d", Distribuidor.class); + return query.getResultList(); + } + + public List search(String term) { + Query query = em.createQuery("SELECT d FROM Distribuidor d JOIN d.empresa e WHERE e.id = d.empresa.id AND (LOWER(e.nombre) LIKE :term OR LOWER(d.rut) LIKE :term)" ); + query.setParameter("term", "%" + term + "%"); + return query.getResultList(); + } + +} diff --git a/src/main/java/xyz/danielcortes/repository/EmpresaRepository.java b/src/main/java/xyz/danielcortes/repository/EmpresaRepository.java new file mode 100644 index 0000000..3f1f9fc --- /dev/null +++ b/src/main/java/xyz/danielcortes/repository/EmpresaRepository.java @@ -0,0 +1,22 @@ +package xyz.danielcortes.repository; + +import java.util.List; +import javax.persistence.Query; +import javax.persistence.TypedQuery; +import xyz.danielcortes.framework.BaseRepository; +import xyz.danielcortes.models.Empresa; + +public class EmpresaRepository extends BaseRepository { + + public List getAll() { + TypedQuery query = em.createQuery("SELECT e FROM Empresa e", Empresa.class); + return query.getResultList(); + } + + public List search(String term) { + Query query = em.createQuery("SELECT e FROM Empresa e WHERE LOWER(e.nombre) LIKE :term" ); + query.setParameter("term", "%" + term.toLowerCase() + "%"); + return query.getResultList(); + } + +} diff --git a/src/main/java/xyz/danielcortes/validator/DistribuidorValidator.java b/src/main/java/xyz/danielcortes/validator/DistribuidorValidator.java new file mode 100644 index 0000000..add908e --- /dev/null +++ b/src/main/java/xyz/danielcortes/validator/DistribuidorValidator.java @@ -0,0 +1,69 @@ +package xyz.danielcortes.validator; + +import xyz.danielcortes.framework.ValidationResult; +import xyz.danielcortes.models.Distribuidor; +import xyz.danielcortes.models.Empresa; +import xyz.danielcortes.repository.DistribuidorRepository; + +public class DistribuidorValidator { + + private DistribuidorRepository distribuidorRepository; + + public DistribuidorValidator(DistribuidorRepository distribuidorRepository) { + this.distribuidorRepository = distribuidorRepository; + } + + 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"); + } else if(rut.length() < 4){ + return new ValidationResult("El rut es muy corto"); + } + if (!rutChecksum(rut)) { + return new ValidationResult("El rut es invalido"); + } + + return ValidationResult.NON_ERROR; + } + + public ValidationResult validateEmpresa(Empresa empresa) { + if(empresa == null) { + return new ValidationResult("La empresa no existe"); + } + return ValidationResult.NON_ERROR; + } + + public ValidationResult validateOriginal(Distribuidor distribuidor) { + if(distribuidor == null){ + return new ValidationResult("El distribuidor es nulo"); + } + return ValidationResult.NON_ERROR; + } + + private boolean rutChecksum(String rut) { + char lastchar = rut.charAt(rut.length() - 1); + 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 digitoVerificador = (char) (mod11 + '0'); + if (mod11 == 11) + digitoVerificador = '0'; + if (mod11 == 10) + digitoVerificador = 'k'; + + return lastchar == digitoVerificador; + } + +} diff --git a/src/main/java/xyz/danielcortes/validator/EmpresaValidator.java b/src/main/java/xyz/danielcortes/validator/EmpresaValidator.java new file mode 100644 index 0000000..c9077b1 --- /dev/null +++ b/src/main/java/xyz/danielcortes/validator/EmpresaValidator.java @@ -0,0 +1,32 @@ +package xyz.danielcortes.validator; + +import xyz.danielcortes.framework.ValidationResult; +import xyz.danielcortes.models.Empresa; +import xyz.danielcortes.repository.EmpresaRepository; + +public class EmpresaValidator { + + private EmpresaRepository empresaRespository; + + public EmpresaValidator(EmpresaRepository empresaRespository) { + this.empresaRespository = empresaRespository; + } + + 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 validateOriginal(Empresa empresa) { + if(empresa == null){ + return new ValidationResult("El empresa es nula"); + } + return ValidationResult.NON_ERROR; + } + +} diff --git a/src/main/java/xyz/danielcortes/validator/TrabajadorValidator.java b/src/main/java/xyz/danielcortes/validator/TrabajadorValidator.java index 1724196..3b99df5 100644 --- a/src/main/java/xyz/danielcortes/validator/TrabajadorValidator.java +++ b/src/main/java/xyz/danielcortes/validator/TrabajadorValidator.java @@ -44,6 +44,8 @@ public class TrabajadorValidator { return new ValidationResult("El rut es nulo"); } else if (rut.isEmpty()) { return new ValidationResult("El rut esta vacío"); + } else if (rut.length() < 4) { + return new ValidationResult("El rut es muy corto"); } if (!rutChecksum(rut)) { return new ValidationResult("El rut es invalido"); @@ -60,6 +62,7 @@ public class TrabajadorValidator { } private boolean rutChecksum(String rut) { + char lastchar = rut.charAt(rut.length() - 1); rut = rut.toLowerCase().replaceAll("[^\\dkK]", ""); int sum = 0; for (int i = rut.length() - 2, j = 2; i >= 0; i--, j++) { @@ -71,7 +74,6 @@ public class TrabajadorValidator { } int mod11 = 11 - (sum % 11); - char lastchar = rut.charAt(rut.length() - 1); char digitoVerificador = (char) (mod11 + '0'); if (mod11 == 11) diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoCreatePanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoCreatePanel.form similarity index 97% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoCreatePanel.form rename to src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoCreatePanel.form index a0e5f89..f9477bd 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoCreatePanel.form +++ b/src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoCreatePanel.form @@ -1,5 +1,5 @@ -
+ diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoCreatePanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoCreatePanel.java similarity index 98% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoCreatePanel.java rename to src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoCreatePanel.java index 52aa39b..6880e08 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoCreatePanel.java +++ b/src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoCreatePanel.java @@ -1,4 +1,4 @@ -package xyz.danielcortes.views.mantenedores.trabajador.correo; +package xyz.danielcortes.views.mantenedores.correo; import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager; diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoSearchPanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoSearchPanel.form similarity index 98% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoSearchPanel.form rename to src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoSearchPanel.form index 9ead2f9..909d6c6 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoSearchPanel.form +++ b/src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoSearchPanel.form @@ -1,5 +1,5 @@ - + diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoSearchPanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoSearchPanel.java similarity index 99% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoSearchPanel.java rename to src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoSearchPanel.java index 402a472..52ef185 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoSearchPanel.java +++ b/src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoSearchPanel.java @@ -1,4 +1,4 @@ -package xyz.danielcortes.views.mantenedores.trabajador.correo; +package xyz.danielcortes.views.mantenedores.correo; import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager; diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoUpdatePanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoUpdatePanel.form similarity index 97% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoUpdatePanel.form rename to src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoUpdatePanel.form index c4fbbac..4dc5561 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoUpdatePanel.form +++ b/src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoUpdatePanel.form @@ -1,5 +1,5 @@ - + diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoUpdatePanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoUpdatePanel.java similarity index 98% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoUpdatePanel.java rename to src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoUpdatePanel.java index bb0901a..faa11af 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoUpdatePanel.java +++ b/src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoUpdatePanel.java @@ -1,4 +1,4 @@ -package xyz.danielcortes.views.mantenedores.trabajador.correo; +package xyz.danielcortes.views.mantenedores.correo; import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager; diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoViewPanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoViewPanel.form similarity index 97% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoViewPanel.form rename to src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoViewPanel.form index 2cd3a2f..eeb2507 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoViewPanel.form +++ b/src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoViewPanel.form @@ -1,5 +1,5 @@ - + diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoViewPanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoViewPanel.java similarity index 98% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoViewPanel.java rename to src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoViewPanel.java index d7a2c3b..66d4d28 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/correo/CorreoViewPanel.java +++ b/src/main/java/xyz/danielcortes/views/mantenedores/correo/CorreoViewPanel.java @@ -1,4 +1,4 @@ -package xyz.danielcortes.views.mantenedores.trabajador.correo; +package xyz.danielcortes.views.mantenedores.correo; import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager; diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionCreatePanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionCreatePanel.form similarity index 97% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionCreatePanel.form rename to src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionCreatePanel.form index 1bcdf40..4f72c1d 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionCreatePanel.form +++ b/src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionCreatePanel.form @@ -1,5 +1,5 @@ - + diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionCreatePanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionCreatePanel.java similarity index 98% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionCreatePanel.java rename to src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionCreatePanel.java index 5860ed2..7288c11 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionCreatePanel.java +++ b/src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionCreatePanel.java @@ -1,4 +1,4 @@ -package xyz.danielcortes.views.mantenedores.trabajador.direccion; +package xyz.danielcortes.views.mantenedores.direccion; import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager; diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionSearchPanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionSearchPanel.form similarity index 98% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionSearchPanel.form rename to src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionSearchPanel.form index a27474d..cf17acf 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionSearchPanel.form +++ b/src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionSearchPanel.form @@ -1,5 +1,5 @@ - + diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionSearchPanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionSearchPanel.java similarity index 99% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionSearchPanel.java rename to src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionSearchPanel.java index c64b38e..3807e64 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionSearchPanel.java +++ b/src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionSearchPanel.java @@ -1,4 +1,4 @@ -package xyz.danielcortes.views.mantenedores.trabajador.direccion; +package xyz.danielcortes.views.mantenedores.direccion; import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager; diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionUpdatePanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionUpdatePanel.form similarity index 97% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionUpdatePanel.form rename to src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionUpdatePanel.form index 1bce0b1..37583f8 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionUpdatePanel.form +++ b/src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionUpdatePanel.form @@ -1,5 +1,5 @@ - + diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionUpdatePanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionUpdatePanel.java similarity index 98% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionUpdatePanel.java rename to src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionUpdatePanel.java index b10cd86..49e6af4 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionUpdatePanel.java +++ b/src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionUpdatePanel.java @@ -1,4 +1,4 @@ -package xyz.danielcortes.views.mantenedores.trabajador.direccion; +package xyz.danielcortes.views.mantenedores.direccion; import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager; diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionViewPanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionViewPanel.form similarity index 97% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionViewPanel.form rename to src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionViewPanel.form index a9f3d14..f95fd2f 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionViewPanel.form +++ b/src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionViewPanel.form @@ -1,5 +1,5 @@ - + diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionViewPanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionViewPanel.java similarity index 98% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionViewPanel.java rename to src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionViewPanel.java index dda7d9d..b04ad01 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/direccion/DireccionViewPanel.java +++ b/src/main/java/xyz/danielcortes/views/mantenedores/direccion/DireccionViewPanel.java @@ -1,4 +1,4 @@ -package xyz.danielcortes.views.mantenedores.trabajador.direccion; +package xyz.danielcortes.views.mantenedores.direccion; import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager; diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorCreatePanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorCreatePanel.form new file mode 100644 index 0000000..6d8d827 --- /dev/null +++ b/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorCreatePanel.form @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorCreatePanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorCreatePanel.java new file mode 100644 index 0000000..4790db1 --- /dev/null +++ b/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorCreatePanel.java @@ -0,0 +1,123 @@ +package xyz.danielcortes.views.mantenedores.distribuidor; + +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.DefaultComboBoxModel; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextField; +import xyz.danielcortes.framework.BasePanel; +import xyz.danielcortes.models.Empresa; + +public class DistribuidorCreatePanel extends BasePanel { + + private JButton guardarButton; + private JPanel contentPane; + private JButton volverButton; + private JTextField rutField; + private JComboBox empresaCombobox; + private DefaultComboBoxModel empresaModel; + + @Override + public JPanel getContentPane() { + return contentPane; + } + + public JButton getGuardarButton() { + return guardarButton; + } + + public JButton getVolverButton() { + return volverButton; + } + + public JTextField getRutField() { + return rutField; + } + + public JComboBox getEmpresaCombobox() { + return empresaCombobox; + } + + public DefaultComboBoxModel getEmpresaModel() { + return empresaModel; + } + + { +// 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(6, 3, new Insets(20, 20, 20, 20), -1, -1)); + final Spacer spacer1 = new Spacer(); + contentPane.add(spacer1, + new GridConstraints(5, 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(5, 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(5, 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(4, 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 label1 = new JLabel(); + label1.setText("Rut:"); + contentPane.add(label1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, + GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + contentPane.add(empresaCombobox, + new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, + GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label2 = new JLabel(); + label2.setText("Empresa:"); + contentPane.add(label2, new GridConstraints(2, 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; + } + + private void createUIComponents() { + this.empresaModel = new DefaultComboBoxModel<>(); + this.empresaCombobox = new JComboBox<>(empresaModel); + } +} diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorSearchPanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorSearchPanel.form new file mode 100644 index 0000000..4a8fea2 --- /dev/null +++ b/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorSearchPanel.form @@ -0,0 +1,96 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorSearchPanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorSearchPanel.java new file mode 100644 index 0000000..e71ab72 --- /dev/null +++ b/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorSearchPanel.java @@ -0,0 +1,151 @@ +package xyz.danielcortes.views.mantenedores.distribuidor; + +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.Distribuidor; + +public class DistribuidorSearchPanel extends BasePanel { + + private JPanel contentPane; + private JTable distribuidorTable; + private JTextField searchField; + private JButton buscarButton; + private JButton verButton; + private JButton eliminarButton; + private JButton editarButton; + private JButton crearButton; + private BaseTableModel distribuidorModel; + + public JPanel getContentPane() { + return contentPane; + } + + public JTable getDistribuidorTable() { + return distribuidorTable; + } + + 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 getDistribuidorModel() { + return distribuidorModel; + } + + private void createUIComponents() { + this.createDistribuidorTable(); + } + + private void createDistribuidorTable() { + // @formatter:off + this.distribuidorModel= new BaseTableModel<>( + new String[]{"Rut", "Empresa"}, + (row, rowIndex, colIndex) -> { + switch (colIndex) { + case 0: return row.get(rowIndex).getRut(); + case 1: return row.get(rowIndex).getEmpresa().getNombre(); + default: return null; + } + } + ); + // @formatter:on + this.distribuidorTable = new JTable(this.distribuidorModel); + this.distribuidorTable.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(distribuidorTable); + 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; + } + +} diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorUpdatePanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorUpdatePanel.form new file mode 100644 index 0000000..9a8d736 --- /dev/null +++ b/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorUpdatePanel.form @@ -0,0 +1,88 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorUpdatePanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorUpdatePanel.java new file mode 100644 index 0000000..f629db1 --- /dev/null +++ b/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorUpdatePanel.java @@ -0,0 +1,123 @@ +package xyz.danielcortes.views.mantenedores.distribuidor; + +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.DefaultComboBoxModel; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextField; +import xyz.danielcortes.framework.BasePanel; +import xyz.danielcortes.models.Empresa; + +public class DistribuidorUpdatePanel extends BasePanel { + + private JButton actualizarButton; + private JPanel contentPane; + private JButton volverButton; + private JTextField rutField; + private JComboBox empresaCombobox; + private DefaultComboBoxModel empresaModel; + + @Override + public JPanel getContentPane() { + return contentPane; + } + + public JButton getActualizarButton() { + return actualizarButton; + } + + public JButton getVolverButton() { + return volverButton; + } + + public JTextField getRutField() { + return rutField; + } + + public JComboBox getEmpresaCombobox() { + return empresaCombobox; + } + + public DefaultComboBoxModel getEmpresaModel() { + return empresaModel; + } + + { +// 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(6, 3, new Insets(20, 20, 20, 20), -1, -1)); + final Spacer spacer1 = new Spacer(); + contentPane.add(spacer1, + new GridConstraints(5, 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(5, 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(5, 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(4, 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 label1 = new JLabel(); + label1.setText("Rut:"); + contentPane.add(label1, new GridConstraints(0, 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)); + contentPane.add(empresaCombobox, + new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, + GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label2 = new JLabel(); + label2.setText("Empresa:"); + contentPane.add(label2, new GridConstraints(2, 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; + } + + private void createUIComponents() { + this.empresaModel = new DefaultComboBoxModel<>(); + this.empresaCombobox = new JComboBox<>(empresaModel); + } +} diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorViewPanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorViewPanel.form new file mode 100644 index 0000000..be49634 --- /dev/null +++ b/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorViewPanel.form @@ -0,0 +1,115 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorViewPanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorViewPanel.java new file mode 100644 index 0000000..f8c0457 --- /dev/null +++ b/src/main/java/xyz/danielcortes/views/mantenedores/distribuidor/DistribuidorViewPanel.java @@ -0,0 +1,134 @@ +package xyz.danielcortes.views.mantenedores.distribuidor; + +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 DistribuidorViewPanel extends BasePanel { + + private JTextField empresaField; + private JButton volverButton; + private JPanel contentPane; + private JTextField rutField; + private JButton direccionesButton; + private JButton correosButton; + private JButton telefonosButton; + + @Override + public JPanel getContentPane() { + return contentPane; + } + + public JTextField getEmpresaField() { + return empresaField; + } + + public JButton getVolverButton() { + return volverButton; + } + + public JTextField getRutField() { + return rutField; + } + + public JButton getDireccionesButton() { + return direccionesButton; + } + + public JButton getCorreosButton() { + return correosButton; + } + + public JButton getTelefonosButton() { + return telefonosButton; + } + + { +// 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(7, 3, new Insets(20, 20, 20, 20), -1, -1)); + final JLabel label1 = new JLabel(); + label1.setText("Empresa:"); + 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)); + empresaField = new JTextField(); + empresaField.setEditable(false); + empresaField.setEnabled(true); + contentPane.add(empresaField, + 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 Spacer spacer1 = new Spacer(); + contentPane.add(spacer1, + new GridConstraints(6, 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(6, 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(6, 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(5, 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 label2 = new JLabel(); + label2.setText("Rut:"); + contentPane.add(label2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, + GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + rutField = new JTextField(); + rutField.setEditable(false); + 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 JPanel panel1 = new JPanel(); + panel1.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1)); + contentPane.add(panel1, new GridConstraints(4, 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)); + direccionesButton = new JButton(); + direccionesButton.setText("Direcciones"); + panel1.add(direccionesButton, 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)); + correosButton = new JButton(); + correosButton.setText("Correos"); + panel1.add(correosButton, 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)); + telefonosButton = new JButton(); + telefonosButton.setText("Telefonos"); + panel1.add(telefonosButton, 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)); + } + + /** + * @noinspection ALL + */ + public JComponent $$$getRootComponent$$$() { + return contentPane; + } + +} diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaCreatePanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaCreatePanel.form new file mode 100644 index 0000000..e775dde --- /dev/null +++ b/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaCreatePanel.form @@ -0,0 +1,74 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaCreatePanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaCreatePanel.java new file mode 100644 index 0000000..82f770d --- /dev/null +++ b/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaCreatePanel.java @@ -0,0 +1,97 @@ +package xyz.danielcortes.views.mantenedores.empresa; + +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 EmpresaCreatePanel extends BasePanel { + + private JPanel contentPane; + private JTextField nombreField; + private JButton guardarButton; + private JButton volverButton; + + public JPanel getContentPane() { + return contentPane; + } + + public JTextField getNombreField() { + return nombreField; + } + + public JButton getGuardarButton() { + return guardarButton; + } + + public JButton getVolverButton() { + return volverButton; + } + + { +// 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(4, 3, new Insets(20, 20, 20, 20), -1, -1)); + nombreField = new JTextField(); + contentPane.add(nombreField, + new GridConstraints(1, 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(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, + null, null, 0, false)); + final JLabel label1 = new JLabel(); + label1.setText("Nombre:"); + contentPane.add(label1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, + GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer2 = new Spacer(); + contentPane.add(spacer2, + new GridConstraints(3, 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(3, 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(2, 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)); + } + + /** + * @noinspection ALL + */ + public JComponent $$$getRootComponent$$$() { + return contentPane; + } + +} diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaSearchPanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaSearchPanel.form new file mode 100644 index 0000000..a301ff5 --- /dev/null +++ b/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaSearchPanel.form @@ -0,0 +1,106 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaSearchPanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaSearchPanel.java new file mode 100644 index 0000000..38c8e1d --- /dev/null +++ b/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaSearchPanel.java @@ -0,0 +1,154 @@ +package xyz.danielcortes.views.mantenedores.empresa; + +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 xyz.danielcortes.framework.BaseTableModel; +import xyz.danielcortes.models.Empresa; +import xyz.danielcortes.framework.BasePanel; + +public class EmpresaSearchPanel extends BasePanel { + + private JPanel contentPane; + private JTable empresaTable; + private JButton buscarButton; + private JTextField buscarField; + private JButton verButton; + private JButton editarButton; + private JButton eliminarButton; + private JButton crearButton; + private BaseTableModel empresaModel; + + public JPanel getContentPane() { + return contentPane; + } + + public JTable getEmpresaTable() { + return empresaTable; + } + + public BaseTableModel getEmpresaModel() { + return empresaModel; + } + + public JButton getBuscarButton() { + return buscarButton; + } + + public JTextField getBuscarField() { + return buscarField; + } + + public JButton getVerButton() { + return verButton; + } + + public JButton getEditarButton() { + return editarButton; + } + + public JButton getEliminarButton() { + return eliminarButton; + } + + public JButton getCrearButton() { + return crearButton; + } + + private void createUIComponents() { + this.createEmpresaTable(); + } + + private void createEmpresaTable() { + // @formatter:off + this.empresaModel = new BaseTableModel<>( + new String[]{"Nombre", "Nº Distribuidores"}, + (row, rowIndex, colIndex) -> { + switch(colIndex) { + case 0: return row.get(rowIndex).getNombre(); + case 1: return row.get(rowIndex).getDistribuidores().size(); + default: return null; + } + } + ); + this.empresaTable = new JTable(this.empresaModel); + // @formatter:on + } + + { +// 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, 1, new Insets(20, 20, 20, 20), -1, -1)); + final JScrollPane scrollPane1 = new JScrollPane(); + contentPane.add(scrollPane1, new GridConstraints(1, 0, 1, 1, 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(empresaTable); + final JPanel panel1 = new JPanel(); + panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); + contentPane.add(panel1, new GridConstraints(0, 0, 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)); + buscarButton = new JButton(); + buscarButton.setText("Buscar"); + panel1.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)); + buscarField = new JTextField(); + panel1.add(buscarField, + 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)); + final JPanel panel2 = new JPanel(); + panel2.setLayout(new GridLayoutManager(1, 4, new Insets(0, 0, 0, 0), -1, -1)); + contentPane.add(panel2, new GridConstraints(2, 0, 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)); + verButton = new JButton(); + verButton.setText("Ver"); + panel2.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)); + editarButton = new JButton(); + editarButton.setText("Editar"); + panel2.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)); + eliminarButton = new JButton(); + eliminarButton.setText("Eliminar"); + panel2.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)); + crearButton = new JButton(); + crearButton.setText("Crear"); + panel2.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; + } + +} diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaUpdatePanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaUpdatePanel.form new file mode 100644 index 0000000..63b8bfd --- /dev/null +++ b/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaUpdatePanel.form @@ -0,0 +1,54 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaUpdatePanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaUpdatePanel.java new file mode 100644 index 0000000..ced477f --- /dev/null +++ b/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaUpdatePanel.java @@ -0,0 +1,82 @@ +package xyz.danielcortes.views.mantenedores.empresa; + +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 EmpresaUpdatePanel extends BasePanel { + + private JPanel contentPane; + private JTextField nombreField; + private JButton actualizarButton; + + public JPanel getContentPane() { + return contentPane; + } + + public JTextField getNombreField() { + return nombreField; + } + + public JButton getActualizarButton() { + return actualizarButton; + } + + { +// 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(4, 3, new Insets(20, 20, 20, 20), -1, -1)); + nombreField = new JTextField(); + contentPane.add(nombreField, + new GridConstraints(1, 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("Nombre:"); + contentPane.add(label1, new GridConstraints(0, 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(3, 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(3, 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(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, + null, null, 0, false)); + actualizarButton = new JButton(); + actualizarButton.setText("Actualizar"); + contentPane.add(actualizarButton, new GridConstraints(2, 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)); + } + + /** + * @noinspection ALL + */ + public JComponent $$$getRootComponent$$$() { + return contentPane; + } + +} diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaViewPanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaViewPanel.form new file mode 100644 index 0000000..8e7b031 --- /dev/null +++ b/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaViewPanel.form @@ -0,0 +1,56 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaViewPanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaViewPanel.java new file mode 100644 index 0000000..6ff9f89 --- /dev/null +++ b/src/main/java/xyz/danielcortes/views/mantenedores/empresa/EmpresaViewPanel.java @@ -0,0 +1,82 @@ +package xyz.danielcortes.views.mantenedores.empresa; + +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 EmpresaViewPanel extends BasePanel { + + private JPanel contentPane; + private JTextField nombreField; + private JButton volverButton; + + public JPanel getContentPane() { + return contentPane; + } + + public JTextField getNombreField() { + return nombreField; + } + + public JButton getVolverButton() { + return volverButton; + } + + { +// 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(4, 3, new Insets(20, 20, 20, 20), -1, -1)); + final Spacer spacer1 = new Spacer(); + contentPane.add(spacer1, + new GridConstraints(3, 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(3, 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(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, + null, null, 0, false)); + final JLabel label1 = new JLabel(); + label1.setText("Nombre:"); + contentPane.add(label1, new GridConstraints(0, 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); + contentPane.add(nombreField, + new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, + GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false)); + volverButton = new JButton(); + volverButton.setText("Volver"); + contentPane.add(volverButton, new GridConstraints(2, 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)); + } + + /** + * @noinspection ALL + */ + public JComponent $$$getRootComponent$$$() { + return contentPane; + } +} diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoCreatePanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoCreatePanel.form similarity index 97% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoCreatePanel.form rename to src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoCreatePanel.form index 446c620..a18762a 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoCreatePanel.form +++ b/src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoCreatePanel.form @@ -1,5 +1,5 @@ -
+ diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoCreatePanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoCreatePanel.java similarity index 98% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoCreatePanel.java rename to src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoCreatePanel.java index 5d777d8..b84be04 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoCreatePanel.java +++ b/src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoCreatePanel.java @@ -1,4 +1,4 @@ -package xyz.danielcortes.views.mantenedores.trabajador.telefono; +package xyz.danielcortes.views.mantenedores.telefono; import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager; diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoSearchPanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoSearchPanel.form similarity index 98% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoSearchPanel.form rename to src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoSearchPanel.form index 41ce943..e442b9b 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoSearchPanel.form +++ b/src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoSearchPanel.form @@ -1,5 +1,5 @@ - + diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoSearchPanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoSearchPanel.java similarity index 99% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoSearchPanel.java rename to src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoSearchPanel.java index 3979630..a947d8d 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoSearchPanel.java +++ b/src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoSearchPanel.java @@ -1,4 +1,4 @@ -package xyz.danielcortes.views.mantenedores.trabajador.telefono; +package xyz.danielcortes.views.mantenedores.telefono; import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager; diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoUpdatePanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoUpdatePanel.form similarity index 97% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoUpdatePanel.form rename to src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoUpdatePanel.form index ba5e805..c294fa1 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoUpdatePanel.form +++ b/src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoUpdatePanel.form @@ -1,5 +1,5 @@ - + diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoUpdatePanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoUpdatePanel.java similarity index 98% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoUpdatePanel.java rename to src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoUpdatePanel.java index dcd90d3..07b163b 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoUpdatePanel.java +++ b/src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoUpdatePanel.java @@ -1,4 +1,4 @@ -package xyz.danielcortes.views.mantenedores.trabajador.telefono; +package xyz.danielcortes.views.mantenedores.telefono; import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager; diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoViewPanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoViewPanel.form similarity index 97% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoViewPanel.form rename to src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoViewPanel.form index e088aa8..a086e13 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoViewPanel.form +++ b/src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoViewPanel.form @@ -1,5 +1,5 @@ - + diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoViewPanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoViewPanel.java similarity index 98% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoViewPanel.java rename to src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoViewPanel.java index 95c7082..1b019fa 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/telefono/TelefonoViewPanel.java +++ b/src/main/java/xyz/danielcortes/views/mantenedores/telefono/TelefonoViewPanel.java @@ -1,4 +1,4 @@ -package xyz.danielcortes.views.mantenedores.trabajador.telefono; +package xyz.danielcortes.views.mantenedores.telefono; import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager; diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioCreatePanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioCreatePanel.form similarity index 97% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioCreatePanel.form rename to src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioCreatePanel.form index 031a067..d7983e6 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioCreatePanel.form +++ b/src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioCreatePanel.form @@ -1,5 +1,5 @@ - + diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioCreatePanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioCreatePanel.java similarity index 98% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioCreatePanel.java rename to src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioCreatePanel.java index 090ea34..6a96a12 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioCreatePanel.java +++ b/src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioCreatePanel.java @@ -1,4 +1,4 @@ -package xyz.danielcortes.views.mantenedores.trabajador.usuario; +package xyz.danielcortes.views.mantenedores.usuario; import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager; diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioUpdatePanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioUpdatePanel.form similarity index 97% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioUpdatePanel.form rename to src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioUpdatePanel.form index d7ef2c2..4054054 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioUpdatePanel.form +++ b/src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioUpdatePanel.form @@ -1,5 +1,5 @@ - + diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioUpdatePanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioUpdatePanel.java similarity index 98% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioUpdatePanel.java rename to src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioUpdatePanel.java index 166a6f5..9f5ec23 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioUpdatePanel.java +++ b/src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioUpdatePanel.java @@ -1,4 +1,4 @@ -package xyz.danielcortes.views.mantenedores.trabajador.usuario; +package xyz.danielcortes.views.mantenedores.usuario; import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager; diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioViewPanel.form b/src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioViewPanel.form similarity index 97% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioViewPanel.form rename to src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioViewPanel.form index 7cdf9aa..588eebb 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioViewPanel.form +++ b/src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioViewPanel.form @@ -1,5 +1,5 @@ - + diff --git a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioViewPanel.java b/src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioViewPanel.java similarity index 98% rename from src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioViewPanel.java rename to src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioViewPanel.java index 428cd6d..b92a5a1 100644 --- a/src/main/java/xyz/danielcortes/views/mantenedores/trabajador/usuario/UsuarioViewPanel.java +++ b/src/main/java/xyz/danielcortes/views/mantenedores/usuario/UsuarioViewPanel.java @@ -1,4 +1,4 @@ -package xyz.danielcortes.views.mantenedores.trabajador.usuario; +package xyz.danielcortes.views.mantenedores.usuario; import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager;