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.JMenuItem;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import xyz.danielcortes.controllers.autor.AutorCreateController;
|
import xyz.danielcortes.controllers.autor.AutorCreateController;
|
||||||
import xyz.danielcortes.controllers.autor.AutorDeleteController;
|
import xyz.danielcortes.controllers.autor.AutorSearchController;
|
||||||
import xyz.danielcortes.controllers.autor.AutorListController;
|
|
||||||
import xyz.danielcortes.controllers.autor.AutorUpdateController;
|
import xyz.danielcortes.controllers.autor.AutorUpdateController;
|
||||||
|
import xyz.danielcortes.controllers.autor.AutorViewController;
|
||||||
import xyz.danielcortes.controllers.categoria.CategoriaCreateController;
|
import xyz.danielcortes.controllers.categoria.CategoriaCreateController;
|
||||||
import xyz.danielcortes.controllers.categoria.CategoriaDeleteController;
|
import xyz.danielcortes.controllers.categoria.CategoriaDeleteController;
|
||||||
import xyz.danielcortes.controllers.categoria.CategoriaListController;
|
import xyz.danielcortes.controllers.categoria.CategoriaListController;
|
||||||
@@ -30,9 +30,9 @@ import xyz.danielcortes.controllers.libro.LibroUpdateController;
|
|||||||
import xyz.danielcortes.framework.PanelName;
|
import xyz.danielcortes.framework.PanelName;
|
||||||
import xyz.danielcortes.views.LaunchFrame;
|
import xyz.danielcortes.views.LaunchFrame;
|
||||||
import xyz.danielcortes.views.autor.AutorCreatePanel;
|
import xyz.danielcortes.views.autor.AutorCreatePanel;
|
||||||
import xyz.danielcortes.views.autor.AutorDeletePanel;
|
import xyz.danielcortes.views.autor.AutorSearchPanel;
|
||||||
import xyz.danielcortes.views.autor.AutorListPanel;
|
|
||||||
import xyz.danielcortes.views.autor.AutorUpdatePanel;
|
import xyz.danielcortes.views.autor.AutorUpdatePanel;
|
||||||
|
import xyz.danielcortes.views.autor.AutorViewPanel;
|
||||||
import xyz.danielcortes.views.categoria.CategoriaCreatePanel;
|
import xyz.danielcortes.views.categoria.CategoriaCreatePanel;
|
||||||
import xyz.danielcortes.views.categoria.CategoriaDeletePanel;
|
import xyz.danielcortes.views.categoria.CategoriaDeletePanel;
|
||||||
import xyz.danielcortes.views.categoria.CategoriaListPanel;
|
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_UPDATE, new LibroUpdateController(new LibroUpdatePanel(), this));
|
||||||
this.controllers.put(PanelName.LIBRO_DELETE, new LibroDeleteController(new LibroDeletePanel(), 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_CREATE, new AutorCreateController(new AutorCreatePanel(), this));
|
||||||
this.controllers.put(PanelName.AUTOR_UPDATE, new AutorUpdateController(new AutorUpdatePanel(), 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_LIST, new IdiomaListController(new IdiomaListPanel(), this));
|
||||||
this.controllers.put(PanelName.IDIOMA_CREATE, new IdiomaCreateController(new IdiomaCreatePanel(), 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);
|
JMenuItem libroDelete = new JMenuItem("Eliminar"); libroDelete.setMnemonic(KeyEvent.VK_E);
|
||||||
|
|
||||||
JMenu autoresMenu = new JMenu("Autores"); autoresMenu.setMnemonic(KeyEvent.VK_A);
|
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 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);
|
JMenu idiomasMenu = new JMenu("Idiomas"); idiomasMenu.setMnemonic(KeyEvent.VK_I);
|
||||||
JMenuItem idiomaList = new JMenuItem("Listar"); idiomaList.setMnemonic(KeyEvent.VK_L);
|
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);
|
JMenuItem editorialDelete = new JMenuItem("Eliminar"); editorialDelete.setMnemonic(KeyEvent.VK_E);
|
||||||
// @formatter:on
|
// @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));
|
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));
|
idiomaList.addActionListener(e -> this.showCard(PanelName.IDIOMA_LIST));
|
||||||
idiomaCreate.addActionListener(e -> this.showCard(PanelName.IDIOMA_CREATE));
|
idiomaCreate.addActionListener(e -> this.showCard(PanelName.IDIOMA_CREATE));
|
||||||
@@ -171,10 +167,8 @@ public class LaunchController {
|
|||||||
librosMenu.add(libroDelete);
|
librosMenu.add(libroDelete);
|
||||||
|
|
||||||
menuBar.add(autoresMenu);
|
menuBar.add(autoresMenu);
|
||||||
autoresMenu.add(autorList);
|
autoresMenu.add(autorSearch);
|
||||||
autoresMenu.add(autorCreate);
|
autoresMenu.add(autorCreate);
|
||||||
autoresMenu.add(autorUpdate);
|
|
||||||
autoresMenu.add(autorDelete);
|
|
||||||
|
|
||||||
menuBar.add(idiomasMenu);
|
menuBar.add(idiomasMenu);
|
||||||
idiomasMenu.add(idiomaList);
|
idiomasMenu.add(idiomaList);
|
||||||
@@ -202,6 +196,10 @@ public class LaunchController {
|
|||||||
this.frame.showCard(name);
|
this.frame.showCard(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BaseController getCard(PanelName name) {
|
||||||
|
return this.controllers.get(name);
|
||||||
|
}
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
this.create();
|
this.create();
|
||||||
this.frame.setVisible(true);
|
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;
|
package xyz.danielcortes.controllers.autor;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import javax.swing.JComboBox;
|
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
import xyz.danielcortes.controllers.LaunchController;
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
import xyz.danielcortes.models.Autor;
|
import xyz.danielcortes.models.Autor;
|
||||||
import xyz.danielcortes.repository.AutorRepository;
|
import xyz.danielcortes.repository.AutorRepository;
|
||||||
import xyz.danielcortes.views.BasePanel;
|
import xyz.danielcortes.views.BasePanel;
|
||||||
@@ -12,6 +11,7 @@ import xyz.danielcortes.views.autor.AutorUpdatePanel;
|
|||||||
|
|
||||||
public class AutorUpdateController extends BaseController {
|
public class AutorUpdateController extends BaseController {
|
||||||
|
|
||||||
|
private Autor autor;
|
||||||
private AutorUpdatePanel view;
|
private AutorUpdatePanel view;
|
||||||
private AutorRepository autorRepository;
|
private AutorRepository autorRepository;
|
||||||
|
|
||||||
@@ -20,31 +20,34 @@ public class AutorUpdateController extends BaseController {
|
|||||||
this.view = view;
|
this.view = view;
|
||||||
this.autorRepository = new AutorRepository();
|
this.autorRepository = new AutorRepository();
|
||||||
this.setupListeners();
|
this.setupListeners();
|
||||||
this.loadAutorCombo();
|
}
|
||||||
|
|
||||||
|
public void setAutor(Autor autor) {
|
||||||
|
this.autor = autor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void show() {
|
public void show() {
|
||||||
this.reload();
|
fillAutor();
|
||||||
this.view.getAutorCombo().requestFocus();
|
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() {
|
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.getApellidoPaternoField().addActionListener(e -> update());
|
||||||
this.view.getActualizarButton().addActionListener(e -> update());
|
this.view.getActualizarButton().addActionListener(e -> update());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void update() {
|
private void update() {
|
||||||
Autor original = (Autor) this.view.getAutorCombo().getSelectedItem();
|
if(!validateOriginal(this.autor)) return;
|
||||||
if(!validateOriginal(original)) return;
|
|
||||||
|
|
||||||
String nombre = this.view.getNombreField().getText();
|
String nombre = this.view.getNombreField().getText();
|
||||||
if(!validateNombre(nombre)) return;
|
if(!validateNombre(nombre)) return;
|
||||||
@@ -55,15 +58,14 @@ public class AutorUpdateController extends BaseController {
|
|||||||
String apellidoMaterno = this.view.getApellidoMaternoField().getText();
|
String apellidoMaterno = this.view.getApellidoMaternoField().getText();
|
||||||
if(!validateApellidoMaterno(apellidoMaterno)) return;
|
if(!validateApellidoMaterno(apellidoMaterno)) return;
|
||||||
|
|
||||||
assert original != null;
|
assert this.autor != null;
|
||||||
original.setNombre(nombre);
|
this.autor.setNombre(nombre);
|
||||||
original.setApellidoPaterno(apellidoPaterno);
|
this.autor.setApellidoPaterno(apellidoPaterno);
|
||||||
original.setApellidoMaterno(apellidoMaterno);
|
this.autor.setApellidoMaterno(apellidoMaterno);
|
||||||
|
|
||||||
this.autorRepository.update(original);
|
this.autorRepository.update(this.autor);
|
||||||
|
|
||||||
this.loadAutorCombo();
|
this.getParentController().showCard(PanelName.AUTOR_SEARCH);
|
||||||
this.view.getNombreField().requestFocus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean validateOriginal(Autor original) {
|
private boolean validateOriginal(Autor original) {
|
||||||
@@ -133,19 +135,6 @@ public class AutorUpdateController extends BaseController {
|
|||||||
return true;
|
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() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package xyz.danielcortes.controllers.autor;
|
|||||||
|
|
||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
import xyz.danielcortes.controllers.LaunchController;
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
import xyz.danielcortes.models.Autor;
|
import xyz.danielcortes.models.Autor;
|
||||||
import xyz.danielcortes.views.BasePanel;
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.autor.AutorViewPanel;
|
import xyz.danielcortes.views.autor.AutorViewPanel;
|
||||||
@@ -14,17 +15,24 @@ public class AutorViewController extends BaseController {
|
|||||||
public AutorViewController(AutorViewPanel view, LaunchController parent) {
|
public AutorViewController(AutorViewPanel view, LaunchController parent) {
|
||||||
super(parent);
|
super(parent);
|
||||||
this.view = view;
|
this.view = view;
|
||||||
this.fillAutor();
|
this.setupListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void show() {
|
public void show() {
|
||||||
|
this.fillAutor();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setAutor(Autor autor){
|
public void setAutor(Autor autor){
|
||||||
this.autor = autor;
|
this.autor = autor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getVolverButton().addActionListener(e -> {
|
||||||
|
this.getParentController().showCard(PanelName.AUTOR_SEARCH);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void fillAutor() {
|
private void fillAutor() {
|
||||||
if (autor == null)
|
if (autor == null)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class CategoriaListController extends BaseController {
|
|||||||
private void loadCategoriaTable() {
|
private void loadCategoriaTable() {
|
||||||
List<Categoria> categorias = this.categoriaRepository.getAll();
|
List<Categoria> categorias = this.categoriaRepository.getAll();
|
||||||
BaseTableModel<Categoria> model = this.view.getCategoriaModel();
|
BaseTableModel<Categoria> model = this.view.getCategoriaModel();
|
||||||
model.addRows(categorias);
|
model.setRows(categorias);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BasePanel getView() { return view; }
|
public BasePanel getView() { return view; }
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class EditorialListController extends BaseController {
|
|||||||
private void loadEditorialTable(){
|
private void loadEditorialTable(){
|
||||||
List<Editorial> editoriales = this.editorialRepository.getAll();
|
List<Editorial> editoriales = this.editorialRepository.getAll();
|
||||||
BaseTableModel<Editorial> model = this.view.getEditorialModel();
|
BaseTableModel<Editorial> model = this.view.getEditorialModel();
|
||||||
model.addRows(editoriales);
|
model.setRows(editoriales);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BasePanel getView() {
|
public BasePanel getView() {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class IdiomaListController extends BaseController {
|
|||||||
private void loadIdiomaTable() {
|
private void loadIdiomaTable() {
|
||||||
List<Idioma> idiomas = this.idiomaRepository.getAll();
|
List<Idioma> idiomas = this.idiomaRepository.getAll();
|
||||||
BaseTableModel<Idioma> model = this.view.getIdiomaTableModel();
|
BaseTableModel<Idioma> model = this.view.getIdiomaTableModel();
|
||||||
model.addRows(idiomas);
|
model.setRows(idiomas);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BasePanel getView() {
|
public BasePanel getView() {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class LibroListController extends BaseController {
|
|||||||
private void loadLibroTable() {
|
private void loadLibroTable() {
|
||||||
List<Libro> libros = this.libroRepository.getAll();
|
List<Libro> libros = this.libroRepository.getAll();
|
||||||
BaseTableModel<Libro> model = this.view.getLibrosModel();
|
BaseTableModel<Libro> model = this.view.getLibrosModel();
|
||||||
model.addRows(libros);
|
model.setRows(libros);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BasePanel getView() {
|
public BasePanel getView() {
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class BaseTableModel<T> extends AbstractTableModel {
|
|||||||
this.fireTableRowsInserted(getRowCount() - 1, getRowCount() - 1);
|
this.fireTableRowsInserted(getRowCount() - 1, getRowCount() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addRows(List<T> items) {
|
public void setRows(List<T> items) {
|
||||||
rows.clear();
|
rows.clear();
|
||||||
rows.addAll(items);
|
rows.addAll(items);
|
||||||
this.fireTableRowsInserted(0, getRowCount() - 1);
|
this.fireTableRowsInserted(0, getRowCount() - 1);
|
||||||
@@ -102,4 +102,8 @@ public class BaseTableModel<T> extends AbstractTableModel {
|
|||||||
this.fireTableRowsDeleted(0, rowCount - 1);
|
this.fireTableRowsDeleted(0, rowCount - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public T getRow(int row){
|
||||||
|
return rows.get(row);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ public enum PanelName {
|
|||||||
EDITORIAL_UPDATE,
|
EDITORIAL_UPDATE,
|
||||||
EDITORIAL_DELETE,
|
EDITORIAL_DELETE,
|
||||||
|
|
||||||
AUTOR_LIST,
|
AUTOR_VIEW,
|
||||||
|
AUTOR_SEARCH,
|
||||||
AUTOR_CREATE,
|
AUTOR_CREATE,
|
||||||
AUTOR_UPDATE,
|
AUTOR_UPDATE,
|
||||||
AUTOR_DELETE
|
AUTOR_DELETE
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package xyz.danielcortes.repository;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
|
import javax.persistence.PersistenceException;
|
||||||
import javax.persistence.TypedQuery;
|
import javax.persistence.TypedQuery;
|
||||||
import javax.persistence.criteria.CriteriaBuilder;
|
import javax.persistence.criteria.CriteriaBuilder;
|
||||||
import javax.persistence.criteria.CriteriaQuery;
|
import javax.persistence.criteria.CriteriaQuery;
|
||||||
@@ -38,19 +39,37 @@ public class AutorRepository {
|
|||||||
|
|
||||||
public void save(Autor autor) {
|
public void save(Autor autor) {
|
||||||
em.getTransaction().begin();
|
em.getTransaction().begin();
|
||||||
em.persist(autor);
|
|
||||||
|
try {
|
||||||
|
em.persist(autor);
|
||||||
|
} catch (PersistenceException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
em.getTransaction().commit();
|
em.getTransaction().commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void update(Autor autor) {
|
public void update(Autor autor) {
|
||||||
em.getTransaction().begin();
|
em.getTransaction().begin();
|
||||||
em.merge(autor);
|
|
||||||
|
try {
|
||||||
|
em.merge(autor);
|
||||||
|
} catch (PersistenceException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
em.getTransaction().commit();
|
em.getTransaction().commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void delete(Autor autor) {
|
public void delete(Autor autor) {
|
||||||
em.getTransaction().begin();
|
em.getTransaction().begin();
|
||||||
em.remove(autor);
|
|
||||||
|
try {
|
||||||
|
em.remove(autor);
|
||||||
|
} catch (PersistenceException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
em.getTransaction().commit();
|
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"?>
|
<?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">
|
<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"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<xy x="20" y="20" width="500" height="400"/>
|
<xy x="20" y="20" width="500" height="400"/>
|
||||||
@@ -8,25 +8,9 @@
|
|||||||
<properties/>
|
<properties/>
|
||||||
<border type="none"/>
|
<border type="none"/>
|
||||||
<children>
|
<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">
|
<component id="c24c2" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<text value="Nombre:"/>
|
<text value="Nombre:"/>
|
||||||
@@ -34,7 +18,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="c6a4b" class="javax.swing.JTextField" binding="nombreField">
|
<component id="c6a4b" class="javax.swing.JTextField" binding="nombreField">
|
||||||
<constraints>
|
<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"/>
|
<preferred-size width="400" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -42,7 +26,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="48e89" class="javax.swing.JLabel">
|
<component id="48e89" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<text value="Apellido Paterno:"/>
|
<text value="Apellido Paterno:"/>
|
||||||
@@ -50,7 +34,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="294b" class="javax.swing.JTextField" binding="apellidoPaternoField">
|
<component id="294b" class="javax.swing.JTextField" binding="apellidoPaternoField">
|
||||||
<constraints>
|
<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"/>
|
<preferred-size width="400" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -58,7 +42,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="c0a2b" class="javax.swing.JTextField" binding="apellidoMaternoField">
|
<component id="c0a2b" class="javax.swing.JTextField" binding="apellidoMaternoField">
|
||||||
<constraints>
|
<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"/>
|
<preferred-size width="400" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -66,7 +50,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="a4360" class="javax.swing.JLabel">
|
<component id="a4360" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<text value="Apellido Materno:"/>
|
<text value="Apellido Materno:"/>
|
||||||
@@ -74,7 +58,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="482e0" class="javax.swing.JButton" binding="actualizarButton" default-binding="true">
|
<component id="482e0" class="javax.swing.JButton" binding="actualizarButton" default-binding="true">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<text value="Actualizar"/>
|
<text value="Actualizar"/>
|
||||||
@@ -82,17 +66,17 @@
|
|||||||
</component>
|
</component>
|
||||||
<vspacer id="29de9">
|
<vspacer id="29de9">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
</vspacer>
|
</vspacer>
|
||||||
<hspacer id="4e68">
|
<hspacer id="4e68">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
</hspacer>
|
</hspacer>
|
||||||
<hspacer id="1cc6d">
|
<hspacer id="1cc6d">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
</hspacer>
|
</hspacer>
|
||||||
</children>
|
</children>
|
||||||
|
|||||||
@@ -5,34 +5,21 @@ import com.intellij.uiDesigner.core.GridLayoutManager;
|
|||||||
import com.intellij.uiDesigner.core.Spacer;
|
import com.intellij.uiDesigner.core.Spacer;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Insets;
|
import java.awt.Insets;
|
||||||
import javax.swing.DefaultComboBoxModel;
|
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JComboBox;
|
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JTextField;
|
import javax.swing.JTextField;
|
||||||
import xyz.danielcortes.models.Autor;
|
|
||||||
import xyz.danielcortes.views.BasePanel;
|
import xyz.danielcortes.views.BasePanel;
|
||||||
|
|
||||||
public class AutorUpdatePanel extends BasePanel {
|
public class AutorUpdatePanel extends BasePanel {
|
||||||
|
|
||||||
private JComboBox<Autor> autorCombo;
|
|
||||||
private DefaultComboBoxModel<Autor> autorModel;
|
|
||||||
private JTextField nombreField;
|
private JTextField nombreField;
|
||||||
private JTextField apellidoPaternoField;
|
private JTextField apellidoPaternoField;
|
||||||
private JTextField apellidoMaternoField;
|
private JTextField apellidoMaternoField;
|
||||||
private JButton actualizarButton;
|
private JButton actualizarButton;
|
||||||
private JPanel contentPane;
|
private JPanel contentPane;
|
||||||
|
|
||||||
public JComboBox<Autor> getAutorCombo() {
|
|
||||||
return autorCombo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DefaultComboBoxModel<Autor> getAutorModel() {
|
|
||||||
return autorModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JTextField getNombreField() {
|
public JTextField getNombreField() {
|
||||||
return nombreField;
|
return nombreField;
|
||||||
}
|
}
|
||||||
@@ -53,14 +40,6 @@ public class AutorUpdatePanel extends BasePanel {
|
|||||||
return contentPane;
|
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
|
// 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
|
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
|
||||||
* call it in your code!
|
|
||||||
*
|
*
|
||||||
* @noinspection ALL
|
* @noinspection ALL
|
||||||
*/
|
*/
|
||||||
private void $$$setupUI$$$() {
|
private void $$$setupUI$$$() {
|
||||||
createUIComponents();
|
|
||||||
contentPane = new JPanel();
|
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();
|
final JLabel label1 = new JLabel();
|
||||||
label1.setText("Autor:");
|
label1.setText("Nombre:");
|
||||||
contentPane.add(label1,
|
contentPane.add(label1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
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));
|
|
||||||
nombreField = new JTextField();
|
nombreField = new JTextField();
|
||||||
contentPane.add(nombreField, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
contentPane.add(nombreField,
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
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));
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
final JLabel label3 = new JLabel();
|
final JLabel label2 = new JLabel();
|
||||||
label3.setText("Apellido Paterno:");
|
label2.setText("Apellido Paterno:");
|
||||||
contentPane.add(label3,
|
contentPane.add(label2, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
|
|
||||||
false));
|
|
||||||
apellidoPaternoField = new JTextField();
|
apellidoPaternoField = new JTextField();
|
||||||
contentPane.add(apellidoPaternoField,
|
contentPane.add(apellidoPaternoField,
|
||||||
new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
|
||||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
apellidoMaternoField = new JTextField();
|
apellidoMaternoField = new JTextField();
|
||||||
contentPane.add(apellidoMaternoField,
|
contentPane.add(apellidoMaternoField,
|
||||||
new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
|
||||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
final JLabel label4 = new JLabel();
|
final JLabel label3 = new JLabel();
|
||||||
label4.setText("Apellido Materno:");
|
label3.setText("Apellido Materno:");
|
||||||
contentPane.add(label4,
|
contentPane.add(label3, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
|
|
||||||
false));
|
|
||||||
actualizarButton = new JButton();
|
actualizarButton = new JButton();
|
||||||
actualizarButton.setText("Actualizar");
|
actualizarButton.setText("Actualizar");
|
||||||
contentPane.add(actualizarButton,
|
contentPane.add(actualizarButton, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
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));
|
||||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
|
||||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
|
||||||
final Spacer spacer1 = new Spacer();
|
final Spacer spacer1 = new Spacer();
|
||||||
contentPane.add(spacer1, new GridConstraints(9, 1, 1, 1, GridConstraints.ANCHOR_CENTER,
|
contentPane.add(spacer1,
|
||||||
GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0,
|
new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||||
false));
|
null, null, 0, false));
|
||||||
final Spacer spacer2 = new Spacer();
|
final Spacer spacer2 = new Spacer();
|
||||||
contentPane.add(spacer2, new GridConstraints(9, 2, 1, 1, GridConstraints.ANCHOR_CENTER,
|
contentPane.add(spacer2,
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null,
|
new GridConstraints(7, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
0, false));
|
null, null, 0, false));
|
||||||
final Spacer spacer3 = new Spacer();
|
final Spacer spacer3 = new Spacer();
|
||||||
contentPane.add(spacer3, new GridConstraints(9, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
|
contentPane.add(spacer3,
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null,
|
new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
0, false));
|
null, null, 0, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<editable value="false"/>
|
<editable value="false"/>
|
||||||
<enabled value="false"/>
|
<enabled value="true"/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
<component id="8b4b2" class="javax.swing.JLabel">
|
<component id="8b4b2" class="javax.swing.JLabel">
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<editable value="false"/>
|
<editable value="false"/>
|
||||||
<enabled value="false"/>
|
<enabled value="true"/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
<component id="e4aeb" class="javax.swing.JLabel">
|
<component id="e4aeb" class="javax.swing.JLabel">
|
||||||
@@ -62,15 +62,7 @@
|
|||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<editable value="false"/>
|
<editable value="false"/>
|
||||||
<enabled value="false"/>
|
<enabled value="true"/>
|
||||||
</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"/>
|
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
<vspacer id="31a4">
|
<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"/>
|
<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>
|
</constraints>
|
||||||
</hspacer>
|
</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>
|
</children>
|
||||||
</grid>
|
</grid>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class AutorViewPanel extends BasePanel {
|
|||||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
nombreField = new JTextField();
|
nombreField = new JTextField();
|
||||||
nombreField.setEditable(false);
|
nombreField.setEditable(false);
|
||||||
nombreField.setEnabled(false);
|
nombreField.setEnabled(true);
|
||||||
contentPane.add(nombreField,
|
contentPane.add(nombreField,
|
||||||
new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
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));
|
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));
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
apellidoPaternoField = new JTextField();
|
apellidoPaternoField = new JTextField();
|
||||||
apellidoPaternoField.setEditable(false);
|
apellidoPaternoField.setEditable(false);
|
||||||
apellidoPaternoField.setEnabled(false);
|
apellidoPaternoField.setEnabled(true);
|
||||||
contentPane.add(apellidoPaternoField,
|
contentPane.add(apellidoPaternoField,
|
||||||
new GridConstraints(3, 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));
|
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));
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
apellidoMaternoField = new JTextField();
|
apellidoMaternoField = new JTextField();
|
||||||
apellidoMaternoField.setEditable(false);
|
apellidoMaternoField.setEditable(false);
|
||||||
apellidoMaternoField.setEnabled(false);
|
apellidoMaternoField.setEnabled(true);
|
||||||
contentPane.add(apellidoMaternoField,
|
contentPane.add(apellidoMaternoField,
|
||||||
new GridConstraints(5, 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));
|
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();
|
final Spacer spacer1 = new Spacer();
|
||||||
contentPane.add(spacer1,
|
contentPane.add(spacer1,
|
||||||
new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
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,
|
contentPane.add(spacer3,
|
||||||
new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
null, null, 0, false));
|
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$$$() {
|
public JComponent $$$getRootComponent$$$() {
|
||||||
return contentPane;
|
return contentPane;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user