diff --git a/.contrasenias.txt b/.contrasenias.txt index 24e6cf7..08e7214 100644 --- a/.contrasenias.txt +++ b/.contrasenias.txt @@ -1 +1,2 @@ admin:8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918 +usuario:9250e222c4c71f0c58d4c54b50a880a312e9f9fed55d5c3aa0b0e860ded99165 diff --git a/bin/Logica/Gestion.class b/bin/Logica/Gestion.class index 02f9e53..c058f83 100644 Binary files a/bin/Logica/Gestion.class and b/bin/Logica/Gestion.class differ diff --git a/bin/Logica/Transaccion.class b/bin/Logica/Transaccion.class index a8e1d04..fa996f6 100644 Binary files a/bin/Logica/Transaccion.class and b/bin/Logica/Transaccion.class differ diff --git a/doc/Ficheros/Configuracion.html b/doc/Ficheros/Configuracion.html index 01c749c..b6bb621 100644 --- a/doc/Ficheros/Configuracion.html +++ b/doc/Ficheros/Configuracion.html @@ -2,9 +2,9 @@ - + Configuracion - + diff --git a/doc/Ficheros/class-use/Configuracion.html b/doc/Ficheros/class-use/Configuracion.html index d86ec9f..6fc3485 100644 --- a/doc/Ficheros/class-use/Configuracion.html +++ b/doc/Ficheros/class-use/Configuracion.html @@ -2,9 +2,9 @@ - + Uses of Class Ficheros.Configuracion - + diff --git a/doc/Ficheros/package-frame.html b/doc/Ficheros/package-frame.html index 10cb7c3..0e6b061 100644 --- a/doc/Ficheros/package-frame.html +++ b/doc/Ficheros/package-frame.html @@ -2,9 +2,9 @@ - + Ficheros - + diff --git a/doc/Ficheros/package-summary.html b/doc/Ficheros/package-summary.html index 782ee92..e8d15e1 100644 --- a/doc/Ficheros/package-summary.html +++ b/doc/Ficheros/package-summary.html @@ -2,9 +2,9 @@ - + Ficheros - + diff --git a/doc/Ficheros/package-tree.html b/doc/Ficheros/package-tree.html index 38f5b19..42ef444 100644 --- a/doc/Ficheros/package-tree.html +++ b/doc/Ficheros/package-tree.html @@ -2,9 +2,9 @@ - + Ficheros Class Hierarchy - + diff --git a/doc/Ficheros/package-use.html b/doc/Ficheros/package-use.html index d33fbc9..5f23ea1 100644 --- a/doc/Ficheros/package-use.html +++ b/doc/Ficheros/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package Ficheros - + diff --git a/doc/Logica/Gestion.html b/doc/Logica/Gestion.html index d2d5a27..cc660e2 100644 --- a/doc/Logica/Gestion.html +++ b/doc/Logica/Gestion.html @@ -2,9 +2,9 @@ - + Gestion - + @@ -18,7 +18,7 @@ catch(err) { } //--> -var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10}; +var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -172,41 +172,66 @@ implements java.io.Serializable void +editarTransaccion(java.lang.String nombreViejo, + java.lang.String nombreNuevo) +
Permite editar una transaccion por nombre para cambiarselo
+ + + +void +editarTransaccionDiero(java.lang.String nombreViejo, + float dinero) +
Edita la transaccion con el nombre indicado alterando el dinero que cuesta
+ + + +void +editarTransaccionFecha(java.lang.String nombreViejo, + java.time.LocalDate fecha) +
Edita la fecha de una transaccion dada su fecha
+ + + +void eliminarTransaccion(java.lang.String transaccion)
Elimina una transaccion
- + boolean esIngreso()
Devuelve verdadero si es un ingerso y falso si es un gasto
- + java.util.Vector<Transaccion> getElementos()
Devuelve todas las transacciones que tiene
- + java.lang.String getNombre()
Devuelve el nombre de la gestion
- + float getSuma()
Devuelve la suma (sin tener e cuenta si es gasto o ingreso) de la gestion
- + float getTotal()
Devuelve la suma de todos sus datos, esta vez teniendo en cuenta si debe sumar o restar
- + +void +setNombre(java.lang.String nombre)  + + java.lang.String toString()  @@ -270,6 +295,15 @@ implements java.io.Serializable + + + + @@ -340,6 +374,54 @@ implements java.io.Serializable + + + + + + + + + + + + diff --git a/doc/Logica/Meses.html b/doc/Logica/Meses.html index dc0169b..aab7717 100644 --- a/doc/Logica/Meses.html +++ b/doc/Logica/Meses.html @@ -2,9 +2,9 @@ - + Meses - + diff --git a/doc/Logica/Transaccion.html b/doc/Logica/Transaccion.html index a58f9bb..d25ae6d 100644 --- a/doc/Logica/Transaccion.html +++ b/doc/Logica/Transaccion.html @@ -2,9 +2,9 @@ - + Transaccion - + @@ -18,7 +18,7 @@ catch(err) { } //--> -var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10}; +var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -203,8 +203,34 @@ implements java.io.Serializable +void +setFecha(java.time.LocalDate fecha) +
edita la fecha de la transaccion
+ + + +void +setName(java.lang.String nombre) +
Edita el nombre de la transaccion
+ + + +void +setPrecio(float nuevo) +
Edita el precio de la nueva transaccion
+ + + java.lang.String -toString()  +toString() +
Devuelve todos los datos de la transaccion
+ + + +java.lang.String +toStringCorto() +
Devuelve los datos importantes de la transaccion
+ @@ -352,7 +395,7 @@ implements java.io.Serializable - diff --git a/doc/Logica/class-use/Gestion.html b/doc/Logica/class-use/Gestion.html index c92f720..80ea2ff 100644 --- a/doc/Logica/class-use/Gestion.html +++ b/doc/Logica/class-use/Gestion.html @@ -2,9 +2,9 @@ - + Uses of Class Logica.Gestion - + diff --git a/doc/Logica/class-use/Meses.html b/doc/Logica/class-use/Meses.html index d1057af..bfd42ac 100644 --- a/doc/Logica/class-use/Meses.html +++ b/doc/Logica/class-use/Meses.html @@ -2,9 +2,9 @@ - + Uses of Class Logica.Meses - + diff --git a/doc/Logica/class-use/Transaccion.html b/doc/Logica/class-use/Transaccion.html index b5227c8..0edb75b 100644 --- a/doc/Logica/class-use/Transaccion.html +++ b/doc/Logica/class-use/Transaccion.html @@ -2,9 +2,9 @@ - + Uses of Class Logica.Transaccion - + diff --git a/doc/Logica/package-frame.html b/doc/Logica/package-frame.html index 86375d3..3383473 100644 --- a/doc/Logica/package-frame.html +++ b/doc/Logica/package-frame.html @@ -2,9 +2,9 @@ - + Logica - + diff --git a/doc/Logica/package-summary.html b/doc/Logica/package-summary.html index 898e9aa..5fed01c 100644 --- a/doc/Logica/package-summary.html +++ b/doc/Logica/package-summary.html @@ -2,9 +2,9 @@ - + Logica - + diff --git a/doc/Logica/package-tree.html b/doc/Logica/package-tree.html index d37ebe0..dd2c919 100644 --- a/doc/Logica/package-tree.html +++ b/doc/Logica/package-tree.html @@ -2,9 +2,9 @@ - + Logica Class Hierarchy - + diff --git a/doc/Logica/package-use.html b/doc/Logica/package-use.html index 452c2fc..e9c0038 100644 --- a/doc/Logica/package-use.html +++ b/doc/Logica/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package Logica - + diff --git a/doc/Main.html b/doc/Main.html index 7ea4679..5a6e384 100644 --- a/doc/Main.html +++ b/doc/Main.html @@ -2,9 +2,9 @@ - + Main - + diff --git a/doc/VistaControlador/BarraOpciones.html b/doc/VistaControlador/BarraOpciones.html index 7f42bf5..76fde0f 100644 --- a/doc/VistaControlador/BarraOpciones.html +++ b/doc/VistaControlador/BarraOpciones.html @@ -2,9 +2,9 @@ - + BarraOpciones - + diff --git a/doc/VistaControlador/ControladorAniadirVisualizar.html b/doc/VistaControlador/ControladorAniadirVisualizar.html index 6cda564..7d9239d 100644 --- a/doc/VistaControlador/ControladorAniadirVisualizar.html +++ b/doc/VistaControlador/ControladorAniadirVisualizar.html @@ -2,9 +2,9 @@ - + ControladorAniadirVisualizar - + diff --git a/doc/VistaControlador/ControladorBarra.html b/doc/VistaControlador/ControladorBarra.html index b034f9c..3e13b9f 100644 --- a/doc/VistaControlador/ControladorBarra.html +++ b/doc/VistaControlador/ControladorBarra.html @@ -2,9 +2,9 @@ - + ControladorBarra - + @@ -50,7 +50,7 @@ var activeTableTab = "activeTableTab"; diff --git a/doc/allclasses-noframe.html b/doc/allclasses-noframe.html index f4c338a..1951e7f 100644 --- a/doc/allclasses-noframe.html +++ b/doc/allclasses-noframe.html @@ -2,9 +2,9 @@ - + All Classes - + @@ -16,7 +16,9 @@
  • Configuracion
  • ControladorAniadirVisualizar
  • ControladorBarra
  • -
  • ControladorPanelLateral
  • +
  • ControladorPanelGestion
  • +
  • ControladorPanelInterfaz
  • +
  • ControladorPanelModificar
  • Gestion
  • Main
  • Menu
  • @@ -24,7 +26,10 @@
  • MostrarTodo
  • Transaccion
  • VistaAniadirVisualizar
  • -
  • VistaPanelLateral
  • +
  • VistaPanel
  • +
  • VistaPanelGestion
  • +
  • VistaPanelInterfaz
  • +
  • VistaPanelModificar
  • diff --git a/doc/class-use/Main.html b/doc/class-use/Main.html index 2d14978..df5623a 100644 --- a/doc/class-use/Main.html +++ b/doc/class-use/Main.html @@ -2,9 +2,9 @@ - + Uses of Class Main - + diff --git a/doc/constant-values.html b/doc/constant-values.html index b1bb8dd..3988fa9 100644 --- a/doc/constant-values.html +++ b/doc/constant-values.html @@ -2,9 +2,9 @@ - + Constant Field Values - + diff --git a/doc/deprecated-list.html b/doc/deprecated-list.html index 8b36669..1ccbbb5 100644 --- a/doc/deprecated-list.html +++ b/doc/deprecated-list.html @@ -2,9 +2,9 @@ - + Deprecated List - + diff --git a/doc/help-doc.html b/doc/help-doc.html index 7d3e568..c47fbcf 100644 --- a/doc/help-doc.html +++ b/doc/help-doc.html @@ -2,9 +2,9 @@ - + API Help - + diff --git a/doc/index-files/index-1.html b/doc/index-files/index-1.html index 04ac077..b12e077 100644 --- a/doc/index-files/index-1.html +++ b/doc/index-files/index-1.html @@ -2,9 +2,9 @@ - + A-Index - + @@ -69,7 +69,7 @@ -
    A B C D E F G I L M S T V  +
    A B C E F G I L M S T V 

    A

    @@ -78,7 +78,11 @@
     
    actionPerformed(ActionEvent) - Method in class VistaControlador.ControladorBarra
     
    -
    actionPerformed(ActionEvent) - Method in class VistaControlador.ControladorPanelLateral
    +
    actionPerformed(ActionEvent) - Method in class VistaControlador.ControladorPanelGestion
    +
     
    +
    actionPerformed(ActionEvent) - Method in class VistaControlador.ControladorPanelInterfaz
    +
     
    +
    actionPerformed(ActionEvent) - Method in class VistaControlador.ControladorPanelModificar
     
    alterarVisibilidad(int) - Method in class Logica.Gestion
    @@ -109,7 +113,7 @@
    Aniade una transaccion y la coloca en el mes y gestion que le corresponde, creandolos si no existen todavia
    -A B C D E F G I L M S T V 
    +A B C E F G I L M S T V 
    diff --git a/doc/index-files/index-10.html b/doc/index-files/index-10.html index dc610a0..33daf23 100644 --- a/doc/index-files/index-10.html +++ b/doc/index-files/index-10.html @@ -2,9 +2,9 @@ - -M-Index - + +S-Index + @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -69,7 +69,7 @@
    -
    A B C D E F G I L M S T V  +
    A B C E F G I L M S T V 

    B

    @@ -81,7 +81,7 @@
    Inicializa labarra con los datos por defecto
    -A B C D E F G I L M S T V 
    +A B C E F G I L M S T V 
    diff --git a/doc/index-files/index-3.html b/doc/index-files/index-3.html index c5c6245..5c5c20d 100644 --- a/doc/index-files/index-3.html +++ b/doc/index-files/index-3.html @@ -2,9 +2,9 @@ - + C-Index - + @@ -69,7 +69,7 @@
    -
    A B C D E F G I L M S T V  +
    A B C E F G I L M S T V 

    C

    @@ -96,14 +96,20 @@
    Constructor del controlador
    -
    ControladorPanelLateral - Class in VistaControlador
    +
    ControladorPanelGestion - Class in VistaControlador
     
    -
    ControladorPanelLateral(VistaPanelLateral, Menu) - Constructor for class VistaControlador.ControladorPanelLateral
    +
    ControladorPanelGestion(VistaPanelGestion, Menu) - Constructor for class VistaControlador.ControladorPanelGestion
    Controlador del panel lateral que gestionara los datos
    +
    ControladorPanelInterfaz - Class in VistaControlador
    +
     
    +
    ControladorPanelInterfaz(VistaPanelInterfaz, Menu) - Constructor for class VistaControlador.ControladorPanelInterfaz
    +
     
    +
    ControladorPanelModificar - Class in VistaControlador
    +
     
    -A B C D E F G I L M S T V 
    +A B C E F G I L M S T V 
    diff --git a/doc/index-files/index-4.html b/doc/index-files/index-4.html index ab7c134..406e468 100644 --- a/doc/index-files/index-4.html +++ b/doc/index-files/index-4.html @@ -2,9 +2,9 @@ - -D-Index - + +E-Index + @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ diff --git a/doc/overview-summary.html b/doc/overview-summary.html index 1db33a1..69495bd 100644 --- a/doc/overview-summary.html +++ b/doc/overview-summary.html @@ -2,9 +2,9 @@ - + Overview - + diff --git a/doc/overview-tree.html b/doc/overview-tree.html index 927642a..0e7f570 100644 --- a/doc/overview-tree.html +++ b/doc/overview-tree.html @@ -2,9 +2,9 @@ - + Class Hierarchy - + @@ -97,7 +97,13 @@
  • javax.swing.JPanel (implements javax.accessibility.Accessible)
  • @@ -123,7 +129,9 @@
  • Ficheros.Configuracion
  • VistaControlador.ControladorAniadirVisualizar (implements java.awt.event.ActionListener)
  • VistaControlador.ControladorBarra (implements java.awt.event.ActionListener)
  • -
  • VistaControlador.ControladorPanelLateral (implements java.awt.event.ActionListener, com.github.lgooddatepicker.optionalusertools.DateChangeListener)
  • +
  • VistaControlador.ControladorPanelGestion (implements java.awt.event.ActionListener)
  • +
  • VistaControlador.ControladorPanelInterfaz (implements java.awt.event.ActionListener)
  • +
  • VistaControlador.ControladorPanelModificar (implements java.awt.event.ActionListener)
  • Logica.Gestion (implements java.io.Serializable)
  • Main
  • Logica.Meses
  • diff --git a/doc/package-frame.html b/doc/package-frame.html index 16af77e..6272613 100644 --- a/doc/package-frame.html +++ b/doc/package-frame.html @@ -2,9 +2,9 @@ - + <Unnamed> - + diff --git a/doc/package-summary.html b/doc/package-summary.html index c90a2fb..b43d6b9 100644 --- a/doc/package-summary.html +++ b/doc/package-summary.html @@ -2,8 +2,8 @@ - - + + diff --git a/doc/package-tree.html b/doc/package-tree.html index cd44cec..767a82e 100644 --- a/doc/package-tree.html +++ b/doc/package-tree.html @@ -2,9 +2,9 @@ - + Class Hierarchy - + diff --git a/doc/package-use.html b/doc/package-use.html index 9ce2ca0..a5411b2 100644 --- a/doc/package-use.html +++ b/doc/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package - + diff --git a/doc/serialized-form.html b/doc/serialized-form.html index 3323f45..d356a91 100644 --- a/doc/serialized-form.html +++ b/doc/serialized-form.html @@ -2,9 +2,9 @@ - + Serialized Form - + @@ -101,10 +101,14 @@

    isPositivo

    boolean isPositivo
    -
  • +
  • nombre

    java.lang.String nombre
  • +
  • +

    isModified

    +
    boolean isModified
    +
  • @@ -137,10 +141,14 @@

    dia

    java.time.LocalDate dia
    -
  • +
  • gestion

    Gestion gestion
  • +
  • +

    isModified

    +
    boolean isModified
    +
  • @@ -198,10 +206,34 @@

    mostrar

    javax.swing.JMenu mostrar
    -
  • +
  • mostrarTodo

    javax.swing.JMenuItem mostrarTodo
  • +
  • +

    vistas

    +
    javax.swing.JMenu vistas
    +
  • +
  • +

    gestion

    +
    javax.swing.JMenuItem gestion
    +
  • +
  • +

    modificacion

    +
    javax.swing.JMenuItem modificacion
    +
  • +
  • +

    menuInterfaz

    +
    javax.swing.JMenuItem menuInterfaz
    +
  • +
  • +

    administracion

    +
    javax.swing.JMenu administracion
    +
  • +
  • +

    aniadirUsuario

    +
    javax.swing.JMenuItem aniadirUsuario
    +
  • @@ -231,8 +263,16 @@
    VistaAniadirVisualizar gastos
  • +

    panelGestion

    +
    VistaPanelGestion panelGestion
    +
  • +
  • +

    panelModificar

    +
    VistaPanelModificar panelModificar
    +
  • +
  • panel

    -
    VistaPanelLateral panel
    +
    VistaPanel panel
  • rutaGuardado

    @@ -262,10 +302,26 @@

    datosGastos

    Gestion datosGastos
  • -
  • +
  • datosIngresos

    Gestion datosIngresos
  • +
  • +

    elegirMes

    +
    com.github.lgooddatepicker.components.DatePicker elegirMes
    +
  • +
  • +

    anio

    +
    int anio
    +
  • +
  • +

    mes

    +
    java.time.Month mes
    +
  • +
  • +

    panelInterfaz

    +
    VistaPanelInterfaz panelInterfaz
    +
  • @@ -322,22 +378,23 @@

    panel

    javax.swing.JScrollPane panel
    -
  • +
  • menu

    Menu menu
  • -
  • -

    controlador

    -
    ControladorAniadirVisualizar controlador
    -
  • -
  • +
  • -

    Class VistaControlador.VistaPanelLateral extends javax.swing.JPanel implements Serializable

    +

    Class VistaControlador.VistaPanel extends javax.swing.JPanel implements Serializable

    +
  • +
  • + + +

    Class VistaControlador.VistaPanelGestion extends VistaPanel implements Serializable

    • Serialized Fields

      @@ -370,6 +427,86 @@
  • +
  • + + +

    Class VistaControlador.VistaPanelInterfaz extends VistaPanel implements Serializable

    +
      +
    • +

      Serialized Fields

      +
        +
      • +

        menu

        +
        javax.swing.ButtonGroup menu
        +
      • +
      • +

        temaClaro

        +
        javax.swing.JRadioButton temaClaro
        +
      • +
      • +

        temaRosa

        +
        javax.swing.JRadioButton temaRosa
        +
      • +
      • +

        temaOscuro

        +
        javax.swing.JRadioButton temaOscuro
        +
      • +
      • +

        aplicarBarra

        +
        javax.swing.JCheckBox aplicarBarra
        +
      • +
      • +

        aplicarCambios

        +
        javax.swing.JButton aplicarCambios
        +
      • +
      +
    • +
    +
  • +
  • + + +

    Class VistaControlador.VistaPanelModificar extends VistaPanel implements Serializable

    +
      +
    • +

      Serialized Fields

      +
        +
      • +

        viejoNombre

        +
        javax.swing.JTextField viejoNombre
        +
      • +
      • +

        nuevoNombre

        +
        javax.swing.JTextField nuevoNombre
        +
      • +
      • +

        viejoEditar

        +
        javax.swing.JTextField viejoEditar
        +
      • +
      • +

        nuevoEditar

        +
        javax.swing.JTextField nuevoEditar
        +
      • +
      • +

        dineroPanel

        +
        javax.swing.JTextField dineroPanel
        +
      • +
      • +

        dineroEditar

        +
        javax.swing.JTextField dineroEditar
        +
      • +
      • +

        editarTransaccion

        +
        javax.swing.JButton editarTransaccion
        +
      • +
      • +

        editarGestion

        +
        javax.swing.JButton editarGestion
        +
      • +
      +
    • +
    +
  • diff --git a/src/Logica/Gestion.java b/src/Logica/Gestion.java index 0b34f2a..b79d157 100644 --- a/src/Logica/Gestion.java +++ b/src/Logica/Gestion.java @@ -9,6 +9,7 @@ public class Gestion implements Serializable{ private float total; private boolean isPositivo; private String nombre; + private boolean isModified; /** * Constructor principal de gestion @@ -22,6 +23,7 @@ public class Gestion implements Serializable{ this.total = 0; this.nombre = nombre; this.isPositivo = isPositivo; + this.isModified = false; } /** @@ -35,6 +37,7 @@ public class Gestion implements Serializable{ public void setNombre(String nombre) { this.nombre = nombre; + this.isModified = true; } /** @@ -93,6 +96,12 @@ public class Gestion implements Serializable{ } } + /** + * Permite editar una transaccion por nombre para cambiarselo + * + * @param nombreViejo nombre de la transaccion a cambiar + * @param nombreNuevo nuevo nombre + */ public void editarTransaccion(String nombreViejo, String nombreNuevo) { for(Transaccion elemento:this.gestiones) { if(elemento.getNombre().equals(nombreViejo)) { @@ -102,6 +111,12 @@ public class Gestion implements Serializable{ } } + /** + * Edita la fecha de una transaccion dada su fecha + * + * @param nombreViejo nombre de la trasnaccion a editar + * @param fecha nueva fecha + */ public void editarTransaccionFecha(String nombreViejo, LocalDate fecha) { for(Transaccion elemento:this.gestiones) { if(elemento.getNombre().equals(nombreViejo)) { @@ -111,6 +126,12 @@ public class Gestion implements Serializable{ } } + /** + * Edita la transaccion con el nombre indicado alterando el dinero que cuesta + * + * @param nombreViejo nombre de la transaccion a editar + * @param dinero nueva cantidad de dinero; + */ public void editarTransaccionDiero(String nombreViejo, float dinero) { for(Transaccion elemento:this.gestiones) { if(elemento.getNombre().equals(nombreViejo)) { @@ -153,9 +174,7 @@ public class Gestion implements Serializable{ } public String toString() { - String ret = ""; - ret += this.nombre + " " + this.suma + " " + this.isPositivo; - return ret; + return this.nombre + " " + this.suma + " Gastos:" + this.isPositivo + " Modificado:"+ this.isModified; } } diff --git a/src/Logica/Transaccion.java b/src/Logica/Transaccion.java index 20bf61b..4182b97 100644 --- a/src/Logica/Transaccion.java +++ b/src/Logica/Transaccion.java @@ -11,6 +11,7 @@ public class Transaccion implements Serializable{ private boolean visible; private LocalDate dia; private Gestion gestion; + private boolean isModified; /** * Constructor de transaccion @@ -26,12 +27,28 @@ public class Transaccion implements Serializable{ this.visible = true; this.dia = dia; this.gestion=gestion; + this.isModified = false; } - public String toString() { + /** + * Devuelve los datos importantes de la transaccion + * + * @return cadena los datos principales a mostrar + */ + public String toStringCorto() { return this.nombre + " " + this.dinero; } + /** + * Devuelve todos los datos de la transaccion + * + * @return cadena con todos los datos + */ + public String toString() { + return this.nombre + " " + this.dinero + " " + this.dia.toString() + " Modificado:" + this.isModified + + " Visible:" + this.visible; + } + /** * devuelve si la transaccion se contara en la gestion o no * @@ -94,15 +111,33 @@ public class Transaccion implements Serializable{ return this.nombre; } + /** + * Edita el nombre de la transaccion + * + * @param nombre nuevo nombre + */ public void setName(String nombre) { this.nombre = nombre; + this.isModified = true; } + /** + * edita la fecha de la transaccion + * + * @param fecha nueva fecha + */ public void setFecha(LocalDate fecha) { this.dia = fecha; + this.isModified = true; } + /** + * Edita el precio de la nueva transaccion + * + * @param nuevo nuevo precio + */ public void setPrecio(float nuevo) { this.dinero = nuevo; + this.isModified = true; } } diff --git a/src/VistaControlador/Menu.java b/src/VistaControlador/Menu.java index 47077ce..12bb7fd 100644 --- a/src/VistaControlador/Menu.java +++ b/src/VistaControlador/Menu.java @@ -252,7 +252,7 @@ public class Menu extends JFrame{ this.pestanias.add(vista); this.controladores.add(new ControladorAniadirVisualizar(vista)); this.pestania.addTab(vista.getName(),vista); - this.meses.getGestionesActuales().add(gestion); + //this.meses.getGestionesActuales().add(gestion); } /** diff --git a/src/VistaControlador/VistaAniadirVisualizar.java b/src/VistaControlador/VistaAniadirVisualizar.java index bb4618b..6c4150b 100644 --- a/src/VistaControlador/VistaAniadirVisualizar.java +++ b/src/VistaControlador/VistaAniadirVisualizar.java @@ -47,14 +47,6 @@ public class VistaAniadirVisualizar extends JPanel{ this.add(panel); } - /** - * Establece cual es el panel lateral - * - * @param panel panel lateral que gestionara este panel - */ - /*public static void setPanelLateral(VistaPanelGestion panel) { - VistaAniadirVisualizar.panelLateral = panel; - }*/ public String getName() { return this.gestiones.getNombre(); @@ -79,7 +71,7 @@ public class VistaAniadirVisualizar extends JPanel{ public void aniadirElemento(String nombre, float dinero, ControladorAniadirVisualizar controlador) { Transaccion transaccion = new Transaccion(nombre, dinero,this.menu.elegirMes.getDate(),this.gestiones); this.gestiones.aniadirGasto(transaccion); - JCheckBox check = new JCheckBox(transaccion.toString()); + JCheckBox check = new JCheckBox(transaccion.toStringCorto()); check.setSelected(true); check.setSize(new Dimension(x,VistaAniadirVisualizar.altoCheck)); check.addActionListener(controlador); @@ -107,16 +99,21 @@ public class VistaAniadirVisualizar extends JPanel{ } } + /** + * Edita el nombre de una transacccion dado el nombre de esta + * + * @param nombreViejo nombre de la transaccion + * @param nombreNuevo nuevo nombre + */ void editarTransaccion(String nombreViejo, String nombreNuevo){ for(Transaccion transaccion:this.gestiones.getElementos()) { if(transaccion.getNombre().equals(nombreViejo)) { for(JCheckBox check:this.transacciones) { - if(check.getText().equals(transaccion.toString())) { + if(check.getText().equals(transaccion.toStringCorto())) { transaccion.setName(nombreNuevo); - check.setText(transaccion.toString()); + check.setText(transaccion.toStringCorto()); check.revalidate(); check.repaint(); - //this.gestiones.editarTransaccion(nombreViejo, nombreNuevo); this.menu.panelGestion.actualizarDatos(this.gestiones); this.cuadro.revalidate(); this.cuadro.repaint(); @@ -126,13 +123,19 @@ public class VistaAniadirVisualizar extends JPanel{ } } + /** + * Edita el coste de una transaccion dado su nombre + * + * @param nombreViejo nombre de la transaccion + * @param dinero costo de la transaccion + */ void editarTransaccionDinero(String nombreViejo, float dinero){ for(Transaccion transaccion:this.gestiones.getElementos()) { if(transaccion.getNombre().equals(nombreViejo)) { for(JCheckBox check:this.transacciones) { - if(check.getText().equals(transaccion.toString())) { + if(check.getText().equals(transaccion.toStringCorto())) { transaccion.setPrecio(dinero); - check.setText(transaccion.toString()); + check.setText(transaccion.toStringCorto()); check.revalidate(); check.repaint(); //this.gestiones.editarTransaccion(nombreViejo, nombreNuevo); @@ -145,13 +148,19 @@ public class VistaAniadirVisualizar extends JPanel{ } } + /** + * Edita la fecha de una transaccion dado su nombre + * + * @param nombreViejo nombre de la transaccion + * @param fecha nueva fecha + */ void editarTransaccionFecha(String nombreViejo, LocalDate fecha){ for(Transaccion transaccion:this.gestiones.getElementos()) { if(transaccion.getNombre().equals(nombreViejo)) { for(JCheckBox check:this.transacciones) { - if(check.getText().equals(transaccion.toString())) { + if(check.getText().equals(transaccion.toStringCorto())) { transaccion.setFecha(fecha); - check.setText(transaccion.toString()); + check.setText(transaccion.toStringCorto()); check.revalidate(); check.repaint(); //this.gestiones.editarTransaccion(nombreViejo, nombreNuevo); @@ -168,7 +177,7 @@ public class VistaAniadirVisualizar extends JPanel{ * aniade una nueva transaccion */ private void aniadirElemento(Transaccion transaccion, ControladorAniadirVisualizar controlador) { - JCheckBox check = new JCheckBox(transaccion.toString()); + JCheckBox check = new JCheckBox(transaccion.toStringCorto()); check.setSelected(true); check.setSize(new Dimension(x,VistaAniadirVisualizar.altoCheck)); check.addActionListener(controlador);