Los libros ahora tienen la mismas vistasq ue el resto
This commit is contained in:
@@ -24,8 +24,9 @@ import xyz.danielcortes.controllers.idioma.IdiomaSearchController;
|
|||||||
import xyz.danielcortes.controllers.idioma.IdiomaUpdateController;
|
import xyz.danielcortes.controllers.idioma.IdiomaUpdateController;
|
||||||
import xyz.danielcortes.controllers.idioma.IdiomaViewController;
|
import xyz.danielcortes.controllers.idioma.IdiomaViewController;
|
||||||
import xyz.danielcortes.controllers.libro.LibroCreateController;
|
import xyz.danielcortes.controllers.libro.LibroCreateController;
|
||||||
import xyz.danielcortes.controllers.libro.LibroListController;
|
import xyz.danielcortes.controllers.libro.LibroSearchController;
|
||||||
import xyz.danielcortes.controllers.libro.LibroUpdateController;
|
import xyz.danielcortes.controllers.libro.LibroUpdateController;
|
||||||
|
import xyz.danielcortes.controllers.libro.LibroViewController;
|
||||||
import xyz.danielcortes.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;
|
||||||
@@ -45,8 +46,9 @@ import xyz.danielcortes.views.idioma.IdiomaSearchPanel;
|
|||||||
import xyz.danielcortes.views.idioma.IdiomaUpdatePanel;
|
import xyz.danielcortes.views.idioma.IdiomaUpdatePanel;
|
||||||
import xyz.danielcortes.views.idioma.IdiomaViewPanel;
|
import xyz.danielcortes.views.idioma.IdiomaViewPanel;
|
||||||
import xyz.danielcortes.views.libro.LibroCreatePanel;
|
import xyz.danielcortes.views.libro.LibroCreatePanel;
|
||||||
import xyz.danielcortes.views.libro.LibroListPanel;
|
import xyz.danielcortes.views.libro.LibroSearchPanel;
|
||||||
import xyz.danielcortes.views.libro.LibroUpdatePanel;
|
import xyz.danielcortes.views.libro.LibroUpdatePanel;
|
||||||
|
import xyz.danielcortes.views.libro.LibroViewPanel;
|
||||||
|
|
||||||
public class LaunchController {
|
public class LaunchController {
|
||||||
|
|
||||||
@@ -66,7 +68,8 @@ public class LaunchController {
|
|||||||
private void createCards() {
|
private void createCards() {
|
||||||
this.frame.addCard(new JPanel(), PanelName.EMPTY);
|
this.frame.addCard(new JPanel(), PanelName.EMPTY);
|
||||||
|
|
||||||
this.controllers.put(PanelName.LIBRO_SEARCH, new LibroListController(new LibroListPanel(), this));
|
this.controllers.put(PanelName.LIBRO_VIEW, new LibroViewController(new LibroViewPanel(), this));
|
||||||
|
this.controllers.put(PanelName.LIBRO_SEARCH, new LibroSearchController(new LibroSearchPanel(), this));
|
||||||
this.controllers.put(PanelName.LIBRO_CREATE, new LibroCreateController(new LibroCreatePanel(), this));
|
this.controllers.put(PanelName.LIBRO_CREATE, new LibroCreateController(new LibroCreatePanel(), this));
|
||||||
this.controllers.put(PanelName.LIBRO_UPDATE, new LibroUpdateController(new LibroUpdatePanel(), this));
|
this.controllers.put(PanelName.LIBRO_UPDATE, new LibroUpdateController(new LibroUpdatePanel(), this));
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import javax.swing.DefaultListModel;
|
|||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
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.models.Categoria;
|
import xyz.danielcortes.models.Categoria;
|
||||||
import xyz.danielcortes.models.Editorial;
|
import xyz.danielcortes.models.Editorial;
|
||||||
@@ -106,20 +107,10 @@ public class LibroCreateController extends BaseController {
|
|||||||
|
|
||||||
this.libroRepository.save(libro);
|
this.libroRepository.save(libro);
|
||||||
|
|
||||||
this.view.getSerieField().setText("");
|
this.getParentController().showCard(PanelName.LIBRO_SEARCH);
|
||||||
this.view.getIsbnField().setText("");
|
|
||||||
this.view.getTituloField().setText("");
|
|
||||||
this.view.getPaginasField().setText("");
|
|
||||||
this.view.getAnoPublicacionField().setText("");
|
|
||||||
this.view.getPrecioReferenciaField().setText("");
|
|
||||||
this.view.getIdiomasList().setSelectedIndices(new int[]{});
|
|
||||||
this.view.getAutoresList().setSelectedIndices(new int[]{});
|
|
||||||
this.view.getCategoriasList().setSelectedIndices(new int[]{});
|
|
||||||
this.view.getEditorialCombo().setSelectedIndex(0);
|
|
||||||
this.view.getSerieField().requestFocus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reload() {
|
private void reload() {
|
||||||
loadIdiomasList();
|
loadIdiomasList();
|
||||||
loadCategoriasList();
|
loadCategoriasList();
|
||||||
loadAutorList();
|
loadAutorList();
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
package xyz.danielcortes.controllers.libro;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import javax.swing.JComboBox;
|
|
||||||
import xyz.danielcortes.controllers.BaseController;
|
|
||||||
import xyz.danielcortes.controllers.LaunchController;
|
|
||||||
import xyz.danielcortes.models.Libro;
|
|
||||||
import xyz.danielcortes.repository.LibroRepository;
|
|
||||||
import xyz.danielcortes.views.BasePanel;
|
|
||||||
import xyz.danielcortes.views.libro.LibroDeletePanel;
|
|
||||||
|
|
||||||
public class LibroDeleteController extends BaseController {
|
|
||||||
|
|
||||||
private LibroDeletePanel view;
|
|
||||||
private LibroValidator validator;
|
|
||||||
private LibroRepository libroRepository;
|
|
||||||
|
|
||||||
public LibroDeleteController(LibroDeletePanel view, LaunchController parent) {
|
|
||||||
super(parent);
|
|
||||||
this.view = view;
|
|
||||||
this.libroRepository = new LibroRepository();
|
|
||||||
this.validator = new LibroValidator(this.libroRepository);
|
|
||||||
this.loadLibroCombo();
|
|
||||||
this.setupListeners();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void show() {
|
|
||||||
this.reload();
|
|
||||||
this.view.getLibroCombo().requestFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupListeners() {
|
|
||||||
this.view.getEliminarButton().addActionListener(e -> this.delete());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void delete() {
|
|
||||||
Libro selected = (Libro) this.view.getLibroCombo().getSelectedItem();
|
|
||||||
if(!validator.validateLibro(selected)) return;
|
|
||||||
|
|
||||||
this.libroRepository.delete(selected);
|
|
||||||
this.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void reload() {
|
|
||||||
this.loadLibroCombo();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadLibroCombo() {
|
|
||||||
List<Libro> libros = this.libroRepository.getAll();
|
|
||||||
JComboBox<Libro> combobox = this.view.getLibroCombo();
|
|
||||||
combobox.removeAllItems();
|
|
||||||
for(Libro libro: libros){
|
|
||||||
combobox.addItem(libro);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public BasePanel getView() {
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package xyz.danielcortes.controllers.libro;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import xyz.danielcortes.controllers.BaseController;
|
|
||||||
import xyz.danielcortes.controllers.LaunchController;
|
|
||||||
import xyz.danielcortes.framework.BaseTableModel;
|
|
||||||
import xyz.danielcortes.models.Libro;
|
|
||||||
import xyz.danielcortes.repository.LibroRepository;
|
|
||||||
import xyz.danielcortes.views.BasePanel;
|
|
||||||
import xyz.danielcortes.views.libro.LibroListPanel;
|
|
||||||
|
|
||||||
public class LibroListController extends BaseController {
|
|
||||||
|
|
||||||
private LibroListPanel view;
|
|
||||||
private LibroRepository libroRepository;
|
|
||||||
|
|
||||||
public LibroListController(LibroListPanel view, LaunchController parent) {
|
|
||||||
super(parent);
|
|
||||||
this.view = view;
|
|
||||||
this.libroRepository = new LibroRepository();
|
|
||||||
this.loadLibroTable();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void show() {
|
|
||||||
this.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void reload() {
|
|
||||||
this.loadLibroTable();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadLibroTable() {
|
|
||||||
List<Libro> libros = this.libroRepository.getAll();
|
|
||||||
BaseTableModel<Libro> model = this.view.getLibrosModel();
|
|
||||||
model.setRows(libros);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BasePanel getView() {
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
package xyz.danielcortes.controllers.libro;
|
||||||
|
|
||||||
|
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.Libro;
|
||||||
|
import xyz.danielcortes.repository.LibroRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
|
import xyz.danielcortes.views.libro.LibroSearchPanel;
|
||||||
|
|
||||||
|
public class LibroSearchController extends BaseController {
|
||||||
|
|
||||||
|
private LibroSearchPanel view;
|
||||||
|
private LibroRepository libroRepository;
|
||||||
|
private LibroValidator validator;
|
||||||
|
|
||||||
|
public LibroSearchController(LibroSearchPanel view, LaunchController parent) {
|
||||||
|
super(parent);
|
||||||
|
this.view = view;
|
||||||
|
this.libroRepository = new LibroRepository();
|
||||||
|
this.validator = new LibroValidator(this.libroRepository);
|
||||||
|
this.loadLibroTable();
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show() {
|
||||||
|
this.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reload() {
|
||||||
|
this.loadLibroTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getBuscarButton().addActionListener(e -> search());
|
||||||
|
this.view.getBuscarField().addActionListener(e -> search());
|
||||||
|
this.view.getEliminarButton().addActionListener(e -> delete());
|
||||||
|
this.view.getEditarButton().addActionListener(e -> edit());
|
||||||
|
this.view.getVerButton().addActionListener(e -> view());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void view() {
|
||||||
|
Libro libro = this.getSelectedLibro();
|
||||||
|
if (libro != null) {
|
||||||
|
LibroViewController controller = (LibroViewController) this.getParentController().getCard(PanelName.LIBRO_VIEW);
|
||||||
|
controller.setLibro(libro);
|
||||||
|
this.getParentController().showCard(PanelName.LIBRO_VIEW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void edit() {
|
||||||
|
Libro libro = this.getSelectedLibro();
|
||||||
|
if (libro != null) {
|
||||||
|
LibroUpdateController controller = (LibroUpdateController) this.getParentController().getCard(PanelName.LIBRO_UPDATE);
|
||||||
|
controller.setLibro(libro);
|
||||||
|
this.getParentController().showCard(PanelName.LIBRO_UPDATE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void delete() {
|
||||||
|
Libro libro = this.getSelectedLibro();
|
||||||
|
if (libro == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
int option = JOptionPane.showConfirmDialog(
|
||||||
|
null,
|
||||||
|
"¿Estas seguro de que deseas eliminar el libro?",
|
||||||
|
"Confirmacion",
|
||||||
|
JOptionPane.YES_NO_OPTION,
|
||||||
|
JOptionPane.QUESTION_MESSAGE
|
||||||
|
);
|
||||||
|
if (option == JOptionPane.NO_OPTION)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.libroRepository.delete(libro);
|
||||||
|
this.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void search() {
|
||||||
|
String term = this.view.getBuscarField().getText();
|
||||||
|
List<Libro> libros = this.libroRepository.search(term);
|
||||||
|
this.loadLibroTable(libros);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadLibroTable(List<Libro> libros) {
|
||||||
|
BaseTableModel<Libro> model = this.view.getLibrosModel();
|
||||||
|
model.setRows(libros);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadLibroTable() {
|
||||||
|
List<Libro> libros = this.libroRepository.getAll();
|
||||||
|
loadLibroTable(libros);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasePanel getView() {
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Libro getSelectedLibro() {
|
||||||
|
int selectedRow = this.view.getLibrosTable().getSelectedRow();
|
||||||
|
if (selectedRow == -1) {
|
||||||
|
JOptionPane.showMessageDialog(
|
||||||
|
null,
|
||||||
|
"No hay Libro seleccionado",
|
||||||
|
"Error",
|
||||||
|
JOptionPane.ERROR_MESSAGE
|
||||||
|
);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return this.view.getLibrosModel().getRow(selectedRow);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import javax.swing.JComboBox;
|
|||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
import xyz.danielcortes.controllers.LaunchController;
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
import xyz.danielcortes.framework.JListUtils;
|
import xyz.danielcortes.framework.JListUtils;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
import xyz.danielcortes.models.Autor;
|
import xyz.danielcortes.models.Autor;
|
||||||
import xyz.danielcortes.models.Categoria;
|
import xyz.danielcortes.models.Categoria;
|
||||||
import xyz.danielcortes.models.Editorial;
|
import xyz.danielcortes.models.Editorial;
|
||||||
@@ -23,6 +24,7 @@ import xyz.danielcortes.views.libro.LibroUpdatePanel;
|
|||||||
|
|
||||||
public class LibroUpdateController extends BaseController {
|
public class LibroUpdateController extends BaseController {
|
||||||
|
|
||||||
|
private Libro libro;
|
||||||
private LibroUpdatePanel view;
|
private LibroUpdatePanel view;
|
||||||
private LibroValidator validator;
|
private LibroValidator validator;
|
||||||
private LibroRepository libroRepository;
|
private LibroRepository libroRepository;
|
||||||
@@ -45,17 +47,23 @@ public class LibroUpdateController extends BaseController {
|
|||||||
this.setupListeners();
|
this.setupListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setLibro(Libro libro) {
|
||||||
|
this.libro = libro;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void show() {
|
public void show() {
|
||||||
this.reload();
|
this.reload();
|
||||||
this.view.getLibroCombo().requestFocus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupListeners() {
|
private void setupListeners() {
|
||||||
this.view.getLibroCombo().addActionListener(e -> {
|
this.view.getActualizarButton().addActionListener(e -> update());
|
||||||
Libro libro = (Libro) this.view.getLibroCombo().getSelectedItem();
|
}
|
||||||
|
|
||||||
|
private void fillLibro() {
|
||||||
if (libro == null)
|
if (libro == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.view.getSerieField().setText(String.valueOf(libro.getSerie()));
|
this.view.getSerieField().setText(String.valueOf(libro.getSerie()));
|
||||||
this.view.getIsbnField().setText(libro.getIsbn());
|
this.view.getIsbnField().setText(libro.getIsbn());
|
||||||
this.view.getTituloField().setText(libro.getTitulo());
|
this.view.getTituloField().setText(libro.getTitulo());
|
||||||
@@ -75,17 +83,14 @@ public class LibroUpdateController extends BaseController {
|
|||||||
libro.getCategorias()
|
libro.getCategorias()
|
||||||
);
|
);
|
||||||
this.view.getEditorialCombo().setSelectedItem(libro.getEditorial());
|
this.view.getEditorialCombo().setSelectedItem(libro.getEditorial());
|
||||||
});
|
|
||||||
this.view.getActualizarButton().addActionListener(e -> update());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void update() {
|
private void update() {
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
Libro original = (Libro) this.view.getLibroCombo().getSelectedItem();
|
if(!validator.validateLibro(libro)) return;
|
||||||
if(!validator.validateLibro(original)) return;
|
|
||||||
|
|
||||||
String serie = this.view.getSerieField().getText();
|
String serie = this.view.getSerieField().getText();
|
||||||
if(!validator.validateSerie(serie, original)) return;
|
if(!validator.validateSerie(serie, libro)) return;
|
||||||
|
|
||||||
String isbn = this.view.getIsbnField().getText();
|
String isbn = this.view.getIsbnField().getText();
|
||||||
if(!validator.validateISBN(isbn)) return;
|
if(!validator.validateISBN(isbn)) return;
|
||||||
@@ -116,38 +121,29 @@ public class LibroUpdateController extends BaseController {
|
|||||||
if(!validator.validateEditorial(editorial)) return;
|
if(!validator.validateEditorial(editorial)) return;
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
assert original != null;
|
assert libro != null;
|
||||||
|
|
||||||
original.setSerie(serie);
|
libro.setSerie(serie);
|
||||||
original.setIsbn(isbn);
|
libro.setIsbn(isbn);
|
||||||
original.setTitulo(titulo);
|
libro.setTitulo(titulo);
|
||||||
original.setNumeroPaginas(Integer.parseInt(numeroPaginas));
|
libro.setNumeroPaginas(Integer.parseInt(numeroPaginas));
|
||||||
original.setAnoPublicacion(Year.of(Integer.parseInt(anoPublicacion)));
|
libro.setAnoPublicacion(Year.of(Integer.parseInt(anoPublicacion)));
|
||||||
original.setPrecioReferencia(Integer.parseInt(precioReferencial));
|
libro.setPrecioReferencia(Integer.parseInt(precioReferencial));
|
||||||
original.setIdiomas(new HashSet<>(idiomas));
|
libro.setIdiomas(new HashSet<>(idiomas));
|
||||||
original.setAutores(new HashSet<>(autores));
|
libro.setAutores(new HashSet<>(autores));
|
||||||
original.setCategorias(new HashSet<>(categorias));
|
libro.setCategorias(new HashSet<>(categorias));
|
||||||
original.setEditorial(editorial);
|
libro.setEditorial(editorial);
|
||||||
|
|
||||||
this.libroRepository.update(original);
|
this.libroRepository.update(libro);
|
||||||
this.reload();
|
this.getParentController().showCard(PanelName.LIBRO_SEARCH);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reload() {
|
private void reload() {
|
||||||
this.loadLibrosCombo();
|
|
||||||
this.loadAutorList();
|
this.loadAutorList();
|
||||||
this.loadCategoriasList();
|
this.loadCategoriasList();
|
||||||
this.loadEditorialCombo();
|
this.loadEditorialCombo();
|
||||||
this.loadIdiomasList();
|
this.loadIdiomasList();
|
||||||
}
|
this.fillLibro();
|
||||||
|
|
||||||
private void loadLibrosCombo() {
|
|
||||||
List<Libro> libros = libroRepository.getAll();
|
|
||||||
JComboBox<Libro> model = this.view.getLibroCombo();
|
|
||||||
model.removeAllItems();
|
|
||||||
for (Libro libro : libros) {
|
|
||||||
model.addItem(libro);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadIdiomasList() {
|
private void loadIdiomasList() {
|
||||||
|
|||||||
@@ -65,8 +65,7 @@ public class LibroValidator {
|
|||||||
if (!validateSerie(serie))
|
if (!validateSerie(serie))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Integer s = Integer.parseInt(serie);
|
if (libroRepository.exists(serie, original.getId())) {
|
||||||
if (libroRepository.exists(s, original.getId())) {
|
|
||||||
JOptionPane.showMessageDialog(
|
JOptionPane.showMessageDialog(
|
||||||
null,
|
null,
|
||||||
"El numero de serie ya existe",
|
"El numero de serie ya existe",
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package xyz.danielcortes.controllers.libro;
|
||||||
|
|
||||||
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.framework.JListUtils;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
|
import xyz.danielcortes.models.Libro;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
|
import xyz.danielcortes.views.libro.LibroViewPanel;
|
||||||
|
|
||||||
|
public class LibroViewController extends BaseController {
|
||||||
|
private Libro libro;
|
||||||
|
private LibroViewPanel view;
|
||||||
|
|
||||||
|
public LibroViewController(LibroViewPanel view, LaunchController parent){
|
||||||
|
super(parent);
|
||||||
|
this.view = view;
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show() {
|
||||||
|
this.fillLibro();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLibro(Libro libro) {
|
||||||
|
this.libro = libro;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getVolverButton().addActionListener(e -> {
|
||||||
|
this.getParentController().showCard(PanelName.LIBRO_SEARCH);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fillLibro() {
|
||||||
|
if(libro != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.view.getSerieField().setText(this.libro.getSerie());
|
||||||
|
this.view.getIsbnField().setText(this.libro.getIsbn());
|
||||||
|
this.view.getTituloField().setText(this.libro.getTitulo());
|
||||||
|
this.view.getPaginasField().setText(String.valueOf(this.libro.getNumeroPaginas()));
|
||||||
|
this.view.getAnoPublicacionField().setText(String.valueOf(this.libro.getAnoPublicacion()));
|
||||||
|
this.view.getPrecioReferenciaField().setText(String.valueOf(this.libro.getPrecioReferencia()));
|
||||||
|
JListUtils.setSelectedValues(this.view.getIdiomasList(), this.libro.getIdiomas());
|
||||||
|
JListUtils.setSelectedValues(this.view.getAutoresList(), this.libro.getAutores());
|
||||||
|
JListUtils.setSelectedValues(this.view.getCategoriasList(), this.libro.getCategorias());
|
||||||
|
this.view.getEditorialCombo().setSelectedItem(this.libro.getEditorial());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BasePanel getView() {
|
||||||
|
return this.view;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,7 +29,11 @@ public class LibroRepository {
|
|||||||
CriteriaQuery<Libro> query = cb.createQuery(Libro.class);
|
CriteriaQuery<Libro> query = cb.createQuery(Libro.class);
|
||||||
Root<Libro> r = query.from(Libro.class);
|
Root<Libro> r = query.from(Libro.class);
|
||||||
query.where(
|
query.where(
|
||||||
cb.like(cb.lower(r.get("nombre")), "%" + term.toLowerCase() + "%")
|
cb.or(
|
||||||
|
cb.like(cb.lower(r.get("titulo")), "%" + term.toLowerCase() + "%"),
|
||||||
|
cb.like(cb.lower(r.get("isbn")), "%" + term.toLowerCase() + "%"),
|
||||||
|
cb.like(r.get("precioReferencia").as(String.class), "%" + term.toLowerCase() + "%")
|
||||||
|
)
|
||||||
);
|
);
|
||||||
return em.createQuery(query).getResultList();
|
return em.createQuery(query).getResultList();
|
||||||
}
|
}
|
||||||
@@ -71,7 +75,7 @@ public class LibroRepository {
|
|||||||
em.getTransaction().commit();
|
em.getTransaction().commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean exists(Integer serie, Integer id) {
|
public boolean exists(String serie, Integer id) {
|
||||||
Query query = em.createQuery("SELECT count(l) FROM Libro l WHERE serie = :serie and id != :id");
|
Query query = em.createQuery("SELECT count(l) FROM Libro l WHERE serie = :serie and id != :id");
|
||||||
query.setParameter("serie", serie);
|
query.setParameter("serie", serie);
|
||||||
query.setParameter("id", id);
|
query.setParameter("id", id);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public class LaunchFrame extends JFrame {
|
|||||||
private Dimension dimension;
|
private Dimension dimension;
|
||||||
|
|
||||||
public LaunchFrame() {
|
public LaunchFrame() {
|
||||||
this.dimension = new Dimension(800, 600);
|
this.dimension = new Dimension(800, 700);
|
||||||
this.setSize(this.dimension);
|
this.setSize(this.dimension);
|
||||||
this.setMinimumSize(this.dimension);
|
this.setMinimumSize(this.dimension);
|
||||||
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public class IdiomaViewPanel extends BasePanel {
|
|||||||
contentPane.add(label1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
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));
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
nombreField = new JTextField();
|
nombreField = new JTextField();
|
||||||
|
nombreField.setEditable(false);
|
||||||
nombreField.setText("");
|
nombreField.setText("");
|
||||||
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,
|
||||||
@@ -79,4 +80,5 @@ public class IdiomaViewPanel extends BasePanel {
|
|||||||
public JComponent $$$getRootComponent$$$() {
|
public JComponent $$$getRootComponent$$$() {
|
||||||
return contentPane;
|
return contentPane;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +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.libro.LibroListPanel">
|
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
|
||||||
<margin top="10" left="10" bottom="10" right="10"/>
|
|
||||||
<constraints>
|
|
||||||
<xy x="20" y="20" width="500" height="400"/>
|
|
||||||
</constraints>
|
|
||||||
<properties/>
|
|
||||||
<border type="none"/>
|
|
||||||
<children>
|
|
||||||
<scrollpane id="7bcd9">
|
|
||||||
<constraints>
|
|
||||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="3" 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="c50ab" class="javax.swing.JTable" binding="librosTable" custom-create="true">
|
|
||||||
<constraints/>
|
|
||||||
<properties/>
|
|
||||||
</component>
|
|
||||||
</children>
|
|
||||||
</scrollpane>
|
|
||||||
</children>
|
|
||||||
</grid>
|
|
||||||
</form>
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
package xyz.danielcortes.views.libro;
|
|
||||||
|
|
||||||
import com.intellij.uiDesigner.core.GridConstraints;
|
|
||||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
|
||||||
import java.awt.Dimension;
|
|
||||||
import java.awt.Insets;
|
|
||||||
import javax.swing.JComponent;
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import javax.swing.JScrollPane;
|
|
||||||
import javax.swing.JTable;
|
|
||||||
import xyz.danielcortes.framework.BaseTableModel;
|
|
||||||
import xyz.danielcortes.models.Libro;
|
|
||||||
import xyz.danielcortes.views.BasePanel;
|
|
||||||
|
|
||||||
public class LibroListPanel extends BasePanel {
|
|
||||||
|
|
||||||
private JTable librosTable;
|
|
||||||
private BaseTableModel<Libro> librosModel;
|
|
||||||
private JPanel contentPane;
|
|
||||||
|
|
||||||
public JTable getLibrosTable() {
|
|
||||||
return librosTable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BaseTableModel<Libro> getLibrosModel() {
|
|
||||||
return librosModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JPanel getContentPane() {
|
|
||||||
return contentPane;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createUIComponents() {
|
|
||||||
this.createLibrosTable();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createLibrosTable() {
|
|
||||||
//@formatter:off
|
|
||||||
this.librosModel = new BaseTableModel<>(
|
|
||||||
new String[]{"Serie", "ISBN", "Titulo", "Precio Referencial"},
|
|
||||||
(rows, rowIndex, colIndex) -> {
|
|
||||||
switch(colIndex) {
|
|
||||||
case 0: return rows.get(rowIndex).getSerie();
|
|
||||||
case 1: return rows.get(rowIndex).getIsbn();
|
|
||||||
case 2: return rows.get(rowIndex).getTitulo();
|
|
||||||
case 3: return rows.get(rowIndex).getPrecioReferencia();
|
|
||||||
default: return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
//@formatter:on
|
|
||||||
this.librosTable = new JTable(this.librosModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
// 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(1, 1, new Insets(10, 10, 10, 10), -1, -1));
|
|
||||||
final JScrollPane scrollPane1 = new JScrollPane();
|
|
||||||
contentPane.add(scrollPane1,
|
|
||||||
new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
|
||||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
|
||||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
|
||||||
new Dimension(400, -1), null, 0, false));
|
|
||||||
scrollPane1.setViewportView(librosTable);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @noinspection ALL
|
|
||||||
*/
|
|
||||||
public JComponent $$$getRootComponent$$$() {
|
|
||||||
return contentPane;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.libro.LibroSearchPanel">
|
||||||
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="10" left="10" bottom="10" right="10"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="500" height="400"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<scrollpane id="7bcd9">
|
||||||
|
<constraints>
|
||||||
|
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="3" 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="c50ab" class="javax.swing.JTable" binding="librosTable" custom-create="true">
|
||||||
|
<constraints/>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</scrollpane>
|
||||||
|
<grid id="6481a" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="183e5" class="javax.swing.JTextField" binding="buscarField">
|
||||||
|
<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="8daa9" 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>
|
||||||
|
<grid id="606a7" 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="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="55e55" 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="37f2b" 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>
|
||||||
|
<component id="bc714" 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>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
144
src/main/java/xyz/danielcortes/views/libro/LibroSearchPanel.java
Normal file
144
src/main/java/xyz/danielcortes/views/libro/LibroSearchPanel.java
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
package xyz.danielcortes.views.libro;
|
||||||
|
|
||||||
|
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.Libro;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
|
|
||||||
|
public class LibroSearchPanel extends BasePanel {
|
||||||
|
|
||||||
|
private JTable librosTable;
|
||||||
|
private BaseTableModel<Libro> librosModel;
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JTextField buscarField;
|
||||||
|
private JButton buscarButton;
|
||||||
|
private JButton verButton;
|
||||||
|
private JButton editarButton;
|
||||||
|
private JButton eliminarButton;
|
||||||
|
|
||||||
|
public JTable getLibrosTable() {
|
||||||
|
return librosTable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BaseTableModel<Libro> getLibrosModel() {
|
||||||
|
return librosModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getBuscarField() {
|
||||||
|
return buscarField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getBuscarButton() {
|
||||||
|
return buscarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getVerButton() {
|
||||||
|
return verButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getEditarButton() {
|
||||||
|
return editarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getEliminarButton() {
|
||||||
|
return eliminarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createUIComponents() {
|
||||||
|
this.createLibrosTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createLibrosTable() {
|
||||||
|
//@formatter:off
|
||||||
|
this.librosModel = new BaseTableModel<>(
|
||||||
|
new String[]{"Serie", "ISBN", "Titulo", "Precio Referencial"},
|
||||||
|
(rows, rowIndex, colIndex) -> {
|
||||||
|
switch(colIndex) {
|
||||||
|
case 0: return rows.get(rowIndex).getSerie();
|
||||||
|
case 1: return rows.get(rowIndex).getIsbn();
|
||||||
|
case 2: return rows.get(rowIndex).getTitulo();
|
||||||
|
case 3: return rows.get(rowIndex).getPrecioReferencia();
|
||||||
|
default: return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
//@formatter:on
|
||||||
|
this.librosTable = new JTable(this.librosModel);
|
||||||
|
this.librosTable.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, 1, new Insets(10, 10, 10, 10), -1, -1));
|
||||||
|
final JScrollPane scrollPane1 = new JScrollPane();
|
||||||
|
contentPane.add(scrollPane1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
scrollPane1.setViewportView(librosTable);
|
||||||
|
final JPanel panel1 = new JPanel();
|
||||||
|
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
|
||||||
|
contentPane.add(panel1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
|
||||||
|
buscarField = new JTextField();
|
||||||
|
panel1.add(buscarField,
|
||||||
|
new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||||
|
buscarButton = new JButton();
|
||||||
|
buscarButton.setText("Buscar");
|
||||||
|
panel1.add(buscarButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
final JPanel panel2 = new JPanel();
|
||||||
|
panel2.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1));
|
||||||
|
contentPane.add(panel2, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
|
||||||
|
verButton = new JButton();
|
||||||
|
verButton.setText("Ver");
|
||||||
|
panel2.add(verButton, new GridConstraints(0, 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));
|
||||||
|
editarButton = new JButton();
|
||||||
|
editarButton.setText("Editar");
|
||||||
|
panel2.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));
|
||||||
|
eliminarButton = new JButton();
|
||||||
|
eliminarButton.setText("Eliminar");
|
||||||
|
panel2.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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,32 +1,16 @@
|
|||||||
<?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.libro.LibroUpdatePanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.libro.LibroUpdatePanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="24" 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="22" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="10" left="10" bottom="10" right="10"/>
|
<margin top="10" left="10" bottom="10" right="10"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<xy x="20" y="20" width="500" height="704"/>
|
<xy x="20" y="20" width="500" height="644"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
<border type="none"/>
|
<border type="none"/>
|
||||||
<children>
|
<children>
|
||||||
<component id="7a42e" 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="Libro:"/>
|
|
||||||
</properties>
|
|
||||||
</component>
|
|
||||||
<component id="a52cd" class="javax.swing.JComboBox" binding="libroCombo" 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="512df" class="javax.swing.JLabel">
|
<component id="512df" 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="Nº Serie:"/>
|
<text value="Nº Serie:"/>
|
||||||
@@ -34,7 +18,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="498b6" class="javax.swing.JTextField" binding="serieField">
|
<component id="498b6" class="javax.swing.JTextField" binding="serieField">
|
||||||
<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="ff327" class="javax.swing.JLabel">
|
<component id="ff327" 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="ISBN:"/>
|
<text value="ISBN:"/>
|
||||||
@@ -50,7 +34,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="3af48" class="javax.swing.JTextField" binding="isbnField">
|
<component id="3af48" class="javax.swing.JTextField" binding="isbnField">
|
||||||
<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="d8528" class="javax.swing.JLabel">
|
<component id="d8528" 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="Titulo:"/>
|
<text value="Titulo:"/>
|
||||||
@@ -66,7 +50,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="d2cef" class="javax.swing.JTextField" binding="tituloField">
|
<component id="d2cef" class="javax.swing.JTextField" binding="tituloField">
|
||||||
<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>
|
||||||
@@ -74,7 +58,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="ba291" class="javax.swing.JLabel">
|
<component id="ba291" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<text value="Nº Paginas:"/>
|
<text value="Nº Paginas:"/>
|
||||||
@@ -82,7 +66,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="7585e" class="javax.swing.JTextField" binding="paginasField">
|
<component id="7585e" class="javax.swing.JTextField" binding="paginasField">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="9" 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="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
<preferred-size width="400" height="-1"/>
|
<preferred-size width="400" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -90,7 +74,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="858e6" class="javax.swing.JLabel">
|
<component id="858e6" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="10" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<text value="Año Publicacion:"/>
|
<text value="Año Publicacion:"/>
|
||||||
@@ -98,7 +82,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="9113f" class="javax.swing.JTextField" binding="anoPublicacionField">
|
<component id="9113f" class="javax.swing.JTextField" binding="anoPublicacionField">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="11" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
<grid row="9" 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>
|
||||||
@@ -106,7 +90,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="f24b8" class="javax.swing.JLabel">
|
<component id="f24b8" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="12" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="10" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<text value="Precio Referencia:"/>
|
<text value="Precio Referencia:"/>
|
||||||
@@ -114,7 +98,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="9e50c" class="javax.swing.JTextField" binding="precioReferenciaField">
|
<component id="9e50c" class="javax.swing.JTextField" binding="precioReferenciaField">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="13" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
<grid row="11" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
<preferred-size width="400" height="-1"/>
|
<preferred-size width="400" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -122,7 +106,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="ecff" class="javax.swing.JLabel">
|
<component id="ecff" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="14" 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="12" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<text value="Idiomas:"/>
|
<text value="Idiomas:"/>
|
||||||
@@ -130,7 +114,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<scrollpane id="3454d">
|
<scrollpane id="3454d">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="15" column="1" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
<grid row="13" column="1" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||||
<preferred-size width="400" height="-1"/>
|
<preferred-size width="400" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -145,7 +129,7 @@
|
|||||||
</scrollpane>
|
</scrollpane>
|
||||||
<component id="1f092" class="javax.swing.JLabel">
|
<component id="1f092" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="16" 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="14" 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="Autores:"/>
|
<text value="Autores:"/>
|
||||||
@@ -153,7 +137,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<scrollpane id="db428">
|
<scrollpane id="db428">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="17" column="1" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
<grid row="15" column="1" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||||
<preferred-size width="400" height="-1"/>
|
<preferred-size width="400" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -168,7 +152,7 @@
|
|||||||
</scrollpane>
|
</scrollpane>
|
||||||
<component id="9e933" class="javax.swing.JLabel">
|
<component id="9e933" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="18" 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="16" 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="Categorias:"/>
|
<text value="Categorias:"/>
|
||||||
@@ -176,7 +160,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<scrollpane id="76cca">
|
<scrollpane id="76cca">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="19" column="1" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
<grid row="17" column="1" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||||
<preferred-size width="400" height="-1"/>
|
<preferred-size width="400" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -191,7 +175,7 @@
|
|||||||
</scrollpane>
|
</scrollpane>
|
||||||
<component id="8b4b1" class="javax.swing.JLabel">
|
<component id="8b4b1" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="20" 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="18" 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="Editorial:"/>
|
<text value="Editorial:"/>
|
||||||
@@ -199,7 +183,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="d3b68" class="javax.swing.JComboBox" binding="editorialCombo" custom-create="true">
|
<component id="d3b68" class="javax.swing.JComboBox" binding="editorialCombo" custom-create="true">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="21" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
<grid row="19" 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"/>
|
<preferred-size width="400" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -207,7 +191,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="16ee1" class="javax.swing.JButton" binding="actualizarButton" default-binding="true">
|
<component id="16ee1" class="javax.swing.JButton" binding="actualizarButton" default-binding="true">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="22" 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="20" 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"/>
|
||||||
@@ -215,17 +199,17 @@
|
|||||||
</component>
|
</component>
|
||||||
<vspacer id="f08c">
|
<vspacer id="f08c">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="23" 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="21" 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="dbf95">
|
<hspacer id="dbf95">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="23" 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="21" 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>
|
||||||
<hspacer id="c8afd">
|
<hspacer id="c8afd">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="23" 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="21" 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>
|
||||||
</children>
|
</children>
|
||||||
|
|||||||
@@ -20,14 +20,11 @@ import xyz.danielcortes.models.Autor;
|
|||||||
import xyz.danielcortes.models.Categoria;
|
import xyz.danielcortes.models.Categoria;
|
||||||
import xyz.danielcortes.models.Editorial;
|
import xyz.danielcortes.models.Editorial;
|
||||||
import xyz.danielcortes.models.Idioma;
|
import xyz.danielcortes.models.Idioma;
|
||||||
import xyz.danielcortes.models.Libro;
|
|
||||||
import xyz.danielcortes.views.BasePanel;
|
import xyz.danielcortes.views.BasePanel;
|
||||||
|
|
||||||
public class LibroUpdatePanel extends BasePanel {
|
public class LibroUpdatePanel extends BasePanel {
|
||||||
|
|
||||||
private JPanel contentPane;
|
private JPanel contentPane;
|
||||||
private JComboBox<Libro> libroCombo;
|
|
||||||
private DefaultComboBoxModel<Libro> libroModel;
|
|
||||||
private JTextField serieField;
|
private JTextField serieField;
|
||||||
private JTextField isbnField;
|
private JTextField isbnField;
|
||||||
private JTextField tituloField;
|
private JTextField tituloField;
|
||||||
@@ -48,14 +45,6 @@ public class LibroUpdatePanel extends BasePanel {
|
|||||||
return contentPane;
|
return contentPane;
|
||||||
}
|
}
|
||||||
|
|
||||||
public JComboBox<Libro> getLibroCombo() {
|
|
||||||
return libroCombo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DefaultComboBoxModel<Libro> getLibroModel() {
|
|
||||||
return libroModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JTextField getSerieField() {
|
public JTextField getSerieField() {
|
||||||
return serieField;
|
return serieField;
|
||||||
}
|
}
|
||||||
@@ -117,18 +106,12 @@ public class LibroUpdatePanel extends BasePanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void createUIComponents() {
|
private void createUIComponents() {
|
||||||
this.createLibroCombo();
|
|
||||||
this.createAutoresList();
|
this.createAutoresList();
|
||||||
this.createCategoriaList();
|
this.createCategoriaList();
|
||||||
this.createEditorialCombo();
|
this.createEditorialCombo();
|
||||||
this.createIdiomasList();
|
this.createIdiomasList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createLibroCombo() {
|
|
||||||
this.libroModel = new DefaultComboBoxModel<>();
|
|
||||||
this.libroCombo = new JComboBox<>(this.libroModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createIdiomasList() {
|
private void createIdiomasList() {
|
||||||
this.idiomasModel = new DefaultListModel<>();
|
this.idiomasModel = new DefaultListModel<>();
|
||||||
this.idiomasList = new JList<>(this.idiomasModel);
|
this.idiomasList = new JList<>(this.idiomasModel);
|
||||||
@@ -160,152 +143,113 @@ public class LibroUpdatePanel 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();
|
createUIComponents();
|
||||||
contentPane = new JPanel();
|
contentPane = new JPanel();
|
||||||
contentPane.setLayout(new GridLayoutManager(24, 3, new Insets(10, 10, 10, 10), -1, -1));
|
contentPane.setLayout(new GridLayoutManager(22, 3, new Insets(10, 10, 10, 10), -1, -1));
|
||||||
final JLabel label1 = new JLabel();
|
final JLabel label1 = new JLabel();
|
||||||
label1.setText("Libro:");
|
label1.setText("Nº Serie:");
|
||||||
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,
|
serieField = new JTextField();
|
||||||
false));
|
contentPane.add(serieField,
|
||||||
contentPane.add(libroCombo, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_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 label2 = new JLabel();
|
final JLabel label2 = new JLabel();
|
||||||
label2.setText("Nº Serie:");
|
label2.setText("ISBN:");
|
||||||
contentPane.add(label2,
|
contentPane.add(label2, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
new GridConstraints(2, 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,
|
isbnField = new JTextField();
|
||||||
false));
|
contentPane.add(isbnField,
|
||||||
serieField = new JTextField();
|
new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
contentPane.add(serieField, 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));
|
||||||
final JLabel label3 = new JLabel();
|
final JLabel label3 = new JLabel();
|
||||||
label3.setText("ISBN:");
|
label3.setText("Titulo:");
|
||||||
contentPane.add(label3,
|
contentPane.add(label3, new GridConstraints(4, 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,
|
tituloField = new JTextField();
|
||||||
false));
|
contentPane.add(tituloField,
|
||||||
isbnField = new JTextField();
|
new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
contentPane.add(isbnField, 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));
|
||||||
final JLabel label4 = new JLabel();
|
final JLabel label4 = new JLabel();
|
||||||
label4.setText("Titulo:");
|
label4.setText("Nº Paginas:");
|
||||||
contentPane.add(label4,
|
contentPane.add(label4, new GridConstraints(6, 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,
|
paginasField = new JTextField();
|
||||||
false));
|
contentPane.add(paginasField,
|
||||||
tituloField = new JTextField();
|
new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
contentPane.add(tituloField, new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
|
||||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
final JLabel label5 = new JLabel();
|
final JLabel label5 = new JLabel();
|
||||||
label5.setText("Nº Paginas:");
|
label5.setText("Año Publicacion:");
|
||||||
contentPane.add(label5,
|
contentPane.add(label5, new GridConstraints(8, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
new GridConstraints(8, 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));
|
|
||||||
paginasField = new JTextField();
|
|
||||||
contentPane.add(paginasField, new GridConstraints(9, 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 label6 = new JLabel();
|
|
||||||
label6.setText("Año Publicacion:");
|
|
||||||
contentPane.add(label6,
|
|
||||||
new GridConstraints(10, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
|
||||||
GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
|
|
||||||
false));
|
|
||||||
anoPublicacionField = new JTextField();
|
anoPublicacionField = new JTextField();
|
||||||
contentPane.add(anoPublicacionField,
|
contentPane.add(anoPublicacionField,
|
||||||
new GridConstraints(11, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
new GridConstraints(9, 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 label7 = new JLabel();
|
final JLabel label6 = new JLabel();
|
||||||
label7.setText("Precio Referencia:");
|
label6.setText("Precio Referencia:");
|
||||||
contentPane.add(label7,
|
contentPane.add(label6, new GridConstraints(10, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
new GridConstraints(12, 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));
|
|
||||||
precioReferenciaField = new JTextField();
|
precioReferenciaField = new JTextField();
|
||||||
contentPane.add(precioReferenciaField,
|
contentPane.add(precioReferenciaField,
|
||||||
new GridConstraints(13, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
new GridConstraints(11, 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 label8 = new JLabel();
|
final JLabel label7 = new JLabel();
|
||||||
label8.setText("Idiomas:");
|
label7.setText("Idiomas:");
|
||||||
contentPane.add(label8,
|
contentPane.add(label7, new GridConstraints(12, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
new GridConstraints(14, 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));
|
|
||||||
final JScrollPane scrollPane1 = new JScrollPane();
|
final JScrollPane scrollPane1 = new JScrollPane();
|
||||||
contentPane.add(scrollPane1,
|
contentPane.add(scrollPane1, new GridConstraints(13, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
new GridConstraints(15, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
|
||||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(400, -1), null, 0, false));
|
||||||
new Dimension(400, -1), null, 0, false));
|
|
||||||
scrollPane1.setViewportView(idiomasList);
|
scrollPane1.setViewportView(idiomasList);
|
||||||
final JLabel label9 = new JLabel();
|
final JLabel label8 = new JLabel();
|
||||||
label9.setText("Autores:");
|
label8.setText("Autores:");
|
||||||
contentPane.add(label9,
|
contentPane.add(label8, new GridConstraints(14, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
new GridConstraints(16, 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));
|
|
||||||
final JScrollPane scrollPane2 = new JScrollPane();
|
final JScrollPane scrollPane2 = new JScrollPane();
|
||||||
contentPane.add(scrollPane2,
|
contentPane.add(scrollPane2, new GridConstraints(15, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
new GridConstraints(17, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
|
||||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(400, -1), null, 0, false));
|
||||||
new Dimension(400, -1), null, 0, false));
|
|
||||||
scrollPane2.setViewportView(autoresList);
|
scrollPane2.setViewportView(autoresList);
|
||||||
final JLabel label10 = new JLabel();
|
final JLabel label9 = new JLabel();
|
||||||
label10.setText("Categorias:");
|
label9.setText("Categorias:");
|
||||||
contentPane.add(label10,
|
contentPane.add(label9, new GridConstraints(16, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
new GridConstraints(18, 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));
|
|
||||||
final JScrollPane scrollPane3 = new JScrollPane();
|
final JScrollPane scrollPane3 = new JScrollPane();
|
||||||
contentPane.add(scrollPane3,
|
contentPane.add(scrollPane3, new GridConstraints(17, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
new GridConstraints(19, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
|
||||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(400, -1), null, 0, false));
|
||||||
new Dimension(400, -1), null, 0, false));
|
|
||||||
scrollPane3.setViewportView(categoriasList);
|
scrollPane3.setViewportView(categoriasList);
|
||||||
final JLabel label11 = new JLabel();
|
final JLabel label10 = new JLabel();
|
||||||
label11.setText("Editorial:");
|
label10.setText("Editorial:");
|
||||||
contentPane.add(label11,
|
contentPane.add(label10,
|
||||||
new GridConstraints(20, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
new GridConstraints(18, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
false));
|
contentPane.add(editorialCombo,
|
||||||
contentPane.add(editorialCombo, new GridConstraints(21, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
new GridConstraints(19, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW,
|
|
||||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
actualizarButton = new JButton();
|
actualizarButton = new JButton();
|
||||||
actualizarButton.setText("Actualizar");
|
actualizarButton.setText("Actualizar");
|
||||||
contentPane.add(actualizarButton,
|
contentPane.add(actualizarButton, new GridConstraints(20, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
new GridConstraints(22, 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(23, 1, 1, 1, GridConstraints.ANCHOR_CENTER,
|
contentPane.add(spacer1,
|
||||||
GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0,
|
new GridConstraints(21, 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(23, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
|
contentPane.add(spacer2,
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null,
|
new GridConstraints(21, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
|
||||||
0, false));
|
null, null, null, 0, false));
|
||||||
final Spacer spacer3 = new Spacer();
|
final Spacer spacer3 = new Spacer();
|
||||||
contentPane.add(spacer3, new GridConstraints(23, 2, 1, 1, GridConstraints.ANCHOR_CENTER,
|
contentPane.add(spacer3,
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null,
|
new GridConstraints(21, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
|
||||||
0, false));
|
null, null, null, 0, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
232
src/main/java/xyz/danielcortes/views/libro/LibroViewPanel.form
Normal file
232
src/main/java/xyz/danielcortes/views/libro/LibroViewPanel.form
Normal file
@@ -0,0 +1,232 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.libro.LibroViewPanel">
|
||||||
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="22" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="10" left="10" bottom="10" right="10"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="500" height="644"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="7dfd" class="javax.swing.JTextField" binding="serieField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<editable value="false"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="f3244" class="javax.swing.JTextField" binding="isbnField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<editable value="false"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="49da" class="javax.swing.JTextField" binding="tituloField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<editable value="false"/>
|
||||||
|
<text value=""/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="a5f4c" class="javax.swing.JTextField" binding="paginasField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<editable value="false"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="1bb31" class="javax.swing.JTextField" binding="anoPublicacionField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="9" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<editable value="false"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="f8b93" class="javax.swing.JComboBox" binding="editorialCombo" custom-create="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="19" 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="b355b" class="javax.swing.JButton" binding="volverButton">
|
||||||
|
<constraints>
|
||||||
|
<grid row="20" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Volver"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<scrollpane id="ff034">
|
||||||
|
<constraints>
|
||||||
|
<grid row="13" column="1" row-span="1" col-span="1" 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="edd72" class="javax.swing.JList" binding="idiomasList" custom-create="true">
|
||||||
|
<constraints/>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</scrollpane>
|
||||||
|
<scrollpane id="47272">
|
||||||
|
<constraints>
|
||||||
|
<grid row="15" column="1" row-span="1" col-span="1" 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="8875f" class="javax.swing.JList" binding="autoresList" custom-create="true">
|
||||||
|
<constraints/>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</scrollpane>
|
||||||
|
<scrollpane id="5b4f1">
|
||||||
|
<constraints>
|
||||||
|
<grid row="17" column="1" row-span="1" col-span="1" 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="66610" class="javax.swing.JList" binding="categoriasList" custom-create="true">
|
||||||
|
<constraints/>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</scrollpane>
|
||||||
|
<component id="10e24" 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="Nº Serie:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="15" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="ISBN:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="61c2f" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Titulo:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="72cc4" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Nº Paginas:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="725bf" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Año Publicacion:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="3c2eb" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="12" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Idiomas:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="f7906" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="14" 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="Autores:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="5981d" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="16" 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="Categorias:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="dc81" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="18" 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="Editorial:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<vspacer id="7f6dd">
|
||||||
|
<constraints>
|
||||||
|
<grid row="21" 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>
|
||||||
|
<component id="cd3f9" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="10" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Precio Referencia:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="a406" class="javax.swing.JTextField" binding="precioReferenciaField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="11" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<editable value="false"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<hspacer id="a5b67">
|
||||||
|
<constraints>
|
||||||
|
<grid row="21" 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="8c06a">
|
||||||
|
<constraints>
|
||||||
|
<grid row="21" 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>
|
||||||
269
src/main/java/xyz/danielcortes/views/libro/LibroViewPanel.java
Normal file
269
src/main/java/xyz/danielcortes/views/libro/LibroViewPanel.java
Normal file
@@ -0,0 +1,269 @@
|
|||||||
|
package xyz.danielcortes.views.libro;
|
||||||
|
|
||||||
|
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.DefaultListModel;
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JList;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import javax.swing.ListSelectionModel;
|
||||||
|
import xyz.danielcortes.models.Autor;
|
||||||
|
import xyz.danielcortes.models.Categoria;
|
||||||
|
import xyz.danielcortes.models.Editorial;
|
||||||
|
import xyz.danielcortes.models.Idioma;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
|
|
||||||
|
public class LibroViewPanel extends BasePanel {
|
||||||
|
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JTextField serieField;
|
||||||
|
private JTextField isbnField;
|
||||||
|
private JTextField tituloField;
|
||||||
|
private JTextField paginasField;
|
||||||
|
private JTextField anoPublicacionField;
|
||||||
|
private JList<Idioma> idiomasList;
|
||||||
|
private DefaultListModel<Idioma> idiomasModel;
|
||||||
|
private JList<Autor> autoresList;
|
||||||
|
private DefaultListModel<Autor> autoresModel;
|
||||||
|
private JList<Categoria> categoriasList;
|
||||||
|
private DefaultListModel<Categoria> categoriasModel;
|
||||||
|
private JComboBox<Editorial> editorialCombo;
|
||||||
|
private DefaultComboBoxModel<Editorial> editorialModel;
|
||||||
|
private JButton volverButton;
|
||||||
|
private JTextField precioReferenciaField;
|
||||||
|
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getSerieField() {
|
||||||
|
return serieField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getIsbnField() {
|
||||||
|
return isbnField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getTituloField() {
|
||||||
|
return tituloField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getPaginasField() {
|
||||||
|
return paginasField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getAnoPublicacionField() {
|
||||||
|
return anoPublicacionField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getPrecioReferenciaField() {
|
||||||
|
return precioReferenciaField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JList<Idioma> getIdiomasList() {
|
||||||
|
return idiomasList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DefaultListModel<Idioma> getIdiomasModel() {
|
||||||
|
return idiomasModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JList<Autor> getAutoresList() {
|
||||||
|
return autoresList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DefaultListModel<Autor> getAutoresModel() {
|
||||||
|
return autoresModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JList<Categoria> getCategoriasList() {
|
||||||
|
return categoriasList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DefaultListModel<Categoria> getCategoriasModel() {
|
||||||
|
return categoriasModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JComboBox<Editorial> getEditorialCombo() {
|
||||||
|
return editorialCombo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DefaultComboBoxModel<Editorial> getEditorialModel() {
|
||||||
|
return editorialModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getVolverButton() {
|
||||||
|
return volverButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||||
|
// >>> IMPORTANT!! <<<
|
||||||
|
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||||
|
$$$setupUI$$$();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
|
||||||
|
*
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
private void $$$setupUI$$$() {
|
||||||
|
createUIComponents();
|
||||||
|
contentPane = new JPanel();
|
||||||
|
contentPane.setLayout(new GridLayoutManager(22, 3, new Insets(10, 10, 10, 10), -1, -1));
|
||||||
|
serieField = new JTextField();
|
||||||
|
serieField.setEditable(false);
|
||||||
|
contentPane.add(serieField,
|
||||||
|
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));
|
||||||
|
isbnField = new JTextField();
|
||||||
|
isbnField.setEditable(false);
|
||||||
|
contentPane.add(isbnField,
|
||||||
|
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));
|
||||||
|
tituloField = new JTextField();
|
||||||
|
tituloField.setEditable(false);
|
||||||
|
tituloField.setText("");
|
||||||
|
contentPane.add(tituloField,
|
||||||
|
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));
|
||||||
|
paginasField = new JTextField();
|
||||||
|
paginasField.setEditable(false);
|
||||||
|
contentPane.add(paginasField,
|
||||||
|
new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
anoPublicacionField = new JTextField();
|
||||||
|
anoPublicacionField.setEditable(false);
|
||||||
|
contentPane.add(anoPublicacionField,
|
||||||
|
new GridConstraints(9, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
contentPane.add(editorialCombo,
|
||||||
|
new GridConstraints(19, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
volverButton = new JButton();
|
||||||
|
volverButton.setText("Volver");
|
||||||
|
contentPane.add(volverButton, new GridConstraints(20, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
final JScrollPane scrollPane1 = new JScrollPane();
|
||||||
|
contentPane.add(scrollPane1, new GridConstraints(13, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
scrollPane1.setViewportView(idiomasList);
|
||||||
|
final JScrollPane scrollPane2 = new JScrollPane();
|
||||||
|
contentPane.add(scrollPane2, new GridConstraints(15, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
scrollPane2.setViewportView(autoresList);
|
||||||
|
final JScrollPane scrollPane3 = new JScrollPane();
|
||||||
|
contentPane.add(scrollPane3, new GridConstraints(17, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
scrollPane3.setViewportView(categoriasList);
|
||||||
|
final JLabel label1 = new JLabel();
|
||||||
|
label1.setText("Nº Serie:");
|
||||||
|
contentPane.add(label1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
final JLabel label2 = new JLabel();
|
||||||
|
label2.setText("ISBN:");
|
||||||
|
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));
|
||||||
|
final JLabel label3 = new JLabel();
|
||||||
|
label3.setText("Titulo:");
|
||||||
|
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));
|
||||||
|
final JLabel label4 = new JLabel();
|
||||||
|
label4.setText("Nº Paginas:");
|
||||||
|
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 label5 = new JLabel();
|
||||||
|
label5.setText("Año Publicacion:");
|
||||||
|
contentPane.add(label5, new GridConstraints(8, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
final JLabel label6 = new JLabel();
|
||||||
|
label6.setText("Idiomas:");
|
||||||
|
contentPane.add(label6, new GridConstraints(12, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
final JLabel label7 = new JLabel();
|
||||||
|
label7.setText("Autores:");
|
||||||
|
contentPane.add(label7, new GridConstraints(14, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
final JLabel label8 = new JLabel();
|
||||||
|
label8.setText("Categorias:");
|
||||||
|
contentPane.add(label8, new GridConstraints(16, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
final JLabel label9 = new JLabel();
|
||||||
|
label9.setText("Editorial:");
|
||||||
|
contentPane.add(label9, new GridConstraints(18, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
final Spacer spacer1 = new Spacer();
|
||||||
|
contentPane.add(spacer1,
|
||||||
|
new GridConstraints(21, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final JLabel label10 = new JLabel();
|
||||||
|
label10.setText("Precio Referencia:");
|
||||||
|
contentPane.add(label10,
|
||||||
|
new GridConstraints(10, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
precioReferenciaField = new JTextField();
|
||||||
|
precioReferenciaField.setEditable(false);
|
||||||
|
contentPane.add(precioReferenciaField,
|
||||||
|
new GridConstraints(11, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
final Spacer spacer2 = new Spacer();
|
||||||
|
contentPane.add(spacer2,
|
||||||
|
new GridConstraints(21, 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(21, 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() {
|
||||||
|
createIdiomasList();
|
||||||
|
createAutoresList();
|
||||||
|
createCategoriaList();
|
||||||
|
createEditorialCombo();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createIdiomasList() {
|
||||||
|
this.idiomasModel = new DefaultListModel<>();
|
||||||
|
this.idiomasList = new JList<>(this.idiomasModel);
|
||||||
|
this.idiomasList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createAutoresList() {
|
||||||
|
this.autoresModel = new DefaultListModel<>();
|
||||||
|
this.autoresList = new JList<>(this.autoresModel);
|
||||||
|
this.autoresList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createCategoriaList() {
|
||||||
|
this.categoriasModel = new DefaultListModel<>();
|
||||||
|
this.categoriasList = new JList<>(this.categoriasModel);
|
||||||
|
this.categoriasList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createEditorialCombo() {
|
||||||
|
this.editorialModel = new DefaultComboBoxModel<>();
|
||||||
|
this.editorialCombo = new JComboBox<>(this.editorialModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/biblioteca_manual"/>
|
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/biblioteca_manual"/>
|
||||||
<property name="javax.persistence.jdbc.user" value="root"/>
|
<property name="javax.persistence.jdbc.user" value="root"/>
|
||||||
<property name="javax.persistence.jdbc.password" value="ff9800s_a_d"/>
|
<property name="javax.persistence.jdbc.password" value="ff9800s_a_d"/>
|
||||||
|
<property name="hibernate.dialect" value="org.hibernate.dialect.MariaDB103Dialect"/>
|
||||||
<!--<property name="hibernate.hbm2ddl.auto" value="create"/>-->
|
<!--<property name="hibernate.hbm2ddl.auto" value="create"/>-->
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user