Browse Source

REPORT-132393 fix: 图表区域布局修复

fbp/release
Levy.Xie-解安森 3 months ago
parent
commit
b641c84a2a
  1. 4
      designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java
  2. 5
      designer-base/src/main/java/com/fr/design/condition/SingleConditionPane.java
  3. 28
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java
  4. 3
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnConditionPane.java
  5. 10
      designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/AbstractNormalMultiLineConditionPane.java
  6. 21
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/RadarTableContentPane.java
  7. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java

4
designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java

@ -84,7 +84,7 @@ public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
selectedItemPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); selectedItemPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
// 选中的添加Itempane // 选中的添加ItemPane
selectedItemScrollPane.setViewportView(selectedItemPane); selectedItemScrollPane.setViewportView(selectedItemPane);
selectedItemScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); selectedItemScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
@ -93,7 +93,7 @@ public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
this.add(FineUIUtils.wrapComponentWithTitle(column( this.add(FineUIUtils.wrapComponentWithTitle(column(
10, 10,
row(cell(addItemPane), flex()), row(cell(addItemPane), flex()),
cell(selectedItemScrollPane).with(it -> it.setBorder(new FineRoundBorder())), cell(selectedItemScrollPane).weight(1).with(it -> it.setBorder(new FineRoundBorder())),
fix(10) fix(10)
).getComponent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property")), BorderLayout.NORTH); ).getComponent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property")), BorderLayout.NORTH);
} }

5
designer-base/src/main/java/com/fr/design/condition/SingleConditionPane.java

@ -7,8 +7,6 @@ import java.awt.event.ActionListener;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
@ -31,9 +29,8 @@ public abstract class SingleConditionPane<T> extends BasicPane {
cancel = new UIButton(new LazyIcon("remove")); cancel = new UIButton(new LazyIcon("remove"));
cancel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Remove")); cancel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Remove"));
cancel.addActionListener(cancleListener); cancel.addActionListener(cancleListener);
cancel.setMargin(new Insets(0, 0, 0, 0));
cancel.setBorder(new ScaledEmptyBorder(0, 0, 0, 10));
cancel.setBackground(FlatUIUtils.getUIColor("default.background", new Color(246, 248, 250, 255))); cancel.setBackground(FlatUIUtils.getUIColor("default.background", new Color(246, 248, 250, 255)));
cancel.setBorder(null);
} }
addCancel(); addCancel();
} }

28
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java

