Browse Source

Pull request #7422: REPORT-65358 & REPORT-65365

Merge in DESIGN/design from ~STARRYI/design:final/11.0 to final/11.0

* commit 'c262e42d2359c9cf4bb46f9e43845182e967f94c':
  REPORT-65371 【主题边框】附件截图,滚动条显示有问题
  REPORT-65365 【主题边框】多次切换单元格样式后切换自定义,边框线有问题
  REPORT-65358 【主题边框】单元格样式双线显示有问题
new-design
starryi 3 years ago
parent
commit
0bd092cda4
  1. 25
      designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java
  2. 13
      designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java
  3. 2
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java

25
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

13
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) {

2
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java

@ -198,7 +198,7 @@ public class CellStyleEditPane extends MultiTabPane<ThemedCellStyle> {
@Override
protected void layoutContentPane() {
super.layoutContentPane();
leftcontentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 5, original));
}
}
}

Loading…
Cancel
Save