Browse Source

REPORT-132601 fix:图表标题面板问题修复

fbp/release
Levy.Xie-解安森 3 months ago
parent
commit
7881d57f78
  1. 18
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java
  2. 10
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithBackGroundLabel.java
  3. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java
  4. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

18
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.designer.component;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.DesignerEnvManager;
import com.fr.design.constants.KeyWords;
import com.fr.design.gui.autocomplete.AutoCompletion;
@ -13,11 +14,8 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.base.VanChartHtmlLabel;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JComponent;
import javax.swing.JPanel;
@ -63,18 +61,13 @@ public class VanChartHtmlLabelPane extends JPanel {
UIComponentUtils.setLineWrap(useHtml);
useHtml.addChangeListener(e -> checkWidthAndHeightPane());
widthAndHeightPane = createWidthAndHeightPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{createJSContentPane()},
new Component[]{useHtml},
new Component[]{null, null},
};
JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
this.setLayout(new BorderLayout());
this.add(contentPane, BorderLayout.NORTH);
@ -152,17 +145,12 @@ public class VanChartHtmlLabelPane extends JPanel {
checkHeight();
}
});
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{isCustomWidth, customWidth},
new Component[]{isCustomHeight, customHeight},
new Component[]{null, null}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
private void checkWidth() {

10
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithBackGroundLabel.java

@ -1,10 +1,8 @@
package com.fr.van.chart.designer.component;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import java.awt.Component;
@ -12,16 +10,12 @@ import java.awt.Component;
public class VanChartHtmlLabelPaneWithBackGroundLabel extends VanChartHtmlLabelPane {
protected JPanel createWidthAndHeightPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH;
JPanel panel = super.createWidthAndHeightPane();
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Background")), panel},
};
return TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p}, new double[]{d, f});
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
}

9
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java

@ -1,7 +1,6 @@
package com.fr.van.chart.designer.style;
import com.fine.theme.utils.FineComponentsFactory;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
import com.fr.base.BaseFormula;
import com.fr.base.Utils;
@ -46,6 +45,7 @@ import java.awt.event.MouseEvent;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIScale.scale;
@ -139,7 +139,12 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"), SwingConstants.LEFT)).weight(1.2),
cell(titleContent).weight(3)
)).getComponent();
),
row(
flex(1.2),
cell(useHtml).weight(3)
)
).getComponent();
return new UIExpandablePane(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content"), titleContentPane);
}

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

@ -126,7 +126,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
double[] rowSize = getLabelPaneRowSize(plot, p);
Component[][] components = getLabelPaneComponents(plot, p, columnSize);
return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1, 0});
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1, 0});
}
protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) {

Loading…
Cancel
Save