Cambiado el list a search

This commit is contained in:
Daniel Cortés
2019-05-08 09:25:57 -04:00
parent ffe8d1a337
commit b9dc5f55c9
5 changed files with 28 additions and 28 deletions

View File

@@ -13,7 +13,7 @@ import xyz.danielcortes.controllers.autor.AutorUpdateController;
import xyz.danielcortes.controllers.autor.AutorViewController;
import xyz.danielcortes.controllers.categoria.CategoriaCreateController;
import xyz.danielcortes.controllers.categoria.CategoriaDeleteController;
import xyz.danielcortes.controllers.categoria.CategoriaListController;
import xyz.danielcortes.controllers.categoria.CategoriaSearchController;
import xyz.danielcortes.controllers.categoria.CategoriaUpdateController;
import xyz.danielcortes.controllers.editorial.EditorialCreateController;
import xyz.danielcortes.controllers.editorial.EditorialDeleteController;
@@ -35,7 +35,7 @@ import xyz.danielcortes.views.autor.AutorUpdatePanel;
import xyz.danielcortes.views.autor.AutorViewPanel;
import xyz.danielcortes.views.categoria.CategoriaCreatePanel;
import xyz.danielcortes.views.categoria.CategoriaDeletePanel;
import xyz.danielcortes.views.categoria.CategoriaListPanel;
import xyz.danielcortes.views.categoria.CategoriaSearchPanel;
import xyz.danielcortes.views.categoria.CategoriaUpdatePanel;
import xyz.danielcortes.views.editorial.EditorialCreatePanel;
import xyz.danielcortes.views.editorial.EditorialDeletePanel;
@@ -68,7 +68,7 @@ public class LaunchController {
private void createCards() {
this.frame.addCard(new JPanel(), PanelName.EMPTY);
this.controllers.put(PanelName.LIBRO_LIST, new LibroListController(new LibroListPanel(), this));
this.controllers.put(PanelName.LIBRO_SEARCH, new LibroListController(new LibroListPanel(), 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_DELETE, new LibroDeleteController(new LibroDeletePanel(), this));
@@ -78,17 +78,17 @@ public class LaunchController {
this.controllers.put(PanelName.AUTOR_CREATE, new AutorCreateController(new AutorCreatePanel(), this));
this.controllers.put(PanelName.AUTOR_UPDATE, new AutorUpdateController(new AutorUpdatePanel(), this));
this.controllers.put(PanelName.IDIOMA_LIST, new IdiomaListController(new IdiomaListPanel(), this));
this.controllers.put(PanelName.IDIOMA_SEARCH, new IdiomaListController(new IdiomaListPanel(), this));
this.controllers.put(PanelName.IDIOMA_CREATE, new IdiomaCreateController(new IdiomaCreatePanel(), this));
this.controllers.put(PanelName.IDIOMA_UPDATE, new IdiomaUpdateController(new IdiomaUpdatePanel(), this));
this.controllers.put(PanelName.IDIOMA_DELETE, new IdiomaDeleteController(new IdiomaDeletePanel(), this));
this.controllers.put(PanelName.CATEGORIA_LIST, new CategoriaListController(new CategoriaListPanel(), this));
this.controllers.put(PanelName.CATEGORIA_SEARCH, new CategoriaSearchController(new CategoriaSearchPanel(), this));
this.controllers.put(PanelName.CATEGORIA_CREATE, new CategoriaCreateController(new CategoriaCreatePanel(), this));
this.controllers.put(PanelName.CATEGORIA_DELETE, new CategoriaDeleteController(new CategoriaDeletePanel(), this));
this.controllers.put(PanelName.CATEGORIA_UPDATE, new CategoriaUpdateController(new CategoriaUpdatePanel(), this));
this.controllers.put(PanelName.EDITORIAL_LIST, new EditorialListController(new EditorialListPanel(), this));
this.controllers.put(PanelName.EDITORIAL_SEARCH, new EditorialListController(new EditorialListPanel(), this));
this.controllers.put(PanelName.EDITORIAL_CREATE, new EditorialCreateController(new EditorialCreatePanel(), this));
this.controllers.put(PanelName.EDITORIAL_UPDATE, new EditorialUpdateController(new EditorialUpdatePanel(), this));
this.controllers.put(PanelName.EDITORIAL_DELETE, new EditorialDeleteController(new EditorialDeletePanel(), this));
@@ -109,7 +109,7 @@ public class LaunchController {
//Es una especie de... Builder pobre :3
// @formatter:off
JMenu librosMenu = new JMenu("Libros"); librosMenu.setMnemonic(KeyEvent.VK_L);
JMenuItem libroList = new JMenuItem("Listar"); libroList.setMnemonic(KeyEvent.VK_L);
JMenuItem libroSearch = new JMenuItem("Buscar"); libroSearch.setMnemonic(KeyEvent.VK_B);
JMenuItem libroCreate = new JMenuItem("Crear"); libroCreate.setMnemonic(KeyEvent.VK_C);
JMenuItem libroUpdate= new JMenuItem("Actualizar"); libroUpdate.setMnemonic(KeyEvent.VK_U);
JMenuItem libroDelete = new JMenuItem("Eliminar"); libroDelete.setMnemonic(KeyEvent.VK_E);
@@ -119,19 +119,19 @@ public class LaunchController {
JMenuItem autorCreate = new JMenuItem("Crear"); autorCreate.setMnemonic(KeyEvent.VK_C);
JMenu idiomasMenu = new JMenu("Idiomas"); idiomasMenu.setMnemonic(KeyEvent.VK_I);
JMenuItem idiomaList = new JMenuItem("Listar"); idiomaList.setMnemonic(KeyEvent.VK_L);
JMenuItem idiomaSearch = new JMenuItem("Buscar"); idiomaSearch.setMnemonic(KeyEvent.VK_B);
JMenuItem idiomaCreate = new JMenuItem("Crear"); idiomaCreate.setMnemonic(KeyEvent.VK_C);
JMenuItem idiomaUpdate = new JMenuItem("Actualizar"); idiomaUpdate.setMnemonic(KeyEvent.VK_A);
JMenuItem idiomaDelete = new JMenuItem("Eliminar"); idiomaDelete.setMnemonic(KeyEvent.VK_E);
JMenu categoriasMenu = new JMenu("Categorias"); categoriasMenu.setMnemonic(KeyEvent.VK_C);
JMenuItem categoriaList = new JMenuItem("Listar"); categoriaList.setMnemonic(KeyEvent.VK_L);
JMenuItem categoriaSearch = new JMenuItem("Buscar"); categoriaSearch.setMnemonic(KeyEvent.VK_B);
JMenuItem categoriaCreate = new JMenuItem("Crear"); categoriaCreate.setMnemonic(KeyEvent.VK_C);
JMenuItem categoriaUpdate = new JMenuItem("Actualizar"); categoriaUpdate.setMnemonic(KeyEvent.VK_A);
JMenuItem categoriaDelete = new JMenuItem("Eliminar"); categoriaDelete.setMnemonic(KeyEvent.VK_E);
JMenu editorialesMenu = new JMenu("Editoriales"); editorialesMenu.setMnemonic(KeyEvent.VK_E);
JMenuItem editorialList= new JMenuItem("Listar"); editorialList.setMnemonic(KeyEvent.VK_L);
JMenuItem editorialSearch= new JMenuItem("Buscar"); editorialSearch.setMnemonic(KeyEvent.VK_B);
JMenuItem editorialCreate= new JMenuItem("Crear"); editorialCreate.setMnemonic(KeyEvent.VK_C);
JMenuItem editorialUpdate = new JMenuItem("Actualizar"); editorialUpdate.setMnemonic(KeyEvent.VK_A);
JMenuItem editorialDelete = new JMenuItem("Eliminar"); editorialDelete.setMnemonic(KeyEvent.VK_E);
@@ -140,28 +140,28 @@ public class LaunchController {
autorSearch.addActionListener(e -> this.showCard(PanelName.AUTOR_SEARCH));
autorCreate.addActionListener(e -> this.showCard(PanelName.AUTOR_CREATE));
idiomaList.addActionListener(e -> this.showCard(PanelName.IDIOMA_LIST));
idiomaSearch.addActionListener(e -> this.showCard(PanelName.IDIOMA_SEARCH));
idiomaCreate.addActionListener(e -> this.showCard(PanelName.IDIOMA_CREATE));
idiomaUpdate.addActionListener(e -> this.showCard(PanelName.IDIOMA_UPDATE));
idiomaDelete.addActionListener(e -> this.showCard(PanelName.IDIOMA_DELETE));
libroList.addActionListener(e -> this.showCard(PanelName.LIBRO_LIST));
libroSearch.addActionListener(e -> this.showCard(PanelName.LIBRO_SEARCH));
libroCreate.addActionListener(e -> this.showCard(PanelName.LIBRO_CREATE));
libroUpdate.addActionListener(e -> this.showCard(PanelName.LIBRO_UPDATE));
libroDelete.addActionListener(e -> this.showCard(PanelName.LIBRO_DELETE));
categoriaList.addActionListener(e -> this.showCard(PanelName.CATEGORIA_LIST));
categoriaSearch.addActionListener(e -> this.showCard(PanelName.CATEGORIA_SEARCH));
categoriaCreate.addActionListener(e -> this.showCard(PanelName.CATEGORIA_CREATE));
categoriaUpdate.addActionListener(e -> this.showCard(PanelName.CATEGORIA_UPDATE));
categoriaDelete.addActionListener(e -> this.showCard(PanelName.CATEGORIA_DELETE));
editorialList.addActionListener(e -> this.showCard(PanelName.EDITORIAL_LIST));
editorialSearch.addActionListener(e -> this.showCard(PanelName.EDITORIAL_SEARCH));
editorialCreate.addActionListener(e -> this.showCard(PanelName.EDITORIAL_CREATE));
editorialUpdate.addActionListener(e -> this.showCard(PanelName.EDITORIAL_UPDATE));
editorialDelete.addActionListener(e -> this.showCard(PanelName.EDITORIAL_DELETE));
menuBar.add(librosMenu);
librosMenu.add(libroList);
librosMenu.add(libroSearch);
librosMenu.add(libroCreate);
librosMenu.add(libroUpdate);
librosMenu.add(libroDelete);
@@ -171,19 +171,19 @@ public class LaunchController {
autoresMenu.add(autorCreate);
menuBar.add(idiomasMenu);
idiomasMenu.add(idiomaList);
idiomasMenu.add(idiomaSearch);
idiomasMenu.add(idiomaCreate);
idiomasMenu.add(idiomaUpdate);
idiomasMenu.add(idiomaDelete);
menuBar.add(categoriasMenu);
categoriasMenu.add(categoriaList);
categoriasMenu.add(categoriaSearch);
categoriasMenu.add(categoriaCreate);
categoriasMenu.add(categoriaUpdate);
categoriasMenu.add(categoriaDelete);
menuBar.add(editorialesMenu);
editorialesMenu.add(editorialList);
editorialesMenu.add(editorialSearch);
editorialesMenu.add(editorialCreate);
editorialesMenu.add(editorialUpdate);
editorialesMenu.add(editorialDelete);

View File

@@ -7,13 +7,13 @@ import xyz.danielcortes.framework.BaseTableModel;
import xyz.danielcortes.models.Categoria;
import xyz.danielcortes.repository.CategoriaRepository;
import xyz.danielcortes.views.BasePanel;
import xyz.danielcortes.views.categoria.CategoriaListPanel;
import xyz.danielcortes.views.categoria.CategoriaSearchPanel;
public class CategoriaListController extends BaseController {
public class CategoriaSearchController extends BaseController {
private CategoriaRepository categoriaRepository;
private CategoriaListPanel view;
private CategoriaSearchPanel view;
public CategoriaListController (CategoriaListPanel view, LaunchController parent) {
public CategoriaSearchController(CategoriaSearchPanel view, LaunchController parent) {
super(parent);
this.view = view;
this.categoriaRepository = new CategoriaRepository();

View File

@@ -3,22 +3,22 @@ package xyz.danielcortes.framework;
public enum PanelName {
EMPTY,
LIBRO_LIST,
LIBRO_SEARCH,
LIBRO_CREATE,
LIBRO_UPDATE,
LIBRO_DELETE,
IDIOMA_LIST,
IDIOMA_SEARCH,
IDIOMA_CREATE,
IDIOMA_UPDATE,
IDIOMA_DELETE,
CATEGORIA_LIST,
CATEGORIA_SEARCH,
CATEGORIA_CREATE,
CATEGORIA_UPDATE,
CATEGORIA_DELETE,
EDITORIAL_LIST,
EDITORIAL_SEARCH,
EDITORIAL_CREATE,
EDITORIAL_UPDATE,
EDITORIAL_DELETE,

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.categoria.CategoriaListPanel">
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.categoria.CategoriaSearchPanel">
<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="20" left="20" bottom="20" right="20"/>
<constraints>

View File

@@ -12,7 +12,7 @@ import xyz.danielcortes.framework.BaseTableModel;
import xyz.danielcortes.models.Categoria;
import xyz.danielcortes.views.BasePanel;
public class CategoriaListPanel extends BasePanel {
public class CategoriaSearchPanel extends BasePanel {
private JPanel contentPane;
private JTable categoriaTable;