|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
package com.fr.design.chart; |
|
|
|
|
|
|
|
|
|
import com.fine.theme.utils.FineUIScale; |
|
|
|
|
import com.fine.swing.ui.layout.Layouts; |
|
|
|
|
import com.fine.theme.utils.FineUIStyle; |
|
|
|
|
import com.fine.theme.utils.FineUIUtils; |
|
|
|
|
import com.fr.base.chart.chartdata.CallbackEvent; |
|
|
|
|
import com.fr.chart.chartattr.ChartCollection; |
|
|
|
|
import com.fr.design.chart.auto.AutoTypeCalculate; |
|
|
|
@ -19,6 +19,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; |
|
|
|
@ -48,6 +49,10 @@ 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 |
|
|
|
@ -140,18 +145,18 @@ public class AutoChartTypePane extends ChartWizardPane implements CallbackEvent
|
|
|
|
|
|
|
|
|
|
private JPanel createContentPane() { |
|
|
|
|
JPanel contentPane = new JPanel(new BorderLayout()); |
|
|
|
|
contentPane.add(Layouts.column( |
|
|
|
|
Layouts.row(10, |
|
|
|
|
Layouts.flex().weight(0.1), |
|
|
|
|
Layouts.cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data") + ":")).weight(1), |
|
|
|
|
Layouts.cell(tableNameComboBox).weight(3), |
|
|
|
|
Layouts.cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Field") + ":")).weight(1.3), |
|
|
|
|
Layouts.cell(dataFieldBox).weight(3), |
|
|
|
|
Layouts.cell(refreshButton).weight(1.5), |
|
|
|
|
Layouts.flex(3) |
|
|
|
|
).with(it -> it.setPreferredSize(new Dimension(super.getPreferredSize().width, FineUIScale.scale(tableNameComboBox.getPreferredSize().height)))) |
|
|
|
|
).getComponent()); |
|
|
|
|
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -206,6 +211,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) { |
|
|
|
|