|
|
|
@ -1,9 +1,9 @@
|
|
|
|
|
package com.fr.design.chart; |
|
|
|
|
|
|
|
|
|
import com.fine.theme.utils.FineUIStyle; |
|
|
|
|
import com.fr.base.chart.chartdata.CallbackEvent; |
|
|
|
|
import com.fr.chart.chartattr.ChartCollection; |
|
|
|
|
import com.fr.design.chart.auto.AutoTypeCalculate; |
|
|
|
|
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.dialog.FineJOptionPane; |
|
|
|
@ -18,6 +18,7 @@ import com.fr.design.utils.gui.GUICoreUtils;
|
|
|
|
|
import com.fr.general.GeneralUtils; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.plugin.chart.vanchart.VanChart; |
|
|
|
|
import com.formdev.flatlaf.util.ScaledEmptyBorder; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.DefaultListCellRenderer; |
|
|
|
@ -39,6 +40,7 @@ import java.util.List;
|
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.concurrent.CancellationException; |
|
|
|
|
import java.awt.Color; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
@ -46,6 +48,11 @@ import java.awt.event.ActionListener;
|
|
|
|
|
import java.awt.event.ItemEvent; |
|
|
|
|
import java.awt.event.ItemListener; |
|
|
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.row; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.flex; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.column; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author Bjorn |
|
|
|
|
* @version 10.0 |
|
|
|
@ -93,6 +100,7 @@ public class AutoChartTypePane extends ChartWizardPane implements CallbackEvent
|
|
|
|
|
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); |
|
|
|
@ -112,26 +120,27 @@ public class AutoChartTypePane extends ChartWizardPane implements CallbackEvent
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
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(126, 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); |
|
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); |
|
|
|
|
return panel; |
|
|
|
|
private JPanel createContentPane() { |
|
|
|
|
JPanel contentPane = new JPanel(new BorderLayout()); |
|
|
|
|
contentPane.add(column( |
|
|
|
|
row(10, |
|
|
|
|
cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data"))), |
|
|
|
|
cell(tableNameComboBox).weight(1), |
|
|
|
|
cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Field"))), |
|
|
|
|
cell(dataFieldBox).weight(1), |
|
|
|
|
cell(refreshButton), |
|
|
|
|
flex(1) |
|
|
|
|
), |
|
|
|
|
flex() |
|
|
|
|
).with(it -> it.setBorder(new ScaledEmptyBorder(10, 10, 10, 10))).getComponent()); |
|
|
|
|
|
|
|
|
|
return contentPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initButtonGroup() { |
|
|
|
|
dataFieldBox = new UIComboCheckBox(new Object[0]); |
|
|
|
|
dataFieldBox.getClickPane().setOpaque(false); |
|
|
|
|
dataFieldBox.addActionListener(new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
@ -180,6 +189,7 @@ public class AutoChartTypePane extends ChartWizardPane implements CallbackEvent
|
|
|
|
|
|
|
|
|
|
private void initRefreshLabel() { |
|
|
|
|
refreshButton = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Recommend")); |
|
|
|
|
FineUIStyle.setStyle(refreshButton, FineUIStyle.STYLE_PRIMARY); |
|
|
|
|
refreshButton.addActionListener(new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|