From e47c0f56723a88fbc81bcac7f5392d24beb6a73e Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 4 Jan 2022 12:43:44 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-65358=20=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E8=BE=B9=E6=A1=86=E3=80=91=E5=8D=95=E5=85=83=E6=A0=BC=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E5=8F=8C=E7=BA=BF=E6=98=BE=E7=A4=BA=E6=9C=89=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 各边框绘制时的偏移距离要单独计算 【改动思路】 同上 --- .../fr/design/cell/CellStylePreviewPane.java | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java b/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java index b4b382af5b..eb3c2cd7b5 100644 --- a/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java @@ -19,9 +19,7 @@ import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; -import java.awt.Rectangle; import java.awt.RenderingHints; -import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; import java.util.List; @@ -154,16 +152,16 @@ public class CellStylePreviewPane extends JPanel { float adjustRight = 0; float adjustBottom = 0; if (column == 0) { - adjustLeft = GraphHelper.getLineStyleSize(style.getBorderLeft()) / 2.0F + computeOffset4DoubleStyleBorder(style); + adjustLeft = computeHalfSize4StyledBorder(style.getBorderLeft()); } if (row == 0) { - adjustTop = GraphHelper.getLineStyleSize(style.getBorderTop()) / 2.0F + computeOffset4DoubleStyleBorder(style); + adjustTop = computeHalfSize4StyledBorder(style.getBorderTop()); } if (column == columnSpan - 1) { - adjustRight = -GraphHelper.getLineStyleSize(style.getBorderRight()) / 2.0F - computeOffset4DoubleStyleBorder(style); + adjustRight = -computeHalfSize4StyledBorder(style.getBorderRight()); } if (row == rowSpan - 1) { - adjustBottom = -GraphHelper.getLineStyleSize(style.getBorderBottom()) / 2.0F - computeOffset4DoubleStyleBorder(style); + adjustBottom = -computeHalfSize4StyledBorder(style.getBorderBottom()); } g2d.translate(adjustLeft, adjustTop); @@ -171,15 +169,16 @@ public class CellStylePreviewPane extends JPanel { g2d.translate(-adjustLeft, -adjustTop); } - private float computeOffset4DoubleStyleBorder(Style style) { - float offset = 0F; - if (style.getBorderLeft() == Constants.LINE_DOUBLE) { - offset += GraphHelper.getLineStyleSize(Constants.LINE_THIN) / 2.0F; - } else if (style.getBorderLeft() == Constants.LINE_DOUBLE_DOT) { - offset += GraphHelper.getLineStyleSize(Constants.LINE_DOT) / 2.0F; + private float computeHalfSize4StyledBorder(int border) { + float size = GraphHelper.getLineStyleSize(border) / 2.0F; + + if (border == Constants.LINE_DOUBLE) { + size += GraphHelper.getLineStyleSize(Constants.LINE_THIN) / 2.0F; + } else if (border == Constants.LINE_DOUBLE_DOT) { + size += GraphHelper.getLineStyleSize(Constants.LINE_DOT) / 2.0F; } - return offset; + return size; } @Override From 9c5a1e72f5d3a95d03917d3bba4c4545604e93c3 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 4 Jan 2022 12:44:38 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-65365=20=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E8=BE=B9=E6=A1=86=E3=80=91=E5=A4=9A=E6=AC=A1=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E6=A0=B7=E5=BC=8F=E5=90=8E=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E8=87=AA=E5=AE=9A=E4=B9=89=EF=BC=8C=E8=BE=B9=E6=A1=86?= =?UTF-8?q?=E7=BA=BF=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 根据数据模型填充面板时,需要先重置面板清理掉旧的数据 【改动思路】 同上 --- .../java/com/fr/design/gui/style/BorderPane.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java index dcead1c878..3c917ea456 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java @@ -4,7 +4,6 @@ package com.fr.design.gui.style; * Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved. */ -import com.fr.base.BaseUtils; import com.fr.base.CellBorderStyle; import com.fr.base.Style; import com.fr.design.constants.LayoutConstants; @@ -17,8 +16,8 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.style.color.NewColorSelectBox; -import com.fr.general.IOUtils; import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils; +import com.fr.general.IOUtils; import com.fr.stable.Constants; import com.fr.stable.CoreConstants; @@ -206,6 +205,8 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse } public void populateLineStyleAndColor(CellBorderStyle cellBorderStyle, boolean onlyInspectTop) { + resetLineStyleAndColorSetting(); + if (cellBorderStyle.getTopStyle() != Constants.LINE_NONE) { this.currentLineCombo.setSelectedLineStyle(cellBorderStyle.getTopStyle()); this.currentLineColorPane.setSelectObject(cellBorderStyle.getTopColor()); @@ -225,9 +226,6 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse } else if (cellBorderStyle.getHorizontalStyle() != Constants.LINE_NONE) { this.currentLineCombo.setSelectedLineStyle(cellBorderStyle.getHorizontalStyle()); this.currentLineColorPane.setSelectObject(cellBorderStyle.getHorizontalColor()); - } else { - this.currentLineCombo.setSelectedLineStyle(Constants.LINE_NONE); - this.currentLineColorPane.setSelectObject(Color.BLACK); } } @@ -236,6 +234,11 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse } } + private void resetLineStyleAndColorSetting() { + this.currentLineCombo.setSelectedLineStyle(Constants.LINE_NONE); + this.currentLineColorPane.setSelectObject(null); + } + @Override public Style update(Style style) { From c262e42d2359c9cf4bb46f9e43845182e967f94c Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 4 Jan 2022 15:34:43 +0800 Subject: [PATCH 3/3] =?UTF-8?q?REPORT-65371=20=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E8=BE=B9=E6=A1=86=E3=80=91=E9=99=84=E4=BB=B6=E6=88=AA=E5=9B=BE?= =?UTF-8?q?=EF=BC=8C=E6=BB=9A=E5=8A=A8=E6=9D=A1=E6=98=BE=E7=A4=BA=E6=9C=89?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 右侧留点边距给滚动条,否则滚动条会遮挡住内容 【改动思路】 同上 --- .../fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java index 8efbb1eee5..d8a4096ceb 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java @@ -198,7 +198,7 @@ public class CellStyleEditPane extends MultiTabPane { @Override protected void layoutContentPane() { super.layoutContentPane(); - leftcontentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 5, original)); } } }