Se actualizaron los paneles del idioma
estan wonitas falta solo la de los libros <3
This commit is contained in:
@@ -20,8 +20,9 @@ import xyz.danielcortes.controllers.editorial.EditorialSearchController;
|
|||||||
import xyz.danielcortes.controllers.editorial.EditorialUpdateController;
|
import xyz.danielcortes.controllers.editorial.EditorialUpdateController;
|
||||||
import xyz.danielcortes.controllers.editorial.EditorialViewController;
|
import xyz.danielcortes.controllers.editorial.EditorialViewController;
|
||||||
import xyz.danielcortes.controllers.idioma.IdiomaCreateController;
|
import xyz.danielcortes.controllers.idioma.IdiomaCreateController;
|
||||||
import xyz.danielcortes.controllers.idioma.IdiomaListController;
|
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.libro.LibroCreateController;
|
import xyz.danielcortes.controllers.libro.LibroCreateController;
|
||||||
import xyz.danielcortes.controllers.libro.LibroListController;
|
import xyz.danielcortes.controllers.libro.LibroListController;
|
||||||
import xyz.danielcortes.controllers.libro.LibroUpdateController;
|
import xyz.danielcortes.controllers.libro.LibroUpdateController;
|
||||||
@@ -40,8 +41,9 @@ import xyz.danielcortes.views.editorial.EditorialSearchPanel;
|
|||||||
import xyz.danielcortes.views.editorial.EditorialUpdatePanel;
|
import xyz.danielcortes.views.editorial.EditorialUpdatePanel;
|
||||||
import xyz.danielcortes.views.editorial.EditorialViewPanel;
|
import xyz.danielcortes.views.editorial.EditorialViewPanel;
|
||||||
import xyz.danielcortes.views.idioma.IdiomaCreatePanel;
|
import xyz.danielcortes.views.idioma.IdiomaCreatePanel;
|
||||||
import xyz.danielcortes.views.idioma.IdiomaListPanel;
|
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.libro.LibroCreatePanel;
|
import xyz.danielcortes.views.libro.LibroCreatePanel;
|
||||||
import xyz.danielcortes.views.libro.LibroListPanel;
|
import xyz.danielcortes.views.libro.LibroListPanel;
|
||||||
import xyz.danielcortes.views.libro.LibroUpdatePanel;
|
import xyz.danielcortes.views.libro.LibroUpdatePanel;
|
||||||
@@ -73,7 +75,8 @@ public class LaunchController {
|
|||||||
this.controllers.put(PanelName.AUTOR_CREATE, new AutorCreateController(new AutorCreatePanel(), this));
|
this.controllers.put(PanelName.AUTOR_CREATE, new AutorCreateController(new AutorCreatePanel(), this));
|
||||||
this.controllers.put(PanelName.AUTOR_UPDATE, new AutorUpdateController(new AutorUpdatePanel(), this));
|
this.controllers.put(PanelName.AUTOR_UPDATE, new AutorUpdateController(new AutorUpdatePanel(), this));
|
||||||
|
|
||||||
this.controllers.put(PanelName.IDIOMA_SEARCH, new IdiomaListController(new IdiomaListPanel(), this));
|
this.controllers.put(PanelName.IDIOMA_VIEW, new IdiomaViewController(new IdiomaViewPanel(), this));
|
||||||
|
this.controllers.put(PanelName.IDIOMA_SEARCH, new IdiomaSearchController(new IdiomaSearchPanel(), this));
|
||||||
this.controllers.put(PanelName.IDIOMA_CREATE, new IdiomaCreateController(new IdiomaCreatePanel(), 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_UPDATE, new IdiomaUpdateController(new IdiomaUpdatePanel(), this));
|
||||||
|
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
package xyz.danielcortes.controllers.idioma;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import xyz.danielcortes.controllers.BaseController;
|
|
||||||
import xyz.danielcortes.controllers.LaunchController;
|
|
||||||
import xyz.danielcortes.framework.BaseTableModel;
|
|
||||||
import xyz.danielcortes.models.Idioma;
|
|
||||||
import xyz.danielcortes.repository.IdiomaRepository;
|
|
||||||
import xyz.danielcortes.views.BasePanel;
|
|
||||||
import xyz.danielcortes.views.idioma.IdiomaListPanel;
|
|
||||||
|
|
||||||
public class IdiomaListController extends BaseController {
|
|
||||||
|
|
||||||
private IdiomaListPanel view;
|
|
||||||
private IdiomaRepository idiomaRepository;
|
|
||||||
|
|
||||||
public IdiomaListController(IdiomaListPanel view, LaunchController parent) {
|
|
||||||
super(parent);
|
|
||||||
this.view = view;
|
|
||||||
this.idiomaRepository = new IdiomaRepository();
|
|
||||||
this.loadIdiomaTable();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void show() {
|
|
||||||
this.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void reload() {
|
|
||||||
this.loadIdiomaTable();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadIdiomaTable() {
|
|
||||||
List<Idioma> idiomas = this.idiomaRepository.getAll();
|
|
||||||
BaseTableModel<Idioma> model = this.view.getIdiomaTableModel();
|
|
||||||
model.setRows(idiomas);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BasePanel getView() {
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
package xyz.danielcortes.controllers.idioma;
|
||||||
|
|
||||||
|
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.Idioma;
|
||||||
|
import xyz.danielcortes.repository.IdiomaRepository;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
|
import xyz.danielcortes.views.idioma.IdiomaSearchPanel;
|
||||||
|
|
||||||
|
public class IdiomaSearchController extends BaseController {
|
||||||
|
|
||||||
|
private IdiomaSearchPanel view;
|
||||||
|
private IdiomaRepository idiomaRepository;
|
||||||
|
private IdiomaValidator validator;
|
||||||
|
|
||||||
|
public IdiomaSearchController(IdiomaSearchPanel view, LaunchController parent) {
|
||||||
|
super(parent);
|
||||||
|
this.view = view;
|
||||||
|
this.idiomaRepository = new IdiomaRepository();
|
||||||
|
this.validator = new IdiomaValidator(this.idiomaRepository);
|
||||||
|
this.loadIdiomaTable();
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show() {
|
||||||
|
this.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reload() {
|
||||||
|
this.loadIdiomaTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
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() {
|
||||||
|
Idioma idioma = this.getSelectedIdioma();
|
||||||
|
if(idioma != null) {
|
||||||
|
IdiomaViewController controller = (IdiomaViewController) this.getParentController().getCard(PanelName.IDIOMA_VIEW);
|
||||||
|
controller.setIdioma(idioma);
|
||||||
|
this.getParentController().showCard(PanelName.IDIOMA_VIEW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void edit() {
|
||||||
|
Idioma idioma = this.getSelectedIdioma();
|
||||||
|
if(idioma != null){
|
||||||
|
IdiomaUpdateController controller = (IdiomaUpdateController) this.getParentController().getCard(PanelName.IDIOMA_UPDATE);
|
||||||
|
controller.setIdioma(idioma);
|
||||||
|
this.getParentController().showCard(PanelName.IDIOMA_UPDATE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void delete() {
|
||||||
|
Idioma idioma = this.getSelectedIdioma();
|
||||||
|
if(idioma == null)
|
||||||
|
return;
|
||||||
|
if(!this.validator.isDeleteable(idioma))
|
||||||
|
return;
|
||||||
|
|
||||||
|
int option = JOptionPane.showConfirmDialog(
|
||||||
|
null,
|
||||||
|
"¿Estas seguro de que deseas eliminar el idioma?",
|
||||||
|
"Confirmacion",
|
||||||
|
JOptionPane.YES_NO_OPTION,
|
||||||
|
JOptionPane.QUESTION_MESSAGE
|
||||||
|
);
|
||||||
|
if (option == JOptionPane.NO_OPTION)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.idiomaRepository.delete(idioma);
|
||||||
|
this.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void search(){
|
||||||
|
String term = this.view.getBuscarField().getText();
|
||||||
|
List<Idioma> idiomas = this.idiomaRepository.search(term);
|
||||||
|
this.loadIdiomaTable(idiomas);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadIdiomaTable(List<Idioma> idiomas){
|
||||||
|
BaseTableModel<Idioma> model = this.view.getIdiomaTableModel();
|
||||||
|
model.setRows(idiomas);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadIdiomaTable() {
|
||||||
|
List<Idioma> idiomas = this.idiomaRepository.getAll();
|
||||||
|
loadIdiomaTable(idiomas);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasePanel getView() {
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Idioma getSelectedIdioma() {
|
||||||
|
int selectedRow = this.view.getIdiomaTable().getSelectedRow();
|
||||||
|
if (selectedRow == -1) {
|
||||||
|
JOptionPane.showMessageDialog(
|
||||||
|
null,
|
||||||
|
"No hay Idioma seleccionado",
|
||||||
|
"Error",
|
||||||
|
JOptionPane.ERROR_MESSAGE
|
||||||
|
);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return this.view.getIdiomaTableModel().getRow(selectedRow);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
package xyz.danielcortes.controllers.idioma;
|
package xyz.danielcortes.controllers.idioma;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
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.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.BasePanel;
|
||||||
@@ -14,6 +13,7 @@ public class IdiomaUpdateController extends BaseController {
|
|||||||
private IdiomaUpdatePanel view;
|
private IdiomaUpdatePanel view;
|
||||||
private IdiomaRepository idiomaRepository;
|
private IdiomaRepository idiomaRepository;
|
||||||
private IdiomaValidator validator;
|
private IdiomaValidator validator;
|
||||||
|
private Idioma idioma;
|
||||||
|
|
||||||
public IdiomaUpdateController(IdiomaUpdatePanel view, LaunchController parent) {
|
public IdiomaUpdateController(IdiomaUpdatePanel view, LaunchController parent) {
|
||||||
super(parent);
|
super(parent);
|
||||||
@@ -25,51 +25,40 @@ public class IdiomaUpdateController extends BaseController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void show() {
|
public void show() {
|
||||||
this.reload();
|
if(this.idioma == null)
|
||||||
this.view.getIdiomaCombo().requestFocus();
|
return;
|
||||||
|
|
||||||
|
this.fillIdioma();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fillIdioma(){
|
||||||
|
this.view.getNombreField().setText(this.idioma.getNombre());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupListeners() {
|
private void setupListeners() {
|
||||||
this.view.getIdiomaCombo().addActionListener(e -> {
|
|
||||||
Idioma selected = (Idioma) this.view.getIdiomaCombo().getSelectedItem();
|
|
||||||
if(selected != null)
|
|
||||||
this.view.getNombreField().setText(selected.getNombre());
|
|
||||||
});
|
|
||||||
this.view.getNombreField().addActionListener(e -> this.update());
|
this.view.getNombreField().addActionListener(e -> this.update());
|
||||||
this.view.getActualizarButton().addActionListener(e -> this.update());
|
this.view.getActualizarButton().addActionListener(e -> this.update());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void update() {
|
private void update() {
|
||||||
Idioma original = (Idioma) this.view.getIdiomaCombo().getSelectedItem();
|
if (!this.validator.validateOriginal(this.idioma)) return;
|
||||||
if (!this.validator.validateOriginal(original)) return;
|
|
||||||
|
|
||||||
String nombre = this.view.getNombreField().getText();
|
String nombre = this.view.getNombreField().getText();
|
||||||
if (!this.validator.validateNombre(nombre)) return;
|
if (!this.validator.validateNombre(nombre)) return;
|
||||||
|
|
||||||
assert original != null;
|
assert this.idioma != null;
|
||||||
original.setNombre(nombre);
|
this.idioma.setNombre(nombre);
|
||||||
idiomaRepository.update(original);
|
idiomaRepository.update(this.idioma);
|
||||||
|
|
||||||
this.view.getNombreField().setText("");
|
this.view.getNombreField().setText("");
|
||||||
this.loadIdiomaCombo();
|
this.getParentController().showCard(PanelName.IDIOMA_SEARCH);
|
||||||
this.view.getNombreField().requestFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void reload() {
|
|
||||||
this.loadIdiomaCombo();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadIdiomaCombo() {
|
|
||||||
List<Idioma> idiomas = this.idiomaRepository.getAll();
|
|
||||||
JComboBox<Idioma> combobox = this.view.getIdiomaCombo();
|
|
||||||
combobox.removeAllItems();
|
|
||||||
for (Idioma idioma : idiomas) {
|
|
||||||
combobox.addItem(idioma);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BasePanel getView() {
|
public BasePanel getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setIdioma(Idioma idioma) {
|
||||||
|
this.idioma = idioma;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,5 +45,17 @@ public class IdiomaValidator {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isDeleteable(Idioma idioma){
|
||||||
|
if(idioma.getLibros().size() > 0){
|
||||||
|
JOptionPane.showMessageDialog(
|
||||||
|
null,
|
||||||
|
"No se puede eliminar el idioma ya que tiene libros asociados",
|
||||||
|
"Error",
|
||||||
|
JOptionPane.ERROR_MESSAGE
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package xyz.danielcortes.controllers.idioma;
|
||||||
|
|
||||||
|
import xyz.danielcortes.controllers.BaseController;
|
||||||
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
|
import xyz.danielcortes.models.Idioma;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
|
import xyz.danielcortes.views.idioma.IdiomaViewPanel;
|
||||||
|
|
||||||
|
public class IdiomaViewController extends BaseController {
|
||||||
|
|
||||||
|
private Idioma idioma;
|
||||||
|
private IdiomaViewPanel view;
|
||||||
|
|
||||||
|
public IdiomaViewController(IdiomaViewPanel view, LaunchController parent) {
|
||||||
|
super(parent);
|
||||||
|
this.view = view;
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show() {
|
||||||
|
this.fillIdioma();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdioma(Idioma idioma) {
|
||||||
|
this.idioma = idioma;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getVolverButton().addActionListener(e -> {
|
||||||
|
this.getParentController().showCard(PanelName.IDIOMA_SEARCH);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fillIdioma() {
|
||||||
|
if (idioma == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.view.getNombreField().setText(this.idioma.getNombre());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BasePanel getView() {
|
||||||
|
return this.view;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,10 +3,12 @@ package xyz.danielcortes.framework;
|
|||||||
public enum PanelName {
|
public enum PanelName {
|
||||||
EMPTY,
|
EMPTY,
|
||||||
|
|
||||||
|
LIBRO_VIEW,
|
||||||
LIBRO_SEARCH,
|
LIBRO_SEARCH,
|
||||||
LIBRO_CREATE,
|
LIBRO_CREATE,
|
||||||
LIBRO_UPDATE,
|
LIBRO_UPDATE,
|
||||||
|
|
||||||
|
IDIOMA_VIEW,
|
||||||
IDIOMA_SEARCH,
|
IDIOMA_SEARCH,
|
||||||
IDIOMA_CREATE,
|
IDIOMA_CREATE,
|
||||||
IDIOMA_UPDATE,
|
IDIOMA_UPDATE,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package xyz.danielcortes.views;
|
package xyz.danielcortes.views;
|
||||||
|
|
||||||
import java.awt.CardLayout;
|
import java.awt.CardLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
@@ -8,9 +9,12 @@ import javax.swing.WindowConstants;
|
|||||||
import xyz.danielcortes.framework.PanelName;
|
import xyz.danielcortes.framework.PanelName;
|
||||||
|
|
||||||
public class LaunchFrame extends JFrame {
|
public class LaunchFrame extends JFrame {
|
||||||
|
private Dimension dimension;
|
||||||
|
|
||||||
public LaunchFrame() {
|
public LaunchFrame() {
|
||||||
this.setSize(800, 600);
|
this.dimension = new Dimension(800, 600);
|
||||||
|
this.setSize(this.dimension);
|
||||||
|
this.setMinimumSize(this.dimension);
|
||||||
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||||
this.setLocationRelativeTo(null);
|
this.setLocationRelativeTo(null);
|
||||||
this.setupCardPanel();
|
this.setupCardPanel();
|
||||||
|
|||||||
@@ -1,103 +0,0 @@
|
|||||||
package xyz.danielcortes.views.idioma;
|
|
||||||
|
|
||||||
import com.intellij.uiDesigner.core.GridConstraints;
|
|
||||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
|
||||||
import com.intellij.uiDesigner.core.Spacer;
|
|
||||||
import java.awt.Dimension;
|
|
||||||
import java.awt.Insets;
|
|
||||||
import javax.swing.DefaultComboBoxModel;
|
|
||||||
import javax.swing.JButton;
|
|
||||||
import javax.swing.JComboBox;
|
|
||||||
import javax.swing.JComponent;
|
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import xyz.danielcortes.models.Idioma;
|
|
||||||
import xyz.danielcortes.views.BasePanel;
|
|
||||||
|
|
||||||
public class IdiomaDeletePanel extends BasePanel {
|
|
||||||
|
|
||||||
private JPanel contentPane;
|
|
||||||
private JButton eliminarButton;
|
|
||||||
private JComboBox<Idioma> idiomaCombo;
|
|
||||||
private DefaultComboBoxModel<Idioma> idiomaModel;
|
|
||||||
|
|
||||||
public JPanel getContentPane() {
|
|
||||||
return contentPane;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JButton getEliminarButton() {
|
|
||||||
return eliminarButton;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JComboBox<Idioma> getIdiomaCombo() {
|
|
||||||
return idiomaCombo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DefaultComboBoxModel<Idioma> getIdiomaModel() {
|
|
||||||
return idiomaModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
|
||||||
// >>> IMPORTANT!! <<<
|
|
||||||
// DO NOT EDIT OR ADD ANY CODE HERE!
|
|
||||||
$$$setupUI$$$();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR
|
|
||||||
* call it in your code!
|
|
||||||
*
|
|
||||||
* @noinspection ALL
|
|
||||||
*/
|
|
||||||
private void $$$setupUI$$$() {
|
|
||||||
createUIComponents();
|
|
||||||
contentPane = new JPanel();
|
|
||||||
contentPane.setLayout(new GridLayoutManager(4, 3, new Insets(20, 20, 20, 20), -1, -1));
|
|
||||||
final DefaultComboBoxModel defaultComboBoxModel1 = new DefaultComboBoxModel();
|
|
||||||
idiomaCombo.setModel(defaultComboBoxModel1);
|
|
||||||
contentPane.add(idiomaCombo, 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));
|
|
||||||
eliminarButton = new JButton();
|
|
||||||
eliminarButton.setText("Eliminar");
|
|
||||||
contentPane.add(eliminarButton,
|
|
||||||
new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
|
||||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
|
||||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
|
||||||
final Spacer spacer1 = new Spacer();
|
|
||||||
contentPane.add(spacer1, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER,
|
|
||||||
GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0,
|
|
||||||
false));
|
|
||||||
final Spacer spacer2 = new Spacer();
|
|
||||||
contentPane.add(spacer2, new GridConstraints(3, 2, 1, 1, GridConstraints.ANCHOR_CENTER,
|
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null,
|
|
||||||
0, false));
|
|
||||||
final Spacer spacer3 = new Spacer();
|
|
||||||
contentPane.add(spacer3, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
|
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null,
|
|
||||||
0, false));
|
|
||||||
final JLabel label1 = new JLabel();
|
|
||||||
label1.setText("Idioma:");
|
|
||||||
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @noinspection ALL
|
|
||||||
*/
|
|
||||||
public JComponent $$$getRootComponent$$$() {
|
|
||||||
return contentPane;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createUIComponents() {
|
|
||||||
this.createIdiomaCombo();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createIdiomaCombo() {
|
|
||||||
idiomaModel = new DefaultComboBoxModel<>();
|
|
||||||
idiomaCombo = new JComboBox<>(idiomaModel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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.idioma.IdiomaListPanel">
|
|
||||||
<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>
|
|
||||||
<xy x="20" y="20" width="500" height="400"/>
|
|
||||||
</constraints>
|
|
||||||
<properties/>
|
|
||||||
<border type="none"/>
|
|
||||||
<children>
|
|
||||||
<scrollpane id="ec841">
|
|
||||||
<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="71e3b" class="javax.swing.JTable" binding="idiomaTable" custom-create="true">
|
|
||||||
<constraints/>
|
|
||||||
<properties/>
|
|
||||||
</component>
|
|
||||||
</children>
|
|
||||||
</scrollpane>
|
|
||||||
</children>
|
|
||||||
</grid>
|
|
||||||
</form>
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
package xyz.danielcortes.views.idioma;
|
|
||||||
|
|
||||||
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.Idioma;
|
|
||||||
import xyz.danielcortes.views.BasePanel;
|
|
||||||
|
|
||||||
public class IdiomaListPanel extends BasePanel {
|
|
||||||
|
|
||||||
private JPanel contentPane;
|
|
||||||
private JTable idiomaTable;
|
|
||||||
private BaseTableModel<Idioma> idiomaTableModel;
|
|
||||||
|
|
||||||
public JPanel getContentPane() {
|
|
||||||
return contentPane;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JTable getIdiomaTable() {
|
|
||||||
return idiomaTable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BaseTableModel<Idioma> getIdiomaTableModel() {
|
|
||||||
return idiomaTableModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
// 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(20, 20, 20, 20), -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(idiomaTable);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @noinspection ALL
|
|
||||||
*/
|
|
||||||
public JComponent $$$getRootComponent$$$() {
|
|
||||||
return contentPane;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createUIComponents() {
|
|
||||||
this.createIdiomaTable();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createIdiomaTable() {
|
|
||||||
// @formatter:off
|
|
||||||
this.idiomaTableModel = new BaseTableModel<>(
|
|
||||||
new String[]{"Nombre", "Nº Libros"},
|
|
||||||
(row, rowIndex, colIndex) -> {
|
|
||||||
switch (colIndex) {
|
|
||||||
case 0: return row.get(rowIndex).getNombre();
|
|
||||||
case 1: return row.get(rowIndex).getLibros().size();
|
|
||||||
default: return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
// @formatter:on
|
|
||||||
this.idiomaTable = new JTable(this.idiomaTableModel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.idioma.IdiomaSearchPanel">
|
||||||
|
<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="20" left="20" bottom="20" right="20"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="500" height="400"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<scrollpane id="ec841">
|
||||||
|
<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="71e3b" class="javax.swing.JTable" binding="idiomaTable" custom-create="true">
|
||||||
|
<constraints/>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</scrollpane>
|
||||||
|
<grid id="9441d" 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="a29f8" 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="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Buscar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="97bf7" 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>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
<grid id="9ab80" 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="92d7b" 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="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Ver"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="1b94e" 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="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Editar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="8c8" 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="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Eliminar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,146 @@
|
|||||||
|
package xyz.danielcortes.views.idioma;
|
||||||
|
|
||||||
|
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.Idioma;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
|
|
||||||
|
public class IdiomaSearchPanel extends BasePanel {
|
||||||
|
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JTable idiomaTable;
|
||||||
|
private JButton buscarButton;
|
||||||
|
private JTextField buscarField;
|
||||||
|
private JButton verButton;
|
||||||
|
private JButton editarButton;
|
||||||
|
private JButton eliminarButton;
|
||||||
|
private BaseTableModel<Idioma> idiomaTableModel;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTable getIdiomaTable() {
|
||||||
|
return idiomaTable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getBuscarButton() {
|
||||||
|
return buscarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getBuscarField() {
|
||||||
|
return buscarField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getVerButton() {
|
||||||
|
return verButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getEditarButton() {
|
||||||
|
return editarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getEliminarButton() {
|
||||||
|
return eliminarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BaseTableModel<Idioma> getIdiomaTableModel() {
|
||||||
|
return idiomaTableModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// 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(20, 20, 20, 20), -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(idiomaTable);
|
||||||
|
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));
|
||||||
|
buscarButton = new JButton();
|
||||||
|
buscarButton.setText("Buscar");
|
||||||
|
panel1.add(buscarButton, new GridConstraints(0, 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));
|
||||||
|
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));
|
||||||
|
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_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
editarButton = new JButton();
|
||||||
|
editarButton.setText("Editar");
|
||||||
|
panel2.add(editarButton, new GridConstraints(0, 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));
|
||||||
|
eliminarButton = new JButton();
|
||||||
|
eliminarButton.setText("Eliminar");
|
||||||
|
panel2.add(eliminarButton, new GridConstraints(0, 2, 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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createUIComponents() {
|
||||||
|
this.createIdiomaTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createIdiomaTable() {
|
||||||
|
// @formatter:off
|
||||||
|
this.idiomaTableModel = new BaseTableModel<>(
|
||||||
|
new String[]{"Nombre", "Nº Libros"},
|
||||||
|
(row, rowIndex, colIndex) -> {
|
||||||
|
switch (colIndex) {
|
||||||
|
case 0: return row.get(rowIndex).getNombre();
|
||||||
|
case 1: return row.get(rowIndex).getLibros().size();
|
||||||
|
default: return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
// @formatter:on
|
||||||
|
this.idiomaTable = new JTable(this.idiomaTableModel);
|
||||||
|
this.idiomaTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,22 +1,14 @@
|
|||||||
<?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.idioma.IdiomaUpdatePanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.idioma.IdiomaUpdatePanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="6" 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="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="20" left="20" bottom="20" right="20"/>
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<xy x="20" y="20" width="484" height="214"/>
|
<xy x="20" y="20" width="484" height="154"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
<border type="none"/>
|
<border type="none"/>
|
||||||
<children>
|
<children>
|
||||||
<component id="44830" class="javax.swing.JTextField" binding="nombreField">
|
<component id="44830" class="javax.swing.JTextField" binding="nombreField">
|
||||||
<constraints>
|
|
||||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
|
||||||
<preferred-size width="400" height="-1"/>
|
|
||||||
</grid>
|
|
||||||
</constraints>
|
|
||||||
<properties/>
|
|
||||||
</component>
|
|
||||||
<component id="d39d0" class="javax.swing.JComboBox" binding="idiomaCombo" custom-create="true">
|
|
||||||
<constraints>
|
<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">
|
<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"/>
|
||||||
@@ -26,38 +18,30 @@
|
|||||||
</component>
|
</component>
|
||||||
<vspacer id="510ce">
|
<vspacer id="510ce">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="5" 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="3" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
</vspacer>
|
</vspacer>
|
||||||
<hspacer id="244db">
|
<hspacer id="244db">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="5" 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="3" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
</hspacer>
|
</hspacer>
|
||||||
<hspacer id="f5ea0">
|
<hspacer id="f5ea0">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="5" 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="3" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
</hspacer>
|
</hspacer>
|
||||||
<component id="e80d1" class="javax.swing.JButton" binding="actualizarButton" default-binding="true">
|
<component id="e80d1" class="javax.swing.JButton" binding="actualizarButton" default-binding="true">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="4" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="2" column="0" row-span="1" col-span="3" 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"/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
<component id="3713c" 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="Original:"/>
|
|
||||||
</properties>
|
|
||||||
</component>
|
|
||||||
<component id="5cc79" class="javax.swing.JLabel">
|
<component id="5cc79" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<text value="Nombre:"/>
|
<text value="Nombre:"/>
|
||||||
|
|||||||
@@ -5,22 +5,17 @@ import com.intellij.uiDesigner.core.GridLayoutManager;
|
|||||||
import com.intellij.uiDesigner.core.Spacer;
|
import com.intellij.uiDesigner.core.Spacer;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Insets;
|
import java.awt.Insets;
|
||||||
import javax.swing.DefaultComboBoxModel;
|
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JComboBox;
|
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JTextField;
|
import javax.swing.JTextField;
|
||||||
import xyz.danielcortes.models.Idioma;
|
|
||||||
import xyz.danielcortes.views.BasePanel;
|
import xyz.danielcortes.views.BasePanel;
|
||||||
|
|
||||||
public class IdiomaUpdatePanel extends BasePanel {
|
public class IdiomaUpdatePanel extends BasePanel {
|
||||||
|
|
||||||
private JPanel contentPane;
|
private JPanel contentPane;
|
||||||
private JTextField nombreField;
|
private JTextField nombreField;
|
||||||
private JComboBox<Idioma> idiomaCombo;
|
|
||||||
private DefaultComboBoxModel<Idioma> idiomaModel;
|
|
||||||
private JButton actualizarButton;
|
private JButton actualizarButton;
|
||||||
|
|
||||||
public JPanel getContentPane() {
|
public JPanel getContentPane() {
|
||||||
@@ -31,14 +26,6 @@ public class IdiomaUpdatePanel extends BasePanel {
|
|||||||
return nombreField;
|
return nombreField;
|
||||||
}
|
}
|
||||||
|
|
||||||
public JComboBox<Idioma> getIdiomaCombo() {
|
|
||||||
return idiomaCombo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DefaultComboBoxModel<Idioma> getIdiomaModel() {
|
|
||||||
return idiomaModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JButton getActualizarButton() {
|
public JButton getActualizarButton() {
|
||||||
return actualizarButton;
|
return actualizarButton;
|
||||||
}
|
}
|
||||||
@@ -51,52 +38,37 @@ public class IdiomaUpdatePanel extends BasePanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR
|
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
|
||||||
* call it in your code!
|
|
||||||
*
|
*
|
||||||
* @noinspection ALL
|
* @noinspection ALL
|
||||||
*/
|
*/
|
||||||
private void $$$setupUI$$$() {
|
private void $$$setupUI$$$() {
|
||||||
createUIComponents();
|
|
||||||
contentPane = new JPanel();
|
contentPane = new JPanel();
|
||||||
contentPane.setLayout(new GridLayoutManager(6, 3, new Insets(20, 20, 20, 20), -1, -1));
|
contentPane.setLayout(new GridLayoutManager(4, 3, new Insets(20, 20, 20, 20), -1, -1));
|
||||||
nombreField = new JTextField();
|
nombreField = new JTextField();
|
||||||
contentPane.add(nombreField, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
contentPane.add(nombreField,
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
contentPane.add(idiomaCombo, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST,
|
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
|
||||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
|
||||||
final Spacer spacer1 = new Spacer();
|
final Spacer spacer1 = new Spacer();
|
||||||
contentPane.add(spacer1, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_CENTER,
|
contentPane.add(spacer1,
|
||||||
GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0,
|
new GridConstraints(3, 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(5, 2, 1, 1, GridConstraints.ANCHOR_CENTER,
|
contentPane.add(spacer2,
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null,
|
new GridConstraints(3, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
0, false));
|
null, null, 0, false));
|
||||||
final Spacer spacer3 = new Spacer();
|
final Spacer spacer3 = new Spacer();
|
||||||
contentPane.add(spacer3, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
|
contentPane.add(spacer3,
|
||||||
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null,
|
new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
0, false));
|
null, null, 0, false));
|
||||||
actualizarButton = new JButton();
|
actualizarButton = new JButton();
|
||||||
actualizarButton.setText("Actualizar");
|
actualizarButton.setText("Actualizar");
|
||||||
contentPane.add(actualizarButton,
|
contentPane.add(actualizarButton, new GridConstraints(2, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
new GridConstraints(4, 0, 1, 3, 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 JLabel label1 = new JLabel();
|
final JLabel label1 = new JLabel();
|
||||||
label1.setText("Original:");
|
label1.setText("Nombre:");
|
||||||
contentPane.add(label1,
|
contentPane.add(label1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
|
|
||||||
false));
|
|
||||||
final JLabel label2 = new JLabel();
|
|
||||||
label2.setText("Nombre:");
|
|
||||||
contentPane.add(label2,
|
|
||||||
new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
|
||||||
GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
|
|
||||||
false));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -106,12 +78,4 @@ public class IdiomaUpdatePanel extends BasePanel {
|
|||||||
return contentPane;
|
return contentPane;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createUIComponents() {
|
|
||||||
this.createIdiomaCombo();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createIdiomaCombo() {
|
|
||||||
idiomaModel = new DefaultComboBoxModel<>();
|
|
||||||
idiomaCombo = new JComboBox<>(idiomaModel);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,54 +1,57 @@
|
|||||||
<?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.idioma.IdiomaDeletePanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.idioma.IdiomaViewPanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="20" left="20" bottom="20" right="20"/>
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<xy x="20" y="20" width="484" height="154"/>
|
<xy x="20" y="20" width="500" height="400"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
<border type="none"/>
|
<border type="none"/>
|
||||||
<children>
|
<children>
|
||||||
<component id="94347" class="javax.swing.JComboBox" binding="idiomaCombo" custom-create="true">
|
<component id="99282" 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="Nombre:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="17f40" class="javax.swing.JTextField" binding="nombreField">
|
||||||
<constraints>
|
<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">
|
<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>
|
||||||
<properties>
|
<properties>
|
||||||
<model/>
|
<editable value="false"/>
|
||||||
|
<text value=""/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
<component id="612b7" class="javax.swing.JButton" binding="eliminarButton" default-binding="true">
|
<component id="cf278" class="javax.swing.JButton" binding="volverButton" default-binding="true">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<text value="Eliminar"/>
|
<text value="Volver"/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
<vspacer id="afb60">
|
<vspacer id="2cebe">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
</vspacer>
|
</vspacer>
|
||||||
<hspacer id="e303d">
|
<hspacer id="cdab1">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
</hspacer>
|
</hspacer>
|
||||||
<hspacer id="aad96">
|
<hspacer id="c5e49">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
</hspacer>
|
</hspacer>
|
||||||
<component id="56c2" 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="Idioma:"/>
|
|
||||||
</properties>
|
|
||||||
</component>
|
|
||||||
</children>
|
</children>
|
||||||
</grid>
|
</grid>
|
||||||
</form>
|
</form>
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package xyz.danielcortes.views.idioma;
|
||||||
|
|
||||||
|
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.JButton;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import xyz.danielcortes.views.BasePanel;
|
||||||
|
|
||||||
|
public class IdiomaViewPanel extends BasePanel {
|
||||||
|
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JTextField nombreField;
|
||||||
|
private JButton volverButton;
|
||||||
|
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getNombreField() {
|
||||||
|
return nombreField;
|
||||||
|
}
|
||||||
|
|
||||||
|
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$$$() {
|
||||||
|
contentPane = new JPanel();
|
||||||
|
contentPane.setLayout(new GridLayoutManager(4, 3, new Insets(20, 20, 20, 20), -1, -1));
|
||||||
|
final JLabel label1 = new JLabel();
|
||||||
|
label1.setText("Nombre:");
|
||||||
|
contentPane.add(label1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
nombreField = new JTextField();
|
||||||
|
nombreField.setText("");
|
||||||
|
contentPane.add(nombreField,
|
||||||
|
new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
volverButton = new JButton();
|
||||||
|
volverButton.setText("Volver");
|
||||||
|
contentPane.add(volverButton, new GridConstraints(2, 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 Spacer spacer1 = new Spacer();
|
||||||
|
contentPane.add(spacer1,
|
||||||
|
new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final Spacer spacer2 = new Spacer();
|
||||||
|
contentPane.add(spacer2,
|
||||||
|
new GridConstraints(3, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final Spacer spacer3 = new Spacer();
|
||||||
|
contentPane.add(spacer3,
|
||||||
|
new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user