@ -47,16 +47,15 @@ import java.util.List;
import static com.fine.theme.utils.FineUIScale.scale; import static com.fine.theme.utils.FineUIScale.scale;
public class UIColorPickerPane extends BasicPane implements UIObserver { public class UIColorPickerPane extends BasicPane implements UIObserver {
private static final int MARGIN_TOP = scale(7); private static final int MARGIN_TOP = scale(10);
private static final int MARGIN_LEFT = scale(5);
private static final int COLORGROUP_MARGIN_LEFT = scale(15); private static final int COLORGROUP_MARGIN_LEFT = scale(15);
private static final int OFF_HEIGHT = scale(6); private static final int OFF_HEIGHT = scale(10);
private static final int COLOR_REC_HEIGHT = scale(40); private static final int COLOR_REC_HEIGHT = scale(40);
private static final int COLOR_REC_WIDTH = scale(30); private static final int COLOR_REC_WIDTH = scale(30);
protected static final int TEXTFIELD_HEIGHT = scale(20); protected static final int TEXTFIELD_HEIGHT = scale(20);
protected static final int TEXTFIELD_WIDTH = scale(130); protected static final int TEXTFIELD_WIDTH = scale(130);
protected static final int UPCONTROLPANE_WIDTH = scale(224); protected static final int UPCONTROLPANE_WIDTH = scale(224);
private static final int LAYOUR_DET = scale(6); private static final int LAYOUR_DET = scale(10);
public static final double VALUE = 100; public static final double VALUE = 100;
@ -610,10 +609,14 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
@Override @Override
public void layoutContainer(Container parent) { public void layoutContainer(Container parent) {
upControlPane.setBounds(getBoundX(), getBoundY(), UPCONTROLPANE_WIDTH, upControlPane.getPreferredSize().height + MARGIN_TOP); upControlPane.setBounds(getBoundX(), getBoundY(),
stagePanel.setBounds(getBoundX(), upControlPane.getPreferredSize().height + scale(8) + getBoundY(), UPCONTROLPANE_WIDTH, stagePanel.getPreferredSize().height); getParent().getWidth(), upControlPane.getPreferredSize().height + LAYOUR_DET);
colorGroup.setBounds( getColorgroupMarginLeft (), 2 * getBoundY() + upControlPane.getPreferredSize().height + stagePanel.getPreferredSize().height + 2 * LAYOUR_DET, colorGroup.getPreferredSize().width, colorGroup.getPreferredSize().height + upControlPane.getPreferredSize().height); stagePanel.setBounds(getBoundX(), upControlPane.getPreferredSize().height + LAYOUR_DET + getBoundY(),
textGroup.setBounds(colorGroup.getPreferredSize().width + getColorgroupMarginLeft (), upControlPane.getPreferredSize().height + stagePanel.getPreferredSize().height + 2 * LAYOUR_DET + getBoundY(), textGroup.getPreferredSize().width, textGroup.getPreferredSize().height); getParent().getWidth(), stagePanel.getPreferredSize().height);
colorGroup.setBounds( getColorgroupMarginLeft(), 2 * getBoundY() + upControlPane.getPreferredSize().height + stagePanel.getPreferredSize().height + 2 * LAYOUR_DET,
colorGroup.getPreferredSize().width, colorGroup.getPreferredSize().height + upControlPane.getPreferredSize().height);
textGroup.setBounds(colorGroup.getPreferredSize().width + getColorgroupMarginLeft(), upControlPane.getPreferredSize().height + stagePanel.getPreferredSize().height + 2 * LAYOUR_DET + getBoundY(),
textGroup.getPreferredSize().width, textGroup.getPreferredSize().height);
} }
@Override @Override
@ -640,9 +643,12 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
@Override @Override
public void layoutContainer(Container parent) { public void layoutContainer(Container parent) {
upControlPane.setBounds(getBoundX(), getBoundY(), getBoundWidth(), upControlPane.getPreferredSize().height); upControlPane.setBounds(getBoundX(), getBoundY(), getParent().getWidth(),
colorGroup.setBounds(COLORGROUP_MARGIN_LEFT, 2 * MARGIN_TOP + upControlPane.getPreferredSize().height + LAYOUR_DET, colorGroup.getPreferredSize().width, colorGroup.getPreferredSize().height + upControlPane.getPreferredSize().height); upControlPane.getPreferredSize().height);
textGroup.setBounds(colorGroup.getPreferredSize().width + COLORGROUP_MARGIN_LEFT, MARGIN_TOP + upControlPane.getPreferredSize().height + LAYOUR_DET, textGroup.getPreferredSize().width, textGroup.getPreferredSize().height); colorGroup.setBounds(COLORGROUP_MARGIN_LEFT, 2 * MARGIN_TOP + upControlPane.getPreferredSize().height + LAYOUR_DET,
colorGroup.getPreferredSize().width, colorGroup.getPreferredSize().height + upControlPane.getPreferredSize().height);
textGroup.setBounds(colorGroup.getPreferredSize().width + COLORGROUP_MARGIN_LEFT, MARGIN_TOP + upControlPane.getPreferredSize().height + LAYOUR_DET,
textGroup.getPreferredSize().width, textGroup.getPreferredSize().height);
} }
@Override @Override

3
designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnConditionPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.column; package com.fr.van.chart.column;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.base.AttrAlpha; import com.fr.chart.base.AttrAlpha;
import com.fr.chart.base.AttrBackground; import com.fr.chart.base.AttrBackground;
import com.fr.chart.base.AttrBorder; import com.fr.chart.base.AttrBorder;
@ -41,7 +42,7 @@ public class VanChartColumnConditionPane extends DataSeriesConditionPane{
protected void initComponents() { protected void initComponents() {
super.initComponents(); super.initComponents();
//添加全部条件属性后被遮挡 //添加全部条件属性后被遮挡
liteConditionPane.setPreferredSize(new Dimension(300, 400)); liteConditionPane.setPreferredSize(FineUIScale.scale(new Dimension(300, 400)));
} }
@Override @Override

10
designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/AbstractNormalMultiLineConditionPane.java

@ -45,15 +45,17 @@ public abstract class AbstractNormalMultiLineConditionPane extends ConditionAttr
JPanel pane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel pane = FRGUIPaneFactory.createBorderLayout_S_Pane();
pane.add(initContentPane()); pane.add(initContentPane());
this.add(row(column(cell(nameLabel), flex()).weight(0.2), this.add(row(
row(cell(initContentPane()).weight(1), flex()).weight(0.8)).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent()); column(cell(nameLabel), flex()).weight(0.2),
cell(initContentPane()).weight(0.8)
).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 5))
).getComponent(), BorderLayout.CENTER);
} }
/** /**
* 添加删除按钮 * 添加删除按钮
*/ */
public void addCancel() { public void addCancel() {
this.add(column(fix(5), cell(cancel), flex()).getComponent(), BorderLayout.EAST); this.add(column(cell(cancel), flex()).getComponent(), BorderLayout.EAST);
} }
} }

