La vista de busqueda es la central ahora
This commit is contained in:
@@ -8,9 +8,9 @@ import javax.swing.JMenuBar;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JPanel;
|
||||
import xyz.danielcortes.controllers.autor.AutorCreateController;
|
||||
import xyz.danielcortes.controllers.autor.AutorDeleteController;
|
||||
import xyz.danielcortes.controllers.autor.AutorListController;
|
||||
import xyz.danielcortes.controllers.autor.AutorSearchController;
|
||||
import xyz.danielcortes.controllers.autor.AutorUpdateController;
|
||||
import xyz.danielcortes.controllers.autor.AutorViewController;
|
||||
import xyz.danielcortes.controllers.categoria.CategoriaCreateController;
|
||||
import xyz.danielcortes.controllers.categoria.CategoriaDeleteController;
|
||||
import xyz.danielcortes.controllers.categoria.CategoriaListController;
|
||||
@@ -30,9 +30,9 @@ import xyz.danielcortes.controllers.libro.LibroUpdateController;
|
||||
import xyz.danielcortes.framework.PanelName;
|
||||
import xyz.danielcortes.views.LaunchFrame;
|
||||
import xyz.danielcortes.views.autor.AutorCreatePanel;
|
||||
import xyz.danielcortes.views.autor.AutorDeletePanel;
|
||||
import xyz.danielcortes.views.autor.AutorListPanel;
|
||||
import xyz.danielcortes.views.autor.AutorSearchPanel;
|
||||
import xyz.danielcortes.views.autor.AutorUpdatePanel;
|
||||
import xyz.danielcortes.views.autor.AutorViewPanel;
|
||||
import xyz.danielcortes.views.categoria.CategoriaCreatePanel;
|
||||
import xyz.danielcortes.views.categoria.CategoriaDeletePanel;
|
||||
import xyz.danielcortes.views.categoria.CategoriaListPanel;
|
||||
@@ -73,10 +73,10 @@ public class LaunchController {
|
||||
this.controllers.put(PanelName.LIBRO_UPDATE, new LibroUpdateController(new LibroUpdatePanel(), this));
|
||||
this.controllers.put(PanelName.LIBRO_DELETE, new LibroDeleteController(new LibroDeletePanel(), this));
|
||||
|
||||
this.controllers.put(PanelName.AUTOR_LIST, new AutorListController(new AutorListPanel(), this));
|
||||
this.controllers.put(PanelName.AUTOR_VIEW, new AutorViewController(new AutorViewPanel(), this));
|
||||
this.controllers.put(PanelName.AUTOR_SEARCH, new AutorSearchController(new AutorSearchPanel(), this));
|
||||
this.controllers.put(PanelName.AUTOR_CREATE, new AutorCreateController(new AutorCreatePanel(), this));
|
||||
this.controllers.put(PanelName.AUTOR_UPDATE, new AutorUpdateController(new AutorUpdatePanel(), this));
|
||||
this.controllers.put(PanelName.AUTOR_DELETE, new AutorDeleteController(new AutorDeletePanel(), this));
|
||||
|
||||
this.controllers.put(PanelName.IDIOMA_LIST, new IdiomaListController(new IdiomaListPanel(), this));
|
||||
this.controllers.put(PanelName.IDIOMA_CREATE, new IdiomaCreateController(new IdiomaCreatePanel(), this));
|
||||
@@ -115,10 +115,8 @@ public class LaunchController {
|
||||
JMenuItem libroDelete = new JMenuItem("Eliminar"); libroDelete.setMnemonic(KeyEvent.VK_E);
|
||||
|
||||
JMenu autoresMenu = new JMenu("Autores"); autoresMenu.setMnemonic(KeyEvent.VK_A);
|
||||
JMenuItem autorList = new JMenuItem("Listar"); autorList.setMnemonic(KeyEvent.VK_L);
|
||||
JMenuItem autorSearch = new JMenuItem("Buscar"); autorSearch.setMnemonic(KeyEvent.VK_B);
|
||||
JMenuItem autorCreate = new JMenuItem("Crear"); autorCreate.setMnemonic(KeyEvent.VK_C);
|
||||
JMenuItem autorUpdate = new JMenuItem("Actualizar"); autorUpdate.setMnemonic(KeyEvent.VK_A);
|
||||
JMenuItem autorDelete = new JMenuItem("Eliminar"); autorDelete.setMnemonic(KeyEvent.VK_E);
|
||||
|
||||
JMenu idiomasMenu = new JMenu("Idiomas"); idiomasMenu.setMnemonic(KeyEvent.VK_I);
|
||||
JMenuItem idiomaList = new JMenuItem("Listar"); idiomaList.setMnemonic(KeyEvent.VK_L);
|
||||
@@ -139,10 +137,8 @@ public class LaunchController {
|
||||
JMenuItem editorialDelete = new JMenuItem("Eliminar"); editorialDelete.setMnemonic(KeyEvent.VK_E);
|
||||
// @formatter:on
|
||||
|
||||
autorList.addActionListener(e -> this.showCard(PanelName.AUTOR_LIST));
|
||||
autorSearch.addActionListener(e -> this.showCard(PanelName.AUTOR_SEARCH));
|
||||
autorCreate.addActionListener(e -> this.showCard(PanelName.AUTOR_CREATE));
|
||||
autorUpdate.addActionListener(e -> this.showCard(PanelName.AUTOR_UPDATE));
|
||||
autorDelete.addActionListener(e -> this.showCard(PanelName.AUTOR_DELETE));
|
||||
|
||||
idiomaList.addActionListener(e -> this.showCard(PanelName.IDIOMA_LIST));
|
||||
idiomaCreate.addActionListener(e -> this.showCard(PanelName.IDIOMA_CREATE));
|
||||
@@ -171,10 +167,8 @@ public class LaunchController {
|
||||
librosMenu.add(libroDelete);
|
||||
|
||||
menuBar.add(autoresMenu);
|
||||
autoresMenu.add(autorList);
|
||||
autoresMenu.add(autorSearch);
|
||||
autoresMenu.add(autorCreate);
|
||||
autoresMenu.add(autorUpdate);
|
||||
autoresMenu.add(autorDelete);
|
||||
|
||||
menuBar.add(idiomasMenu);
|
||||
idiomasMenu.add(idiomaList);
|
||||
@@ -202,6 +196,10 @@ public class LaunchController {
|
||||
this.frame.showCard(name);
|
||||
}
|
||||
|
||||
public BaseController getCard(PanelName name) {
|
||||
return this.controllers.get(name);
|
||||
}
|
||||
|
||||
public void run() {
|
||||
this.create();
|
||||
this.frame.setVisible(true);
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
package xyz.danielcortes.controllers.autor;
|
||||
|
||||
import java.util.List;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JOptionPane;
|
||||
import xyz.danielcortes.controllers.BaseController;
|
||||
import xyz.danielcortes.controllers.LaunchController;
|
||||
import xyz.danielcortes.models.Autor;
|
||||
import xyz.danielcortes.repository.AutorRepository;
|
||||
import xyz.danielcortes.views.BasePanel;
|
||||
import xyz.danielcortes.views.autor.AutorDeletePanel;
|
||||
|
||||
public class AutorDeleteController extends BaseController {
|
||||
private AutorDeletePanel view;
|
||||
private AutorRepository autorRepository;
|
||||
|
||||
public AutorDeleteController(AutorDeletePanel view, LaunchController parent){
|
||||
super(parent);
|
||||
this.view = view;
|
||||
this.autorRepository = new AutorRepository();
|
||||
this.setupListeners();
|
||||
this.loadAutorCombo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show(){
|
||||
this.reload();
|
||||
this.view.getAutorCombo().requestFocus();
|
||||
}
|
||||
|
||||
private void setupListeners() {
|
||||
view.getEliminarButton().addActionListener(e -> delete());
|
||||
}
|
||||
|
||||
private void delete() {
|
||||
Autor selected = (Autor) this.view.getAutorCombo().getSelectedItem();
|
||||
if(!validateAutor(selected)) return;
|
||||
|
||||
this.autorRepository.delete(selected);
|
||||
this.reload();
|
||||
}
|
||||
|
||||
private boolean validateAutor(Autor autor) {
|
||||
if (autor == null) {
|
||||
JOptionPane.showMessageDialog(
|
||||
this.view.getContentPane(),
|
||||
"No hay autor seleccionado",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void reload(){
|
||||
loadAutorCombo();
|
||||
}
|
||||
|
||||
private void loadAutorCombo(){
|
||||
List<Autor> autores = this.autorRepository.getAll();
|
||||
JComboBox<Autor> combobox = this.view.getAutorCombo();
|
||||
combobox.removeAllItems();
|
||||
for(Autor autor: autores) {
|
||||
combobox.addItem(autor);
|
||||
}
|
||||
}
|
||||
|
||||
public BasePanel getView() {
|
||||
return view;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package xyz.danielcortes.controllers.autor;
|
||||
|
||||
import java.util.List;
|
||||
import xyz.danielcortes.controllers.BaseController;
|
||||
import xyz.danielcortes.controllers.LaunchController;
|
||||
import xyz.danielcortes.framework.BaseTableModel;
|
||||
import xyz.danielcortes.models.Autor;
|
||||
import xyz.danielcortes.repository.AutorRepository;
|
||||
import xyz.danielcortes.views.BasePanel;
|
||||
import xyz.danielcortes.views.autor.AutorListPanel;
|
||||
|
||||
public class AutorListController extends BaseController {
|
||||
private AutorListPanel view;
|
||||
private AutorRepository autorRepository;
|
||||
|
||||
public AutorListController(AutorListPanel view, LaunchController parent) {
|
||||
super(parent);
|
||||
this.view = view;
|
||||
this.autorRepository = new AutorRepository();
|
||||
this.setupListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
this.reload();
|
||||
}
|
||||
|
||||
public void reload() {
|
||||
this.loadAutorTable();
|
||||
}
|
||||
|
||||
private void setupListeners() {
|
||||
this.view.getBuscarButton().addActionListener(e -> {
|
||||
String term = this.view.getSearchField().getText();
|
||||
List<Autor> autores = this.autorRepository.search(term);
|
||||
this.loadAutorTable(autores);
|
||||
});
|
||||
}
|
||||
|
||||
private void loadAutorTable() {
|
||||
List<Autor> autores = this.autorRepository.getAll();
|
||||
loadAutorTable(autores);
|
||||
}
|
||||
|
||||
private void loadAutorTable(List<Autor> autores) {
|
||||
BaseTableModel<Autor> model = this.view.getAutorModel();
|
||||
model.addRows(autores);
|
||||
}
|
||||
|
||||
|
||||
public BasePanel getView() {
|
||||
return view;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package xyz.danielcortes.controllers.autor;
|
||||
|
||||
import java.util.List;
|
||||
import javax.swing.JOptionPane;
|
||||
import xyz.danielcortes.controllers.BaseController;
|
||||
import xyz.danielcortes.controllers.LaunchController;
|
||||
import xyz.danielcortes.framework.BaseTableModel;
|
||||
import xyz.danielcortes.framework.PanelName;
|
||||
import xyz.danielcortes.models.Autor;
|
||||
import xyz.danielcortes.repository.AutorRepository;
|
||||
import xyz.danielcortes.views.BasePanel;
|
||||
import xyz.danielcortes.views.autor.AutorSearchPanel;
|
||||
|
||||
public class AutorSearchController extends BaseController {
|
||||
|
||||
private AutorSearchPanel view;
|
||||
private AutorRepository autorRepository;
|
||||
|
||||
public AutorSearchController(AutorSearchPanel view, LaunchController parent) {
|
||||
super(parent);
|
||||
this.view = view;
|
||||
this.autorRepository = new AutorRepository();
|
||||
this.setupListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
this.reload();
|
||||
this.view.getAutorTable().clearSelection();
|
||||
}
|
||||
|
||||
public void reload() {
|
||||
this.loadAutorTable();
|
||||
}
|
||||
|
||||
private void setupListeners() {
|
||||
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() {
|
||||
Autor autor = this.getSelectedAutor();
|
||||
if (autor != null) {
|
||||
AutorUpdateController controller = (AutorUpdateController) this.getParentController().getCard(PanelName.AUTOR_UPDATE);
|
||||
controller.setAutor(autor);
|
||||
this.getParentController().showCard(PanelName.AUTOR_UPDATE);
|
||||
}
|
||||
}
|
||||
|
||||
private void delete() {
|
||||
Autor autor = this.getSelectedAutor();
|
||||
if (autor == null)
|
||||
return;
|
||||
|
||||
int option = JOptionPane.showConfirmDialog(
|
||||
null,
|
||||
"¿Estas seguro de que deseas eliminar el autor?",
|
||||
"Confirmacion",
|
||||
JOptionPane.YES_NO_OPTION,
|
||||
JOptionPane.QUESTION_MESSAGE
|
||||
);
|
||||
if (option == JOptionPane.NO_OPTION)
|
||||
return;
|
||||
|
||||
this.autorRepository.delete(autor);
|
||||
this.reload();
|
||||
}
|
||||
|
||||
private void view() {
|
||||
Autor autor = this.getSelectedAutor();
|
||||
if (autor != null) {
|
||||
AutorViewController controller = (AutorViewController) this.getParentController().getCard(PanelName.AUTOR_VIEW);
|
||||
controller.setAutor(autor);
|
||||
this.getParentController().showCard(PanelName.AUTOR_VIEW);
|
||||
}
|
||||
}
|
||||
|
||||
private void search() {
|
||||
String term = this.view.getSearchField().getText();
|
||||
List<Autor> autores = this.autorRepository.search(term);
|
||||
this.loadAutorTable(autores);
|
||||
}
|
||||
|
||||
private void loadAutorTable() {
|
||||
List<Autor> autores = this.autorRepository.getAll();
|
||||
loadAutorTable(autores);
|
||||
}
|
||||
|
||||
private void loadAutorTable(List<Autor> autores) {
|
||||
BaseTableModel<Autor> model = this.view.getAutorModel();
|
||||
model.setRows(autores);
|
||||
}
|
||||
|
||||
private Autor getSelectedAutor() {
|
||||
int selectedRow = this.view.getAutorTable().getSelectedRow();
|
||||
if (selectedRow == -1) {
|
||||
JOptionPane.showMessageDialog(
|
||||
null,
|
||||
"No hay autor seleccionado",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.view.getAutorModel().getRow(this.view.getAutorTable().getSelectedRow());
|
||||
}
|
||||
|
||||
public BasePanel getView() {
|
||||
return view;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
package xyz.danielcortes.controllers.autor;
|
||||
|
||||
import java.util.List;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JOptionPane;
|
||||
import xyz.danielcortes.controllers.BaseController;
|
||||
import xyz.danielcortes.controllers.LaunchController;
|
||||
import xyz.danielcortes.framework.PanelName;
|
||||
import xyz.danielcortes.models.Autor;
|
||||
import xyz.danielcortes.repository.AutorRepository;
|
||||
import xyz.danielcortes.views.BasePanel;
|
||||
@@ -12,6 +11,7 @@ import xyz.danielcortes.views.autor.AutorUpdatePanel;
|
||||
|
||||
public class AutorUpdateController extends BaseController {
|
||||
|
||||
private Autor autor;
|
||||
private AutorUpdatePanel view;
|
||||
private AutorRepository autorRepository;
|
||||
|
||||
@@ -20,31 +20,34 @@ public class AutorUpdateController extends BaseController {
|
||||
this.view = view;
|
||||
this.autorRepository = new AutorRepository();
|
||||
this.setupListeners();
|
||||
this.loadAutorCombo();
|
||||
}
|
||||
|
||||
public void setAutor(Autor autor) {
|
||||
this.autor = autor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
this.reload();
|
||||
this.view.getAutorCombo().requestFocus();
|
||||
fillAutor();
|
||||
this.view.getNombreField().requestFocus();
|
||||
}
|
||||
|
||||
private void fillAutor() {
|
||||
if (autor == null)
|
||||
return;
|
||||
|
||||
this.view.getNombreField().setText(this.autor.getNombre());
|
||||
this.view.getApellidoPaternoField().setText(this.autor.getApellidoPaterno());
|
||||
this.view.getApellidoMaternoField().setText(this.autor.getApellidoMaterno());
|
||||
}
|
||||
|
||||
private void setupListeners() {
|
||||
this.view.getAutorCombo().addActionListener(e -> {
|
||||
Autor selected = (Autor) view.getAutorCombo().getSelectedItem();
|
||||
if (selected != null) {
|
||||
this.view.getNombreField().setText(selected.getNombre());
|
||||
this.view.getApellidoPaternoField().setText(selected.getApellidoPaterno());
|
||||
this.view.getApellidoMaternoField().setText(selected.getApellidoMaterno());
|
||||
}
|
||||
});
|
||||
this.view.getApellidoPaternoField().addActionListener(e -> update());
|
||||
this.view.getActualizarButton().addActionListener(e -> update());
|
||||
}
|
||||
|
||||
private void update() {
|
||||
Autor original = (Autor) this.view.getAutorCombo().getSelectedItem();
|
||||
if(!validateOriginal(original)) return;
|
||||
if(!validateOriginal(this.autor)) return;
|
||||
|
||||
String nombre = this.view.getNombreField().getText();
|
||||
if(!validateNombre(nombre)) return;
|
||||
@@ -55,15 +58,14 @@ public class AutorUpdateController extends BaseController {
|
||||
String apellidoMaterno = this.view.getApellidoMaternoField().getText();
|
||||
if(!validateApellidoMaterno(apellidoMaterno)) return;
|
||||
|
||||
assert original != null;
|
||||
original.setNombre(nombre);
|
||||
original.setApellidoPaterno(apellidoPaterno);
|
||||
original.setApellidoMaterno(apellidoMaterno);
|
||||
assert this.autor != null;
|
||||
this.autor.setNombre(nombre);
|
||||
this.autor.setApellidoPaterno(apellidoPaterno);
|
||||
this.autor.setApellidoMaterno(apellidoMaterno);
|
||||
|
||||
this.autorRepository.update(original);
|
||||
this.autorRepository.update(this.autor);
|
||||
|
||||
this.loadAutorCombo();
|
||||
this.view.getNombreField().requestFocus();
|
||||
this.getParentController().showCard(PanelName.AUTOR_SEARCH);
|
||||
}
|
||||
|
||||
private boolean validateOriginal(Autor original) {
|
||||
@@ -133,19 +135,6 @@ public class AutorUpdateController extends BaseController {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void reload() {
|
||||
this.loadAutorCombo();
|
||||
}
|
||||
|
||||
private void loadAutorCombo() {
|
||||
List<Autor> autores = this.autorRepository.getAll();
|
||||
JComboBox<Autor> combobox = this.view.getAutorCombo();
|
||||
combobox.removeAllItems();
|
||||
for (Autor autor : autores) {
|
||||
combobox.addItem(autor);
|
||||
}
|
||||
}
|
||||
|
||||
public BasePanel getView() {
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package xyz.danielcortes.controllers.autor;
|
||||
|
||||
import xyz.danielcortes.controllers.BaseController;
|
||||
import xyz.danielcortes.controllers.LaunchController;
|
||||
import xyz.danielcortes.framework.PanelName;
|
||||
import xyz.danielcortes.models.Autor;
|
||||
import xyz.danielcortes.views.BasePanel;
|
||||
import xyz.danielcortes.views.autor.AutorViewPanel;
|
||||
@@ -14,17 +15,24 @@ public class AutorViewController extends BaseController {
|
||||
public AutorViewController(AutorViewPanel view, LaunchController parent) {
|
||||
super(parent);
|
||||
this.view = view;
|
||||
this.fillAutor();
|
||||
this.setupListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
this.fillAutor();
|
||||
}
|
||||
|
||||
private void setAutor(Autor autor){
|
||||
public void setAutor(Autor autor){
|
||||
this.autor = autor;
|
||||
}
|
||||
|
||||
private void setupListeners() {
|
||||
this.view.getVolverButton().addActionListener(e -> {
|
||||
this.getParentController().showCard(PanelName.AUTOR_SEARCH);
|
||||
});
|
||||
}
|
||||
|
||||
private void fillAutor() {
|
||||
if (autor == null)
|
||||
return;
|
||||
|
||||
@@ -30,7 +30,7 @@ public class CategoriaListController extends BaseController {
|
||||
private void loadCategoriaTable() {
|
||||
List<Categoria> categorias = this.categoriaRepository.getAll();
|
||||
BaseTableModel<Categoria> model = this.view.getCategoriaModel();
|
||||
model.addRows(categorias);
|
||||
model.setRows(categorias);
|
||||
}
|
||||
|
||||
public BasePanel getView() { return view; }
|
||||
|
||||
@@ -32,7 +32,7 @@ public class EditorialListController extends BaseController {
|
||||
private void loadEditorialTable(){
|
||||
List<Editorial> editoriales = this.editorialRepository.getAll();
|
||||
BaseTableModel<Editorial> model = this.view.getEditorialModel();
|
||||
model.addRows(editoriales);
|
||||
model.setRows(editoriales);
|
||||
}
|
||||
|
||||
public BasePanel getView() {
|
||||
|
||||
@@ -33,7 +33,7 @@ public class IdiomaListController extends BaseController {
|
||||
private void loadIdiomaTable() {
|
||||
List<Idioma> idiomas = this.idiomaRepository.getAll();
|
||||
BaseTableModel<Idioma> model = this.view.getIdiomaTableModel();
|
||||
model.addRows(idiomas);
|
||||
model.setRows(idiomas);
|
||||
}
|
||||
|
||||
public BasePanel getView() {
|
||||
|
||||
@@ -33,7 +33,7 @@ public class LibroListController extends BaseController {
|
||||
private void loadLibroTable() {
|
||||
List<Libro> libros = this.libroRepository.getAll();
|
||||
BaseTableModel<Libro> model = this.view.getLibrosModel();
|
||||
model.addRows(libros);
|
||||
model.setRows(libros);
|
||||
}
|
||||
|
||||
public BasePanel getView() {
|
||||
|
||||
@@ -84,7 +84,7 @@ public class BaseTableModel<T> extends AbstractTableModel {
|
||||
this.fireTableRowsInserted(getRowCount() - 1, getRowCount() - 1);
|
||||
}
|
||||
|
||||
public void addRows(List<T> items) {
|
||||
public void setRows(List<T> items) {
|
||||
rows.clear();
|
||||
rows.addAll(items);
|
||||
this.fireTableRowsInserted(0, getRowCount() - 1);
|
||||
@@ -102,4 +102,8 @@ public class BaseTableModel<T> extends AbstractTableModel {
|
||||
this.fireTableRowsDeleted(0, rowCount - 1);
|
||||
}
|
||||
}
|
||||
|
||||
public T getRow(int row){
|
||||
return rows.get(row);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@ public enum PanelName {
|
||||
EDITORIAL_UPDATE,
|
||||
EDITORIAL_DELETE,
|
||||
|
||||
AUTOR_LIST,
|
||||
AUTOR_VIEW,
|
||||
AUTOR_SEARCH,
|
||||
AUTOR_CREATE,
|
||||
AUTOR_UPDATE,
|
||||
AUTOR_DELETE
|
||||
|
||||
@@ -2,6 +2,7 @@ package xyz.danielcortes.repository;
|
||||
|
||||
import java.util.List;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceException;
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
@@ -38,19 +39,37 @@ public class AutorRepository {
|
||||
|
||||
public void save(Autor autor) {
|
||||
em.getTransaction().begin();
|
||||
em.persist(autor);
|
||||
|
||||
try {
|
||||
em.persist(autor);
|
||||
} catch (PersistenceException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
em.getTransaction().commit();
|
||||
}
|
||||
|
||||
public void update(Autor autor) {
|
||||
em.getTransaction().begin();
|
||||
em.merge(autor);
|
||||
|
||||
try {
|
||||
em.merge(autor);
|
||||
} catch (PersistenceException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
em.getTransaction().commit();
|
||||
}
|
||||
|
||||
public void delete(Autor autor) {
|
||||
em.getTransaction().begin();
|
||||
em.remove(autor);
|
||||
|
||||
try {
|
||||
em.remove(autor);
|
||||
} catch (PersistenceException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
em.getTransaction().commit();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.autor.AutorDeletePanel">
|
||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="500" height="400"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="a766b" class="javax.swing.JComboBox" binding="autorCombo" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="19f2d" class="javax.swing.JLabel" binding="autorField">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Autor:"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="8d497" class="javax.swing.JButton" binding="eliminarButton" default-binding="true">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Eliminar"/>
|
||||
</properties>
|
||||
</component>
|
||||
<vspacer id="63378">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<hspacer id="3d741">
|
||||
<constraints>
|
||||
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</hspacer>
|
||||
<hspacer id="1c5a8">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</hspacer>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
@@ -1,106 +0,0 @@
|
||||
package xyz.danielcortes.views.autor;
|
||||
|
||||
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 xyz.danielcortes.models.Autor;
|
||||
import xyz.danielcortes.views.BasePanel;
|
||||
|
||||
public class AutorDeletePanel extends BasePanel {
|
||||
|
||||
private JComboBox<Autor> autorCombo;
|
||||
private DefaultComboBoxModel<Autor> autorModel;
|
||||
private JButton eliminarButton;
|
||||
private JLabel autorField;
|
||||
private JPanel contentPane;
|
||||
|
||||
public JComboBox<Autor> getAutorCombo() {
|
||||
return autorCombo;
|
||||
}
|
||||
|
||||
public JButton getEliminarButton() {
|
||||
return eliminarButton;
|
||||
}
|
||||
|
||||
public JLabel getAutorField() {
|
||||
return autorField;
|
||||
}
|
||||
|
||||
public DefaultComboBoxModel<Autor> getAutorModel() {
|
||||
return autorModel;
|
||||
}
|
||||
|
||||
public JPanel getContentPane() {
|
||||
return contentPane;
|
||||
}
|
||||
|
||||
{
|
||||
// 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(4, 3, new Insets(0, 0, 0, 0), -1, -1));
|
||||
contentPane.add(autorCombo, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||
autorField = new JLabel();
|
||||
autorField.setText("Autor:");
|
||||
contentPane.add(autorField,
|
||||
new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
|
||||
false));
|
||||
eliminarButton = new JButton();
|
||||
eliminarButton.setText("Eliminar");
|
||||
contentPane.add(eliminarButton,
|
||||
new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
* @noinspection ALL
|
||||
*/
|
||||
public JComponent $$$getRootComponent$$$() {
|
||||
return contentPane;
|
||||
}
|
||||
|
||||
private void createUIComponents() {
|
||||
this.createAutorCombo();
|
||||
}
|
||||
|
||||
private void createAutorCombo() {
|
||||
this.autorModel = new DefaultComboBoxModel<>();
|
||||
this.autorCombo = new JComboBox<>(this.autorModel);
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.autor.AutorListPanel">
|
||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="20" left="20" bottom="20" right="20"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="501" height="443"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<scrollpane id="4cd2">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="c98c0" class="javax.swing.JTable" binding="autorTable" custom-create="true">
|
||||
<constraints/>
|
||||
<properties/>
|
||||
</component>
|
||||
</children>
|
||||
</scrollpane>
|
||||
<component id="ced19" class="javax.swing.JTextField" binding="searchField" default-binding="true">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="d89c0" class="javax.swing.JButton" binding="buscarButton" default-binding="true">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Buscar"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
@@ -1,110 +0,0 @@
|
||||
package xyz.danielcortes.views.autor;
|
||||
|
||||
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.Autor;
|
||||
import xyz.danielcortes.views.BasePanel;
|
||||
|
||||
public class AutorListPanel extends BasePanel {
|
||||
|
||||
private JPanel contentPane;
|
||||
private JTable autorTable;
|
||||
private JTextField searchField;
|
||||
private JButton buscarButton;
|
||||
private BaseTableModel<Autor> autorModel;
|
||||
|
||||
public JPanel getContentPane() {
|
||||
return contentPane;
|
||||
}
|
||||
|
||||
public JTable getAutorTable() {
|
||||
return autorTable;
|
||||
}
|
||||
|
||||
public BaseTableModel<Autor> getAutorModel() {
|
||||
return autorModel;
|
||||
}
|
||||
|
||||
public JButton getBuscarButton() {
|
||||
return buscarButton;
|
||||
}
|
||||
|
||||
public JTextField getSearchField() {
|
||||
return searchField;
|
||||
}
|
||||
|
||||
private void createUIComponents() {
|
||||
this.createAutorTable();
|
||||
}
|
||||
|
||||
private void createAutorTable() {
|
||||
// @formatter:off
|
||||
this.autorModel = new BaseTableModel<>(
|
||||
new String[]{"Nombre", "Apellido Paterno", "Apellido Materno", "Nº Libros"},
|
||||
(row, rowIndex, colIndex) -> {
|
||||
switch (colIndex) {
|
||||
case 0: return row.get(rowIndex).getNombre();
|
||||
case 1: return row.get(rowIndex).getApellidoPaterno();
|
||||
case 2: return row.get(rowIndex).getApellidoMaterno();
|
||||
case 3: return row.get(rowIndex).getLibros().size();
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
);
|
||||
// @formatter:on
|
||||
this.autorTable = new JTable(this.autorModel);
|
||||
}
|
||||
|
||||
{
|
||||
// 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(2, 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(autorTable);
|
||||
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, null, null, 0, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @noinspection ALL
|
||||
*/
|
||||
public JComponent $$$getRootComponent$$$() {
|
||||
return contentPane;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.autor.AutorSearchPanel">
|
||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="20" left="20" bottom="20" right="20"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="501" height="443"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<scrollpane id="4cd2">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="c98c0" class="javax.swing.JTable" binding="autorTable" custom-create="true">
|
||||
<constraints/>
|
||||
<properties/>
|
||||
</component>
|
||||
</children>
|
||||
</scrollpane>
|
||||
<component id="ced19" class="javax.swing.JTextField" binding="searchField" default-binding="true">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="d89c0" class="javax.swing.JButton" binding="buscarButton" default-binding="true">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Buscar"/>
|
||||
</properties>
|
||||
</component>
|
||||
<grid id="6e1ed" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="23e34" class="javax.swing.JButton" binding="verButton" default-binding="true">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Ver"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="40732" class="javax.swing.JButton" binding="eliminarButton" default-binding="true">
|
||||
<constraints>
|
||||
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Eliminar"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="99cf5" class="javax.swing.JButton" binding="editarButton" default-binding="true">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Editar"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
139
src/main/java/xyz/danielcortes/views/autor/AutorSearchPanel.java
Normal file
139
src/main/java/xyz/danielcortes/views/autor/AutorSearchPanel.java
Normal file
@@ -0,0 +1,139 @@
|
||||
package xyz.danielcortes.views.autor;
|
||||
|
||||
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.BaseTableModel;
|
||||
import xyz.danielcortes.models.Autor;
|
||||
import xyz.danielcortes.views.BasePanel;
|
||||
|
||||
public class AutorSearchPanel extends BasePanel {
|
||||
|
||||
private JPanel contentPane;
|
||||
private JTable autorTable;
|
||||
private JTextField searchField;
|
||||
private JButton buscarButton;
|
||||
private JButton verButton;
|
||||
private JButton eliminarButton;
|
||||
private JButton editarButton;
|
||||
private BaseTableModel<Autor> autorModel;
|
||||
|
||||
public JPanel getContentPane() {
|
||||
return contentPane;
|
||||
}
|
||||
|
||||
public JTable getAutorTable() {
|
||||
return autorTable;
|
||||
}
|
||||
|
||||
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 BaseTableModel<Autor> getAutorModel() {
|
||||
return autorModel;
|
||||
}
|
||||
|
||||
private void createUIComponents() {
|
||||
this.createAutorTable();
|
||||
}
|
||||
|
||||
private void createAutorTable() {
|
||||
// @formatter:off
|
||||
this.autorModel = new BaseTableModel<>(
|
||||
new String[]{"Nombre", "Apellido Paterno", "Apellido Materno", "Nº Libros"},
|
||||
(row, rowIndex, colIndex) -> {
|
||||
switch (colIndex) {
|
||||
case 0: return row.get(rowIndex).getNombre();
|
||||
case 1: return row.get(rowIndex).getApellidoPaterno();
|
||||
case 2: return row.get(rowIndex).getApellidoMaterno();
|
||||
case 3: return row.get(rowIndex).getLibros().size();
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
);
|
||||
// @formatter:on
|
||||
this.autorTable = new JTable(this.autorModel);
|
||||
this.autorTable.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(autorTable);
|
||||
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, null, 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(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, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
eliminarButton = new JButton();
|
||||
eliminarButton.setText("Eliminar");
|
||||
panel1.add(eliminarButton, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
editarButton = new JButton();
|
||||
editarButton.setText("Editar");
|
||||
panel1.add(editarButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @noinspection ALL
|
||||
*/
|
||||
public JComponent $$$getRootComponent$$$() {
|
||||
return contentPane;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.autor.AutorUpdatePanel">
|
||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="10" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="8" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="500" height="400"/>
|
||||
@@ -8,25 +8,9 @@
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="4ebd9" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Autor:"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="a8128" class="javax.swing.JComboBox" binding="autorCombo" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="c24c2" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Nombre:"/>
|
||||
@@ -34,7 +18,7 @@
|
||||
</component>
|
||||
<component id="c6a4b" class="javax.swing.JTextField" binding="nombreField">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -42,7 +26,7 @@
|
||||
</component>
|
||||
<component id="48e89" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Apellido Paterno:"/>
|
||||
@@ -50,7 +34,7 @@
|
||||
</component>
|
||||
<component id="294b" class="javax.swing.JTextField" binding="apellidoPaternoField">
|
||||
<constraints>
|
||||
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -58,7 +42,7 @@
|
||||
</component>
|
||||
<component id="c0a2b" class="javax.swing.JTextField" binding="apellidoMaternoField">
|
||||
<constraints>
|
||||
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -66,7 +50,7 @@
|
||||
</component>
|
||||
<component id="a4360" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Apellido Materno:"/>
|
||||
@@ -74,7 +58,7 @@
|
||||
</component>
|
||||
<component id="482e0" class="javax.swing.JButton" binding="actualizarButton" default-binding="true">
|
||||
<constraints>
|
||||
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Actualizar"/>
|
||||
@@ -82,17 +66,17 @@
|
||||
</component>
|
||||
<vspacer id="29de9">
|
||||
<constraints>
|
||||
<grid row="9" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<hspacer id="4e68">
|
||||
<constraints>
|
||||
<grid row="9" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="7" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</hspacer>
|
||||
<hspacer id="1cc6d">
|
||||
<constraints>
|
||||
<grid row="9" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</hspacer>
|
||||
</children>
|
||||
|
||||
@@ -5,34 +5,21 @@ 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.models.Autor;
|
||||
import xyz.danielcortes.views.BasePanel;
|
||||
|
||||
public class AutorUpdatePanel extends BasePanel {
|
||||
|
||||
private JComboBox<Autor> autorCombo;
|
||||
private DefaultComboBoxModel<Autor> autorModel;
|
||||
private JTextField nombreField;
|
||||
private JTextField apellidoPaternoField;
|
||||
private JTextField apellidoMaternoField;
|
||||
private JButton actualizarButton;
|
||||
private JPanel contentPane;
|
||||
|
||||
public JComboBox<Autor> getAutorCombo() {
|
||||
return autorCombo;
|
||||
}
|
||||
|
||||
public DefaultComboBoxModel<Autor> getAutorModel() {
|
||||
return autorModel;
|
||||
}
|
||||
|
||||
public JTextField getNombreField() {
|
||||
return nombreField;
|
||||
}
|
||||
@@ -53,14 +40,6 @@ public class AutorUpdatePanel extends BasePanel {
|
||||
return contentPane;
|
||||
}
|
||||
|
||||
private void createUIComponents() {
|
||||
this.createAutorCombo();
|
||||
}
|
||||
|
||||
private void createAutorCombo() {
|
||||
this.autorModel = new DefaultComboBoxModel<>();
|
||||
this.autorCombo = new JComboBox<>(autorModel);
|
||||
}
|
||||
|
||||
{
|
||||
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||
@@ -70,74 +49,53 @@ public class AutorUpdatePanel extends BasePanel {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR
|
||||
* call it in your code!
|
||||
* 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(10, 3, new Insets(0, 0, 0, 0), -1, -1));
|
||||
contentPane.setLayout(new GridLayoutManager(8, 3, new Insets(0, 0, 0, 0), -1, -1));
|
||||
final JLabel label1 = new JLabel();
|
||||
label1.setText("Autor:");
|
||||
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(autorCombo, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||
final JLabel label2 = new JLabel();
|
||||
label2.setText("Nombre:");
|
||||
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));
|
||||
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();
|
||||
contentPane.add(nombreField, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||
final JLabel label3 = new JLabel();
|
||||
label3.setText("Apellido Paterno:");
|
||||
contentPane.add(label3,
|
||||
new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
|
||||
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));
|
||||
final JLabel label2 = new JLabel();
|
||||
label2.setText("Apellido Paterno:");
|
||||
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));
|
||||
apellidoPaternoField = new JTextField();
|
||||
contentPane.add(apellidoPaternoField,
|
||||
new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
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));
|
||||
apellidoMaternoField = new JTextField();
|
||||
contentPane.add(apellidoMaternoField,
|
||||
new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||
final JLabel label4 = new JLabel();
|
||||
label4.setText("Apellido Materno:");
|
||||
contentPane.add(label4,
|
||||
new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
|
||||
false));
|
||||
final JLabel label3 = new JLabel();
|
||||
label3.setText("Apellido Materno:");
|
||||
contentPane.add(label3, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
actualizarButton = new JButton();
|
||||
actualizarButton.setText("Actualizar");
|
||||
contentPane.add(actualizarButton,
|
||||
new GridConstraints(8, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
contentPane.add(actualizarButton, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final Spacer spacer1 = new Spacer();
|
||||
contentPane.add(spacer1, new GridConstraints(9, 1, 1, 1, GridConstraints.ANCHOR_CENTER,
|
||||
GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0,
|
||||
false));
|
||||
contentPane.add(spacer1,
|
||||
new GridConstraints(7, 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(9, 2, 1, 1, GridConstraints.ANCHOR_CENTER,
|
||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null,
|
||||
0, false));
|
||||
contentPane.add(spacer2,
|
||||
new GridConstraints(7, 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(9, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
|
||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null,
|
||||
0, false));
|
||||
contentPane.add(spacer3,
|
||||
new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||
null, null, 0, false));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
<enabled value="false"/>
|
||||
<enabled value="true"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="8b4b2" class="javax.swing.JLabel">
|
||||
@@ -43,7 +43,7 @@
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
<enabled value="false"/>
|
||||
<enabled value="true"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="e4aeb" class="javax.swing.JLabel">
|
||||
@@ -62,15 +62,7 @@
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
<enabled value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="107b1" class="javax.swing.JButton" binding="volverButton" default-binding="true">
|
||||
<constraints>
|
||||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Volver"/>
|
||||
<enabled value="true"/>
|
||||
</properties>
|
||||
</component>
|
||||
<vspacer id="31a4">
|
||||
@@ -88,6 +80,14 @@
|
||||
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</hspacer>
|
||||
<component id="7d83d" class="javax.swing.JButton" binding="volverButton" default-binding="true">
|
||||
<constraints>
|
||||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Volver"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
|
||||
@@ -61,7 +61,7 @@ public class AutorViewPanel extends BasePanel {
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
nombreField = new JTextField();
|
||||
nombreField.setEditable(false);
|
||||
nombreField.setEnabled(false);
|
||||
nombreField.setEnabled(true);
|
||||
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));
|
||||
@@ -71,7 +71,7 @@ public class AutorViewPanel extends BasePanel {
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
apellidoPaternoField = new JTextField();
|
||||
apellidoPaternoField.setEditable(false);
|
||||
apellidoPaternoField.setEnabled(false);
|
||||
apellidoPaternoField.setEnabled(true);
|
||||
contentPane.add(apellidoPaternoField,
|
||||
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));
|
||||
@@ -81,14 +81,10 @@ public class AutorViewPanel extends BasePanel {
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
apellidoMaternoField = new JTextField();
|
||||
apellidoMaternoField.setEditable(false);
|
||||
apellidoMaternoField.setEnabled(false);
|
||||
apellidoMaternoField.setEnabled(true);
|
||||
contentPane.add(apellidoMaternoField,
|
||||
new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||
volverButton = new JButton();
|
||||
volverButton.setText("Volver");
|
||||
contentPane.add(volverButton, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final Spacer spacer1 = new Spacer();
|
||||
contentPane.add(spacer1,
|
||||
new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||
@@ -101,6 +97,10 @@ public class AutorViewPanel extends BasePanel {
|
||||
contentPane.add(spacer3,
|
||||
new GridConstraints(7, 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(6, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,4 +109,5 @@ public class AutorViewPanel extends BasePanel {
|
||||
public JComponent $$$getRootComponent$$$() {
|
||||
return contentPane;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user