Tecnicamente esta terminada la funcionalidad basica
This commit is contained in:
@@ -34,6 +34,7 @@ import danielcortes.xyz.models.ingreso.IngresoDAO;
|
||||
import danielcortes.xyz.views.ArqueoView;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
|
||||
public class ArqueoController {
|
||||
@@ -71,7 +72,7 @@ public class ArqueoController {
|
||||
private void fillEfectivo() {
|
||||
this.efectivo = this.efectivoDAO.findByCaja(this.caja);
|
||||
this.view.getVeinteMilField().setText(String.valueOf(efectivo.getVeinteMil()));
|
||||
this.view.getDiezField().setText(String.valueOf(efectivo.getDiezMil()));
|
||||
this.view.getDiezMilField().setText(String.valueOf(efectivo.getDiezMil()));
|
||||
this.view.getCincoMilField().setText(String.valueOf(efectivo.getCincoMil()));
|
||||
this.view.getDosMilField().setText(String.valueOf(efectivo.getDosMil()));
|
||||
this.view.getMilField().setText(String.valueOf(efectivo.getMil()));
|
||||
@@ -142,6 +143,11 @@ public class ArqueoController {
|
||||
this.view.getArqueoField().setText(String.valueOf(arqueo));
|
||||
this.view.getAjusteField().setText(String.valueOf(ajuste));
|
||||
|
||||
if(ajuste < 0) {
|
||||
this.view.getAjusteField().setForeground(new Color(255,0,0));
|
||||
}else{
|
||||
this.view.getAjusteField().setForeground(new Color(0,0,0));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -90,6 +90,8 @@ public class IngresosController {
|
||||
this.view.getIngresosTable().getSelectionModel().addListSelectionListener(e -> onSelectTableRowListener());
|
||||
this.view.getGuardarButton().addActionListener(e -> guardarActionListener());
|
||||
this.view.getValorField().addActionListener(e -> guardarActionListener());
|
||||
this.view.getNroInicialField().addActionListener(e -> guardarActionListener());
|
||||
this.view.getNroFinalField().addActionListener(e -> guardarActionListener());
|
||||
this.view.getEliminarButton().addActionListener(e -> eliminarActionListener());
|
||||
this.view.getEditarButton().addActionListener(e -> editarActionListener());
|
||||
|
||||
@@ -115,12 +117,17 @@ public class IngresosController {
|
||||
private void guardarActionListener() {
|
||||
this.normalizeInputs();
|
||||
String valor = this.view.getValorField().getText();
|
||||
String nroInicial = this.view.getNroInicialField().getText();
|
||||
String nroFinal = this.view.getNroFinalField().getText();
|
||||
TipoIngreso tipoIngreso = (TipoIngreso) this.view.getTipoCombo().getSelectedItem();
|
||||
|
||||
System.out.println(nroInicial);
|
||||
System.out.println(nroFinal);
|
||||
|
||||
if(editing) {
|
||||
this.editarIngreso(valor, tipoIngreso, this.caja);
|
||||
this.editarIngreso(valor, nroInicial, nroFinal, tipoIngreso, this.caja);
|
||||
} else {
|
||||
this.guardarIngreso(valor, tipoIngreso, this.caja);
|
||||
this.guardarIngreso(valor, nroInicial, nroFinal, tipoIngreso, this.caja);
|
||||
}
|
||||
this.resetFocus();
|
||||
}
|
||||
@@ -147,6 +154,8 @@ public class IngresosController {
|
||||
|
||||
this.view.getTipoCombo().setSelectedItem(ingreso.getTipoIngreso());
|
||||
this.view.getValorField().setText(String.valueOf(ingreso.getValor()));
|
||||
this.view.getNroInicialField().setText(String.valueOf(ingreso.getNroInicial()));
|
||||
this.view.getNroFinalField().setText(String.valueOf(ingreso.getNroFinal()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,12 +179,14 @@ public class IngresosController {
|
||||
}
|
||||
}
|
||||
|
||||
private void guardarIngreso(String valor, TipoIngreso tipoIngreso, Caja caja){
|
||||
if(this.validateInput(valor, tipoIngreso, caja)){
|
||||
private void guardarIngreso(String valor, String nroInicial, String nroFinal, TipoIngreso tipoIngreso, Caja caja){
|
||||
if(this.validateInput(valor, nroInicial, nroFinal, tipoIngreso, caja)){
|
||||
Ingreso ingreso = new Ingreso();
|
||||
ingreso.setTipoIngreso(tipoIngreso);
|
||||
ingreso.setCaja(caja);
|
||||
ingreso.setValor(Integer.valueOf(valor));
|
||||
ingreso.setNroInicial(nroInicial);
|
||||
ingreso.setNroFinal(nroFinal);
|
||||
|
||||
this.ingresoDAO.insertIngreso(ingreso);
|
||||
this.view.getIngresosTableModel().addRow(ingreso);
|
||||
@@ -185,10 +196,12 @@ public class IngresosController {
|
||||
}
|
||||
}
|
||||
|
||||
private void editarIngreso(String valor, TipoIngreso tipoIngreso, Caja caja){
|
||||
if(this.validateInput(valor, tipoIngreso, caja)){
|
||||
private void editarIngreso(String valor, String nroInicial, String nroFinal, TipoIngreso tipoIngreso, Caja caja){
|
||||
if(this.validateInput(valor, nroInicial, nroFinal, tipoIngreso, caja)){
|
||||
this.editingIngreso.setTipoIngreso(tipoIngreso);
|
||||
this.editingIngreso.setValor(Integer.valueOf(valor));
|
||||
this.editingIngreso.setNroInicial(nroInicial);
|
||||
this.editingIngreso.setNroFinal(nroFinal);
|
||||
this.ingresoDAO.updateIngreso(this.editingIngreso);
|
||||
this.view.getIngresosTableModel().setIngreso(this.editingId, this.editingIngreso);
|
||||
this.updateTotalIngresos();
|
||||
@@ -197,10 +210,12 @@ public class IngresosController {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean validateInput(String valor, TipoIngreso tipoIngreso, Caja caja) {
|
||||
private boolean validateInput(String valor, String nroInicial, String nroFinal, TipoIngreso tipoIngreso, Caja caja) {
|
||||
this.hideErrorMessages();
|
||||
|
||||
boolean valorValidation = this.validateValor(valor);
|
||||
boolean nroInicialValidation = this.validateNroInicial(nroInicial);
|
||||
boolean nroFinalValidation = this.validateNroFinal(nroFinal);
|
||||
boolean tipoIngresoValidation = this.validateTipoIngreso(tipoIngreso);
|
||||
boolean cajaValidation = this.validateCaja(caja);
|
||||
|
||||
@@ -241,6 +256,36 @@ public class IngresosController {
|
||||
|
||||
}
|
||||
|
||||
private boolean validateNroInicial(String nroInicial){
|
||||
if (nroInicial == null) {
|
||||
this.view.getErrorNroInicial().setText("Hubo un problema con los datos");
|
||||
this.view.getErrorNroInicial().setVisible(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (nroInicial.isEmpty()) {
|
||||
this.view.getErrorNroInicial().setText("El campo esta vacio");
|
||||
this.view.getErrorNroInicial().setVisible(true);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean validateNroFinal(String nroFinal){
|
||||
if (nroFinal == null) {
|
||||
this.view.getErrorNroFinal().setText("Hubo un problema con los datos");
|
||||
this.view.getErrorNroFinal().setVisible(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (nroFinal.isEmpty()) {
|
||||
this.view.getErrorNroFinal().setText("El campo esta vacio");
|
||||
this.view.getErrorNroFinal().setVisible(true);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean validateTipoIngreso(TipoIngreso tipoIngreso) {
|
||||
if (tipoIngreso == null) {
|
||||
this.view.getErrorTipoIngreso().setText("Hubo un problema con los datos");
|
||||
@@ -253,15 +298,21 @@ public class IngresosController {
|
||||
private void hideErrorMessages() {
|
||||
this.view.getErrorTipoIngreso().setVisible(false);
|
||||
this.view.getErrorValor().setVisible(false);
|
||||
this.view.getErrorNroInicial().setVisible(false);
|
||||
this.view.getErrorNroFinal().setVisible(false);
|
||||
}
|
||||
|
||||
private void clearInputs() {
|
||||
this.view.getTipoCombo().setSelectedIndex(0);
|
||||
this.view.getValorField().setText("");
|
||||
this.view.getNroInicialField().setText("");
|
||||
this.view.getNroFinalField().setText("");
|
||||
}
|
||||
|
||||
private void normalizeInputs(){
|
||||
this.view.getValorField().setText(this.view.getValorField().getText().trim());
|
||||
this.view.getNroInicialField().setText(this.view.getNroInicialField().getText().trim());
|
||||
this.view.getNroFinalField().setText(this.view.getNroFinalField().getText().trim());
|
||||
}
|
||||
|
||||
private void resetFocus(){
|
||||
|
||||
@@ -152,7 +152,6 @@ public class MysqlEfectivoDAO implements EfectivoDAO {
|
||||
ps.setInt(1, efectivo.getCaja().getId());
|
||||
|
||||
updates = ps.executeUpdate();
|
||||
System.out.println(updates);
|
||||
ps.close();
|
||||
|
||||
ps = conn.prepareStatement("select last_insert_id()");
|
||||
|
||||
@@ -30,22 +30,11 @@ import danielcortes.xyz.models.tipo_ingreso.TipoIngreso;
|
||||
public class Ingreso {
|
||||
private int id;
|
||||
private int valor;
|
||||
private String nroInicial;
|
||||
private String nroFinal;
|
||||
private TipoIngreso tipoIngreso;
|
||||
private Caja caja;
|
||||
|
||||
public Ingreso(int id, int valor, TipoIngreso tipoIngreso ) {
|
||||
this.id = id;
|
||||
this.valor = valor;
|
||||
this.tipoIngreso = tipoIngreso;
|
||||
}
|
||||
|
||||
public Ingreso( int valor, TipoIngreso tipoIngreso) {
|
||||
this.valor = valor;
|
||||
this.tipoIngreso = tipoIngreso;
|
||||
}
|
||||
|
||||
public Ingreso(){}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -54,14 +43,6 @@ public class Ingreso {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public TipoIngreso getTipoIngreso() {
|
||||
return tipoIngreso;
|
||||
}
|
||||
|
||||
public void setTipoIngreso(TipoIngreso tipoIngreso) {
|
||||
this.tipoIngreso = tipoIngreso;
|
||||
}
|
||||
|
||||
public int getValor() {
|
||||
return valor;
|
||||
}
|
||||
@@ -70,6 +51,30 @@ public class Ingreso {
|
||||
this.valor = valor;
|
||||
}
|
||||
|
||||
public String getNroInicial() {
|
||||
return nroInicial;
|
||||
}
|
||||
|
||||
public void setNroInicial(String nroInicial) {
|
||||
this.nroInicial = nroInicial;
|
||||
}
|
||||
|
||||
public String getNroFinal() {
|
||||
return nroFinal;
|
||||
}
|
||||
|
||||
public void setNroFinal(String nroFinal) {
|
||||
this.nroFinal = nroFinal;
|
||||
}
|
||||
|
||||
public TipoIngreso getTipoIngreso() {
|
||||
return tipoIngreso;
|
||||
}
|
||||
|
||||
public void setTipoIngreso(TipoIngreso tipoIngreso) {
|
||||
this.tipoIngreso = tipoIngreso;
|
||||
}
|
||||
|
||||
public Caja getCaja() {
|
||||
return caja;
|
||||
}
|
||||
|
||||
@@ -130,10 +130,12 @@ public class MysqlIngresoDAO implements IngresoDAO{
|
||||
int updates;
|
||||
try {
|
||||
Connection conn = mysqlConnection.getConnection();
|
||||
PreparedStatement ps = conn.prepareStatement("insert into ingresos (valor, tipo_ingreso_id, caja_id) values (?,?,?)");
|
||||
PreparedStatement ps = conn.prepareStatement("insert into ingresos (valor, nro_inicial, nro_final, tipo_ingreso_id, caja_id) values (?,?,?,?,?)");
|
||||
ps.setInt(1, ingreso.getValor());
|
||||
ps.setInt(2, ingreso.getTipoIngreso().getId());
|
||||
ps.setInt(3, ingreso.getCaja().getId());
|
||||
ps.setString(2, ingreso.getNroInicial());
|
||||
ps.setString(3, ingreso.getNroFinal());
|
||||
ps.setInt(4, ingreso.getTipoIngreso().getId());
|
||||
ps.setInt(5, ingreso.getCaja().getId());
|
||||
|
||||
updates = ps.executeUpdate();
|
||||
ps.close();
|
||||
@@ -157,11 +159,13 @@ public class MysqlIngresoDAO implements IngresoDAO{
|
||||
int updates;
|
||||
try {
|
||||
Connection conn = mysqlConnection.getConnection();
|
||||
PreparedStatement ps = conn.prepareStatement("update ingresos set valor = ? , tipo_ingreso_id = ?, caja_id = ? where id = ?");
|
||||
PreparedStatement ps = conn.prepareStatement("update ingresos set valor = ? , nro_inicial = ?, nro_final = ?, tipo_ingreso_id = ?, caja_id = ? where id = ?");
|
||||
ps.setInt(1,ingreso.getValor());
|
||||
ps.setInt(2, ingreso.getTipoIngreso().getId());
|
||||
ps.setInt(3, ingreso.getCaja().getId());
|
||||
ps.setInt(4, ingreso.getId());
|
||||
ps.setString(2, ingreso.getNroInicial());
|
||||
ps.setString(3, ingreso.getNroFinal());
|
||||
ps.setInt(4, ingreso.getTipoIngreso().getId());
|
||||
ps.setInt(5, ingreso.getCaja().getId());
|
||||
ps.setInt(6, ingreso.getId());
|
||||
|
||||
updates = ps.executeUpdate();
|
||||
|
||||
@@ -227,6 +231,8 @@ public class MysqlIngresoDAO implements IngresoDAO{
|
||||
|
||||
ingreso.setId(rs.getInt("id"));
|
||||
ingreso.setValor(rs.getInt("valor"));
|
||||
ingreso.setNroInicial(rs.getString("nro_inicial"));
|
||||
ingreso.setNroFinal(rs.getString("nro_final"));
|
||||
ingreso.setTipoIngreso(tipoIngreso);
|
||||
ingreso.setCaja(caja);
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="danielcortes.xyz.views.ArqueoView">
|
||||
<grid id="27dc6" binding="contentPanel" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="27dc6" binding="contentPanel" layout-manager="GridLayoutManager" row-count="4" 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>
|
||||
<xy x="20" y="20" width="616" height="626"/>
|
||||
<xy x="20" y="20" width="616" height="646"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none">
|
||||
@@ -86,7 +86,7 @@
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="84446" layout-manager="GridLayoutManager" row-count="6" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="84446" layout-manager="GridLayoutManager" row-count="7" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="10" left="10" bottom="10" right="10"/>
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
@@ -172,7 +172,7 @@
|
||||
</component>
|
||||
<component id="cee37" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Arqueo"/>
|
||||
@@ -180,40 +180,48 @@
|
||||
</component>
|
||||
<component id="b0664" class="javax.swing.JTextField" binding="arqueoField">
|
||||
<constraints>
|
||||
<grid row="4" 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="5" 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"/>
|
||||
<font style="1"/>
|
||||
<text value="0"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="509b2" class="javax.swing.JTextField" binding="ajusteField">
|
||||
<constraints>
|
||||
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
<font style="1"/>
|
||||
<text value="0"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="bafd7" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Ajuste "/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="679e2" class="javax.swing.JSeparator">
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="2" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="3f85f" layout-manager="GridLayoutManager" row-count="19" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="10" left="10" bottom="10" right="10"/>
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="2" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
<grid row="0" column="0" row-span="3" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="etched" title="Detalle Efectivo">
|
||||
@@ -484,6 +492,16 @@
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<vspacer id="28775">
|
||||
<constraints>
|
||||
<grid row="2" 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>
|
||||
<vspacer id="93947">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
|
||||
@@ -26,6 +26,7 @@ package danielcortes.xyz.views;
|
||||
|
||||
import com.intellij.uiDesigner.core.GridConstraints;
|
||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||
import com.intellij.uiDesigner.core.Spacer;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.TitledBorder;
|
||||
@@ -204,7 +205,7 @@ public class ArqueoView {
|
||||
*/
|
||||
private void $$$setupUI$$$() {
|
||||
contentPanel = new JPanel();
|
||||
contentPanel.setLayout(new GridLayoutManager(2, 2, new Insets(0, 0, 0, 0), -1, -1));
|
||||
contentPanel.setLayout(new GridLayoutManager(4, 2, new Insets(0, 0, 0, 0), -1, -1));
|
||||
final JPanel panel1 = new JPanel();
|
||||
panel1.setLayout(new GridLayoutManager(5, 2, new Insets(10, 10, 10, 10), -1, -1));
|
||||
contentPanel.add(panel1, new GridConstraints(0, 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));
|
||||
@@ -235,7 +236,7 @@ public class ArqueoView {
|
||||
errorTarjetas.setVisible(false);
|
||||
panel1.add(errorTarjetas, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final JPanel panel2 = new JPanel();
|
||||
panel2.setLayout(new GridLayoutManager(6, 2, new Insets(10, 10, 10, 10), -1, -1));
|
||||
panel2.setLayout(new GridLayoutManager(7, 2, new Insets(10, 10, 10, 10), -1, -1));
|
||||
contentPanel.add(panel2, new GridConstraints(1, 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));
|
||||
panel2.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Resumen"));
|
||||
final JLabel label3 = new JLabel();
|
||||
@@ -268,21 +269,27 @@ public class ArqueoView {
|
||||
panel2.add(ingresosField, new GridConstraints(2, 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("Arqueo");
|
||||
panel2.add(label7, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
panel2.add(label7, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
arqueoField = new JTextField();
|
||||
arqueoField.setEditable(false);
|
||||
Font arqueoFieldFont = this.$$$getFont$$$(null, Font.BOLD, -1, arqueoField.getFont());
|
||||
if (arqueoFieldFont != null) arqueoField.setFont(arqueoFieldFont);
|
||||
arqueoField.setText("0");
|
||||
panel2.add(arqueoField, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||
panel2.add(arqueoField, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||
ajusteField = new JTextField();
|
||||
ajusteField.setEditable(false);
|
||||
Font ajusteFieldFont = this.$$$getFont$$$(null, Font.BOLD, -1, ajusteField.getFont());
|
||||
if (ajusteFieldFont != null) ajusteField.setFont(ajusteFieldFont);
|
||||
ajusteField.setText("0");
|
||||
panel2.add(ajusteField, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||
panel2.add(ajusteField, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||
final JLabel label8 = new JLabel();
|
||||
label8.setText("Ajuste ");
|
||||
panel2.add(label8, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
panel2.add(label8, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final JSeparator separator1 = new JSeparator();
|
||||
panel2.add(separator1, new GridConstraints(4, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
|
||||
final JPanel panel3 = new JPanel();
|
||||
panel3.setLayout(new GridLayoutManager(19, 2, new Insets(10, 10, 10, 10), -1, -1));
|
||||
contentPanel.add(panel3, new GridConstraints(0, 0, 2, 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));
|
||||
contentPanel.add(panel3, new GridConstraints(0, 0, 3, 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));
|
||||
panel3.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Detalle Efectivo", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, -1, -1, panel3.getFont())));
|
||||
final JLabel label9 = new JLabel();
|
||||
label9.setText("$20000");
|
||||
@@ -386,6 +393,10 @@ public class ArqueoView {
|
||||
errorDiez.setText("Error");
|
||||
errorDiez.setVisible(false);
|
||||
panel3.add(errorDiez, new GridConstraints(17, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final Spacer spacer1 = new Spacer();
|
||||
contentPanel.add(spacer1, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
|
||||
final Spacer spacer2 = new Spacer();
|
||||
contentPanel.add(spacer2, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</component>
|
||||
</children>
|
||||
</scrollpane>
|
||||
<grid id="7fa26" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="7fa26" layout-manager="GridLayoutManager" row-count="3" column-count="4" 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"/>
|
||||
@@ -39,31 +39,15 @@
|
||||
<children>
|
||||
<component id="50b32" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" 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="3" 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="Tipo"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="d0439" 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="Valor"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="375b0" class="javax.swing.JTextField" binding="valorField">
|
||||
<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">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="b5d8c" class="javax.swing.JComboBox" binding="tipoCombo">
|
||||
<constraints>
|
||||
<grid row="1" column="0" 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="3" 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>
|
||||
@@ -71,9 +55,57 @@
|
||||
<model/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="d0439" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" 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="Valor"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="375b0" class="javax.swing.JTextField" binding="valorField">
|
||||
<constraints>
|
||||
<grid row="1" 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>
|
||||
<component id="9bb1" 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="N° Inicial"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="3f626" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="2" 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="N° Final"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="461c1" class="javax.swing.JTextField" binding="nroInicialField">
|
||||
<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">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="949e" class="javax.swing.JTextField" binding="nroFinalField">
|
||||
<constraints>
|
||||
<grid row="1" column="2" 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="d11b0" class="javax.swing.JLabel" binding="errorTipoIngreso">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="2" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<foreground color="-65536"/>
|
||||
@@ -82,6 +114,16 @@
|
||||
</properties>
|
||||
</component>
|
||||
<component id="4b7ff" class="javax.swing.JLabel" binding="errorValor">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<foreground color="-65536"/>
|
||||
<text value="Label"/>
|
||||
<visible value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="7d011" class="javax.swing.JLabel" binding="errorNroInicial">
|
||||
<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"/>
|
||||
</constraints>
|
||||
@@ -91,6 +133,16 @@
|
||||
<visible value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="ef90" class="javax.swing.JLabel" binding="errorNroFinal">
|
||||
<constraints>
|
||||
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<foreground color="-65536"/>
|
||||
<text value="Label"/>
|
||||
<visible value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="ea865" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
|
||||
@@ -44,6 +44,10 @@ public class IngresosView {
|
||||
private JLabel errorTipoIngreso;
|
||||
private JLabel errorValor;
|
||||
private JButton editarButton;
|
||||
private JTextField nroInicialField;
|
||||
private JTextField nroFinalField;
|
||||
private JLabel errorNroInicial;
|
||||
private JLabel errorNroFinal;
|
||||
|
||||
private IngresosTableModel ingresosTableModel;
|
||||
|
||||
@@ -74,10 +78,6 @@ public class IngresosView {
|
||||
return eliminarButton;
|
||||
}
|
||||
|
||||
public JButton getEditarButton() {
|
||||
return editarButton;
|
||||
}
|
||||
|
||||
public JTextField getTotalIngresoField() {
|
||||
return totalIngresoField;
|
||||
}
|
||||
@@ -90,10 +90,6 @@ public class IngresosView {
|
||||
return tipoCombo;
|
||||
}
|
||||
|
||||
public IngresosTableModel getIngresosTableModel() {
|
||||
return ingresosTableModel;
|
||||
}
|
||||
|
||||
public JLabel getErrorTipoIngreso() {
|
||||
return errorTipoIngreso;
|
||||
}
|
||||
@@ -102,6 +98,30 @@ public class IngresosView {
|
||||
return errorValor;
|
||||
}
|
||||
|
||||
public JButton getEditarButton() {
|
||||
return editarButton;
|
||||
}
|
||||
|
||||
public JTextField getNroInicialField() {
|
||||
return nroInicialField;
|
||||
}
|
||||
|
||||
public JTextField getNroFinalField() {
|
||||
return nroFinalField;
|
||||
}
|
||||
|
||||
public JLabel getErrorNroInicial() {
|
||||
return errorNroInicial;
|
||||
}
|
||||
|
||||
public JLabel getErrorNroFinal() {
|
||||
return errorNroFinal;
|
||||
}
|
||||
|
||||
public IngresosTableModel getIngresosTableModel() {
|
||||
return ingresosTableModel;
|
||||
}
|
||||
|
||||
{
|
||||
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||
// >>> IMPORTANT!! <<<
|
||||
@@ -128,39 +148,59 @@ public class IngresosView {
|
||||
panel1.add(scrollPane1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
|
||||
scrollPane1.setViewportView(ingresosTable);
|
||||
final JPanel panel2 = new JPanel();
|
||||
panel2.setLayout(new GridLayoutManager(3, 2, new Insets(0, 0, 0, 0), -1, -1));
|
||||
panel2.setLayout(new GridLayoutManager(3, 4, new Insets(0, 0, 0, 0), -1, -1));
|
||||
panel1.add(panel2, 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));
|
||||
final JLabel label1 = new JLabel();
|
||||
label1.setText("Tipo");
|
||||
panel2.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final JLabel label2 = new JLabel();
|
||||
label2.setText("Valor");
|
||||
panel2.add(label2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
valorField = new JTextField();
|
||||
panel2.add(valorField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||
panel2.add(label1, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
tipoCombo = new JComboBox();
|
||||
final DefaultComboBoxModel defaultComboBoxModel1 = new DefaultComboBoxModel();
|
||||
tipoCombo.setModel(defaultComboBoxModel1);
|
||||
panel2.add(tipoCombo, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||
panel2.add(tipoCombo, new GridConstraints(1, 3, 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 label2 = new JLabel();
|
||||
label2.setText("Valor");
|
||||
panel2.add(label2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
valorField = new JTextField();
|
||||
panel2.add(valorField, new GridConstraints(1, 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 JLabel label3 = new JLabel();
|
||||
label3.setText("N° Inicial");
|
||||
panel2.add(label3, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final JLabel label4 = new JLabel();
|
||||
label4.setText("N° Final");
|
||||
panel2.add(label4, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
nroInicialField = new JTextField();
|
||||
panel2.add(nroInicialField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||
nroFinalField = new JTextField();
|
||||
panel2.add(nroFinalField, new GridConstraints(1, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||
errorTipoIngreso = new JLabel();
|
||||
errorTipoIngreso.setForeground(new Color(-65536));
|
||||
errorTipoIngreso.setText("Label");
|
||||
errorTipoIngreso.setVisible(false);
|
||||
panel2.add(errorTipoIngreso, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
panel2.add(errorTipoIngreso, new GridConstraints(2, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
errorValor = new JLabel();
|
||||
errorValor.setForeground(new Color(-65536));
|
||||
errorValor.setText("Label");
|
||||
errorValor.setVisible(false);
|
||||
panel2.add(errorValor, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
panel2.add(errorValor, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
errorNroInicial = new JLabel();
|
||||
errorNroInicial.setForeground(new Color(-65536));
|
||||
errorNroInicial.setText("Label");
|
||||
errorNroInicial.setVisible(false);
|
||||
panel2.add(errorNroInicial, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
errorNroFinal = new JLabel();
|
||||
errorNroFinal.setForeground(new Color(-65536));
|
||||
errorNroFinal.setText("Label");
|
||||
errorNroFinal.setVisible(false);
|
||||
panel2.add(errorNroFinal, new GridConstraints(2, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final JPanel panel3 = new JPanel();
|
||||
panel3.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1));
|
||||
panel1.add(panel3, 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));
|
||||
final JPanel panel4 = new JPanel();
|
||||
panel4.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
|
||||
panel3.add(panel4, new GridConstraints(0, 2, 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));
|
||||
final JLabel label3 = new JLabel();
|
||||
label3.setText("Total Ingresos");
|
||||
panel4.add(label3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final JLabel label5 = new JLabel();
|
||||
label5.setText("Total Ingresos");
|
||||
panel4.add(label5, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
totalIngresoField = new JTextField();
|
||||
totalIngresoField.setEditable(false);
|
||||
panel4.add(totalIngresoField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||
|
||||
@@ -33,9 +33,9 @@ public class IngresosTableModel extends AbstractTableModel {
|
||||
private String[] columns;
|
||||
private ArrayList<Ingreso> rows;
|
||||
|
||||
public IngresosTableModel(){
|
||||
public IngresosTableModel() {
|
||||
super();
|
||||
this.columns = new String[]{"Tipo", "Valor"};
|
||||
this.columns = new String[]{"Valor", "N° Inicial", "N° Final", "Tipo"};
|
||||
this.rows = new ArrayList<>();
|
||||
}
|
||||
|
||||
@@ -53,38 +53,42 @@ public class IngresosTableModel extends AbstractTableModel {
|
||||
|
||||
public void addRow(Ingreso ingreso) {
|
||||
this.rows.add(ingreso);
|
||||
this.fireTableRowsInserted(getRowCount()-1, getRowCount()-1);
|
||||
this.fireTableRowsInserted(getRowCount() - 1, getRowCount() - 1);
|
||||
}
|
||||
|
||||
public void removeRow(int row){
|
||||
public void removeRow(int row) {
|
||||
this.rows.remove(row);
|
||||
this.fireTableRowsDeleted(row,row);
|
||||
this.fireTableRowsDeleted(row, row);
|
||||
}
|
||||
|
||||
public void removeRows(){
|
||||
public void removeRows() {
|
||||
int rowCount = getRowCount();
|
||||
if(rowCount > 0){
|
||||
if (rowCount > 0) {
|
||||
this.rows.clear();
|
||||
this.fireTableRowsDeleted(0, rowCount-1);
|
||||
this.fireTableRowsDeleted(0, rowCount - 1);
|
||||
}
|
||||
}
|
||||
|
||||
public Object getValueAt(int row, int col) {
|
||||
switch (col) {
|
||||
case 0:
|
||||
return this.rows.get(row).getTipoIngreso().getNombre();
|
||||
case 1:
|
||||
return this.rows.get(row).getValor();
|
||||
case 1:
|
||||
return this.rows.get(row).getNroInicial();
|
||||
case 2:
|
||||
return this.rows.get(row).getNroFinal();
|
||||
case 3:
|
||||
return this.rows.get(row).getTipoIngreso().getNombre();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Ingreso getIngreso(int row){
|
||||
public Ingreso getIngreso(int row) {
|
||||
return this.rows.get(row);
|
||||
}
|
||||
|
||||
public void setIngreso(int editingId, Ingreso ingreso) {
|
||||
this.rows.set(editingId, ingreso);
|
||||
this.fireTableRowsUpdated(getRowCount()-2, getRowCount()-1);
|
||||
this.fireTableRowsUpdated(getRowCount() - 2, getRowCount() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user