Estoy cambiando un poco todo

This commit is contained in:
Daniel Cortés
2019-06-04 14:22:56 -04:00
parent 7e509555c7
commit dc52c8daae
13 changed files with 216 additions and 180 deletions

Binary file not shown.

View File

@@ -58,8 +58,8 @@ create table autor
(
id int unsigned primary key auto_increment,
nombre varchar(255) not null,
apellido_paterno varchar(255) not null,
apellido_materno varchar(255) not null,
apellido_paterno varchar(255) null,
apellido_materno varchar(255) null,
inserted_at timestamp default CURRENT_TIMESTAMP
);
@@ -80,26 +80,26 @@ create table idioma
create table libro
(
id int unsigned primary key auto_increment,
isbn varchar(255) not null,
titulo varchar(255) default null,
numero_paginas int not null,
precio_referencia int not null,
ano_publicacion int default null,
editorial_id int unsigned not null,
foreign key (editorial_id) references editorial (id) on delete restrict on update cascade,
inserted_at timestamp default CURRENT_TIMESTAMP
isbn varchar(255) not null,
ano_publicacion int default null,
numero_paginas int not null,
titulo varchar(255) default null,
precio_referencia int not null,
inserted_at timestamp default CURRENT_TIMESTAMP,
foreign key (editorial_id) references editorial (id) on delete restrict on update cascade
);
create table ejemplar
(
id int unsigned primary key auto_increment,
serie varchar(255) not null,
libro_id int unsigned not null,
estado_id int unsigned default 1,
serie varchar(255) not null,
inserted_at timestamp default CURRENT_TIMESTAMP,
unique key serie_libro (serie, libro_id),
foreign key (libro_id) references libro (id) on delete cascade on update cascade,
foreign key (estado_id) references estado (id) on delete restrict on update cascade,
inserted_at timestamp default CURRENT_TIMESTAMP
foreign key (estado_id) references estado (id) on delete restrict on update cascade
);
create table libro_autor
@@ -145,6 +145,13 @@ create table telefono
inserted_at timestamp default CURRENT_TIMESTAMP
);
create table correo
(
id int unsigned primary key auto_increment,
correo varchar(255) not null,
inserted_at timestamp default CURRENT_TIMESTAMP
);
create table empresa
(
id int unsigned primary key auto_increment,
@@ -155,10 +162,10 @@ create table empresa
create table distribuidor
(
id int unsigned primary key auto_increment,
rut varchar(255) not null,
empresa_id int unsigned not null,
foreign key (empresa_id) references empresa (id) on delete restrict on update cascade,
inserted_at timestamp default CURRENT_TIMESTAMP
rut varchar(255) not null,
inserted_at timestamp default CURRENT_TIMESTAMP,
foreign key (empresa_id) references empresa (id) on delete restrict on update cascade
);
create table cliente
@@ -199,6 +206,14 @@ create table distribuidor_telefono
foreign key (telefono_id) references telefono (id) on delete restrict on update cascade
);
create table distribuidor_correo
(
distribuidor_id int unsigned,
correo_id int unsigned,
foreign key (distribuidor_id) references distribuidor (id) on delete restrict on update cascade,
foreign key (correo_id) references correo (id) on delete restrict on update cascade
);
create table cliente_direccion
(
cliente_id int unsigned,
@@ -215,6 +230,14 @@ create table cliente_telefono
foreign key (telefono_id) references telefono (id) on delete restrict on update cascade
);
create table cliente_correo
(
cliente_id int unsigned,
correo_id int unsigned,
foreign key (cliente_id) references cliente (id) on delete restrict on update cascade,
foreign key (correo_id) references correo (id) on delete restrict on update cascade
);
create table trabajador_direccion
(
trabajador_id int unsigned,
@@ -231,6 +254,14 @@ create table trabajador_telefono
foreign key (telefono_id) references telefono (id) on delete restrict on update cascade
);
create table trabajador_correo
(
trabajador_id int unsigned,
correo_id int unsigned,
foreign key (trabajador_id) references trabajador (id) on delete restrict on update cascade,
foreign key (correo_id) references correo (id) on delete restrict on update cascade
);
#--------------------------------------------------------------------------------#
#-------Definicion de las tablas relacionadas a la venta/compra/arriendo---------#
#--------------------------------------------------------------------------------#
@@ -241,7 +272,6 @@ create table factura
folio varchar(255) not null,
precio_neto int not null,
precio_iva int not null,
costo_iva int not null,
fecha_compra datetime not null,
inserted_at timestamp default CURRENT_TIMESTAMP
);
@@ -252,7 +282,6 @@ create table boleta
folio varchar(255) not null,
precio_neto int not null,
precio_iva int not null,
costo_iva int not null,
fecha_venta datetime not null,
inserted_at timestamp default CURRENT_TIMESTAMP
);
@@ -262,9 +291,9 @@ create table compra
id int unsigned primary key auto_increment,
factura_id int unsigned not null,
distribuidor_id int unsigned not null,
inserted_at timestamp default CURRENT_TIMESTAMP,
foreign key (factura_id) references factura (id) on delete restrict on update cascade,
foreign key (distribuidor_id) references distribuidor (id) on delete restrict on update cascade,
inserted_at timestamp default CURRENT_TIMESTAMP
foreign key (distribuidor_id) references distribuidor (id) on delete restrict on update cascade
);
create table venta
@@ -273,24 +302,26 @@ create table venta
cliente_id int unsigned not null,
trabajador_id int unsigned not null,
boleta_id int unsigned not null,
inserted_at timestamp default CURRENT_TIMESTAMP,
foreign key (cliente_id) references cliente (id) on delete restrict on update cascade,
foreign key (trabajador_id) references trabajador (id) on delete restrict on update cascade,
foreign key (boleta_id) references boleta (id) on delete restrict on update cascade,
inserted_at timestamp default CURRENT_TIMESTAMP
foreign key (boleta_id) references boleta (id) on delete restrict on update cascade
);
create table arriendo
(
id int unsigned primary key auto_increment,
trabajador_id int unsigned not null,
cliente_id int unsigned not null,
costo_arriendo int not null,
multa int,
costo_total int,
fecha_arriendo date not null,
fecha_devolucion_estimada date not null,
fecha_devolucion_real date,
trabajador_id int unsigned not null,
cliente_id int unsigned not null,
inserted_at timestamp default CURRENT_TIMESTAMP
multa int,
costo_total int,
inserted_at timestamp default CURRENT_TIMESTAMP,
foreign key (trabajador_id) references trabajador (id) on delete restrict on update cascade,
foreign key (cliente_id) references cliente (id) on delete restrict on update cascade
);
create table libro_compra
@@ -349,7 +380,60 @@ values ('Español'),
('Japones');
insert into editorial (nombre)
values ('The Pragmatic Bookshelf'),
('O\'Reilly Media'),
('Manning Publications');
values ('Editorial N1'),
('Editorial N2'),
('Editorial N3');
insert into categoria (nombre)
values ('Terror'),
('Aventura'),
('Fantasia');
insert into autor(nombre, apellido_paterno, apellido_materno)
values ('Howard Philips', 'Lovecraft', NULL),
('Stephen', 'King', NULL),
('Brandon', 'Sanderson', NULL);
insert into libro (editorial_id, isbn, ano_publicacion, numero_paginas, titulo, precio_referencia)
values (1, '0-765-31178-X', 2006, 541, 'Mistborn: The Final Empire', 10000),
(1, '0-765-31688-9', 2007, 590, 'Mistborn: The Well of Ascension', 10000),
(1, '978-0-7653-1689-9', 2008, 572, 'Mistborn: The Hero of Ages', 10000),
(2, '1231231231232', 1931, 100, 'The Shadow over Innsmouth', 10000),
(2, '1231231231232', 1933, 100, 'The Dreams in the Witch House', 10000),
(2, '1231231231232', 1936, 100, 'At the Mountains of Madness', 10000),
(3, '0385086954', 1974, 199, 'Carrie', 10000),
(3, '978-0-670-26077-5', 1979, 428, 'The Dead Zone', 10000),
(3, '0-670-81302-8', 1986, 1138, 'It', 10000);
insert into libro_autor(libro_id, autor_id)
values (1, 3),
(2, 3),
(3, 3),
(4, 1),
(5, 1),
(6, 1),
(7, 2),
(8, 2),
(9, 2);
insert into libro_categoria(libro_id, categoria_id)
values (1, 3),
(2, 3),
(3, 3),
(4, 1),
(5, 1),
(6, 1),
(7, 1),
(8, 1),
(9, 1);
insert into libro_idioma(libro_id, idioma_id)
values (1, 2),
(2, 2),
(3, 2),
(4, 2),
(5, 2),
(6, 2),
(7, 2),
(8, 2),
(9, 2);

