Mejoras de estilo y otros

This commit is contained in:
roche
2019-11-14 12:05:58 +01:00
parent 0ade46bde2
commit 667182d76e
13 changed files with 126 additions and 109 deletions

View File

@@ -23,16 +23,15 @@ public class VistaAniadirVisualizar extends JPanel{
boolean positivo;
static VistaPanelLateral panelLateral;
public VistaAniadirVisualizar(Menu menu, Gestion gestion,boolean positivo) {
this.positivo=positivo;
this.gestiones=gestion;
this.transacciones=new LinkedList<JCheckBox>();
this.menu=menu;
this.x=100;
this.boton=new JButton("aniadir");
//this.gestiones=new Gestion();
this.positivo = positivo;
this.gestiones = gestion;
this.transacciones = new LinkedList<JCheckBox>();
this.menu = menu;
this.x = 100;
this.boton = new JButton("aniadir");
this.add(boton);
this.cuadro=new JPanel();
this.panel=new JScrollPane(cuadro);
this.cuadro = new JPanel();
this.panel = new JScrollPane(cuadro);
this.panel.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
this.panel.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
cuadro.setPreferredSize(new Dimension(x, y));
@@ -42,19 +41,19 @@ public class VistaAniadirVisualizar extends JPanel{
}
public static void setPanelLateral(VistaPanelLateral panel) {
VistaAniadirVisualizar.panelLateral=panel;
VistaAniadirVisualizar.panelLateral = panel;
}
public void aniadirElemento(String nombre, float dinero, ControladorAniadirVisualizar controlador) {
Transaccion transaccion=new Transaccion(nombre, dinero,panelLateral.getDate(),this.positivo);
Transaccion transaccion = new Transaccion(nombre, dinero,panelLateral.getDate(),this.positivo);
this.gestiones.aniadirGasto(transaccion);
JCheckBox check=new JCheckBox(transaccion.toString());
JCheckBox check = new JCheckBox(transaccion.toString());
check.setSelected(true);
check.setSize(new Dimension(x,VistaAniadirVisualizar.altoCheck));
check.addActionListener(controlador);
this.transacciones.add(check);
this.cuadro.add(check);
this.y+=VistaAniadirVisualizar.altoCheck;
this.y += VistaAniadirVisualizar.altoCheck;
cuadro.setPreferredSize(new Dimension(x, y));
this.revalidate();
this.repaint();