From 31f74c939267b32f710b70f200b075b77ffd9e68 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 24 Sep 2020 14:44:42 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-38618=20=E3=80=90=E5=9B=9E=E5=BD=92?= =?UTF-8?q?=E3=80=91=E8=A1=A8=E5=8D=95-=E4=B8=8B=E6=96=B9=E7=BC=A9?= =?UTF-8?q?=E6=94=BE=E7=BC=A9=E5=B0=8F=E4=B9=8B=E5=90=8E=EF=BC=8C=E6=8B=96?= =?UTF-8?q?=E5=85=A5tab=E5=9D=97=EF=BC=8C=E6=9F=A5=E7=9C=8B=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A1=86=E7=BA=BF=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/FormDesignerUI.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java index b75fbcf3ce..233ee2a96a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java @@ -22,10 +22,12 @@ import com.fr.form.main.parameter.FormParameterUI; import com.fr.page.WatermarkPainter; import com.fr.report.core.ReportUtils; import com.fr.stable.ArrayUtils; +import com.fr.stable.Constants; import javax.swing.*; import javax.swing.plaf.ComponentUI; import java.awt.AlphaComposite; +import java.awt.Color; import java.awt.Component; import java.awt.Graphics; import java.awt.Graphics2D; @@ -41,6 +43,8 @@ import java.util.ArrayList; */ public class FormDesignerUI extends ComponentUI { + private static final Color DESIGNER_BORDER_COLOR = new Color(198, 198, 198); + // 当前的设计器 private FormDesigner designer; private SelectionModel selectionModel; @@ -90,7 +94,7 @@ public class FormDesignerUI extends ComponentUI { designer.getDrawLineHelper().drawAuxiliaryLine(g); return; } - + paintBorder(g); paintSelection(g); if (DesignerMode.isAuthorityEditing()) { @@ -275,6 +279,19 @@ public class FormDesignerUI extends ComponentUI { clipg.dispose(); } + public void paintBorder(Graphics g) { + Rectangle bounds = designer.getTopContainer().getBounds(); + bounds.x = -designer.getHorizontalScaleValue(); + bounds.y = -designer.getVerticalScaleValue(); + Graphics clipg = g.create(); + clipg.clipRect(bounds.x, bounds.y, bounds.width, bounds.height); + Color oldColor = g.getColor(); + g.setColor(DESIGNER_BORDER_COLOR); + GraphHelper.draw(g, bounds, Constants.LINE_THIN); + clipg.dispose(); + g.setColor(oldColor); + } + /** * 画出当前选择、拖拽状态框 *