From 8c018790534274d085d8ff7130d939d694977f53 Mon Sep 17 00:00:00 2001 From: obo Date: Tue, 14 Nov 2023 15:27:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=8F=92=E4=BB=B6=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B=E5=A4=87=E6=B3=A8?= =?UTF-8?q?=E5=92=8Cimport=E8=AF=AD=E5=8F=A5-=E7=AC=AC=E4=BA=8C=E9=83=A8?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 10 ++++- .../mainframe/mobile/ui/MobileStylePane.java | 1 - .../mainframe/theme/FormThemeProfilePane.java | 6 ++- .../theme/ReportThemeProfilePane.java | 5 ++- .../designer/WidgetThemeDisplayAction.java | 2 +- .../WidgetThemeDisplayConfigPane.java | 19 ++++++--- .../edit/ParamContainerStyleEditPane.java | 2 + .../theme/panel/ControlPreviewCell.java | 15 +++++-- .../util/WidgetThemeDesignerUtils.java | 8 ++-- .../DisplayEnhanceMobileStyleDefinePane.java | 9 +++- .../pane/MobileStyleFontConfigPane.java | 12 +++++- .../designer/DirectWriteEditorDefinePane.java | 9 +++- .../widget/ui/designer/LabelDefinePane.java | 14 +++++-- .../ui/designer/NumberEditorDefinePane.java | 14 ++++++- ...ingPane.java => BaseStyleSettingPane.java} | 19 ++++++--- .../design/widgettheme/LabelSettingPane.java | 9 ++-- .../widgettheme/ParaButtonSettingPane.java | 4 +- .../widgettheme/ParaEditorSettingPane.java | 4 +- .../ParaNormalButtonSettingPane.java | 8 +++- .../ParaTreeEditorSettingPane.java | 4 +- .../fr/design/widgettheme/StyleSetting.java | 29 ++++++++++++- .../widgettheme/common/ButtonSettingPane.java | 8 ++-- .../widgettheme/common/EditorSettingPane.java | 8 ++-- .../common/NormalButtonSettingPane.java | 8 ++-- .../common/TreeEditorSettingPane.java | 8 ++-- .../WidgetThemeCreatorPaneAcceptor.java | 12 ++++-- .../WidgetThemeXCreaterPaneAcceptor.java | 41 ++++++++++++++----- .../design/widget/ui/CheckBoxDefinePane.java | 12 +++++- .../widget/ui/FieldEditorDefinePane.java | 13 +++++- 29 files changed, 230 insertions(+), 83 deletions(-) rename designer-form/src/main/java/com/fr/design/widgettheme/{StyleSettingPane.java => BaseStyleSettingPane.java} (96%) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index e936a945b9..bdede20412 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -104,9 +104,15 @@ import com.fr.stable.core.UUID; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JComponent; +import javax.swing.JOptionPane; +import javax.swing.SwingConstants; import javax.swing.undo.UndoManager; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.FontMetrics; import java.io.ByteArrayOutputStream; import java.nio.file.Paths; import java.util.Arrays; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStylePane.java index 921fb34863..b043758bcb 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStylePane.java @@ -130,7 +130,6 @@ public class MobileStylePane extends BasicPane { listModel.addElement(displayName); try { - //MobileStyleDefinePaneCreator processor = ExtraDesignClassManager.getInstance().getSingle(MobileStyleDefinePaneCreator.XML_TAG); BasicBeanPane mobileStyleBasicBeanPane = new MobileStyleDefinePane(widget, appearanceClazz, mobileStyleClazz); if (checkFlag && WidgetThemeMobileStyleDefinePaneCreator.createBaseBeanPane(widget, appearanceClazz, mobileStyleClazz) != null) { mobileStyleBasicBeanPane = WidgetThemeMobileStyleDefinePaneCreator.createBaseBeanPane(widget, appearanceClazz, mobileStyleClazz); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java index 6ff3333517..922230b158 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java @@ -10,8 +10,12 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.theme.edit.ChartStyleFormEditPane; import com.fr.design.mainframe.theme.edit.ComponentStyleEditPane; import com.fr.design.mainframe.theme.edit.FormBodyStyleEditPane; +import com.fr.design.mainframe.theme.preview.FormThemePreviewPane; +import com.fr.design.mainframe.theme.preview.ReportThemePreviewPane; import com.fr.design.mainframe.theme.processor.ThemePreviewPaneProcessor; import com.fr.widgettheme.theme.panel.WidgetDisplayFormThemePreviewPane; +import com.fr.widgettheme.theme.panel.WidgetDisplayReportThemePreviewPane; +import com.fr.widgettheme.util.WidgetThemeDesignerUtils; import javax.swing.JPanel; @@ -38,7 +42,7 @@ public class FormThemeProfilePane extends TemplateThemeProfilePane { if (processor != null) { return processor.createFormThemePreviewPane(); } - return new WidgetDisplayFormThemePreviewPane(); + return WidgetThemeDesignerUtils.enableWidgetEnhance() ? new WidgetDisplayFormThemePreviewPane() : new FormThemePreviewPane(); } @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java index 18423c06b3..3f654cae5c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java @@ -5,8 +5,10 @@ import com.fr.base.theme.TemplateThemeConfig; import com.fr.design.ExtraDesignClassManager; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.theme.edit.ReportBodyStyleEditPane; +import com.fr.design.mainframe.theme.preview.ReportThemePreviewPane; import com.fr.design.mainframe.theme.processor.ThemePreviewPaneProcessor; import com.fr.widgettheme.theme.panel.WidgetDisplayReportThemePreviewPane; +import com.fr.widgettheme.util.WidgetThemeDesignerUtils; /** * @author Starryi @@ -26,8 +28,7 @@ public class ReportThemeProfilePane extends TemplateThemeProfilePane> extends JTemplateAction { diff --git a/designer-base/src/main/java/com/fr/widgettheme/designer/WidgetThemeDisplayConfigPane.java b/designer-base/src/main/java/com/fr/widgettheme/designer/WidgetThemeDisplayConfigPane.java index 3d70153eb5..6fadc92cca 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/designer/WidgetThemeDisplayConfigPane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/designer/WidgetThemeDisplayConfigPane.java @@ -8,13 +8,13 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.VerticalFlowLayout; import com.fr.widgettheme.control.attr.WidgetDisplayEnhanceMarkAttr; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import java.awt.Color; /** * @author Bruce.Deng - * @version 11.0 - * Created by Bruce.Deng on 2022/11/28 + * @since 11.0 + * Created on 2022/11/28 */ public class WidgetThemeDisplayConfigPane extends BasicPane { @@ -46,6 +46,11 @@ public class WidgetThemeDisplayConfigPane extends BasicPane { return Toolkit.i18nText("Fine-Design_Widget_Display_Enhance"); } + /** + * 根据属性填充pane选项 + * + * @param widgetDisplayEnhanceMarkAttr 控件显示增强属性 + */ public void populate(WidgetDisplayEnhanceMarkAttr widgetDisplayEnhanceMarkAttr) { if (widgetDisplayEnhanceMarkAttr == null) { widgetDisplayEnhanceMarkAttr = new WidgetDisplayEnhanceMarkAttr(); @@ -53,12 +58,14 @@ public class WidgetThemeDisplayConfigPane extends BasicPane { widgetEnhance.setSelected(widgetDisplayEnhanceMarkAttr.isWidgetEnhance()); } + /** + * 更新 + */ public WidgetDisplayEnhanceMarkAttr update() { WidgetDisplayEnhanceMarkAttr attr = new WidgetDisplayEnhanceMarkAttr(); attr.setWidgetEnhance(widgetEnhance.isSelected()); if (widgetEnhance.isSelected()) { -// SCDesignRecord record = new SCDesignRecord(DesignKit.getCurrentEditingTemplateId()); -// DesignRecorderProvider.getRecorder().record(record); + //埋点信息 } return attr; } diff --git a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/ParamContainerStyleEditPane.java b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/ParamContainerStyleEditPane.java index 6013ef212c..9e9ad79eef 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/ParamContainerStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/ParamContainerStyleEditPane.java @@ -16,6 +16,8 @@ import java.awt.BorderLayout; import java.awt.Component; /** + * 参数面板样式编辑pane + * * @author Bruce.Deng * @since 11.0 * Created on 2022/12/16 diff --git a/designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewCell.java b/designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewCell.java index 776297879a..d38a05b1ad 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewCell.java +++ b/designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewCell.java @@ -9,16 +9,23 @@ import com.fr.general.FRFont; import com.fr.widgettheme.theme.widget.theme.WidgetThemeDisplayConstants; import com.fr.stable.Constants; -import javax.swing.*; -import java.awt.*; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JPanel; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.LayoutManager; import java.awt.image.BufferedImage; /** * 主题界面预览单元格子 * * @author John.Ying - * @version 11.0 - * Created by John.Ying on 2023/3/18 + * @since 11.0 + * Created on 2023/3/18 */ public class ControlPreviewCell extends JPanel { protected static final LayoutManager DEFAULT = FRGUIPaneFactory.createRightFlowLayout(); diff --git a/designer-base/src/main/java/com/fr/widgettheme/util/WidgetThemeDesignerUtils.java b/designer-base/src/main/java/com/fr/widgettheme/util/WidgetThemeDesignerUtils.java index 25b07be0a3..7106161f8c 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/util/WidgetThemeDesignerUtils.java +++ b/designer-base/src/main/java/com/fr/widgettheme/util/WidgetThemeDesignerUtils.java @@ -8,9 +8,11 @@ import com.fr.stable.StringUtils; import com.fr.widgettheme.control.attr.WidgetDisplayEnhanceMarkAttr; /** - * @author Bruce.Deng - * @version 11.0 - * Created by Bruce.Deng on 2022/12/1 + * 控件主题设计器部分工具类 + * + * @author obo + * @since 11.0 + * Created on 2023/11/13 */ public class WidgetThemeDesignerUtils { diff --git a/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/DisplayEnhanceMobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/DisplayEnhanceMobileStyleDefinePane.java index 4ec64262be..a0ed4159c7 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/DisplayEnhanceMobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/DisplayEnhanceMobileStyleDefinePane.java @@ -28,10 +28,15 @@ import com.fr.widgettheme.theme.widget.theme.WidgetThemeDisplayConstants; import com.fr.stable.Constants; import com.fr.stable.StringUtils; -import javax.swing.*; +import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import javax.swing.border.TitledBorder; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; diff --git a/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/MobileStyleFontConfigPane.java b/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/MobileStyleFontConfigPane.java index 84aa422fa1..6a6ad694de 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/MobileStyleFontConfigPane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/MobileStyleFontConfigPane.java @@ -13,9 +13,17 @@ import com.fr.general.FRFont; import com.fr.stable.Constants; import com.fr.stable.StringUtils; -import javax.swing.*; +import javax.swing.DefaultComboBoxModel; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JPanel; import javax.swing.border.EmptyBorder; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; import java.util.Vector; /** diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java index 7a7d681186..c16498f4d3 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java @@ -15,8 +15,13 @@ import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.form.ui.DirectWriteEditor; import com.fr.stable.collections.CollectionUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.FlowLayout; import java.util.Set; //richer:需要提供能否直接编辑的控件设置面板——下拉框、复选框、时间、日期、下拉树 diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java index beebdbec03..310c3d8dd6 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java @@ -25,15 +25,23 @@ import com.fr.plugin.observer.PluginEventListener; import com.fr.stable.Constants; import com.fr.stable.collections.CollectionUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Component; import java.util.ArrayList; import java.util.List; import java.util.Set; /** - * Created by ibm on 2017/8/3. + * 标签控件pane + * + * @author obo + * @version 11.0 + * Created on 2023/11/13 */ public class LabelDefinePane extends AbstractDataModify