Se generalizo la creacion de controllers/vistas
eso <3
This commit is contained in:
@@ -1,9 +1,12 @@
|
|||||||
package xyz.danielcortes.controllers;
|
package xyz.danielcortes.controllers;
|
||||||
|
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
|
|
||||||
public interface BaseController {
|
public interface BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Este metodo sera llamado cada vez que se necesite mostrar la vista que contiene
|
* Este metodo sera llamado cada vez que se necesite mostrar la vista que contiene
|
||||||
*/
|
*/
|
||||||
void show();
|
void show();
|
||||||
|
BasePanel getView();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package xyz.danielcortes.controllers;
|
package xyz.danielcortes.controllers;
|
||||||
|
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
import javax.swing.JMenu;
|
import javax.swing.JMenu;
|
||||||
import javax.swing.JMenuBar;
|
import javax.swing.JMenuBar;
|
||||||
import javax.swing.JMenuItem;
|
import javax.swing.JMenuItem;
|
||||||
@@ -51,31 +53,11 @@ import xyz.danielcortes.views.libro.LibroUpdatePanel;
|
|||||||
public class LaunchController {
|
public class LaunchController {
|
||||||
|
|
||||||
private LaunchFrame frame;
|
private LaunchFrame frame;
|
||||||
|
private Map<PanelName, BaseController> controllers;
|
||||||
|
|
||||||
private LibroListController libroListController;
|
public LaunchController() {
|
||||||
private LibroCreateController libroCreateController;
|
this.controllers = new HashMap<>();
|
||||||
private LibroUpdateController libroUpdateController;
|
}
|
||||||
private LibroDeleteController libroDeleteController;
|
|
||||||
|
|
||||||
private AutorListController autorListController;
|
|
||||||
private AutorCreateController autorCreateController;
|
|
||||||
private AutorUpdateController autorUpdateController;
|
|
||||||
private AutorDeleteController autorDeleteController;
|
|
||||||
|
|
||||||
private IdiomaListController idiomaListController;
|
|
||||||
private IdiomaCreateController idiomaCreateController;
|
|
||||||
private IdiomaUpdateController idiomaUpdateController;
|
|
||||||
private IdiomaDeleteController idiomaDeleteController;
|
|
||||||
|
|
||||||
private CategoriaListController categoriaListController;
|
|
||||||
private CategoriaCreateController categoriaCreateController;
|
|
||||||
private CategoriaUpdateController categoriaUpdateController;
|
|
||||||
private CategoriaDeleteController categoriaDeleteController;
|
|
||||||
|
|
||||||
private EditorialListController editorialListController;
|
|
||||||
private EditorialCreateController editorialCreateController;
|
|
||||||
private EditorialUpdateController editorialUpdateController;
|
|
||||||
private EditorialDeleteController editorialDeleteController;
|
|
||||||
|
|
||||||
private void create() {
|
private void create() {
|
||||||
frame = new LaunchFrame();
|
frame = new LaunchFrame();
|
||||||
@@ -86,113 +68,37 @@ public class LaunchController {
|
|||||||
private void createCards() {
|
private void createCards() {
|
||||||
this.frame.addCard(new JPanel(), PanelName.EMPTY);
|
this.frame.addCard(new JPanel(), PanelName.EMPTY);
|
||||||
|
|
||||||
this.libroListController = new LibroListController(new LibroListPanel(this.frame));
|
this.controllers.put(PanelName.LIBRO_LIST, new LibroListController(new LibroListPanel(this.frame)));
|
||||||
this.libroCreateController = new LibroCreateController(new LibroCreatePanel(this.frame));
|
this.controllers.put(PanelName.LIBRO_CREATE, new LibroCreateController(new LibroCreatePanel(this.frame)));
|
||||||
this.libroUpdateController = new LibroUpdateController(new LibroUpdatePanel(this.frame));
|
this.controllers.put(PanelName.LIBRO_UPDATE, new LibroUpdateController(new LibroUpdatePanel(this.frame)));
|
||||||
this.libroDeleteController = new LibroDeleteController(new LibroDeletePanel(this.frame));
|
this.controllers.put(PanelName.LIBRO_DELETE, new LibroDeleteController(new LibroDeletePanel(this.frame)));
|
||||||
|
|
||||||
this.frame.addCard(
|
this.controllers.put(PanelName.AUTOR_LIST, new AutorListController(new AutorListPanel(this.frame)));
|
||||||
this.libroListController.getView().getContentPane(),
|
this.controllers.put(PanelName.AUTOR_CREATE, new AutorCreateController(new AutorCreatePanel(this.frame)));
|
||||||
PanelName.LIBRO_LIST
|
this.controllers.put(PanelName.AUTOR_UPDATE, new AutorUpdateController(new AutorUpdatePanel(this.frame)));
|
||||||
);
|
this.controllers.put(PanelName.AUTOR_DELETE, new AutorDeleteController(new AutorDeletePanel(this.frame)));
|
||||||
this.frame.addCard(
|
|
||||||
this.libroCreateController.getView().getContentPane(),
|
|
||||||
PanelName.LIBRO_CREATE
|
|
||||||
);
|
|
||||||
this.frame.addCard(
|
|
||||||
this.libroUpdateController.getView().getContentPane(),
|
|
||||||
PanelName.LIBRO_UPDATE
|
|
||||||
);
|
|
||||||
this.frame.addCard(
|
|
||||||
this.libroDeleteController.getView().getContentPane(),
|
|
||||||
PanelName.LIBRO_DELETE
|
|
||||||
);
|
|
||||||
|
|
||||||
this.autorListController = new AutorListController(new AutorListPanel(this.frame));
|
this.controllers.put(PanelName.IDIOMA_LIST, new IdiomaListController(new IdiomaListPanel(this.frame)));
|
||||||
this.autorCreateController = new AutorCreateController(new AutorCreatePanel(this.frame));
|
this.controllers.put(PanelName.IDIOMA_CREATE, new IdiomaCreateController(new IdiomaCreatePanel(this.frame)));
|
||||||
this.autorUpdateController = new AutorUpdateController(new AutorUpdatePanel(this.frame));
|
this.controllers.put(PanelName.IDIOMA_UPDATE, new IdiomaUpdateController(new IdiomaUpdatePanel(this.frame)));
|
||||||
this.autorDeleteController = new AutorDeleteController(new AutorDeletePanel(this.frame));
|
this.controllers.put(PanelName.IDIOMA_DELETE, new IdiomaDeleteController(new IdiomaDeletePanel(this.frame)));
|
||||||
this.frame.addCard(
|
|
||||||
this.autorListController.getView().getContentPane(),
|
|
||||||
PanelName.AUTOR_LIST
|
|
||||||
);
|
|
||||||
this.frame.addCard(
|
|
||||||
this.autorCreateController.getView().getContentPane(),
|
|
||||||
PanelName.AUTOR_CREATE
|
|
||||||
);
|
|
||||||
this.frame.addCard(
|
|
||||||
this.autorUpdateController.getView().getContentPane(),
|
|
||||||
PanelName.AUTOR_UPDATE
|
|
||||||
);
|
|
||||||
this.frame.addCard(
|
|
||||||
this.autorDeleteController.getView().getContentPane(),
|
|
||||||
PanelName.AUTOR_DELETE
|
|
||||||
);
|
|
||||||
|
|
||||||
this.idiomaListController = new IdiomaListController(new IdiomaListPanel(this.frame));
|
this.controllers.put(PanelName.CATEGORIA_LIST, new CategoriaListController(new CategoriaListPanel(this.frame)));
|
||||||
this.idiomaCreateController = new IdiomaCreateController(new IdiomaCreatePanel(this.frame));
|
this.controllers.put(PanelName.CATEGORIA_CREATE, new CategoriaCreateController(new CategoriaCreatePanel(this.frame)));
|
||||||
this.idiomaUpdateController = new IdiomaUpdateController(new IdiomaUpdatePanel(this.frame));
|
this.controllers.put(PanelName.CATEGORIA_DELETE, new CategoriaDeleteController(new CategoriaDeletePanel(this.frame)));
|
||||||
this.idiomaDeleteController = new IdiomaDeleteController(new IdiomaDeletePanel(this.frame));
|
this.controllers.put(PanelName.CATEGORIA_UPDATE, new CategoriaUpdateController(new CategoriaUpdatePanel(this.frame)));
|
||||||
this.frame.addCard(
|
|
||||||
this.idiomaListController.getView().getContentPane(),
|
|
||||||
PanelName.IDIOMA_LIST
|
|
||||||
);
|
|
||||||
this.frame.addCard(
|
|
||||||
this.idiomaCreateController.getView().getContentPane(),
|
|
||||||
PanelName.IDIOMA_CREATE
|
|
||||||
);
|
|
||||||
this.frame.addCard(
|
|
||||||
this.idiomaUpdateController.getView().getContentPane(),
|
|
||||||
PanelName.IDIOMA_UPDATE
|
|
||||||
);
|
|
||||||
this.frame.addCard(
|
|
||||||
this.idiomaDeleteController.getView().getContentPane(),
|
|
||||||
PanelName.IDIOMA_DELETE
|
|
||||||
);
|
|
||||||
|
|
||||||
this.categoriaListController = new CategoriaListController(new CategoriaListPanel(this.frame));
|
this.controllers.put(PanelName.EDITORIAL_LIST, new EditorialListController(new EditorialListPanel(this.frame)));
|
||||||
this.categoriaCreateController = new CategoriaCreateController(new CategoriaCreatePanel(this.frame));
|
this.controllers.put(PanelName.EDITORIAL_CREATE, new EditorialCreateController(new EditorialCreatePanel(this.frame)));
|
||||||
this.categoriaDeleteController = new CategoriaDeleteController(new CategoriaDeletePanel(this.frame));
|
this.controllers.put(PanelName.EDITORIAL_UPDATE, new EditorialUpdateController(new EditorialUpdatePanel(this.frame)));
|
||||||
this.categoriaUpdateController = new CategoriaUpdateController(new CategoriaUpdatePanel(this.frame));
|
this.controllers.put(PanelName.EDITORIAL_DELETE, new EditorialDeleteController(new EditorialDeletePanel(this.frame)));
|
||||||
|
|
||||||
this.frame.addCard(
|
for (PanelName name : this.controllers.keySet()) {
|
||||||
this.categoriaListController.getView().getContentPane(),
|
BaseController controller = this.controllers.get(name);
|
||||||
PanelName.CATEGORIA_LIST
|
controller.show();
|
||||||
);
|
this.frame.addCard(controller.getView().getContentPane(), name);
|
||||||
this.frame.addCard(
|
}
|
||||||
this.categoriaUpdateController.getView().getContentPane(),
|
|
||||||
PanelName.CATEGORIA_UPDATE
|
|
||||||
);
|
|
||||||
this.frame.addCard(
|
|
||||||
this.categoriaCreateController.getView().getContentPane(),
|
|
||||||
PanelName.CATEGORIA_CREATE
|
|
||||||
);
|
|
||||||
this.frame.addCard(
|
|
||||||
this.categoriaDeleteController.getView().getContentPane(),
|
|
||||||
PanelName.CATEGORIA_DELETE
|
|
||||||
);
|
|
||||||
|
|
||||||
this.editorialListController = new EditorialListController(new EditorialListPanel(this.frame));
|
|
||||||
this.editorialCreateController= new EditorialCreateController(new EditorialCreatePanel(this.frame));
|
|
||||||
this.editorialUpdateController= new EditorialUpdateController(new EditorialUpdatePanel(this.frame));
|
|
||||||
this.editorialDeleteController= new EditorialDeleteController(new EditorialDeletePanel(this.frame));
|
|
||||||
|
|
||||||
this.frame.addCard(
|
|
||||||
this.editorialListController.getView().getContentPane(),
|
|
||||||
PanelName.EDITORIAL_LIST
|
|
||||||
);
|
|
||||||
this.frame.addCard(
|
|
||||||
this.editorialCreateController.getView().getContentPane(),
|
|
||||||
PanelName.EDITORIAL_CREATE
|
|
||||||
);
|
|
||||||
this.frame.addCard(
|
|
||||||
this.editorialUpdateController.getView().getContentPane(),
|
|
||||||
PanelName.EDITORIAL_UPDATE
|
|
||||||
);
|
|
||||||
this.frame.addCard(
|
|
||||||
this.editorialDeleteController.getView().getContentPane(),
|
|
||||||
PanelName.EDITORIAL_DELETE
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createMenuBar() {
|
private void createMenuBar() {
|
||||||
@@ -234,98 +140,88 @@ public class LaunchController {
|
|||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
autorList.addActionListener(e -> {
|
autorList.addActionListener(e -> {
|
||||||
this.autorListController.reload();
|
this.controllers.get(PanelName.AUTOR_LIST).show();
|
||||||
this.frame.showCard(PanelName.AUTOR_LIST);
|
this.frame.showCard(PanelName.AUTOR_LIST);
|
||||||
});
|
});
|
||||||
autorCreate.addActionListener(e -> {
|
autorCreate.addActionListener(e -> {
|
||||||
this.frame.showCard(PanelName.AUTOR_CREATE);
|
this.frame.showCard(PanelName.AUTOR_CREATE);
|
||||||
this.autorCreateController.getView().getNombreField().requestFocus();
|
this.controllers.get(PanelName.AUTOR_CREATE).show();
|
||||||
});
|
});
|
||||||
autorUpdate.addActionListener(e -> {
|
autorUpdate.addActionListener(e -> {
|
||||||
this.autorUpdateController.reload();
|
this.controllers.get(PanelName.AUTOR_UPDATE).show();
|
||||||
this.frame.showCard(PanelName.AUTOR_UPDATE);
|
this.frame.showCard(PanelName.AUTOR_UPDATE);
|
||||||
this.autorUpdateController.getView().getAutorCombo().requestFocus();
|
|
||||||
});
|
});
|
||||||
autorDelete.addActionListener(e -> {
|
autorDelete.addActionListener(e -> {
|
||||||
this.autorDeleteController.reload();
|
this.controllers.get(PanelName.AUTOR_DELETE).show();
|
||||||
this.frame.showCard(PanelName.AUTOR_DELETE);
|
this.frame.showCard(PanelName.AUTOR_DELETE);
|
||||||
this.autorDeleteController.getView().getAutorCombo().requestFocus();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
idiomaList.addActionListener(e -> {
|
idiomaList.addActionListener(e -> {
|
||||||
this.idiomaListController.reload();
|
this.controllers.get(PanelName.IDIOMA_LIST).show();
|
||||||
this.frame.showCard(PanelName.IDIOMA_LIST);
|
this.frame.showCard(PanelName.IDIOMA_LIST);
|
||||||
});
|
});
|
||||||
idiomaCreate.addActionListener(e -> {
|
idiomaCreate.addActionListener(e -> {
|
||||||
|
this.controllers.get(PanelName.IDIOMA_CREATE).show();
|
||||||
this.frame.showCard(PanelName.IDIOMA_CREATE);
|
this.frame.showCard(PanelName.IDIOMA_CREATE);
|
||||||
this.idiomaCreateController.getView().getNombreField().requestFocus();
|
|
||||||
});
|
});
|
||||||
idiomaUpdate.addActionListener(e -> {
|
idiomaUpdate.addActionListener(e -> {
|
||||||
this.idiomaUpdateController.reload();
|
this.controllers.get(PanelName.IDIOMA_UPDATE).show();
|
||||||
this.frame.showCard(PanelName.IDIOMA_UPDATE);
|
this.frame.showCard(PanelName.IDIOMA_UPDATE);
|
||||||
this.idiomaUpdateController.getView().getIdiomaCombo().requestFocus();
|
|
||||||
});
|
});
|
||||||
idiomaDelete.addActionListener(e -> {
|
idiomaDelete.addActionListener(e -> {
|
||||||
this.idiomaDeleteController.reload();
|
this.controllers.get(PanelName.IDIOMA_DELETE).show();
|
||||||
this.frame.showCard(PanelName.IDIOMA_DELETE);
|
this.frame.showCard(PanelName.IDIOMA_DELETE);
|
||||||
this.idiomaDeleteController.getView().getIdiomaCombo().requestFocus();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
libroList.addActionListener(e -> {
|
libroList.addActionListener(e -> {
|
||||||
this.libroListController.reload();
|
this.controllers.get(PanelName.LIBRO_LIST).show();
|
||||||
this.frame.showCard(PanelName.LIBRO_LIST);
|
this.frame.showCard(PanelName.LIBRO_LIST);
|
||||||
});
|
});
|
||||||
libroCreate.addActionListener(e -> {
|
libroCreate.addActionListener(e -> {
|
||||||
this.libroCreateController.reload();
|
this.controllers.get(PanelName.LIBRO_CREATE).show();
|
||||||
this.frame.showCard(PanelName.LIBRO_CREATE);
|
this.frame.showCard(PanelName.LIBRO_CREATE);
|
||||||
this.libroCreateController.getView().getSerieField().requestFocus();
|
|
||||||
});
|
});
|
||||||
libroUpdate.addActionListener(e -> {
|
libroUpdate.addActionListener(e -> {
|
||||||
this.libroUpdateController.reload();
|
this.controllers.get(PanelName.LIBRO_UPDATE).show();
|
||||||
this.frame.showCard(PanelName.LIBRO_UPDATE);
|
this.frame.showCard(PanelName.LIBRO_UPDATE);
|
||||||
this.libroUpdateController.getView().getSerieField().requestFocus();
|
|
||||||
});
|
});
|
||||||
libroDelete.addActionListener(e -> {
|
libroDelete.addActionListener(e -> {
|
||||||
this.libroDeleteController.reload();
|
this.controllers.get(PanelName.LIBRO_DELETE).show();
|
||||||
this.frame.showCard(PanelName.LIBRO_DELETE);
|
this.frame.showCard(PanelName.LIBRO_DELETE);
|
||||||
});
|
});
|
||||||
|
|
||||||
categoriaList.addActionListener(e -> {
|
categoriaList.addActionListener(e -> {
|
||||||
this.categoriaListController.reload();
|
this.controllers.get(PanelName.CATEGORIA_LIST).show();
|
||||||
this.frame.showCard(PanelName.CATEGORIA_LIST);
|
this.frame.showCard(PanelName.CATEGORIA_LIST);
|
||||||
});
|
});
|
||||||
categoriaCreate.addActionListener(e -> {
|
categoriaCreate.addActionListener(e -> {
|
||||||
|
this.controllers.get(PanelName.CATEGORIA_CREATE).show();
|
||||||
this.frame.showCard(PanelName.CATEGORIA_CREATE);
|
this.frame.showCard(PanelName.CATEGORIA_CREATE);
|
||||||
this.categoriaCreateController.getView().getNombreField().requestFocus();
|
|
||||||
});
|
});
|
||||||
categoriaUpdate.addActionListener(e -> {
|
categoriaUpdate.addActionListener(e -> {
|
||||||
this.categoriaUpdateController.reload();
|
this.controllers.get(PanelName.CATEGORIA_UPDATE).show();
|
||||||
this.frame.showCard(PanelName.CATEGORIA_UPDATE);
|
this.frame.showCard(PanelName.CATEGORIA_UPDATE);
|
||||||
this.categoriaUpdateController.getView().getCategoriaCombo().requestFocus();
|
|
||||||
});
|
});
|
||||||
categoriaDelete.addActionListener(e -> {
|
categoriaDelete.addActionListener(e -> {
|
||||||
this.categoriaDeleteController.reload();
|
this.controllers.get(PanelName.CATEGORIA_DELETE).show();
|
||||||
this.frame.showCard(PanelName.CATEGORIA_DELETE);
|
this.frame.showCard(PanelName.CATEGORIA_DELETE);
|
||||||
this.categoriaDeleteController.getView().getCategoriaCombo().requestFocus();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
editorialList.addActionListener(e -> {
|
editorialList.addActionListener(e -> {
|
||||||
this.editorialListController.reload();
|
this.controllers.get(PanelName.EDITORIAL_LIST).show();
|
||||||
this.frame.showCard(PanelName.EDITORIAL_LIST);
|
this.frame.showCard(PanelName.EDITORIAL_LIST);
|
||||||
});
|
});
|
||||||
editorialCreate.addActionListener(e -> {
|
editorialCreate.addActionListener(e -> {
|
||||||
|
this.controllers.get(PanelName.EDITORIAL_CREATE).show();
|
||||||
this.frame.showCard(PanelName.EDITORIAL_CREATE);
|
this.frame.showCard(PanelName.EDITORIAL_CREATE);
|
||||||
this.editorialCreateController.getView().getNombreField().requestFocus();
|
|
||||||
});
|
});
|
||||||
editorialUpdate.addActionListener(e -> {
|
editorialUpdate.addActionListener(e -> {
|
||||||
this.editorialUpdateController.reload();
|
this.controllers.get(PanelName.EDITORIAL_UPDATE).show();
|
||||||
this.frame.showCard(PanelName.EDITORIAL_UPDATE);
|
this.frame.showCard(PanelName.EDITORIAL_UPDATE);
|
||||||
this.editorialUpdateController.getView().getEditorialCombo().requestFocus();
|
|
||||||
});
|
});
|
||||||
editorialDelete.addActionListener(e -> {
|
editorialDelete.addActionListener(e -> {
|
||||||
this.editorialDeleteController.reload();
|
this.controllers.get(PanelName.EDITORIAL_DELETE).show();
|
||||||
this.frame.showCard(PanelName.EDITORIAL_DELETE);
|
this.frame.showCard(PanelName.EDITORIAL_DELETE);
|
||||||
this.editorialDeleteController.getView().getEditorialCombo().requestFocus();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
menuBar.add(librosMenu);
|
menuBar.add(librosMenu);
|
||||||
@@ -361,6 +257,7 @@ public class LaunchController {
|
|||||||
this.frame.setJMenuBar(menuBar);
|
this.frame.setJMenuBar(menuBar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
this.create();
|
this.create();
|
||||||
this.frame.setVisible(true);
|
this.frame.setVisible(true);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import javax.swing.JOptionPane;
|
|||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
import xyz.danielcortes.models.Autor;
|
import xyz.danielcortes.models.Autor;
|
||||||
import xyz.danielcortes.repository.AutorRepository;
|
import xyz.danielcortes.repository.AutorRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.autor.AutorCreatePanel;
|
import xyz.danielcortes.views.autor.AutorCreatePanel;
|
||||||
|
|
||||||
public class AutorCreateController implements BaseController {
|
public class AutorCreateController implements BaseController {
|
||||||
@@ -105,7 +106,7 @@ public class AutorCreateController implements BaseController {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AutorCreatePanel getView() {
|
public BasePanel getView() {
|
||||||
return this.view;
|
return this.view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import javax.swing.JOptionPane;
|
|||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
import xyz.danielcortes.models.Autor;
|
import xyz.danielcortes.models.Autor;
|
||||||
import xyz.danielcortes.repository.AutorRepository;
|
import xyz.danielcortes.repository.AutorRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.autor.AutorDeletePanel;
|
import xyz.danielcortes.views.autor.AutorDeletePanel;
|
||||||
|
|
||||||
public class AutorDeleteController implements BaseController {
|
public class AutorDeleteController implements BaseController {
|
||||||
@@ -62,7 +63,7 @@ public class AutorDeleteController implements BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public AutorDeletePanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import xyz.danielcortes.controllers.BaseController;
|
|||||||
import xyz.danielcortes.framework.BaseTableModel;
|
import xyz.danielcortes.framework.BaseTableModel;
|
||||||
import xyz.danielcortes.models.Autor;
|
import xyz.danielcortes.models.Autor;
|
||||||
import xyz.danielcortes.repository.AutorRepository;
|
import xyz.danielcortes.repository.AutorRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.autor.AutorListPanel;
|
import xyz.danielcortes.views.autor.AutorListPanel;
|
||||||
|
|
||||||
public class AutorListController implements BaseController {
|
public class AutorListController implements BaseController {
|
||||||
@@ -46,7 +47,7 @@ public class AutorListController implements BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public AutorListPanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package xyz.danielcortes.controllers.autor;
|
package xyz.danielcortes.controllers.autor;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
import xyz.danielcortes.models.Autor;
|
import xyz.danielcortes.models.Autor;
|
||||||
import xyz.danielcortes.repository.AutorRepository;
|
import xyz.danielcortes.repository.AutorRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.autor.AutorUpdatePanel;
|
import xyz.danielcortes.views.autor.AutorUpdatePanel;
|
||||||
|
|
||||||
public class AutorUpdateController implements BaseController {
|
public class AutorUpdateController implements BaseController {
|
||||||
@@ -24,7 +24,7 @@ public class AutorUpdateController implements BaseController {
|
|||||||
@Override
|
@Override
|
||||||
public void show() {
|
public void show() {
|
||||||
this.reload();
|
this.reload();
|
||||||
this.getView().getAutorCombo().requestFocus();
|
this.view.getAutorCombo().requestFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupListeners() {
|
private void setupListeners() {
|
||||||
@@ -144,7 +144,7 @@ public class AutorUpdateController implements BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public AutorUpdatePanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package xyz.danielcortes.controllers.autor;
|
|||||||
|
|
||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
import xyz.danielcortes.models.Autor;
|
import xyz.danielcortes.models.Autor;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.autor.AutorViewPanel;
|
import xyz.danielcortes.views.autor.AutorViewPanel;
|
||||||
|
|
||||||
public class AutorViewController implements BaseController {
|
public class AutorViewController implements BaseController {
|
||||||
@@ -31,4 +32,7 @@ public class AutorViewController implements BaseController {
|
|||||||
this.view.getApellidoMaternoField().setText(this.autor.getApellidoMaterno());
|
this.view.getApellidoMaternoField().setText(this.autor.getApellidoMaterno());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BasePanel getView() {
|
||||||
|
return view;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import javax.swing.JOptionPane;
|
|||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
import xyz.danielcortes.models.Categoria;
|
import xyz.danielcortes.models.Categoria;
|
||||||
import xyz.danielcortes.repository.CategoriaRepository;
|
import xyz.danielcortes.repository.CategoriaRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.categoria.CategoriaCreatePanel;
|
import xyz.danielcortes.views.categoria.CategoriaCreatePanel;
|
||||||
|
|
||||||
public class CategoriaCreateController implements BaseController {
|
public class CategoriaCreateController implements BaseController {
|
||||||
@@ -18,7 +19,7 @@ public class CategoriaCreateController implements BaseController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void show() {
|
public void show() {
|
||||||
this.getView().getNombreField().requestFocus();
|
this.view.getNombreField().requestFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupListeners() {
|
private void setupListeners() {
|
||||||
@@ -58,7 +59,7 @@ public class CategoriaCreateController implements BaseController {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CategoriaCreatePanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import javax.swing.JOptionPane;
|
|||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
import xyz.danielcortes.models.Categoria;
|
import xyz.danielcortes.models.Categoria;
|
||||||
import xyz.danielcortes.repository.CategoriaRepository;
|
import xyz.danielcortes.repository.CategoriaRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.categoria.CategoriaDeletePanel;
|
import xyz.danielcortes.views.categoria.CategoriaDeletePanel;
|
||||||
|
|
||||||
public class CategoriaDeleteController implements BaseController {
|
public class CategoriaDeleteController implements BaseController {
|
||||||
@@ -62,7 +63,7 @@ public class CategoriaDeleteController implements BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public CategoriaDeletePanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import xyz.danielcortes.controllers.BaseController;
|
|||||||
import xyz.danielcortes.framework.BaseTableModel;
|
import xyz.danielcortes.framework.BaseTableModel;
|
||||||
import xyz.danielcortes.models.Categoria;
|
import xyz.danielcortes.models.Categoria;
|
||||||
import xyz.danielcortes.repository.CategoriaRepository;
|
import xyz.danielcortes.repository.CategoriaRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.categoria.CategoriaListPanel;
|
import xyz.danielcortes.views.categoria.CategoriaListPanel;
|
||||||
|
|
||||||
public class CategoriaListController implements BaseController {
|
public class CategoriaListController implements BaseController {
|
||||||
@@ -30,5 +31,5 @@ public class CategoriaListController implements BaseController {
|
|||||||
model.addRows(categorias);
|
model.addRows(categorias);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CategoriaListPanel getView() { return view; }
|
public BasePanel getView() { return view; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import javax.swing.JOptionPane;
|
|||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
import xyz.danielcortes.models.Categoria;
|
import xyz.danielcortes.models.Categoria;
|
||||||
import xyz.danielcortes.repository.CategoriaRepository;
|
import xyz.danielcortes.repository.CategoriaRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.categoria.CategoriaUpdatePanel;
|
import xyz.danielcortes.views.categoria.CategoriaUpdatePanel;
|
||||||
|
|
||||||
public class CategoriaUpdateController implements BaseController {
|
public class CategoriaUpdateController implements BaseController {
|
||||||
@@ -95,7 +96,7 @@ public class CategoriaUpdateController implements BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public CategoriaUpdatePanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import javax.swing.JOptionPane;
|
|||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
import xyz.danielcortes.models.Editorial;
|
import xyz.danielcortes.models.Editorial;
|
||||||
import xyz.danielcortes.repository.EditorialRepository;
|
import xyz.danielcortes.repository.EditorialRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.editorial.EditorialCreatePanel;
|
import xyz.danielcortes.views.editorial.EditorialCreatePanel;
|
||||||
|
|
||||||
public class EditorialCreateController implements BaseController {
|
public class EditorialCreateController implements BaseController {
|
||||||
@@ -60,7 +61,7 @@ public class EditorialCreateController implements BaseController {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EditorialCreatePanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import javax.swing.JOptionPane;
|
|||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
import xyz.danielcortes.models.Editorial;
|
import xyz.danielcortes.models.Editorial;
|
||||||
import xyz.danielcortes.repository.EditorialRepository;
|
import xyz.danielcortes.repository.EditorialRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.editorial.EditorialDeletePanel;
|
import xyz.danielcortes.views.editorial.EditorialDeletePanel;
|
||||||
|
|
||||||
public class EditorialDeleteController implements BaseController {
|
public class EditorialDeleteController implements BaseController {
|
||||||
@@ -63,7 +64,7 @@ public class EditorialDeleteController implements BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public EditorialDeletePanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import xyz.danielcortes.controllers.BaseController;
|
|||||||
import xyz.danielcortes.framework.BaseTableModel;
|
import xyz.danielcortes.framework.BaseTableModel;
|
||||||
import xyz.danielcortes.models.Editorial;
|
import xyz.danielcortes.models.Editorial;
|
||||||
import xyz.danielcortes.repository.EditorialRepository;
|
import xyz.danielcortes.repository.EditorialRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.editorial.EditorialListPanel;
|
import xyz.danielcortes.views.editorial.EditorialListPanel;
|
||||||
|
|
||||||
public class EditorialListController implements BaseController {
|
public class EditorialListController implements BaseController {
|
||||||
@@ -32,7 +33,7 @@ public class EditorialListController implements BaseController {
|
|||||||
model.addRows(editoriales);
|
model.addRows(editoriales);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EditorialListPanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import javax.swing.JOptionPane;
|
|||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
import xyz.danielcortes.models.Editorial;
|
import xyz.danielcortes.models.Editorial;
|
||||||
import xyz.danielcortes.repository.EditorialRepository;
|
import xyz.danielcortes.repository.EditorialRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.editorial.EditorialUpdatePanel;
|
import xyz.danielcortes.views.editorial.EditorialUpdatePanel;
|
||||||
|
|
||||||
public class EditorialUpdateController implements BaseController {
|
public class EditorialUpdateController implements BaseController {
|
||||||
@@ -98,7 +99,7 @@ public class EditorialUpdateController implements BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public EditorialUpdatePanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import javax.swing.JOptionPane;
|
|||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
import xyz.danielcortes.models.Idioma;
|
import xyz.danielcortes.models.Idioma;
|
||||||
import xyz.danielcortes.repository.IdiomaRepository;
|
import xyz.danielcortes.repository.IdiomaRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.idioma.IdiomaCreatePanel;
|
import xyz.danielcortes.views.idioma.IdiomaCreatePanel;
|
||||||
|
|
||||||
public class IdiomaCreateController implements BaseController {
|
public class IdiomaCreateController implements BaseController {
|
||||||
@@ -60,7 +61,7 @@ public class IdiomaCreateController implements BaseController {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IdiomaCreatePanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import javax.swing.JOptionPane;
|
|||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
import xyz.danielcortes.models.Idioma;
|
import xyz.danielcortes.models.Idioma;
|
||||||
import xyz.danielcortes.repository.IdiomaRepository;
|
import xyz.danielcortes.repository.IdiomaRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.idioma.IdiomaDeletePanel;
|
import xyz.danielcortes.views.idioma.IdiomaDeletePanel;
|
||||||
|
|
||||||
public class IdiomaDeleteController implements BaseController {
|
public class IdiomaDeleteController implements BaseController {
|
||||||
@@ -63,7 +64,7 @@ public class IdiomaDeleteController implements BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IdiomaDeletePanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ package xyz.danielcortes.controllers.idioma;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
|
import xyz.danielcortes.framework.BaseTableModel;
|
||||||
import xyz.danielcortes.models.Idioma;
|
import xyz.danielcortes.models.Idioma;
|
||||||
import xyz.danielcortes.repository.IdiomaRepository;
|
import xyz.danielcortes.repository.IdiomaRepository;
|
||||||
import xyz.danielcortes.framework.BaseTableModel;
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.idioma.IdiomaListPanel;
|
import xyz.danielcortes.views.idioma.IdiomaListPanel;
|
||||||
|
|
||||||
public class IdiomaListController implements BaseController {
|
public class IdiomaListController implements BaseController {
|
||||||
@@ -33,7 +34,7 @@ public class IdiomaListController implements BaseController {
|
|||||||
model.addRows(idiomas);
|
model.addRows(idiomas);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IdiomaListPanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import javax.swing.JOptionPane;
|
|||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
import xyz.danielcortes.models.Idioma;
|
import xyz.danielcortes.models.Idioma;
|
||||||
import xyz.danielcortes.repository.IdiomaRepository;
|
import xyz.danielcortes.repository.IdiomaRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.idioma.IdiomaUpdatePanel;
|
import xyz.danielcortes.views.idioma.IdiomaUpdatePanel;
|
||||||
|
|
||||||
public class IdiomaUpdateController implements BaseController {
|
public class IdiomaUpdateController implements BaseController {
|
||||||
@@ -96,7 +97,7 @@ public class IdiomaUpdateController implements BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IdiomaUpdatePanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import xyz.danielcortes.repository.CategoriaRepository;
|
|||||||
import xyz.danielcortes.repository.EditorialRepository;
|
import xyz.danielcortes.repository.EditorialRepository;
|
||||||
import xyz.danielcortes.repository.IdiomaRepository;
|
import xyz.danielcortes.repository.IdiomaRepository;
|
||||||
import xyz.danielcortes.repository.LibroRepository;
|
import xyz.danielcortes.repository.LibroRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.libro.LibroCreatePanel;
|
import xyz.danielcortes.views.libro.LibroCreatePanel;
|
||||||
|
|
||||||
public class LibroCreateController implements BaseController {
|
public class LibroCreateController implements BaseController {
|
||||||
@@ -159,7 +160,7 @@ public class LibroCreateController implements BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public LibroCreatePanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import javax.swing.JComboBox;
|
|||||||
import xyz.danielcortes.controllers.BaseController;
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
import xyz.danielcortes.models.Libro;
|
import xyz.danielcortes.models.Libro;
|
||||||
import xyz.danielcortes.repository.LibroRepository;
|
import xyz.danielcortes.repository.LibroRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.libro.LibroDeletePanel;
|
import xyz.danielcortes.views.libro.LibroDeletePanel;
|
||||||
|
|
||||||
public class LibroDeleteController implements BaseController {
|
public class LibroDeleteController implements BaseController {
|
||||||
@@ -52,7 +53,7 @@ public class LibroDeleteController implements BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public LibroDeletePanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import xyz.danielcortes.controllers.BaseController;
|
|||||||
import xyz.danielcortes.framework.BaseTableModel;
|
import xyz.danielcortes.framework.BaseTableModel;
|
||||||
import xyz.danielcortes.models.Libro;
|
import xyz.danielcortes.models.Libro;
|
||||||
import xyz.danielcortes.repository.LibroRepository;
|
import xyz.danielcortes.repository.LibroRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.libro.LibroListPanel;
|
import xyz.danielcortes.views.libro.LibroListPanel;
|
||||||
|
|
||||||
public class LibroListController implements BaseController {
|
public class LibroListController implements BaseController {
|
||||||
@@ -33,7 +34,7 @@ public class LibroListController implements BaseController {
|
|||||||
model.addRows(libros);
|
model.addRows(libros);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LibroListPanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import xyz.danielcortes.repository.CategoriaRepository;
|
|||||||
import xyz.danielcortes.repository.EditorialRepository;
|
import xyz.danielcortes.repository.EditorialRepository;
|
||||||
import xyz.danielcortes.repository.IdiomaRepository;
|
import xyz.danielcortes.repository.IdiomaRepository;
|
||||||
import xyz.danielcortes.repository.LibroRepository;
|
import xyz.danielcortes.repository.LibroRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
import xyz.danielcortes.views.libro.LibroUpdatePanel;
|
import xyz.danielcortes.views.libro.LibroUpdatePanel;
|
||||||
|
|
||||||
public class LibroUpdateController implements BaseController {
|
public class LibroUpdateController implements BaseController {
|
||||||
@@ -183,7 +184,7 @@ public class LibroUpdateController implements BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public LibroUpdatePanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
package xyz.danielcortes.views;
|
package xyz.danielcortes.views;
|
||||||
|
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
public class BasePanel {
|
public abstract class BasePanel {
|
||||||
private JFrame parentFrame;
|
private JFrame parentFrame;
|
||||||
|
|
||||||
public BasePanel(JFrame parentFrame) {
|
public BasePanel(JFrame parentFrame) {
|
||||||
@@ -12,4 +13,6 @@ public class BasePanel {
|
|||||||
public JFrame getParentFrame() {
|
public JFrame getParentFrame() {
|
||||||
return parentFrame;
|
return parentFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract JPanel getContentPane();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.autor.AutorViewPanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.autor.AutorViewPanel">
|
||||||
<grid id="27dc6" layout-manager="GridLayoutManager" row-count="8" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="8" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="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="400"/>
|
<xy x="20" y="20" width="500" height="400"/>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.intellij.uiDesigner.core.Spacer;
|
|||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Insets;
|
import java.awt.Insets;
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JComponent;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
@@ -18,11 +19,16 @@ public class AutorViewPanel extends BasePanel {
|
|||||||
private JTextField apellidoPaternoField;
|
private JTextField apellidoPaternoField;
|
||||||
private JTextField apellidoMaternoField;
|
private JTextField apellidoMaternoField;
|
||||||
private JButton volverButton;
|
private JButton volverButton;
|
||||||
|
private JPanel contentPane;
|
||||||
|
|
||||||
public AutorViewPanel(JFrame parentFrame) {
|
public AutorViewPanel(JFrame parentFrame) {
|
||||||
super(parentFrame);
|
super(parentFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
public JTextField getNombreField() {
|
public JTextField getNombreField() {
|
||||||
return nombreField;
|
return nombreField;
|
||||||
}
|
}
|
||||||
@@ -47,67 +53,65 @@ public class AutorViewPanel 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$$$() {
|
||||||
final JPanel panel1 = new JPanel();
|
contentPane = new JPanel();
|
||||||
panel1.setLayout(new GridLayoutManager(8, 3, new Insets(10, 10, 10, 10), -1, -1));
|
contentPane.setLayout(new GridLayoutManager(8, 3, new Insets(10, 10, 10, 10), -1, -1));
|
||||||
final JLabel label1 = new JLabel();
|
final JLabel label1 = new JLabel();
|
||||||
label1.setText("Nombre:");
|
label1.setText("Nombre:");
|
||||||
panel1.add(label1,
|
contentPane.add(label1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
|
|
||||||
false));
|
|
||||||
nombreField = new JTextField();
|
nombreField = new JTextField();
|
||||||
nombreField.setEditable(false);
|
nombreField.setEditable(false);
|
||||||
nombreField.setEnabled(false);
|
nombreField.setEnabled(false);
|
||||||
panel1.add(nombreField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
contentPane.add(nombreField,
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
final JLabel label2 = new JLabel();
|
final JLabel label2 = new JLabel();
|
||||||
label2.setText("Apellido Paterno:");
|
label2.setText("Apellido Paterno:");
|
||||||
panel1.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,
|
|
||||||
false));
|
|
||||||
apellidoPaternoField = new JTextField();
|
apellidoPaternoField = new JTextField();
|
||||||
apellidoPaternoField.setEditable(false);
|
apellidoPaternoField.setEditable(false);
|
||||||
apellidoPaternoField.setEnabled(false);
|
apellidoPaternoField.setEnabled(false);
|
||||||
panel1.add(apellidoPaternoField, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
contentPane.add(apellidoPaternoField,
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
final JLabel label3 = new JLabel();
|
final JLabel label3 = new JLabel();
|
||||||
label3.setText("Apellido Materno:");
|
label3.setText("Apellido Materno:");
|
||||||
panel1.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,
|
|
||||||
false));
|
|
||||||
apellidoMaternoField = new JTextField();
|
apellidoMaternoField = new JTextField();
|
||||||
apellidoMaternoField.setEditable(false);
|
apellidoMaternoField.setEditable(false);
|
||||||
apellidoMaternoField.setEnabled(false);
|
apellidoMaternoField.setEnabled(false);
|
||||||
panel1.add(apellidoMaternoField, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
contentPane.add(apellidoMaternoField,
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
volverButton = new JButton();
|
volverButton = new JButton();
|
||||||
volverButton.setText("Volver");
|
volverButton.setText("Volver");
|
||||||
panel1.add(volverButton,
|
contentPane.add(volverButton, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
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();
|
||||||
panel1.add(spacer1, new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_CENTER,
|
contentPane.add(spacer1,
|
||||||
GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0,
|
new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||||
false));
|
null, null, 0, false));
|
||||||
final Spacer spacer2 = new Spacer();
|
final Spacer spacer2 = new Spacer();
|
||||||
panel1.add(spacer2, new GridConstraints(7, 2, 1, 1, GridConstraints.ANCHOR_CENTER,
|
contentPane.add(spacer2,
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null,
|
new GridConstraints(7, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
0, false));
|
null, null, 0, false));
|
||||||
final Spacer spacer3 = new Spacer();
|
final Spacer spacer3 = new Spacer();
|
||||||
panel1.add(spacer3, new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
|
contentPane.add(spacer3,
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null,
|
new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
0, false));
|
null, null, 0, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user