Clasificacion por fecha y posibilidad de aniadir mas gestiones por mes
This commit is contained in:
@@ -4,19 +4,26 @@ import java.awt.Frame;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.time.Year;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
|
||||
import org.jfree.chart.ChartFactory;
|
||||
import org.jfree.chart.ChartFrame;
|
||||
import org.jfree.chart.JFreeChart;
|
||||
import org.jfree.data.time.Month;
|
||||
import org.jfree.data.xy.XYSeries;
|
||||
import org.jfree.data.xy.XYSeriesCollection;
|
||||
|
||||
import com.github.lgooddatepicker.components.DatePicker;
|
||||
import com.github.lgooddatepicker.optionalusertools.DateChangeListener;
|
||||
import com.github.lgooddatepicker.zinternaltools.DateChangeEvent;
|
||||
import com.github.lgooddatepicker.zinternaltools.DemoPanel;
|
||||
public class ControladorPanelLateral implements ActionListener{
|
||||
public class ControladorPanelLateral implements ActionListener, DateChangeListener{
|
||||
private VistaPanelLateral vista;
|
||||
private java.time.Month mes;
|
||||
private int anio;
|
||||
|
||||
|
||||
public ControladorPanelLateral(VistaPanelLateral vista) {
|
||||
this.vista=vista;
|
||||
@@ -45,8 +52,21 @@ public class ControladorPanelLateral implements ActionListener{
|
||||
private void aniadirElementos() {
|
||||
this.vista.mostrarEstadisticas.addActionListener(this);
|
||||
this.vista.mostrarEstadisticas.setActionCommand("Mostrar estadisticas");
|
||||
//this.vista.elegirMes.addActionListener(this);
|
||||
//this.vista.elegirMes.setActionCommand("Elegir mes");
|
||||
if(VistaPanelLateral.elegirMes.getDateChangeListeners().size()==0) {
|
||||
VistaPanelLateral.elegirMes.addDateChangeListener(this);
|
||||
this.mes=VistaPanelLateral.elegirMes.getDate().getMonth();
|
||||
this.anio=VistaPanelLateral.elegirMes.getDate().getYear();
|
||||
}
|
||||
}
|
||||
|
||||
public void dateChanged(DateChangeEvent arg0) {
|
||||
if(this.mes!=VistaPanelLateral.elegirMes.getDate().getMonth() ||
|
||||
this.anio!=VistaPanelLateral.elegirMes.getDate().getYear()) {
|
||||
System.out.println("Cambia mes");
|
||||
this.mes=VistaPanelLateral.elegirMes.getDate().getMonth();
|
||||
this.anio=VistaPanelLateral.elegirMes.getDate().getYear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user