package com.fr.plugin.chart.gantt.designer;

import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.designer.other.VanChartOtherPane;
import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.gantt.designer.data.VanChartGanttDataPane;
import com.fr.plugin.chart.gantt.designer.data.data.GanttPlotReportDataContentPane;
import com.fr.plugin.chart.gantt.designer.data.data.GanttPlotTableDataContentPane;
import com.fr.plugin.chart.gantt.designer.other.VanChartGanttConditionPane;
import com.fr.plugin.chart.gantt.designer.other.VanChartGanttInteractivePane;
import com.fr.plugin.chart.gantt.designer.style.VanChartGanttStylePane;
import com.fr.plugin.chart.gantt.designer.style.series.VanChartGanttSeriesPane;
import com.fr.plugin.chart.gantt.designer.type.VanChartGanttPlotPane;
import com.fr.plugin.chart.vanchart.AbstractIndependentVanChartUI;

/**
 * Created by hufan on 2017/1/9.
 */
public class GanttIndependentVanChartInterface extends AbstractIndependentVanChartUI {
    @Override
    public AbstractChartTypePane getPlotTypePane() {
        return new VanChartGanttPlotPane();
    }

    @Override
    public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
        return new VanChartGanttDataPane(listener);
    }

    @Override
    public ConditionAttributesPane getPlotConditionPane(Plot plot){
        return new VanChartGanttConditionPane(plot);
    }

    public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent){
        return new GanttPlotReportDataContentPane();
    }

    public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent){
        return new GanttPlotTableDataContentPane();
    }

    public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
        return new VanChartGanttSeriesPane(parent, plot);
    }

    @Override
    public String getIconPath() {
        return "com/fr/design/images/form/toolbar/gantt.png";
    }


    public String getPlotTypeTitle4PopupWindow(){
        return VanChartGanttPlotPane.TITLE;
    }

    /**
     * 图表的属性界面数组
     * @return 属性界面
     */
    public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){
        VanChartStylePane stylePane = new VanChartGanttStylePane(listener);
        VanChartOtherPane otherPane = new VanChartOtherPane(){
            @Override
            protected BasicBeanPane<Chart> createInteractivePane() {
                return new VanChartGanttInteractivePane();
            }
        };
        return new AbstractChartAttrPane[]{stylePane, otherPane};
    }
}