diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JDashboard.java b/designer-base/src/main/java/com/fr/design/mainframe/JDashboard.java index d2b45f4ea1..e4e4e9be93 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JDashboard.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JDashboard.java @@ -1,5 +1,9 @@ package com.fr.design.mainframe; +import com.fr.report.worksheet.FormElementCase; + +import java.awt.Rectangle; + /** * @author Starryi * @version 1.0 @@ -7,4 +11,6 @@ package com.fr.design.mainframe; */ public interface JDashboard { void switchToDashBoardEditor(); + + Rectangle getElementCaseRectangle(FormElementCase elementCase); } diff --git a/designer-base/src/main/java/com/fr/design/utils/ColorUtils.java b/designer-base/src/main/java/com/fr/design/utils/ColorUtils.java index 739d394720..7c0daa111f 100644 --- a/designer-base/src/main/java/com/fr/design/utils/ColorUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/ColorUtils.java @@ -27,4 +27,15 @@ public class ColorUtils { } } } + + public static boolean isDarkColor(Color color) { + if(color == null) { + return false; + } + int red = color.getRed(); + int green = color.getGreen(); + int blue = color.getBlue(); + int greyLevel = (int)(red * 0.299 + green * 0.587 + blue * 0.114); + return greyLevel < 192; + } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index b58932c8a7..a142ee297c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -41,6 +41,7 @@ import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.fit.FormFitAttrAction; +import com.fr.design.fit.common.FormDesignerUtil; import com.fr.design.fun.PreviewProvider; import com.fr.design.fun.PropertyItemPaneProvider; import com.fr.design.gui.frpane.HyperlinkGroupPane; @@ -109,12 +110,7 @@ import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.tree.TreePath; -import java.awt.BorderLayout; -import java.awt.CardLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Font; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; @@ -1307,4 +1303,25 @@ public class JForm extends JTemplate