Browse Source

无jira 图表面板遗留问题解决

fbp/merge
Levy.Xie-解安森 5 months ago
parent
commit
ceeef6aed2
  1. 14
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPaneWithGradientBar.java
  2. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java
  3. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java
  4. 12
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java
  5. 15
      designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java
  6. 5
      designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java

14
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPaneWithGradientBar.java

@ -1,11 +1,11 @@
package com.fr.van.chart.designer.component;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chart.base.GradientStyle;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.style.background.gradient.FixedGradientBar;
import com.fr.plugin.chart.type.GradientType;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import java.awt.BorderLayout;
@ -29,18 +29,12 @@ public class VanChartBeautyPaneWithGradientBar extends VanChartBeautyPane {
private JPanel initGradientBarPane() {
colorGradient = new FixedGradientBar(4, 140);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{null, colorGradient},
};
gradientBarPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
gradientBarPane = FineLayoutBuilder.commonLeftRightLayout(components);
gradientBarPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
return gradientBarPane;
}

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

@ -14,6 +14,7 @@ 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.FRGUIPaneFactory;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.base.VanChartHtmlLabel;
@ -69,7 +70,7 @@ public class VanChartHtmlLabelPane extends JPanel {
JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
this.setLayout(new BorderLayout());
this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
this.add(contentPane, BorderLayout.NORTH);
if (widthAndHeightPane != null) {
this.add(widthAndHeightPane, BorderLayout.CENTER);
@ -150,7 +151,7 @@ public class VanChartHtmlLabelPane extends JPanel {
new Component[]{isCustomWidth, customWidth},
new Component[]{isCustomHeight, customHeight},
};
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1, 1});
}
private void checkWidth() {

5
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java

@ -22,7 +22,6 @@ import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -62,7 +61,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
initStyleListener();
return FineLayoutBuilder.compatibleTableLayout(10, getLabelStyleComponents(plot),new double[]{1.2, 3});
return FineLayoutBuilder.commonLeftRightLayout(getLabelStyleComponents(plot));
}
protected void initStyleListener() {
@ -118,7 +117,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
}
protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) {
return TableLayout4VanChartHelper.createGapTableLayoutPane(title, panel);
return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, new UILabel(title), panel);
}
protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) {

12
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java

@ -1,13 +1,11 @@
package com.fr.van.chart.designer.style.label;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.ibutton.UIButtonGroup;
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.stable.Constants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.pie.style.VanChartPieCategoryLabelContentPane;
@ -40,18 +38,12 @@ public class VanChartPieCategoryLabelDetailPane extends VanChartPlotLabelDetailP
UIButtonGroup<Integer> position = new UIButtonGroup<>(positionName, positionValue);
setPosition(position);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] row = {p, p};
double[] col = {f, e};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")), position},
};
return TableLayoutHelper.createTableLayoutPane(components, row, col);
return FineLayoutBuilder.commonLeftRightLayout(components);
}
protected void checkPositionPane(String title) {

15
designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java

@ -1,15 +1,14 @@
package com.fr.van.chart.gauge;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.base.GradientStyle;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.style.background.gradient.FixedGradientBar;
import com.fr.plugin.chart.type.GradientType;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartBeautyPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
@ -29,24 +28,18 @@ public class VanChartGaugeBeautyPane extends VanChartBeautyPane {
public VanChartGaugeBeautyPane() {
super();
this.add(initGradientBarPane(), BorderLayout.SOUTH);
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
initListener();
}
private JPanel initGradientBarPane() {
colorGradient = new FixedGradientBar(4, 140);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{null, colorGradient},
};
gradientBarPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
gradientBarPane = FineLayoutBuilder.commonLeftRightLayout(components);
gradientBarPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
colorGradient.updateColor(ChartConstants.GRADIENT_END, ChartConstants.GRADIENT_START);
return gradientBarPane;
}

5
designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java

@ -27,7 +27,6 @@ import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.type.GaugeStyle;
import com.fr.plugin.chart.type.GradientType;
import com.fr.stable.Constants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartFillStylePane;
import com.fr.van.chart.designer.style.series.VanChartMultiColorSeriesPane;
@ -172,7 +171,7 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
}
}
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(title, gaugeLayout);
JPanel panel = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, new UILabel(title), gaugeLayout);
gaugeLayout.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
@ -211,7 +210,7 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
private JPanel createGaugeStylePane() {
JPanel panel = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
JPanel centerPanel = FineLayoutBuilder.compatibleTableLayout(10, getDiffComponentsWithGaugeStyle(), new double[]{1.2, 3});
JPanel centerPanel = FineLayoutBuilder.commonLeftRightLayout(getDiffComponentsWithGaugeStyle());
panel.add(centerPanel, BorderLayout.CENTER);
if (rotate != null) {
JPanel panel1 = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},

Loading…
Cancel
Save