Browse Source

Pull request #16182: REPORT-144631 图表类型自动推荐UI调整

Merge in DESIGN/design from ~SHENGZU.XUE/design:fbp/feature to fbp/feature

* commit '0d66014eedd8d89bca423c0e3c2ac1985c6aba89':
  REPORT-144631 使用LazyIcon适配Icon
  REPORT-144631 放弃对于UIComboCheckBox相关的修改
  REPORT-144631 调整图标自动类型推荐布局,修改部分icon
  REPORT-144631 优化import
  REPORT-144631 AutoChartTypePane 中的DataFieldComboBox
  REPORT-144631 checkbox使用row来布局宽度
  REPORT-144631 修改错误的注释
  REPORT-144631 调整AutoChartTypePane combobox缩放
  REPORT-144631 调整AutoChartTypePane DataFieldComboBox 的宽度缩放
  REPORT-144631 -图表类型自动推荐UI调整
fbp/feature
Shengzu.Xue-薛胜祖 2 months ago
parent
commit
5d91e0df72
  1. 6
      designer-base/src/main/resources/com/fine/theme/icon/insert/auto_chart_disabled.svg
  2. 6
      designer-base/src/main/resources/com/fine/theme/icon/insert/auto_chart_normal.svg
  3. 4
      designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json
  4. 42
      designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java
  5. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java
  6. 4
      designer-realize/src/main/java/com/fr/design/actions/insert/cell/AutoChartCellAction.java
  7. 4
      designer-realize/src/main/java/com/fr/design/actions/insert/flot/AutoChartFloatAction.java

6
designer-base/src/main/resources/com/fine/theme/icon/insert/auto_chart_disabled.svg

@ -0,0 +1,6 @@
<svg width="16" height="16" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.5 26C10.5 26.5523 10.9477 27 11.5 27H17C17.5523 27 18 26.5523 18 26V23.0365L17.3945 22.4032C16.6539 21.6285 17.0125 20.3675 18 20.0674V4C18 3.44771 17.5523 3 17 3H11.5C10.9477 3 10.5 3.44772 10.5 4V26ZM12.1 25.4H16.4V4.6H12.1V25.4Z" fill="#0A1C38" fill-opacity="0.29"/>
<path d="M27.5 10V19.6285L26.6486 19.4739L25.9 18.083V10.6H21.6V18.7572L21.2143 19.4739L20 19.6943V10C20 9.44772 20.4477 9 21 9H26.5C27.0523 9 27.5 9.44771 27.5 10Z" fill="#0A1C38" fill-opacity="0.29"/>
<path d="M20.7058 28.278C20.4063 28.4222 20.0667 28.1754 20.1113 27.8461L20.5647 24.4978C20.5817 24.372 20.5405 24.2453 20.4528 24.1535L18.118 21.7112C17.8883 21.4709 18.018 21.0717 18.345 21.0124L21.6695 20.4088C21.7944 20.3862 21.9022 20.3078 21.9624 20.1961L23.5637 17.2208C23.7212 16.9281 24.141 16.9281 24.2985 17.2208L25.8998 20.1961C25.8997 20.1959 25.8999 20.1962 25.8998 20.1961C25.96 20.3078 26.0681 20.3862 26.193 20.4089L29.5172 21.0124C29.8442 21.0717 29.9739 21.4709 29.7442 21.7112L27.5 24.0587L27.4097 24.1536C27.322 24.2453 27.2808 24.372 27.2978 24.4979L27.5 25.9909V25.9932L27.7509 27.8461C27.7955 28.1754 27.4559 28.4222 27.1564 28.278L24.1121 26.8121C24.0737 26.7937 24.0332 26.7814 23.992 26.7753C23.9105 26.7634 23.8263 26.7756 23.7504 26.8122L20.7058 28.278Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 27C1.44772 27 1 26.5523 1 26V16C1 15.4477 1.44772 15 2 15H7.5C8.05228 15 8.5 15.4477 8.5 16V26C8.5 26.5523 8.05228 27 7.5 27H2ZM6.9 25.4H2.6V16.6H6.9V25.4Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

6
designer-base/src/main/resources/com/fine/theme/icon/insert/auto_chart_normal.svg

