package sikd.sikd5.model.combo;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import sikd.sikd5.sikd5bean.query.Periode;
import sikd.sikd5.sikd5bean.tabel.TahunAnggaran;
import sikd.sikd5.sikd5bean.util.SIKDUtil;

/**
 *
 * @author soraturaes
 */
public class MonthYearCombo implements Serializable {
    protected String idPanel;
    protected boolean view;
    protected String idComboPeriode;
    protected Periode selectedPeriode;
    protected boolean mode;
    protected List<Periode> periodes;
    protected String update;

    protected String idComboYear;
    protected TahunAnggaran selectedYear;
    protected List<TahunAnggaran> years;
    String align="left";
    String labelStyle="width: 140px; padding: 5px;";
    String label="Tahun";
    String comboYearStyle="width: 500px; padding: 5px;";

    public MonthYearCombo() {
        initPeriode();
    }

    public MonthYearCombo(String idPanel, boolean view, String idComboPeriode, Periode selectedPeriode, boolean mode, List<Periode> periodes, String update, String idComboYear, TahunAnggaran selectedYear, List<TahunAnggaran> years) {
        this.idPanel = idPanel;
        this.view = view;
        this.idComboPeriode = idComboPeriode;
        this.selectedPeriode = selectedPeriode;
        this.mode = mode;
        this.periodes = periodes;
        this.update = update;
        this.idComboYear = idComboYear;
        this.selectedYear = selectedYear;
        this.years = years;
        initPeriode();
    }
    
    public void initPeriode(){
        periodes = SIKDUtil.getBulans();
        Date dd = new Date();
        short bln = (short)(dd.getMonth()+1);
        boolean ff = false;
        int ii = 0;
        while(ii < periodes.size() && ff == false){
            if(periodes.get(ii).getBulanShort() == bln){
                selectedPeriode = periodes.get(ii);
                ff = true;
            }
            ii++;
        }
    }

    public String getIdPanel() {
        return idPanel;
    }

    public void setIdPanel(String idPanel) {
        this.idPanel = idPanel;
    }

    public boolean isView() {
        return view;
    }

    public void setView(boolean view) {
        this.view = view;
    }

    public String getIdComboPeriode() {
        return idComboPeriode;
    }

    public void setIdComboPeriode(String idComboPeriode) {
        this.idComboPeriode = idComboPeriode;
    }

    public Periode getSelectedPeriode() {
        return selectedPeriode;
    }

    public void setSelectedPeriode(Periode selectedPeriode) {
        this.selectedPeriode = selectedPeriode;
    }

    public boolean isMode() {
        return mode;
    }

    public void setMode(boolean mode) {
        this.mode = mode;
    }

    public List<Periode> getPeriodes() {
        return periodes;
    }

    public void setPeriodes(List<Periode> periodes) {
        this.periodes = periodes;
    }

    public String getUpdate() {
        return update;
    }

    public void setUpdate(String update) {
        this.update = update;
    }

    public String getIdComboYear() {
        return idComboYear;
    }

    public void setIdComboYear(String idComboYear) {
        this.idComboYear = idComboYear;
    }

    public TahunAnggaran getSelectedYear() {
        return selectedYear;
    }

    public void setSelectedYear(TahunAnggaran selectedYear) {
        this.selectedYear = selectedYear;
    }

    public List<TahunAnggaran> getYears() {
        return years;
    }

    public void setYears(List<TahunAnggaran> years) {
        this.years = years;
    }

    public String getAlign() {
        return align;
    }

    public void setAlign(String align) {
        this.align = align;
    }

    public String getLabelStyle() {
        return labelStyle;
    }

    public void setLabelStyle(String labelStyle) {
        this.labelStyle = labelStyle;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getComboYearStyle() {
        return comboYearStyle;
    }

    public void setComboYearStyle(String comboYearStyle) {
        this.comboYearStyle = comboYearStyle;
    }
}