21
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/RadarTableContentPane.java

@ -1,19 +1,16 @@
package com.fr.van.chart.designer.style.axis.radar; package com.fr.van.chart.designer.style.axis.radar;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.plugin.chart.radar.data.RadarYAxisTableDefinition; import com.fr.plugin.chart.radar.data.RadarYAxisTableDefinition;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.util.List; import java.util.List;
public class RadarTableContentPane extends AbstractTableDataContentPane { public class RadarTableContentPane extends AbstractTableDataContentPane {
@ -29,13 +26,10 @@ public class RadarTableContentPane extends AbstractTableDataContentPane {
private void initAllComponent() { private void initAllComponent() {
categoryNameComboBox = new UIComboBox(); categoryNameComboBox = new UIComboBox();
categoryNameComboBox.setPreferredSize(new Dimension(100, 20));
minValueComboBox = new UIComboBox(); minValueComboBox = new UIComboBox();
minValueComboBox.setPreferredSize(new Dimension(100, 20));
maxValueComboBox = new UIComboBox(); maxValueComboBox = new UIComboBox();
maxValueComboBox.setPreferredSize(new Dimension(100, 20));
addAutoItem(); addAutoItem();
@ -47,18 +41,13 @@ public class RadarTableContentPane extends AbstractTableDataContentPane {
} }
private JPanel getContentPane() { private JPanel getContentPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p, p, p};
double[] col = {p, f};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Category") + ":", SwingConstants.RIGHT), categoryNameComboBox}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Category")), categoryNameComboBox},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Value") + ":", SwingConstants.RIGHT), minValueComboBox}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Value")), minValueComboBox},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Max_Value") + ":", SwingConstants.RIGHT), maxValueComboBox} new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Max_Value")), maxValueComboBox}
}; };
return TableLayoutHelper.createTableLayoutPane(components, row, col); return FineLayoutBuilder.commonLeftRightLayout(components);
} }
@Override @Override

5
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java

@ -6,6 +6,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartValueAxis; import com.fr.plugin.chart.attr.axis.VanChartValueAxis;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
@ -38,7 +39,7 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane {
new Component[]{createValueStylePane(), null}, new Component[]{createValueStylePane(), null},
}; };
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1, 0});
} }
protected LineComboBox createLineComboBox() { protected LineComboBox createLineComboBox() {
@ -57,7 +58,7 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane {
centerPane.add(commenPane, Toolkit.i18nText("Fine-Design_Chart_Axis_Unified_Count")); centerPane.add(commenPane, Toolkit.i18nText("Fine-Design_Chart_Axis_Unified_Count"));
centerPane.add(tableDataPane, Toolkit.i18nText("Fine-Design_Chart_Respectively_Specified")); centerPane.add(tableDataPane, Toolkit.i18nText("Fine-Design_Chart_Respectively_Specified"));
JPanel contentPane = new JPanel(new BorderLayout()); JPanel contentPane = new JPanel(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
contentPane.add(valueStyle, BorderLayout.NORTH); contentPane.add(valueStyle, BorderLayout.NORTH);
contentPane.add(centerPane, BorderLayout.CENTER); contentPane.add(centerPane, BorderLayout.CENTER);
valueStyle.addActionListener(new ActionListener() { valueStyle.addActionListener(new ActionListener() {

Loading…
Cancel
Save