@ -0,0 +1,6 @@
<svg width="16" height="16" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.5 26C10.5 26.5523 10.9477 27 11.5 27H17C17.5523 27 18 26.5523 18 26V23.0365L17.3945 22.4032C16.6539 21.6285 17.0125 20.3675 18 20.0674V4C18 3.44771 17.5523 3 17 3H11.5C10.9477 3 10.5 3.44772 10.5 4V26ZM12.1 25.4H16.4V4.6H12.1V25.4Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M27.5 10V19.6285L26.6486 19.4739L25.9 18.083V10.6H21.6V18.7572L21.2143 19.4739L20 19.6943V10C20 9.44772 20.4477 9 21 9H26.5C27.0523 9 27.5 9.44771 27.5 10Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M20.7058 28.278C20.4063 28.4222 20.0667 28.1754 20.1113 27.8461L20.5647 24.4978C20.5817 24.372 20.5405 24.2453 20.4528 24.1535L18.118 21.7112C17.8883 21.4709 18.018 21.0717 18.345 21.0124L21.6695 20.4088C21.7944 20.3862 21.9022 20.3078 21.9624 20.1961L23.5637 17.2208C23.7212 16.9281 24.141 16.9281 24.2985 17.2208L25.8998 20.1961C25.8997 20.1959 25.8999 20.1962 25.8998 20.1961C25.96 20.3078 26.0681 20.3862 26.193 20.4089L29.5172 21.0124C29.8442 21.0717 29.9739 21.4709 29.7442 21.7112L27.5 24.0587L27.4097 24.1536C27.322 24.2453 27.2808 24.372 27.2978 24.4979L27.5 25.9909V25.9932L27.7509 27.8461C27.7955 28.1754 27.4559 28.4222 27.1564 28.278L24.1121 26.8121C24.0737 26.7937 24.0332 26.7814 23.992 26.7753C23.9105 26.7634 23.8263 26.7756 23.7504 26.8122L20.7058 28.278Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 27C1.44772 27 1 26.5523 1 26V16C1 15.4477 1.44772 15 2 15H7.5C8.05228 15 8.5 15.4477 8.5 16V26C8.5 26.5523 8.05228 27 7.5 27H2ZM6.9 25.4H2.6V16.6H6.9V25.4Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

4
designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json

@ -511,6 +511,10 @@
"normal": "alphafine/alphaFine_template.svg",
"disable": "alphafine/alphaFine_template_disable.svg",
"white": "alphafine/alphaFine_template_white.svg"
},
"auto_chart": {
"normal": "insert/auto_chart_normal.svg",
"disable": "insert/auto_chart_disabled.svg"
}
}
}

42
designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java

@ -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) {

4
designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java

@ -1,7 +1,9 @@
package com.fr.van.chart.designer.type;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.BaseUtils;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.base.svg.IconUtils;
import com.fr.chart.base.AttrFillStyle;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Legend;
@ -61,7 +63,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Van
buttonPane.setLayout(new BorderLayout());
if (ChartTypeManager.AUTO_CHART) {
autoButton = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Auto_Recommended_Chart"),
BaseUtils.readIcon("/com/fr/design/images/m_insert/auto_chart.png")) {
new LazyIcon("auto_chart")) {
@Override
public Dimension getPreferredSize() {
return new Dimension((int) super.getPreferredSize().getWidth(), 25);

4
designer-realize/src/main/java/com/fr/design/actions/insert/cell/AutoChartCellAction.java

@ -1,6 +1,6 @@
package com.fr.design.actions.insert.cell;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fr.chart.chartattr.AutoChartCollection;
import com.fr.common.annotations.Open;
import com.fr.design.actions.core.WorkBookSupportable;
@ -31,7 +31,7 @@ public class AutoChartCellAction extends AbstractCellAction implements WorkBookS
this.setMenuKeySet(INSERT_AUTO_CHART);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/auto_chart.png"));
this.setSmallIcon(new LazyIcon("auto_chart"));
}
public static final MenuKeySet INSERT_AUTO_CHART = new MenuKeySet() {

4
designer-realize/src/main/java/com/fr/design/actions/insert/flot/AutoChartFloatAction.java

@ -1,6 +1,6 @@
package com.fr.design.actions.insert.flot;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.gui.chart.MiddleChartDialog;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ElementCasePane;
@ -28,7 +28,7 @@ public class AutoChartFloatAction extends ChartFloatAction {
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"));
this.setSmallIcon(new LazyIcon("auto_chart"));
}
public static final MenuKeySet FLOAT_INSERT_AUTO_CHART = new MenuKeySet() {

Loading…
Cancel
Save