forked from fanruan/finekit
白岳
5 years ago
13 changed files with 560 additions and 2 deletions
@ -0,0 +1,71 @@
|
||||
package com.fanruan.api.design.chart; |
||||
|
||||
import com.fr.design.gui.frpane.AttributeChangeListener; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2019-09-19 |
||||
*/ |
||||
public abstract class AbstractChartTypeUI extends com.fr.design.chart.fun.impl.AbstractChartTypeUI { |
||||
|
||||
/** |
||||
* 定义图表类型选择界面 |
||||
* |
||||
* @return 类型选择界面 |
||||
*/ |
||||
@Override |
||||
public DefaultTypePane getPlotTypePane() { |
||||
return new DefaultTypePane(); |
||||
} |
||||
|
||||
/** |
||||
* 定义图表数据配置界面 |
||||
* |
||||
* @return 数据配置界面 |
||||
*/ |
||||
@Override |
||||
public abstract AbstractDataPane getChartDataPane(AttributeChangeListener listener); |
||||
|
||||
/** |
||||
* 定义其他界面 |
||||
* |
||||
* @return 其他界面集合 |
||||
*/ |
||||
@Override |
||||
public abstract AbstractOtherPane[] getAttrPaneArray(AttributeChangeListener listener); |
||||
|
||||
/** |
||||
* 定义图表类型选择界面子类型的名称 |
||||
* |
||||
* @return 图表子类型名称集合 |
||||
*/ |
||||
@Override |
||||
public String[] getSubName() { |
||||
return super.getSubName(); |
||||
} |
||||
|
||||
/** |
||||
* 定义图表的icon图片路径 |
||||
* |
||||
* @return icon图片路径 |
||||
*/ |
||||
@Override |
||||
public abstract String getIconPath(); |
||||
|
||||
/** |
||||
* 定义图表图表类型选择界面的类型名称 |
||||
* |
||||
* @return 图表类型名称 |
||||
*/ |
||||
@Override |
||||
public abstract String getName(); |
||||
|
||||
/** |
||||
* 定义图表类型选择界面子类型的示例图片路径 |
||||
* |
||||
* @return 图表子类型图片路径集合 |
||||
*/ |
||||
@Override |
||||
public abstract String[] getDemoImagePath(); |
||||
} |
@ -0,0 +1,26 @@
|
||||
package com.fanruan.api.design.chart; |
||||
|
||||
import com.fr.design.gui.frpane.AttributeChangeListener; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2019-09-18 |
||||
*/ |
||||
public abstract class AbstractDataPane extends com.fr.design.chartx.impl.AbstractDataPane { |
||||
|
||||
/** |
||||
* 构造函数 |
||||
*/ |
||||
public AbstractDataPane(AttributeChangeListener listener) { |
||||
super(listener); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 创建数据配置面板 |
||||
* |
||||
* @return 数据配置面板 |
||||
*/ |
||||
protected abstract SingleDataPane createSingleDataPane(); |
||||
} |
@ -0,0 +1,31 @@
|
||||
package com.fanruan.api.design.chart; |
||||
|
||||
import com.fanruan.api.engine.chart.AbstractChartWithData; |
||||
|
||||
import javax.swing.JPanel; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2019-09-17 |
||||
*/ |
||||
public abstract class AbstractOtherPane<T extends AbstractChartWithData> extends com.fr.design.chartx.impl.AbstractOtherPane<T> { |
||||
|
||||
/** |
||||
* 创建内容面板 |
||||
* |
||||
* @return 面板 |
||||
*/ |
||||
@Override |
||||
protected abstract JPanel createContentPane(); |
||||
|
||||
/** |
||||
* 界面标题 |
||||
* |
||||
* @return 标题 |
||||
*/ |
||||
@Override |
||||
public String title4PopupWindow() { |
||||
return super.title4PopupWindow(); |
||||
} |
||||
} |
@ -0,0 +1,81 @@
|
||||
package com.fanruan.api.design.chart; |
||||
|
||||
import com.fanruan.api.engine.chart.AbstractChartWithData; |
||||
import com.fr.chartx.attr.ChartProvider; |
||||
|
||||
import javax.swing.JPanel; |
||||
import java.awt.Component; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2019-09-18 |
||||
*/ |
||||
public class DefaultTypePane<T extends AbstractChartWithData> extends com.fr.design.chartx.impl.DefaultTypePane<T> { |
||||
|
||||
/** |
||||
* 获取图表类型界面图表选择子类型的缩略图路径,默认使用UI界面插入图表时子类型的图片路径 |
||||
* |
||||
* @return 图片路径集合 |
||||
*/ |
||||
@Override |
||||
protected String[] getTypeIconPath() { |
||||
return super.getTypeIconPath(); |
||||
} |
||||
|
||||
/** |
||||
* 获取图表类型界面图表选择子类型的缩略图提示内容,默认使用UI界面插入图表时的图表子类型名称 |
||||
* |
||||
* @return 提示内容集合 |
||||
*/ |
||||
@Override |
||||
protected String[] getTypeTipName() { |
||||
return super.getTypeTipName(); |
||||
} |
||||
|
||||
/** |
||||
* 获取图表子类型对象,默认使用AbstractChartType.getChartTypes()返回的第一个对象 |
||||
* |
||||
* @return 图表对象 |
||||
*/ |
||||
@Override |
||||
public ChartProvider getDefaultChart() { |
||||
return super.getDefaultChart(); |
||||
} |
||||
|
||||
/** |
||||
* 获取图表类型界面切换图表类型名称。默认使用UI界面插入图表时的图表名称。 |
||||
* |
||||
* @return 图表名称 |
||||
*/ |
||||
@Override |
||||
public String title4PopupWindow() { |
||||
return super.title4PopupWindow(); |
||||
} |
||||
|
||||
/** |
||||
* 根据图表对象返回该图表对象的所对应的子类型序号,默认返回0 |
||||
* |
||||
* @return 子类型序号 |
||||
*/ |
||||
@Override |
||||
protected int getSelectIndexInChart(T chart) { |
||||
return super.getSelectIndexInChart(chart); |
||||
} |
||||
|
||||
/** |
||||
* 根据图表子类型序号,还原图表对象对应的属性。 |
||||
*/ |
||||
@Override |
||||
protected void setSelectIndexInChart(T chart, int index) { |
||||
super.setSelectIndexInChart(chart, index); |
||||
} |
||||
|
||||
/** |
||||
* 根据图表子类型序号,还原图表对象对应的属性。 |
||||
*/ |
||||
@Override |
||||
protected Component[][] getPaneComponents(JPanel typePane) { |
||||
return super.getPaneComponents(typePane); |
||||
} |
||||
} |
@ -0,0 +1,19 @@
|
||||
package com.fanruan.api.design.chart; |
||||
|
||||
import com.fanruan.api.design.chart.field.AbstractCellDataFieldsPane; |
||||
import com.fanruan.api.design.chart.field.AbstractDataSetFieldsPane; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2019-09-18 |
||||
*/ |
||||
public class SingleDataPane extends com.fr.design.chartx.single.SingleDataPane { |
||||
|
||||
/** |
||||
* 构造函数,组合数据集数据源配置面板和单元格数据源配置面板 |
||||
*/ |
||||
public SingleDataPane(AbstractDataSetFieldsPane dataSetFieldsPane, AbstractCellDataFieldsPane cellDataFieldsPane) { |
||||
super(dataSetFieldsPane, cellDataFieldsPane); |
||||
} |
||||
} |
@ -0,0 +1,79 @@
|
||||
package com.fanruan.api.design.chart.field; |
||||
|
||||
import com.fanruan.api.design.ui.component.formula.UIFormulaTextField; |
||||
import com.fanruan.api.engine.chart.field.ColumnFieldCollection; |
||||
|
||||
import javax.swing.JPanel; |
||||
import java.awt.Component; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2019-09-17 |
||||
*/ |
||||
public abstract class AbstractCellDataFieldsPane<T extends ColumnFieldCollection> extends com.fr.design.chartx.fields.AbstractCellDataFieldsPane<T> { |
||||
|
||||
/** |
||||
* 初始化面板布局,默认会加载北部、中部和南部的面板 |
||||
*/ |
||||
@Override |
||||
protected void initComponents() { |
||||
super.initComponents(); |
||||
} |
||||
|
||||
/** |
||||
* 创建中部位置的面板,默认会通过所有的组件和组件名称生成面板。 |
||||
* |
||||
* @return 面板 |
||||
*/ |
||||
@Override |
||||
protected JPanel createCenterPane() { |
||||
return super.createCenterPane(); |
||||
} |
||||
|
||||
/** |
||||
* 创建北部位置的面板,默认生成空面板 |
||||
* |
||||
* @return 面板 |
||||
*/ |
||||
@Override |
||||
protected JPanel createNorthPane() { |
||||
return super.createNorthPane(); |
||||
} |
||||
|
||||
/** |
||||
* 创建南部位置的面板,默认生成空面板 |
||||
* |
||||
* @return 面板 |
||||
*/ |
||||
@Override |
||||
protected JPanel createSouthPane() { |
||||
return super.createSouthPane(); |
||||
} |
||||
|
||||
/** |
||||
* 面板中所有组件,默认会去获取所有公式组件 |
||||
* |
||||
* @return 所有组件的集合 |
||||
*/ |
||||
@Override |
||||
protected Component[] fieldComponents() { |
||||
return super.fieldComponents(); |
||||
} |
||||
|
||||
/** |
||||
* 面板中所有组件的名称 |
||||
* |
||||
* @return 所有组件的名称集合 |
||||
*/ |
||||
@Override |
||||
protected abstract String[] fieldLabels(); |
||||
|
||||
/** |
||||
* 面板中的公式组件 |
||||
* |
||||
* @return 公式组件的集合 |
||||
*/ |
||||
@Override |
||||
protected abstract UIFormulaTextField[] formulaPanes(); |
||||
} |
@ -0,0 +1,78 @@
|
||||
package com.fanruan.api.design.chart.field; |
||||
|
||||
import com.fanruan.api.design.ui.component.UIComboBox; |
||||
import com.fanruan.api.engine.chart.field.ColumnFieldCollection; |
||||
|
||||
import javax.swing.JPanel; |
||||
import java.awt.Component; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2019-09-17 |
||||
*/ |
||||
public abstract class AbstractDataSetFieldsPane<T extends ColumnFieldCollection> extends com.fr.design.chartx.fields.AbstractDataSetFieldsPane<T> { |
||||
/** |
||||
* 初始化面板布局,默认会加载北部、中部和南部的面板 |
||||
*/ |
||||
@Override |
||||
protected void initComponents() { |
||||
super.initComponents(); |
||||
} |
||||
|
||||
/** |
||||
* 创建中部位置的面板,默认会通过所有的组件和组件名称生成面板。 |
||||
* |
||||
* @return 面板 |
||||
*/ |
||||
@Override |
||||
protected JPanel createCenterPane() { |
||||
return super.createCenterPane(); |
||||
} |
||||
|
||||
/** |
||||
* 创建北部位置的面板,默认生成空面板 |
||||
* |
||||
* @return 面板 |
||||
*/ |
||||
@Override |
||||
protected JPanel createNorthPane() { |
||||
return super.createNorthPane(); |
||||
} |
||||
|
||||
/** |
||||
* 创建南部位置的面板,默认生成空面板 |
||||
* |
||||
* @return 面板 |
||||
*/ |
||||
@Override |
||||
protected JPanel createSouthPane() { |
||||
return super.createSouthPane(); |
||||
} |
||||
|
||||
/** |
||||
* 面板中所有组件,默认会去获取所有下拉框组件 |
||||
* |
||||
* @return 所有组件的集合 |
||||
*/ |
||||
@Override |
||||
protected Component[] fieldComponents() { |
||||
return super.fieldComponents(); |
||||
} |
||||
|
||||
/** |
||||
* 面板中所有组件的名称 |
||||
* |
||||
* @return 所有组件的名称集合 |
||||
*/ |
||||
@Override |
||||
protected abstract String[] fieldLabels(); |
||||
|
||||
/** |
||||
* 面板中的下拉框组件 |
||||
* |
||||
* @return 下拉框组件的集合 |
||||
*/ |
||||
@Override |
||||
protected abstract UIComboBox[] filedComboBoxes(); |
||||
} |
@ -0,0 +1,31 @@
|
||||
package com.fanruan.api.design.ui.component; |
||||
|
||||
import javax.swing.Icon; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2019-09-19 |
||||
*/ |
||||
public class UIButtonGroup<T> extends com.fr.design.gui.ibutton.UIButtonGroup<T> { |
||||
|
||||
public UIButtonGroup(String[] textArray) { |
||||
super(textArray); |
||||
} |
||||
|
||||
public UIButtonGroup(Icon[] iconArray) { |
||||
super(iconArray); |
||||
} |
||||
|
||||
public UIButtonGroup(Icon[][] iconArray) { |
||||
super(iconArray); |
||||
} |
||||
|
||||
public UIButtonGroup(Icon[] iconArray, T[] objects) { |
||||
super(iconArray, objects); |
||||
} |
||||
|
||||
public UIButtonGroup(Icon[][] iconArray, T[] objects) { |
||||
super(iconArray, objects); |
||||
} |
||||
} |
@ -0,0 +1,9 @@
|
||||
package com.fanruan.api.design.ui.component.chart; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2019-09-23 |
||||
*/ |
||||
public class CalculateComboBox extends com.fr.design.mainframe.chart.gui.data.CalculateComboBox { |
||||
} |
@ -0,0 +1,41 @@
|
||||
package com.fanruan.api.engine.chart; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2019-09-17 |
||||
*/ |
||||
public abstract class AbstractChartType extends com.fr.chart.impl.AbstractChartType { |
||||
|
||||
/** |
||||
* 该种图表所有的图表对象实例,比如柱形图就有堆积柱形图,百分比堆积柱形图等等 |
||||
* |
||||
* @return 图表所有的对象实例 |
||||
*/ |
||||
@Override |
||||
public abstract AbstractChartWithData[] getChartTypes(); |
||||
|
||||
/** |
||||
* 图表在web端展现时需要的JS文件路径 |
||||
* |
||||
* @return JS文件路径数组 |
||||
*/ |
||||
@Override |
||||
public abstract String[] getRequiredJS(); |
||||
|
||||
/** |
||||
* 图表在web端展现时需要的CSS文件路径 |
||||
* |
||||
* @return CSS文件路径数组 |
||||
*/ |
||||
@Override |
||||
public abstract String[] getRequiredCss(); |
||||
|
||||
/** |
||||
* JS对象名,该对象一般是一个函数,执行后会在给定的dom中绘制图表 |
||||
* |
||||
* @return JS对象名 |
||||
*/ |
||||
@Override |
||||
public abstract String getWrapperName(); |
||||
} |
@ -0,0 +1,70 @@
|
||||
package com.fanruan.api.engine.chart; |
||||
|
||||
import com.fanruan.api.engine.chart.field.ColumnFieldCollection; |
||||
import com.fr.base.chart.cross.FormulaProcessor; |
||||
import com.fr.chart.ChartWebPara; |
||||
import com.fr.js.NameJavaScriptGroup; |
||||
import com.fr.json.JSONObject; |
||||
|
||||
import java.awt.Image; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2019-09-17 |
||||
*/ |
||||
public abstract class AbstractChartWithData extends com.fr.chart.impl.AbstractChartWithData { |
||||
|
||||
/** |
||||
* 获取所有的超链 |
||||
* |
||||
* @return 超链集合 |
||||
*/ |
||||
@Override |
||||
public NameJavaScriptGroup getHotHyperlink(String linkKey) { |
||||
return super.getHotHyperlink(linkKey); |
||||
} |
||||
|
||||
/** |
||||
* 处理公式,调用formulaProcessor.dealWith方法,覆写该方法需要调用父类的方法。 |
||||
*/ |
||||
@Override |
||||
public void dealFormula(FormulaProcessor formulaProcessor) { |
||||
super.dealFormula(formulaProcessor); |
||||
} |
||||
|
||||
/** |
||||
* 生成设计器中显示的图片,默认返回一个饼图的图片 |
||||
* |
||||
* @return 图片 |
||||
*/ |
||||
@Override |
||||
public Image toImage(int width, int height, int resolution, ChartWebPara chartWebPara) { |
||||
return super.toImage(width, height, resolution, chartWebPara); |
||||
} |
||||
|
||||
/** |
||||
* 生成图表预览的options |
||||
* |
||||
* @return JSON对象 |
||||
*/ |
||||
@Override |
||||
public abstract JSONObject createAttributeConfig(ChartWebPara chartWebPara); |
||||
|
||||
/** |
||||
* 定义图表的ID,与plugin.xml中的chartID对应 |
||||
* |
||||
* @return ID |
||||
*/ |
||||
@Override |
||||
public abstract String getID(); |
||||
|
||||
/** |
||||
* 获取字段集合对象 |
||||
* |
||||
* @return 字段集合对象 |
||||
*/ |
||||
public <T extends ColumnFieldCollection> T getColumnFieldCollection(Class<T> var1) { |
||||
return super.getFieldCollection(var1); |
||||
} |
||||
} |
@ -0,0 +1,12 @@
|
||||
package com.fanruan.api.engine.chart.field; |
||||
|
||||
import com.fr.chartx.data.field.AbstractColumnFieldCollection; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2019-09-17 |
||||
*/ |
||||
public class ColumnFieldCollection extends AbstractColumnFieldCollection { |
||||
|
||||
} |
Loading…
Reference in new issue