白岳
5 years ago
25 changed files with 1209 additions and 413 deletions
After Width: | Height: | Size: 135 B |
@ -0,0 +1,69 @@
|
||||
package com.fr.design.chart; |
||||
|
||||
import com.fr.base.chart.BaseChartCollection; |
||||
import com.fr.base.chart.chartdata.TopDefinitionProvider; |
||||
import com.fr.chart.chartattr.ChartCollection; |
||||
import com.fr.plugin.chart.vanchart.VanChart; |
||||
|
||||
import java.awt.Component; |
||||
import java.awt.Dialog; |
||||
import java.awt.Frame; |
||||
import java.awt.event.ActionEvent; |
||||
import java.awt.event.ActionListener; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2020-05-28 |
||||
*/ |
||||
public class AutoChartDialog extends ChartDialog { |
||||
|
||||
private AutoChartTypePane autoChartTypePane; |
||||
|
||||
public AutoChartDialog(Frame owner) { |
||||
super(owner); |
||||
} |
||||
|
||||
public AutoChartDialog(Dialog owner) { |
||||
super(owner); |
||||
} |
||||
|
||||
protected Component initCenterPane() { |
||||
autoChartTypePane = new AutoChartTypePane(); |
||||
|
||||
return autoChartTypePane; |
||||
} |
||||
|
||||
protected void addOkAction() { |
||||
ok.addActionListener(new ActionListener() { |
||||
public void actionPerformed(ActionEvent e) { |
||||
ChartCollection chartCollection = (ChartCollection) getChartCollection(); |
||||
autoChartTypePane.update(chartCollection); |
||||
if (chartCollection.getChartCount() > 0) { |
||||
doOK(); |
||||
} else { |
||||
doCancel(); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 更新新建的图表 ChartCollection |
||||
*/ |
||||
public void populate(BaseChartCollection cc) { |
||||
super.populate(cc); |
||||
ChartCollection chartCollection = (ChartCollection) getChartCollection(); |
||||
VanChart vanChart = chartCollection.getSelectedChartProvider(VanChart.class); |
||||
if (vanChart == null) { |
||||
return; |
||||
} |
||||
TopDefinitionProvider filterDefinition = vanChart.getFilterDefinition(); |
||||
if (filterDefinition == null) { |
||||
return; |
||||
} |
||||
String tableName = vanChart.getFilterDefinition().getTableName(); |
||||
String[] dataFields = vanChart.getFilterDefinition().getDataFields(); |
||||
autoChartTypePane.populate(tableName, dataFields); |
||||
} |
||||
} |
@ -0,0 +1,108 @@
|
||||
package com.fr.design.chart; |
||||
|
||||
import com.fr.base.ScreenResolution; |
||||
import com.fr.base.chart.BaseChartPainter; |
||||
import com.fr.base.chart.chartdata.CallbackEvent; |
||||
import com.fr.base.chart.result.WebChartIDInfo; |
||||
import com.fr.chart.chartattr.Chart; |
||||
import com.fr.chart.chartattr.ChartCollection; |
||||
import com.fr.design.ChartTypeInterfaceManager; |
||||
import com.fr.design.file.HistoryTemplateListPane; |
||||
import com.fr.script.Calculator; |
||||
|
||||
import javax.swing.Icon; |
||||
import java.awt.Color; |
||||
import java.awt.Component; |
||||
import java.awt.Graphics; |
||||
import java.awt.Graphics2D; |
||||
import java.awt.Paint; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2020-05-29 |
||||
*/ |
||||
public class AutoChartIcon implements Icon { |
||||
|
||||
private static final int WIDTH = 500; |
||||
private static final int HEIGHT = 281; |
||||
|
||||
private ChartCollection chartCollection; |
||||
private CallbackEvent callbackEvent; |
||||
|
||||
private String chartName; |
||||
|
||||
public AutoChartIcon(ChartCollection chartCollection) { |
||||
this.chartCollection = chartCollection; |
||||
initChartName(); |
||||
} |
||||
|
||||
public ChartCollection getChartCollection() { |
||||
return chartCollection; |
||||
} |
||||
|
||||
public String getChartName() { |
||||
return chartName; |
||||
} |
||||
|
||||
private void initChartName() { |
||||
Chart chart = chartCollection.getSelectedChart(Chart.class); |
||||
String[] subName = ChartTypeInterfaceManager.getInstance().getSubName(chart.getPlot().getPlotID()); |
||||
chartName = subName[0]; |
||||
} |
||||
|
||||
public void registerCallBackEvent(CallbackEvent callbackEvent) { |
||||
this.callbackEvent = callbackEvent; |
||||
} |
||||
|
||||
/** |
||||
* 画出缩略图Icon |
||||
* |
||||
* @param g 图形的上下文 |
||||
* @param c 所在的Component |
||||
* @param x 缩略图的起始坐标x |
||||
* @param y 缩略图的起始坐标y |
||||
*/ |
||||
@Override |
||||
public void paintIcon(Component c, Graphics g, int x, int y) { |
||||
|
||||
BaseChartPainter painter = chartCollection.createResultChartPainterWithOutDealFormula(Calculator.createCalculator(), |
||||
WebChartIDInfo.createEmptyDesignerInfo(), getIconWidth(), getIconHeight()); |
||||
|
||||
int resolution = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution(); |
||||
if (resolution == 0) { |
||||
resolution = ScreenResolution.getScreenResolution(); |
||||
} |
||||
|
||||
Graphics2D g2d = (Graphics2D) g; |
||||
Paint oldPaint = g2d.getPaint(); |
||||
g.translate(x, y); |
||||
g2d.setPaint(Color.white); |
||||
g2d.fillRect(0, 0, getIconWidth(), getIconHeight()); |
||||
|
||||
painter.paint(g2d, getIconWidth(), getIconHeight(), resolution, null, callbackEvent); |
||||
|
||||
g.translate(-x, -y); |
||||
g2d.setPaint(oldPaint); |
||||
} |
||||
|
||||
/** |
||||
* 返回缩略图的宽度 |
||||
* |
||||
* @return int 缩略图宽度 |
||||
*/ |
||||
@Override |
||||
public int getIconWidth() { |
||||
return WIDTH; |
||||
} |
||||
|
||||
/** |
||||
* 返回缩略图的高度 |
||||
* |
||||
* @return int 缩略图高度 |
||||
*/ |
||||
@Override |
||||
public int getIconHeight() { |
||||
return HEIGHT; |
||||
} |
||||
} |
@ -0,0 +1,230 @@
|
||||
package com.fr.design.chart; |
||||
|
||||
import com.fr.base.chart.BaseChartCollection; |
||||
import com.fr.base.chart.BaseChartGetter; |
||||
import com.fr.base.chart.chartdata.CallbackEvent; |
||||
import com.fr.chart.chartattr.ChartCollection; |
||||
import com.fr.chartx.attr.ChartProvider; |
||||
import com.fr.design.data.DesignTableDataManager; |
||||
import com.fr.design.data.datapane.TableDataComboBox; |
||||
import com.fr.design.data.tabledata.wrapper.TableDataWrapper; |
||||
import com.fr.design.gui.ibutton.UIButton; |
||||
import com.fr.design.gui.icombocheckbox.UIComboCheckBox; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.utils.gui.GUICoreUtils; |
||||
import com.fr.plugin.chart.area.VanChartAreaPlot; |
||||
import com.fr.plugin.chart.column.VanChartColumnPlot; |
||||
import com.fr.plugin.chart.line.VanChartLinePlot; |
||||
import com.fr.plugin.chart.vanchart.VanChart; |
||||
|
||||
import javax.swing.BorderFactory; |
||||
import javax.swing.DefaultListCellRenderer; |
||||
import javax.swing.DefaultListModel; |
||||
import javax.swing.JList; |
||||
import javax.swing.JPanel; |
||||
import javax.swing.JScrollPane; |
||||
import javax.swing.JSplitPane; |
||||
import javax.swing.ListCellRenderer; |
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.awt.Color; |
||||
import java.awt.Component; |
||||
import java.awt.Dimension; |
||||
import java.awt.event.ActionEvent; |
||||
import java.awt.event.ActionListener; |
||||
import java.awt.event.ItemEvent; |
||||
import java.awt.event.ItemListener; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2020-05-29 |
||||
*/ |
||||
public class AutoChartTypePane extends ChartWizardPane implements CallbackEvent { |
||||
|
||||
private JList chartViewList; |
||||
private DefaultListModel chartResultModel; |
||||
private UIButton refreshButton; |
||||
|
||||
private TableDataComboBox tableNameComboBox; |
||||
private UIComboCheckBox dataFieldBox; |
||||
|
||||
public AutoChartTypePane() { |
||||
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
initButtonGroup(); |
||||
initRefreshLabel(); |
||||
initDataFiledBox(); |
||||
JPanel contentPane = createContentPane(); |
||||
|
||||
chartViewList = new JList(); |
||||
|
||||
chartResultModel = new DefaultListModel(); |
||||
chartViewList.setModel(chartResultModel); |
||||
chartViewList.setVisibleRowCount(0); |
||||
chartViewList.setLayoutOrientation(JList.HORIZONTAL_WRAP); |
||||
chartViewList.setCellRenderer(iconCellRenderer); |
||||
|
||||
JScrollPane subListPane = new JScrollPane(chartViewList); |
||||
|
||||
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, contentPane, subListPane); |
||||
splitPane.setDividerLocation(60); |
||||
splitPane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Chart_M_Popup_Auto_Chart_Type"))); |
||||
this.add(splitPane); |
||||
} |
||||
|
||||
ListCellRenderer iconCellRenderer = new DefaultListCellRenderer() { |
||||
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
||||
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); |
||||
this.setText(""); |
||||
|
||||
AutoChartIcon chartIcon = (AutoChartIcon) value; |
||||
this.setIcon(chartIcon); |
||||
setHorizontalAlignment(UILabel.CENTER); |
||||
if (isSelected) { |
||||
// 深蓝色.
|
||||
this.setBackground(new Color(57, 107, 181)); |
||||
this.setBorder(GUICoreUtils.createTitledBorder(chartIcon.getChartName(), Color.WHITE)); |
||||
} else { |
||||
this.setBorder(GUICoreUtils.createTitledBorder(chartIcon.getChartName())); |
||||
} |
||||
return this; |
||||
} |
||||
}; |
||||
|
||||
private JPanel createContentPane() { |
||||
JPanel panel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
||||
|
||||
JPanel tableDataPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
||||
panel.add(tableDataPane); |
||||
tableDataPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data") + ":")); |
||||
tableNameComboBox.setPreferredSize(new Dimension(96, 20)); |
||||
tableDataPane.add(tableNameComboBox); |
||||
|
||||
JPanel areaNamePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
||||
panel.add(areaNamePane); |
||||
areaNamePane.add(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Field") + ":")); |
||||
areaNamePane.add(dataFieldBox); |
||||
panel.add(refreshButton); |
||||
return panel; |
||||
} |
||||
|
||||
private void initButtonGroup() { |
||||
dataFieldBox = new UIComboCheckBox(new Object[0]); |
||||
dataFieldBox.addActionListener(new ActionListener() { |
||||
@Override |
||||
public void actionPerformed(ActionEvent e) { |
||||
checkButtonState(); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
private void initDataFiledBox() { |
||||
tableNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()); |
||||
tableNameComboBox.addItemListener(new ItemListener() { |
||||
@Override |
||||
public void itemStateChanged(ItemEvent e) { |
||||
if (e.getStateChange() == ItemEvent.SELECTED) { |
||||
refreshBox(); |
||||
checkButtonState(); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
|
||||
private void checkButtonState() { |
||||
if (tableNameComboBox.getSelectedItem() != null && dataFieldBox.getSelectedValues().length > 0) { |
||||
refreshButton.setEnabled(true); |
||||
} else { |
||||
refreshButton.setEnabled(false); |
||||
} |
||||
} |
||||
|
||||
private void refreshBox() { |
||||
TableDataWrapper dataWrap = tableNameComboBox.getSelectedItem(); |
||||
|
||||
if (dataWrap == null) { |
||||
return; |
||||
} |
||||
dataFieldBox.clearText(); |
||||
|
||||
List<String> columnNameList = dataWrap.calculateColumnNameList(); |
||||
|
||||
dataFieldBox.refreshCombo(columnNameList.toArray()); |
||||
} |
||||
|
||||
private void initRefreshLabel() { |
||||
refreshButton = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Recommend")); |
||||
refreshButton.addActionListener(new ActionListener() { |
||||
@Override |
||||
public void actionPerformed(ActionEvent e) { |
||||
calculateAutoChart(); |
||||
} |
||||
}); |
||||
refreshButton.setEnabled(false); |
||||
} |
||||
|
||||
private void calculateAutoChart() { |
||||
chartResultModel.clear(); |
||||
|
||||
//TODO 使用以下模拟数据,计算规则待补充
|
||||
BaseChartCollection chartCollection = BaseChartGetter.createChartCollection(VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID); |
||||
VanChart selectedChart = ((ChartCollection) chartCollection).getSelectedChart(VanChart.class); |
||||
selectedChart.getTitle().setTextObject("自动图表标题"); |
||||
|
||||
BaseChartCollection chartCollection1 = BaseChartGetter.createChartCollection(VanChartLinePlot.VAN_CHART_LINE_PLOT); |
||||
VanChart selectedChart1 = ((ChartCollection) chartCollection1).getSelectedChart(VanChart.class); |
||||
selectedChart1.getTitle().setTextObject("自动图表标题"); |
||||
|
||||
BaseChartCollection chartCollection2 = BaseChartGetter.createChartCollection(VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID); |
||||
VanChart selectedChart2 = ((ChartCollection) chartCollection2).getSelectedChart(VanChart.class); |
||||
selectedChart2.getTitle().setTextObject("自动图表标题"); |
||||
|
||||
AutoChartIcon autoChartIcon = new AutoChartIcon((ChartCollection) chartCollection); |
||||
autoChartIcon.registerCallBackEvent(this); |
||||
AutoChartIcon autoChartIcon1 = new AutoChartIcon((ChartCollection) chartCollection1); |
||||
autoChartIcon1.registerCallBackEvent(this); |
||||
AutoChartIcon autoChartIcon2 = new AutoChartIcon((ChartCollection) chartCollection2); |
||||
autoChartIcon2.registerCallBackEvent(this); |
||||
|
||||
chartResultModel.addElement(autoChartIcon); |
||||
chartResultModel.addElement(autoChartIcon1); |
||||
chartResultModel.addElement(autoChartIcon2); |
||||
chartViewList.setSelectedIndex(0); |
||||
} |
||||
|
||||
@Override |
||||
public void populate(ChartCollection cc) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void update(ChartCollection cc) { |
||||
if (chartViewList.getSelectedIndex() < 0) { |
||||
return; |
||||
} |
||||
AutoChartIcon chartIcon = (AutoChartIcon) chartViewList.getSelectedValue(); |
||||
ChartProvider chartProvider = chartIcon.getChartCollection().getSelectedChartProvider(ChartProvider.class); |
||||
if (cc.getChartCount() > 0) { |
||||
cc.setSelectChart(chartProvider); |
||||
} else { |
||||
cc.addChart(chartProvider); |
||||
} |
||||
} |
||||
|
||||
public void populate(String tableName, String[] dataFields) { |
||||
tableNameComboBox.setSelectedTableDataByName(tableName); |
||||
Map<Object, Boolean> map = new HashMap(); |
||||
for (String dataField : dataFields) { |
||||
map.put(dataField, true); |
||||
} |
||||
dataFieldBox.setSelectedValues(map); |
||||
} |
||||
|
||||
@Override |
||||
public void callback() { |
||||
this.repaint(); |
||||
} |
||||
} |
After Width: | Height: | Size: 179 B |
@ -0,0 +1,113 @@
|
||||
package com.fr.design.designer.creator; |
||||
|
||||
import com.fr.base.GraphHelper; |
||||
import com.fr.base.chart.BaseChartCollection; |
||||
import com.fr.design.dialog.DialogActionAdapter; |
||||
import com.fr.design.gui.chart.MiddleChartComponent; |
||||
import com.fr.design.gui.chart.MiddleChartDialog; |
||||
import com.fr.design.mainframe.BaseJForm; |
||||
import com.fr.design.mainframe.DesignerContext; |
||||
import com.fr.design.mainframe.EditingMouseListener; |
||||
import com.fr.design.mainframe.FormDesigner; |
||||
import com.fr.design.module.DesignModuleFactory; |
||||
import com.fr.form.ui.ChartAutoEditor; |
||||
import com.fr.stable.bridge.StableFactory; |
||||
|
||||
import javax.swing.JComponent; |
||||
import javax.swing.JPanel; |
||||
import java.awt.Color; |
||||
import java.awt.Dimension; |
||||
import java.awt.Graphics; |
||||
import java.awt.Rectangle; |
||||
import java.awt.event.MouseEvent; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2020-05-26 |
||||
*/ |
||||
public class XAutoChartCreator extends XChartEditor { |
||||
|
||||
private MiddleChartDialog autoChartDialog; |
||||
|
||||
private EditingMouseListener editingMouseListener; |
||||
|
||||
public XAutoChartCreator(ChartAutoEditor editor, Dimension size) { |
||||
super(editor, size); |
||||
} |
||||
|
||||
/** |
||||
* 返回组件默认名 |
||||
* |
||||
* @return 组件类名(小写) |
||||
*/ |
||||
public String createDefaultName() { |
||||
return "auto_chart"; |
||||
} |
||||
|
||||
@Override |
||||
public ChartAutoEditor toData() { |
||||
return (ChartAutoEditor) data; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 点击选中的时候, 刷新界面 |
||||
* 右键 reset之后, 触发事件 populate此方法 |
||||
* |
||||
* @param jform 表单 |
||||
* @param formDesigner 表单设计器 |
||||
* @return 控件. |
||||
*/ |
||||
public JComponent createToolPane(final BaseJForm jform, final FormDesigner formDesigner) { |
||||
if (toData().isChartSelect()) { |
||||
return super.createToolPane(jform, formDesigner); |
||||
} |
||||
if (isEditing) { |
||||
if (autoChartDialog != null && autoChartDialog.isVisible()) { |
||||
return new JPanel(); |
||||
} |
||||
final BaseChartCollection chartCollection = (BaseChartCollection) StableFactory.createXmlObject(BaseChartCollection.XML_TAG); |
||||
autoChartDialog = DesignModuleFactory.getAutoChartDialog(DesignerContext.getDesignerFrame()); |
||||
autoChartDialog.populate(chartCollection); |
||||
autoChartDialog.addDialogActionListener(new DialogActionAdapter() { |
||||
@Override |
||||
public void doOk() { |
||||
initChart(autoChartDialog.getChartCollection()); |
||||
formDesigner.fireTargetModified(); |
||||
} |
||||
@Override |
||||
public void doCancel() { |
||||
editingMouseListener.stopEditing(); |
||||
} |
||||
}); |
||||
autoChartDialog.setVisible(true); |
||||
} |
||||
return toData().isChartSelect() ? super.createToolPane(jform, formDesigner) : new JPanel(); |
||||
} |
||||
|
||||
/** |
||||
* 响应点击事件 |
||||
* |
||||
* @param editingMouseListener 鼠标点击,位置处理器 |
||||
* @param e 鼠标点击事件 |
||||
*/ |
||||
public void respondClick(EditingMouseListener editingMouseListener, MouseEvent e) { |
||||
this.editingMouseListener = editingMouseListener; |
||||
super.respondClick(editingMouseListener, e); |
||||
} |
||||
|
||||
|
||||
public void paint(Graphics g) { |
||||
//TODO @Bjorn 视觉样式优化
|
||||
g.setColor(Color.RED); |
||||
GraphHelper.fill(g, new Rectangle(0, 0, getWidth(), getHeight())); |
||||
super.paint(g); |
||||
} |
||||
|
||||
private void initChart(BaseChartCollection chartCollection) { |
||||
((MiddleChartComponent) getDesignerEditor().getEditorTarget()).populate(chartCollection); |
||||
this.toData().resetChangeChartCollection(chartCollection); |
||||
this.toData().setChartSelect(true); |
||||
} |
||||
} |
@ -0,0 +1,57 @@
|
||||
package com.fr.design.actions.insert.cell; |
||||
|
||||
import com.fr.base.BaseUtils; |
||||
import com.fr.chart.chartattr.AutoChartCollection; |
||||
import com.fr.design.actions.core.WorkBookSupportable; |
||||
import com.fr.design.mainframe.ElementCasePane; |
||||
import com.fr.design.menu.MenuKeySet; |
||||
|
||||
import javax.swing.KeyStroke; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2020-05-28 |
||||
*/ |
||||
public class AutoChartCellAction extends AbstractCellAction implements WorkBookSupportable { |
||||
|
||||
public AutoChartCellAction() { |
||||
initAction(); |
||||
} |
||||
|
||||
public AutoChartCellAction(ElementCasePane t) { |
||||
super(t); |
||||
initAction(); |
||||
} |
||||
|
||||
private void initAction() { |
||||
this.setMenuKeySet(INSERT_AUTO_CHART); |
||||
this.setName(getMenuKeySet().getMenuKeySetName() + "..."); |
||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||
//TODO @Bjorn 视觉样式优化icon
|
||||
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/auto_chart.png")); |
||||
} |
||||
|
||||
public static final MenuKeySet INSERT_AUTO_CHART = new MenuKeySet() { |
||||
@Override |
||||
public char getMnemonic() { |
||||
return 'M'; |
||||
} |
||||
|
||||
@Override |
||||
public String getMenuName() { |
||||
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Auto_Chart"); |
||||
} |
||||
|
||||
@Override |
||||
public KeyStroke getKeyStroke() { |
||||
return null; |
||||
} |
||||
}; |
||||
|
||||
|
||||
@Override |
||||
public Class getCellValueClass() { |
||||
return AutoChartCollection.class; |
||||
} |
||||
} |
@ -0,0 +1,53 @@
|
||||
package com.fr.design.actions.insert.flot; |
||||
|
||||
import com.fr.base.BaseUtils; |
||||
import com.fr.design.gui.chart.MiddleChartDialog; |
||||
import com.fr.design.mainframe.ElementCasePane; |
||||
import com.fr.design.menu.MenuKeySet; |
||||
import com.fr.design.module.DesignModuleFactory; |
||||
|
||||
import javax.swing.KeyStroke; |
||||
import java.awt.Window; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2020-05-28 |
||||
*/ |
||||
public class AutoChartFloatAction extends ChartFloatAction { |
||||
|
||||
/** |
||||
* 构造函数 图表插入悬浮元素 |
||||
*/ |
||||
public AutoChartFloatAction(ElementCasePane t) { |
||||
super(t); |
||||
} |
||||
|
||||
protected void init() { |
||||
this.setMenuKeySet(FLOAT_INSERT_AUTO_CHART); |
||||
this.setName(getMenuKeySet().getMenuKeySetName()); |
||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/auto_chart.png")); |
||||
} |
||||
|
||||
public static final MenuKeySet FLOAT_INSERT_AUTO_CHART = new MenuKeySet() { |
||||
@Override |
||||
public char getMnemonic() { |
||||
return 'M'; |
||||
} |
||||
|
||||
@Override |
||||
public String getMenuName() { |
||||
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Auto_Chart"); |
||||
} |
||||
|
||||
@Override |
||||
public KeyStroke getKeyStroke() { |
||||
return null; |
||||
} |
||||
}; |
||||
|
||||
protected MiddleChartDialog getMiddleChartDialog(Window window) { |
||||
return DesignModuleFactory.getAutoChartDialog(window); |
||||
} |
||||
} |
@ -0,0 +1,24 @@
|
||||
package com.fr.design.cell.editor; |
||||
|
||||
import com.fr.design.gui.chart.MiddleChartDialog; |
||||
import com.fr.design.mainframe.ElementCasePane; |
||||
import com.fr.design.module.DesignModuleFactory; |
||||
import com.fr.report.elementcase.TemplateElementCase; |
||||
|
||||
import java.awt.Window; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2020-05-28 |
||||
*/ |
||||
public class AutoChartCellEditor extends ChartCellEditor { |
||||
|
||||
public AutoChartCellEditor(ElementCasePane<? extends TemplateElementCase> ePane) { |
||||
super(ePane); |
||||
} |
||||
|
||||
protected MiddleChartDialog getMiddleChartDialog(Window window) { |
||||
return DesignModuleFactory.getAutoChartDialog(window); |
||||
} |
||||
} |
@ -0,0 +1,18 @@
|
||||
package com.fr.design.cell.editor; |
||||
|
||||
import com.fr.design.gui.chart.MiddleChartDialog; |
||||
import com.fr.design.module.DesignModuleFactory; |
||||
|
||||
import java.awt.Window; |
||||
|
||||
/** |
||||
* @author Bjorn |
||||
* @version 10.0 |
||||
* Created by Bjorn on 2020-05-28 |
||||
*/ |
||||
public class AutoChartFloatEditor extends ChartFloatEditor { |
||||
|
||||
protected MiddleChartDialog getMiddleChartDialog(Window window) { |
||||
return DesignModuleFactory.getAutoChartDialog(window); |
||||
} |
||||
} |
Loading…
Reference in new issue