Browse Source

REPORT-113994 【NewUI】图表遗留问题处理

fbp-1.0
Levy.Xie-解安森 4 months ago
parent
commit
9d2c8f2783
  1. 16
      designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBoxRenderer.java
  2. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java
  3. 36
      designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java
  4. 22
      designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableResultDataSeriesPane.java
  5. 22
      designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesTypeUsePane.java
  6. 23
      designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java
  7. 20
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

16
designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBoxRenderer.java

@ -1,10 +1,13 @@
package com.fr.design.gui.icombobox;
import java.awt.Dimension;
import java.awt.*;
import javax.swing.DefaultListCellRenderer;
import javax.swing.*;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.UIConstants;
/**
*
@ -19,6 +22,15 @@ public class UIComboBoxRenderer extends DefaultListCellRenderer {
super();
}
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
JLabel renderer =(JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
renderer.setBorder(new ScaledEmptyBorder(FineUIUtils.getUIInsets(
"ComboBox.renderInset", "ComboBox.padding"
)));
return renderer;
}
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, FineUIScale.scale(24));

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.chart.gui.data.table;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.Utils;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection;
@ -92,12 +93,8 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane<ChartCollec
}
};
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p};
Component[][] components = getUseComponent();
centerPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
centerPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
this.setLayout(new BorderLayout());
this.add(centerPane, BorderLayout.CENTER);
}

36
designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java

@ -1,5 +1,8 @@
package com.fr.van.chart.box.data.table;
import com.fine.swing.ui.layout.Column;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalTableDataDefinition;
@ -23,6 +26,8 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.column;
public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane {
private UIButtonGroup dataType;
@ -51,47 +56,30 @@ public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane {
}
private JPanel createDataTypePane() {
JPanel pane = new JPanel(new BorderLayout(4, 0));
pane.setBorder(BorderFactory.createMatteBorder(0, 0, 6, 1, getBackground()));
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Form"));
label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
String[] names = new String[]{
Toolkit.i18nText("Fine-Design_Chart_Detailed_Data"),
Toolkit.i18nText("Fine-Design_Chart_Result_Data")
};
dataType = new UIButtonGroup(names);
dataType.setSelectedIndex(0);
dataType.setPreferredSize(new Dimension(100, 20));
pane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{dataType, null, null, label, null}));
pane.setPreferredSize(new Dimension(246, 30));
pane.setBorder(BorderFactory.createEmptyBorder(0, 24, 10, 15));
return pane;
return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, label, dataType);
}
private JPanel createSeriesPane() {
seriesTypeComboxPane = new BoxPlotTableSeriesTypeUsePane();
resultDataSeriesPane = new BoxPlotTableResultDataSeriesPane();
JPanel pane = new JPanel(new BorderLayout(4, 0));
pane.add(seriesTypeComboxPane, BorderLayout.CENTER);
pane.add(resultDataSeriesPane, BorderLayout.SOUTH);
return pane;
Column column = new Column();
column.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
column.setSpacing(10);
column.add(seriesTypeComboxPane);
column.add(resultDataSeriesPane);
return column;
}
private JPanel createFilterPane() {
dataScreeningPane = new ChartDataFilterPane(initplot, parent, false);
dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10, 24, 10, 15));
filterPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), 290, 24, dataScreeningPane);
filterPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
return filterPane;
}

22
designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableResultDataSeriesPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.box.data.table;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.icombobox.UIComboBox;
@ -66,16 +67,7 @@ public class BoxPlotTableResultDataSeriesPane extends AbstractTableDataContentPa
private JPanel createUIComboBoxPane(UIComboBox comboBox, String title) {
UILabel label = new UILabel(title);
label.setPreferredSize(new Dimension(80, 20));
comboBox.setPreferredSize(new Dimension(100, 20));
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout(4, 0));
panel.add(label, BorderLayout.WEST);
panel.add(comboBox, BorderLayout.CENTER);
return panel;
return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, label, comboBox);
}
private UIComboBoxWithEditLabel createUIComboBoxWithEditLabel(String title) {
@ -108,11 +100,6 @@ public class BoxPlotTableResultDataSeriesPane extends AbstractTableDataContentPa
}
private JPanel createDataSeriesPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p, p, p, p, p, p, p};
double[] col = {f};
Component[][] components = new Component[][]{
new Component[]{categoryPane},
new Component[]{seriesNamePane},
@ -123,10 +110,7 @@ public class BoxPlotTableResultDataSeriesPane extends AbstractTableDataContentPa
new Component[]{min}
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col);
panel.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15));
return panel;
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
}
public void checkBoxUse(boolean hasUse) {

22
designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesTypeUsePane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.box.data.table;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.MoreNameCDDefinition;
@ -69,7 +70,6 @@ public class BoxPlotTableSeriesTypeUsePane extends BasicBeanPane<ChartCollection
}
};
cardPane.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15));
cardPane.add(nameFieldValuePane, nameFieldValuePane.title4PopupWindow());
cardPane.add(nameFieldNamePane, nameFieldNamePane.title4PopupWindow());
@ -107,32 +107,16 @@ public class BoxPlotTableSeriesTypeUsePane extends BasicBeanPane<ChartCollection
}
private JPanel createNorthPane() {
JPanel north = new JPanel(new BorderLayout(4, 0));
north.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, getBackground()));
UILabel label = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Style_Category"));
label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
categoryCombox = new UIComboBox();
categoryCombox.setPreferredSize(new Dimension(100, 20));
categoryCombox.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
categoryCombox.setSelectedItem(null);
north.add(GUICoreUtils.createBorderLayoutPane(new Component[]{categoryCombox, null, null, label, null}));
north.setPreferredSize(new Dimension(246, 20));
north.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15));
return north;
return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, label, categoryCombox);
}
private JPanel createCenterPane() {
JPanel center = new JPanel(new BorderLayout(4, 0));
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name_From"));
label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
center.add(GUICoreUtils.createBorderLayoutPane(new Component[]{seriesFrom, null, null, label, null}));
center.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15));
return center;
return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, label, seriesFrom);
}
private void initListener() {

23
designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java

@ -1,5 +1,7 @@
package com.fr.van.chart.designer.other;
import com.fine.swing.ui.layout.Column;
import com.fine.swing.ui.layout.Row;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIConstants;
@ -12,6 +14,7 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.RefreshMoreLabel;
import com.fr.plugin.chart.vanchart.VanChart;
@ -27,6 +30,8 @@ import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.*;
/**
* Created by hufan on 2016/12/30.
@ -76,7 +81,7 @@ public class AutoRefreshPane extends BasicBeanPane<RefreshMoreLabel> {
initTooltipSet();
JPanel jPanel = new JPanel();
JPanel jPanel = new JPanel(new BorderLayout());
jPanel.add(autoTooltip, BorderLayout.CENTER);
jPanel.add(tooltipSet, BorderLayout.EAST);
@ -85,7 +90,7 @@ public class AutoRefreshPane extends BasicBeanPane<RefreshMoreLabel> {
Component[][] components = initComponent(jPanel);
JPanel panel1 = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 1.2, 1.2, 0.6});
JPanel panel1 = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
contentPane = new JPanel(new BorderLayout());
contentPane.add(panel1, BorderLayout.CENTER);
@ -97,10 +102,18 @@ public class AutoRefreshPane extends BasicBeanPane<RefreshMoreLabel> {
protected Component[][] initComponent(JPanel autoTooltipPane){
Column toolTipPane = column(10,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Interval"))),
flex(),
cell(autoRefreshTime),
cell(new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Seconds")))
),
cell(autoTooltipPane)
).getComponent();
return new Component[][]{
new Component[]{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Interval")),
autoRefreshTime, new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Seconds"))},
new Component[]{null, autoTooltip, null, tooltipSet},
new Component[]{null, toolTipPane}
};
}

20
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.designer.style.label;
import com.fine.swing.ui.layout.Column;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.chartattr.Plot;
@ -230,16 +231,17 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
return new JPanel();
}
autoAdjust = new UIButtonGroup<Boolean>(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false});
autoAdjust = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false});
JPanel panel = new JPanel(new BorderLayout());
Column column = new Column();
column.setSpacing(10);
positionPane = new JPanel();
checkPositionPane(title);
panel.add(positionPane, BorderLayout.NORTH);
column.add(positionPane);
if (hasLabelOrientationPane()) {
panel.add(createLabelOrientationPane(), BorderLayout.CENTER);
column.add(createLabelOrientationPane());
}
if (plot.isSupportLeadLine()) {
@ -250,14 +252,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
double[] row = new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED};
double[] col = new double[]{TableLayout.FILL, TableLayout4VanChartHelper.EDIT_AREA_WIDTH};
getLabelPositionPane(comps, row, col);
panel.add(getLabelPositionPane(comps, row, col), BorderLayout.SOUTH);
column.add(getLabelPositionPane(comps, row, col));
initPositionListener();
} else if (PlotFactory.plotAutoAdjustLabelPosition(plot)) {
panel.add(FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Auto_Adjust")), autoAdjust), BorderLayout.SOUTH);
column.add(FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Auto_Adjust")), autoAdjust));
}
return getLabelLayoutPane(panel, Toolkit.i18nText("Fine-Design_Form_Attr_Layout"));
return getLabelLayoutPane(column, Toolkit.i18nText("Fine-Design_Form_Attr_Layout"));
}
protected JPanel getLabelLayoutPane(JPanel panel, String title) {
@ -318,7 +320,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
}
protected JPanel getLabelPositionPane(Component[][] comps, double[] row, double[] col) {
return TableLayoutHelper.createTableLayoutPane(comps, row, col);
return FineLayoutBuilder.compatibleTableLayout(10, comps, new double[]{1.2, 3});
}
protected void initPositionListener() {

Loading…
Cancel
Save