|
|
|
@ -1,9 +1,10 @@
|
|
|
|
|
package com.fr.design.chart; |
|
|
|
|
|
|
|
|
|
import com.fine.theme.utils.FineUIScale; |
|
|
|
|
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; |
|
|
|
|
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; |
|
|
|
@ -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; |
|
|
|
@ -58,7 +60,7 @@ public class AutoChartTypePane extends ChartWizardPane implements CallbackEvent
|
|
|
|
|
private UIButton refreshButton; |
|
|
|
|
|
|
|
|
|
private TableDataComboBox tableNameComboBox; |
|
|
|
|
private UIComboCheckBox dataFieldBox; |
|
|
|
|
private DataFieldComboBox dataFieldBox; |
|
|
|
|
|
|
|
|
|
private AutoProgressBar connectionBar; |
|
|
|
|
private SwingWorker worker; |
|
|
|
@ -93,6 +95,29 @@ public class AutoChartTypePane extends ChartWizardPane implements CallbackEvent
|
|
|
|
|
this.add(splitPane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private class DataFieldComboBox extends UIComboCheckBox { |
|
|
|
|
public DataFieldComboBox(Object[] value) { |
|
|
|
|
super(value); |
|
|
|
|
} |
|
|
|
|
@Override |
|
|
|
|
protected void setLayoutAndAddComponents() { |
|
|
|
|
// 使用BorderLayout 将ClickPane添加到中心,不然受到FineComboBoxUI影响会有两个下拉箭头按钮
|
|
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
JPanel pane = getClickPane(); |
|
|
|
|
pane.setOpaque(false); |
|
|
|
|
this.add(pane, BorderLayout.CENTER); |
|
|
|
|
} |
|
|
|
|
@Override |
|
|
|
|
public Dimension getPreferredSize() { |
|
|
|
|
// 这里大小设计要和TableDataComboBox保持一致,不然两个多选框会有大小差异
|
|
|
|
|
int renderFix = FineUIScale.scale(5); |
|
|
|
|
int comboHeight = FineUIUtils.getAndScaleInt("ComboBox.comboHeight", 24); |
|
|
|
|
return new Dimension(super.getPreferredSize().width + renderFix, comboHeight); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ListCellRenderer iconCellRenderer = new DefaultListCellRenderer() { |
|
|
|
|
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
|
|
|
|
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); |
|
|
|
@ -125,13 +150,14 @@ public class AutoChartTypePane extends ChartWizardPane implements CallbackEvent
|
|
|
|
|
panel.add(areaNamePane); |
|
|
|
|
areaNamePane.add(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Field") + ":")); |
|
|
|
|
areaNamePane.add(dataFieldBox); |
|
|
|
|
dataFieldBox.setPreferredSize(new Dimension(126, 20)); |
|
|
|
|
panel.add(refreshButton); |
|
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); |
|
|
|
|
return panel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initButtonGroup() { |
|
|
|
|
dataFieldBox = new UIComboCheckBox(new Object[0]); |
|
|
|
|
dataFieldBox = new DataFieldComboBox(new Object[0]); |
|
|
|
|
dataFieldBox.addActionListener(new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|