Corregida usabilidad en autores, idioma

This commit is contained in:
Daniel Cortés
2019-06-19 01:07:55 -04:00
parent 4ffad28c0c
commit 0d4f8d7321
8 changed files with 62 additions and 20 deletions

View File

@@ -66,6 +66,9 @@ public class AutorCreateController extends BaseController {
@Override @Override
public void show() { public void show() {
this.view.getNombreField().setText("");
this.view.getApellidoPaternoField().setText("");
this.view.getApellidoMaternoField().setText("");
this.view.getNombreField().requestFocus(); this.view.getNombreField().requestFocus();
} }

View File

@@ -107,6 +107,8 @@ public class AutorSearchController extends BaseController {
public void reload() { public void reload() {
this.loadAutorTable(); this.loadAutorTable();
this.view.getSearchField().requestFocus();
this.view.getAutorTable().setRowSelectionInterval(0, 0);
} }
private void loadAutorTable() { private void loadAutorTable() {
@@ -117,7 +119,6 @@ public class AutorSearchController extends BaseController {
@Override @Override
public void show() { public void show() {
this.reload(); this.reload();
this.view.getAutorTable().clearSelection();
} }
@Override @Override

View File

@@ -112,6 +112,8 @@ public class IdiomaSearchController extends BaseController {
public void reload() { public void reload() {
this.loadIdiomaTable(); this.loadIdiomaTable();
this.view.getBuscarField().requestFocus();
this.view.getIdiomaTable().setRowSelectionInterval(0, 0);
} }
@Override @Override

View File

@@ -28,6 +28,7 @@ public class IdiomaUpdateController extends BaseController {
private void setupListeners() { private void setupListeners() {
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());
this.view.getVolverButton().addActionListener(e -> this.getParentController().showCard(PanelName.IDIOMA_SEARCH));
} }
private void update() { private void update() {
@@ -54,10 +55,8 @@ public class IdiomaUpdateController extends BaseController {
@Override @Override
public void show() { public void show() {
if (this.idioma == null)
return;
this.fillIdioma(); this.fillIdioma();
this.view.getNombreField().requestFocus();
} }
private void fillIdioma() { private void fillIdioma() {

View File

@@ -106,6 +106,7 @@ public class LibroSearchController extends BaseController {
public void reload() { public void reload() {
this.loadLibroTable(); this.loadLibroTable();
this.view.getBuscarField().requestFocus(); this.view.getBuscarField().requestFocus();
this.view.getLibrosTable().setRowSelectionInterval(0, 0);
} }
@Override @Override

View File

@@ -38,4 +38,5 @@ public class ComprarLibroPanel extends BasePanel {
public JComponent $$$getRootComponent$$$() { public JComponent $$$getRootComponent$$$() {
return contentPane; return contentPane;
} }
} }

View File

@@ -3,7 +3,7 @@
<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="484" height="174"/>
</constraints> </constraints>
<properties/> <properties/>
<border type="none"/> <border type="none"/>
@@ -31,16 +31,6 @@
<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="e80d1" class="javax.swing.JButton" binding="actualizarButton" default-binding="true">
<constraints>
<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">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<text value="Actualizar"/>
</properties>
</component>
<component id="5cc79" class="javax.swing.JLabel"> <component id="5cc79" class="javax.swing.JLabel">
<constraints> <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"/> <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"/>
@@ -49,6 +39,36 @@
<text value="Nombre:"/> <text value="Nombre:"/>
</properties> </properties>
</component> </component>
<grid id="5107e" 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="2" 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"/>
<children>
<component id="e80d1" class="javax.swing.JButton" binding="actualizarButton" 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="Actualizar"/>
</properties>
</component>
<component id="444b5" class="javax.swing.JButton" binding="volverButton" 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="Volver"/>
</properties>
</component>
</children>
</grid>
</children> </children>
</grid> </grid>
</form> </form>

View File

@@ -17,6 +17,7 @@ public class IdiomaUpdatePanel extends BasePanel {
private JPanel contentPane; private JPanel contentPane;
private JTextField nombreField; private JTextField nombreField;
private JButton actualizarButton; private JButton actualizarButton;
private JButton volverButton;
{ {
// GUI initializer generated by IntelliJ IDEA GUI Designer // GUI initializer generated by IntelliJ IDEA GUI Designer
@@ -38,6 +39,10 @@ public class IdiomaUpdatePanel extends BasePanel {
return this.actualizarButton; return this.actualizarButton;
} }
public JButton getVolverButton() {
return this.volverButton;
}
/** /**
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code! * Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
* *
@@ -62,15 +67,25 @@ public class IdiomaUpdatePanel extends BasePanel {
contentPane.add(spacer3, contentPane.add(spacer3,
new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
null, null, 0, false)); null, null, 0, false));
actualizarButton = new JButton();
actualizarButton.setText("Actualizar");
contentPane.add(actualizarButton, new GridConstraints(2, 0, 1, 3, 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 label1 = new JLabel(); final JLabel label1 = new JLabel();
label1.setText("Nombre:"); label1.setText("Nombre:");
contentPane.add(label1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, contentPane.add(label1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel1, new GridConstraints(2, 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));
actualizarButton = new JButton();
actualizarButton.setText("Actualizar");
panel1.add(actualizarButton, 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));
volverButton = new JButton();
volverButton.setText("Volver");
panel1.add(volverButton, 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));
} }
/** /**