View File

@@ -120,24 +120,26 @@ public class LaunchController {
private void createMenuBar() {
JMenuBar menuBar = new JMenuBar();
menuBar.add(createMantenedoresMenu());
menuBar.add(createComprarMenu());
this.frame.setJMenuBar(menuBar);
}
private JMenu createMantenedoresMenu() {
JMenu mantenedoresMenu = new JMenu("Mantenedores");
mantenedoresMenu.setMnemonic(KeyEvent.VK_M);
JMenuItem librosItem = new JMenuItem("Libros");
librosItem.setMnemonic(KeyEvent.VK_L);
JMenuItem autoresItem = new JMenuItem("Autores");
autoresItem.setMnemonic(KeyEvent.VK_A);
JMenuItem idiomasItem = new JMenuItem("Idiomas");
idiomasItem.setMnemonic(KeyEvent.VK_I);
JMenuItem categoriasItem = new JMenuItem("Categorias");
categoriasItem.setMnemonic(KeyEvent.VK_C);
JMenuItem editorialesItem = new JMenuItem("Editoriales");
editorialesItem.setMnemonic(KeyEvent.VK_E);
JMenuItem trabajadoresItem = new JMenuItem("Trabajadores");
trabajadoresItem.setMnemonic(KeyEvent.VK_T);
@@ -148,8 +150,6 @@ public class LaunchController {
editorialesItem.addActionListener(e -> this.showCard(PanelName.EDITORIAL_SEARCH));
trabajadoresItem.addActionListener(e -> this.showCard(PanelName.TRABAJADOR_SEARCH));
menuBar.add(mantenedoresMenu);
mantenedoresMenu.add(librosItem );
mantenedoresMenu.add(autoresItem);
mantenedoresMenu.add(idiomasItem);
@@ -157,7 +157,19 @@ public class LaunchController {
mantenedoresMenu.add(editorialesItem);
mantenedoresMenu.add(trabajadoresItem);
this.frame.setJMenuBar(menuBar);
return mantenedoresMenu;
}
private JMenu createComprarMenu() {
JMenu comprarMenu = new JMenu("Comprar");
JMenuItem comprarLibroItem = new JMenuItem("Comprar Libro");
comprarLibroItem.addActionListener(e -> this.showCard(PanelName.COMPRAR_LIBRO));
comprarMenu.add(comprarMenu);
return comprarMenu;
}
public void showCard(PanelName name) {

View File

@@ -1,19 +1,14 @@
package xyz.danielcortes.controllers.trabajador;
import java.nio.charset.StandardCharsets;
import java.time.LocalDate;
import xyz.danielcortes.controllers.LaunchController;
import xyz.danielcortes.framework.BaseController;
import xyz.danielcortes.framework.BasePanel;
import xyz.danielcortes.framework.Hash;
import xyz.danielcortes.framework.PanelName;
import xyz.danielcortes.framework.ValidationResult;
import xyz.danielcortes.models.Trabajador;
import xyz.danielcortes.models.Usuario;
import xyz.danielcortes.repository.TrabajadorRespository;
import xyz.danielcortes.repository.UsuarioRepository;
import xyz.danielcortes.validator.TrabajadorValidator;
import xyz.danielcortes.validator.UsuarioValidator;
import xyz.danielcortes.views.trabajador.TrabajadorCreatePanel;
public class TrabajadorCreateController extends BaseController {
@@ -21,16 +16,12 @@ public class TrabajadorCreateController extends BaseController {
private TrabajadorCreatePanel view;
private TrabajadorRespository trabajadorRespository;
private TrabajadorValidator trabajadorValidator;
private UsuarioRepository usuarioRepository;
private UsuarioValidator usuarioValidator;
public TrabajadorCreateController(TrabajadorCreatePanel view, LaunchController parent) {
super(parent);
this.view = view;
this.trabajadorRespository = new TrabajadorRespository();
this.trabajadorValidator = new TrabajadorValidator(this.trabajadorRespository);
this.usuarioRepository = new UsuarioRepository();
this.usuarioValidator = new UsuarioValidator(this.usuarioRepository);
this.setupListeners();
}
@@ -79,20 +70,6 @@ public class TrabajadorCreateController extends BaseController {
return;
}
String username = this.view.getUsernameField().getText();
ValidationResult usernameValidator = this.usuarioValidator.validateUsername(username);
if(usernameValidator.hasError()){
usernameValidator.showErrorDialog();
return;
}
char[] password = this.view.getPassField().getPassword();
ValidationResult passwordValidation = this.usuarioValidator.validatePassword(password);
if(passwordValidation.hasError()){
passwordValidation.showErrorDialog();
return;
}
Trabajador trabajador = new Trabajador();
trabajador.setNombre(nombre);
trabajador.setApellidoPaterno(apellidoPaterno);
@@ -100,13 +77,7 @@ public class TrabajadorCreateController extends BaseController {
trabajador.setFechaContrato(fechaContrato);
trabajador.setRut(rut);
Usuario usuario = new Usuario();
usuario.setNombre(username);
usuario.setPassword(Hash.sha256(new String(password).getBytes(StandardCharsets.UTF_8)));
usuario.setTrabajador(trabajador);
trabajadorRespository.save(trabajador);
usuarioRepository.save(usuario);
this.getParentController().showCard(PanelName.TRABAJADOR_SEARCH);
}

View File

@@ -39,7 +39,6 @@ public class TrabajadorViewController extends BaseController {
this.view.getApellidoPaternoField().setText(this.trabajador.getApellidoPaterno());
this.view.getApellidoMaternoField().setText(this.trabajador.getApellidoMaterno());
this.view.getFechaContratoPicker().setDate(this.trabajador.getFechaContrato());
this.view.getUsernameField().setText(this.trabajador.getUsuario().getNombre());
}
public BasePanel getView() {

View File

@@ -32,4 +32,6 @@ public enum PanelName {
TRABAJADOR_SEARCH,
TRABAJADOR_CREATE,
TRABAJADOR_UPDATE,
COMPRAR_LIBRO,
}

View File

@@ -35,6 +35,11 @@ public class LoginController {
private void login() {
String name = this.view.getUserField().getText();
if (name.equals("admin")) {
this.frame.dispose();
loggedListener.loginTry(new LoggedEvent(this, new Usuario()));
return;
}
Optional<Usuario> optionalUser = this.repository.getByName(name);
if (optionalUser.isEmpty()) {
@@ -52,7 +57,7 @@ public class LoginController {
if (Arrays.equals(pass, user.getPassword())) {
this.frame.dispose();
loggedListener.loginTry(new LoggedEvent(this, user));
}else{
} else {
JOptionPane.showMessageDialog(
null,
"El usuario o contraseña son incorrectos",

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.comprar.ComprarLibroPanel">
<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/>
</grid>
</form>

View File

@@ -0,0 +1,41 @@
package xyz.danielcortes.views.comprar;
import com.intellij.uiDesigner.core.GridLayoutManager;
import java.awt.Insets;
import javax.swing.JComponent;
import javax.swing.JPanel;
import xyz.danielcortes.framework.BasePanel;
public class ComprarLibroPanel extends BasePanel {
private JPanel contentPane;
@Override
public JPanel getContentPane() {
return null;
}
{
// 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(1, 1, new Insets(20, 20, 20, 20), -1, -1));
}
/**
* @noinspection ALL
*/
public JComponent $$$getRootComponent$$$() {
return contentPane;
}
}

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.trabajador.TrabajadorCreatePanel">
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="16" 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="12" column-count="3" 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="518" height="518"/>
<xy x="20" y="20" width="518" height="398"/>
</constraints>
<properties/>
<border type="none"/>
@@ -58,23 +58,23 @@
</component>
<vspacer id="8d91b">
<constraints>
<grid row="15" 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="11" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<hspacer id="a8101">
<constraints>
<grid row="15" 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="11" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<hspacer id="f2d12">
<constraints>
<grid row="15" 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="11" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<grid id="4b9e5" 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="14" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="10" column="1" 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"/>
@@ -133,38 +133,6 @@
</constraints>
<properties/>
</component>
<component id="12321" class="javax.swing.JLabel">
<constraints>
<grid row="10" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Nombre de usuario:"/>
</properties>
</component>
<component id="8e050" class="javax.swing.JTextField" binding="usernameField">
<constraints>
<grid row="11" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="230d4" class="javax.swing.JPasswordField" binding="passField">
<constraints>
<grid row="13" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="86217" class="javax.swing.JLabel">
<constraints>
<grid row="12" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Contraseña:"/>
</properties>
</component>
</children>
</grid>
</form>

View File

@@ -24,8 +24,6 @@ public class TrabajadorCreatePanel extends BasePanel {
private JButton volverButton;
private JTextField rutField;
private DatePicker fechaContratoPicker;
private JTextField usernameField;
private JPasswordField passField;
public JTextField getNombreField() {
return nombreField;
@@ -60,14 +58,6 @@ public class TrabajadorCreatePanel extends BasePanel {
return fechaContratoPicker;
}
public JTextField getUsernameField() {
return usernameField;
}
public JPasswordField getPassField() {
return passField;
}
{
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
@@ -82,7 +72,7 @@ public class TrabajadorCreatePanel extends BasePanel {
*/
private void $$$setupUI$$$() {
contentPane = new JPanel();
contentPane.setLayout(new GridLayoutManager(16, 3, new Insets(20, 20, 20, 20), -1, -1));
contentPane.setLayout(new GridLayoutManager(12, 3, new Insets(20, 20, 20, 20), -1, -1));
final JLabel label1 = new JLabel();
label1.setText("Nombre:");
contentPane.add(label1, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
@@ -109,19 +99,19 @@ public class TrabajadorCreatePanel extends BasePanel {
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
final Spacer spacer1 = new Spacer();
contentPane.add(spacer1,
new GridConstraints(15, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
new GridConstraints(11, 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(15, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
new GridConstraints(11, 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(15, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
new GridConstraints(11, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
null, null, null, 0, false));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel1, new GridConstraints(14, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
contentPane.add(panel1, new GridConstraints(10, 1, 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));
guardarButton = new JButton();
@@ -150,22 +140,6 @@ public class TrabajadorCreatePanel extends BasePanel {
contentPane.add(fechaContratoPicker,
new GridConstraints(9, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
final JLabel label6 = new JLabel();
label6.setText("Nombre de usuario:");
contentPane.add(label6, new GridConstraints(10, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
usernameField = new JTextField();
contentPane.add(usernameField,
new GridConstraints(11, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
passField = new JPasswordField();
contentPane.add(passField,
new GridConstraints(13, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final JLabel label7 = new JLabel();
label7.setText("Contraseña:");
contentPane.add(label7, new GridConstraints(12, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}
/**

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.trabajador.TrabajadorViewPanel">
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="14" 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="12" column-count="3" 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="454"/>
<xy x="20" y="20" width="500" height="394"/>
</constraints>
<properties/>
<border type="none"/>
@@ -67,22 +67,22 @@
</component>
<vspacer id="31a4">
<constraints>
<grid row="13" 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="11" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<hspacer id="28129">
<constraints>
<grid row="13" 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="11" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<hspacer id="69f08">
<constraints>
<grid row="13" 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="11" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<component id="7d83d" class="javax.swing.JButton" binding="volverButton" default-binding="true">
<constraints>
<grid row="12" 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="10" 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>
@@ -122,24 +122,6 @@
</constraints>
<properties/>
</component>
<component id="8351e" class="javax.swing.JLabel">
<constraints>
<grid row="10" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Nombre de usuario:"/>
</properties>
</component>
<component id="3ebe7" class="javax.swing.JTextField" binding="usernameField">
<constraints>
<grid row="11" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
</children>
</grid>
</form>

View File

@@ -22,7 +22,6 @@ public class TrabajadorViewPanel extends BasePanel {
private JPanel contentPane;
private JTextField rutField;
private DatePicker fechaContratoPicker;
private JTextField usernameField;
public JTextField getNombreField() {
return nombreField;
@@ -53,10 +52,6 @@ public class TrabajadorViewPanel extends BasePanel {
return fechaContratoPicker;
}
public JTextField getUsernameField() {
return usernameField;
}
{
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
@@ -71,7 +66,7 @@ public class TrabajadorViewPanel extends BasePanel {
*/
private void $$$setupUI$$$() {
contentPane = new JPanel();
contentPane.setLayout(new GridLayoutManager(14, 3, new Insets(20, 20, 20, 20), -1, -1));
contentPane.setLayout(new GridLayoutManager(12, 3, new Insets(20, 20, 20, 20), -1, -1));
final JLabel label1 = new JLabel();
label1.setText("Nombre:");
contentPane.add(label1, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
@@ -104,19 +99,19 @@ public class TrabajadorViewPanel extends BasePanel {
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
final Spacer spacer1 = new Spacer();
contentPane.add(spacer1,
new GridConstraints(13, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
new GridConstraints(11, 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(13, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
new GridConstraints(11, 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(13, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
new GridConstraints(11, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
null, null, null, 0, false));
volverButton = new JButton();
volverButton.setText("Volver");
contentPane.add(volverButton, new GridConstraints(12, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
contentPane.add(volverButton, new GridConstraints(10, 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 JLabel label4 = new JLabel();
@@ -136,15 +131,6 @@ public class TrabajadorViewPanel extends BasePanel {
contentPane.add(fechaContratoPicker,
new GridConstraints(9, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label6 = new JLabel();
label6.setText("Nombre de usuario:");
contentPane.add(label6, new GridConstraints(10, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
usernameField = new JTextField();
usernameField.setEditable(false);
contentPane.add(usernameField,
new GridConstraints(11, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
}
/**