diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java index 0850cf05a1..6a9c2d1edb 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java @@ -186,10 +186,12 @@ public class TableDataTreePane extends BasicTableDataTreePane { for (int i = 0; i < lineTips.length; i++) { String lineTip = lineTips[i]; List jLabels = new ArrayList<>(); - jLabels.add(new JLabel(lineTip)); + JLabel lineJLabel = new JLabel(lineTip); + lineJLabel.setForeground(Color.lightGray); + jLabels.add(lineJLabel); if (i == (lineTips.length - 1)) { JLabel jLabel = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Alphafine_No_Remind")); - jLabel.setForeground(Color.lightGray); + jLabel.setForeground(Color.blue); jLabel.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { diff --git a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java index cd094480b4..f17c620776 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java @@ -218,6 +218,10 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane { } for (int i = 0; i < columnSize.length; i++) { if (i == 0) { - columnSize[i] = 80; + columnSize[i] = DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.firstColumn").getWidth(); } else { - columnSize[i] = 100; + columnSize[i] = DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.column").getWidth(); } } diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java index 36328d9bdd..c1dd3afd6e 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java @@ -4,6 +4,7 @@ import com.fr.design.actions.JTemplateAction; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.UIDialog; +import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; @@ -66,13 +67,13 @@ public class ReportFitAttrAction extends JTemplateAction { private void showReportFitDialog(ReportFitAttr fitAttr, final JTemplate jwb, final FitProvider wbTpl, final BasicBeanPane attrPane) { attrPane.populateBean(fitAttr); - UIDialog dialog = attrPane.showMediumWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + UIDialog dialog = attrPane.showWindowWithCustomSize(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { wbTpl.setReportFitAttr(attrPane.updateBean()); jwb.fireTargetModified(); } - }); + }, DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.templatePane.dialog")); dialog.setVisible(true); } diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties index b69ede5ea8..686c3da8a8 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties @@ -8,4 +8,8 @@ com.fr.design.version.check.dialog=490*95 com.fr.design.version.detail.label=750*30 com.fr.design.version.detail.dialog=900*500 com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*36 -com.fr.design.web.pane.text.field=450*20 \ No newline at end of file +com.fr.design.web.pane.text.field=450*20 +com.fr.design.actions.server.dialog=800*630 +com.fr.design.report.fit.templatePane.dialog=800*400 +com.fr.design.report.fit.firstColumn=120*20 +com.fr.design.report.fit.column=160*20 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties index 7d09dee4d0..5937b272ae 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties @@ -7,4 +7,8 @@ com.fr.design.version.check.dialog=430*95 com.fr.design.version.detail.label=650*30 com.fr.design.version.detail.dialog=800*500 com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*36 -com.fr.design.web.pane.text.field=400*20 \ No newline at end of file +com.fr.design.web.pane.text.field=400*20 +com.fr.design.actions.server.dialog=700*630 +com.fr.design.report.fit.templatePane.dialog=600*400 +com.fr.design.report.fit.firstColumn=170*20 +com.fr.design.report.fit.column=100*20 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties index 28823bf1ad..5615b35556 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties @@ -7,4 +7,8 @@ com.fr.design.version.check.dialog=450*95 com.fr.design.version.detail.label=700*30 com.fr.design.version.detail.dialog=850*500 com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*36 -com.fr.design.web.pane.text.field=450*20 \ No newline at end of file +com.fr.design.web.pane.text.field=450*20 +com.fr.design.actions.server.dialog=700*630 +com.fr.design.report.fit.templatePane.dialog=600*400 +com.fr.design.report.fit.firstColumn=130*20 +com.fr.design.report.fit.column=100*20 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties index 56998f7f7e..c507fcc083 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties @@ -8,4 +8,8 @@ com.fr.design.version.check.dialog=230*95 com.fr.design.version.detail.label=450*30 com.fr.design.version.detail.dialog=600*500 com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*20 -com.fr.design.web.pane.text.field=450*20 \ No newline at end of file +com.fr.design.web.pane.text.field=450*20 +com.fr.design.actions.server.dialog=700*630 +com.fr.design.report.fit.templatePane.dialog=600*400 +com.fr.design.report.fit.firstColumn=80*20 +com.fr.design.report.fit.column=100*20 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties index 58e6ae1216..8a383a4387 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties @@ -7,4 +7,8 @@ com.fr.design.version.check.dialog=230*95 com.fr.design.version.detail.label=450*30 com.fr.design.version.detail.dialog=600*500 com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*20 -com.fr.design.web.pane.text.field=450*20 \ No newline at end of file +com.fr.design.web.pane.text.field=450*20 +com.fr.design.actions.server.dialog=700*630 +com.fr.design.report.fit.templatePane.dialog=600*400 +com.fr.design.report.fit.firstColumn=80*20 +com.fr.design.report.fit.column=100*20 \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java index 476afe8b66..364588813f 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java @@ -81,6 +81,9 @@ import static javax.swing.JOptionPane.ERROR_MESSAGE; * 创建组件事件 */ public class CreateComponentAction extends UpdateAction { + private static final double MAX_WIDTH = 960.0; + private static final double MAX_HEIGHT = 540.0; + ShareUIAspect aspect; /** * 等待时间 500 ms. @@ -114,8 +117,12 @@ public class CreateComponentAction extends UpdateAction { // 获取选中的组件 Triple sharedTriple = ComponentTransformerFactory.getInstance().transform(selection); if (sharedTriple == null) { - FineJOptionPane.showMessageDialog(designerFrame, Toolkit.i18nText("Fine-Design_Share_Select_Error_Tip"), - Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), ERROR_MESSAGE, IOUtils.readIcon("/com/fr/base/images/share/Information_Icon_warning_normal_32x32.png")); + showErrMsgDialog(Toolkit.i18nText("Fine-Design_Share_Select_Error_Tip")); + return; + } + + if (isBeyondMaxSize(sharedTriple.getRight())) { + showErrMsgDialog(Toolkit.i18nText("Fine-Design_Share_Widget_Size_Error_Tip")); return; } @@ -398,4 +405,20 @@ public class CreateComponentAction extends UpdateAction { } return paras; } + + private boolean isBeyondMaxSize(Rectangle rec) { + double width = rec.getWidth(); + double height = rec.getHeight(); + return width > 0 && height > 0 && (width > MAX_WIDTH || height > MAX_HEIGHT); + } + + private void showErrMsgDialog(String err) { + FineJOptionPane.showMessageDialog( + DesignerContext.getDesignerFrame(), + err, + Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + ERROR_MESSAGE, + IOUtils.readIcon("/com/fr/base/images/share/Information_Icon_warning_normal_32x32.png") + ); + } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/DownloadSuitableThemeAction.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/DownloadSuitableThemeAction.java index 8eb068fd68..f8f4cc1a78 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/DownloadSuitableThemeAction.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/DownloadSuitableThemeAction.java @@ -8,11 +8,15 @@ import com.fr.design.DesignerEnvManager; import com.fr.design.actions.UpdateAction; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.gui.imenu.UIMenuItem; +import com.fr.design.gui.imenu.UIMenuItemUI; +import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.i18n.Toolkit; import com.fr.design.login.DesignerLoginHelper; import com.fr.design.login.DesignerLoginSource; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.share.ui.constants.ColorConstants; import com.fr.design.mainframe.share.util.DownloadUtils; import com.fr.design.mainframe.theme.dialog.TemplateThemeUsingDialog; import com.fr.stable.StringUtils; @@ -22,6 +26,7 @@ import com.fr.workspace.WorkContext; import javax.swing.Action; import javax.swing.JOptionPane; import javax.swing.SwingWorker; +import java.awt.Color; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.WindowAdapter; @@ -35,15 +40,37 @@ import java.util.concurrent.ExecutionException; */ public class DownloadSuitableThemeAction extends UpdateAction { private final String themePath; + private final UIPopupMenu popupMenu; private boolean downloading = false; private JTemplate currentTemplate; - public DownloadSuitableThemeAction(String themePath) { + public DownloadSuitableThemeAction(String themePath, UIPopupMenu popupMenu) { this.themePath = themePath; + this.popupMenu = popupMenu; this.putValue(Action.SMALL_ICON, null); this.setName(Toolkit.i18nText("Fine-Design_Share_Download_Suitable_Theme")); } + @Override + public UIMenuItem createMenuItem() { + return getLoadingMenuItem(); + } + + public LoadingMenuItem getLoadingMenuItem() { + Object object = this.getValue(LoadingMenuItem.class.getName()); + if (object == null) { + UIMenuItem menuItem = new LoadingMenuItem(this); + // 设置名字用作单元测 + menuItem.setName(getName()); + setPressedIcon4Button(menuItem); + setDisabledIcon4Button(menuItem); + object = menuItem; + + this.putValue(LoadingMenuItem.class.getName(), object); + } + return (LoadingMenuItem) object; + } + @Override public void actionPerformed(ActionEvent e) { currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); @@ -78,6 +105,8 @@ public class DownloadSuitableThemeAction extends UpdateAction { } downloading = true; + LoadingMenuItem menuItem = getLoadingMenuItem(); + menuItem.startLoading(); new SwingWorker() { @Override @@ -96,11 +125,14 @@ public class DownloadSuitableThemeAction extends UpdateAction { onThemeFetched(theme); downloading = false; + LoadingMenuItem menuItem = getLoadingMenuItem(); + menuItem.stopLoading(); } }.execute(); } public void onThemeFetched(FormTheme theme) { + popupMenu.menuSelectionChanged(false); if (theme == null) { return; } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/Jump2DetailAction.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/Jump2DetailAction.java index 73a91fc871..698ec7545d 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/Jump2DetailAction.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/Jump2DetailAction.java @@ -1,11 +1,14 @@ package com.fr.design.mainframe.share.ui.actions; import com.fr.design.actions.UpdateAction; +import com.fr.design.gui.imenu.UIMenuItem; +import com.fr.design.gui.imenu.UIMenuItemUI; import com.fr.design.i18n.Toolkit; -import com.fr.form.share.bean.OnlineShareWidget; +import com.fr.design.mainframe.share.ui.constants.ColorConstants; import com.fr.stable.StringUtils; import javax.swing.Action; +import java.awt.Color; import java.awt.Desktop; import java.awt.event.ActionEvent; import java.io.IOException; @@ -27,6 +30,15 @@ public class Jump2DetailAction extends UpdateAction { this.setName(Toolkit.i18nText("Fine-Design_Share_Jump_To_Detail")); } + @Override + public UIMenuItem createMenuItem() { + UIMenuItem menuItem = super.createMenuItem(); + menuItem.setOpaque(true); + menuItem.setBackground(ColorConstants.BACKGROUND); + menuItem.setUI(new SharedComponentActionMenuItemUI()); + return menuItem; + } + @Override public void actionPerformed(ActionEvent e) { if (StringUtils.isNotEmpty(id)) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/LoadingMenuItem.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/LoadingMenuItem.java new file mode 100644 index 0000000000..6262c34a33 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/LoadingMenuItem.java @@ -0,0 +1,50 @@ +package com.fr.design.mainframe.share.ui.actions; + +import com.fr.design.gui.imenu.UIMenuItem; +import com.fr.design.mainframe.share.ui.constants.ColorConstants; +import com.fr.general.IOUtils; + +import javax.swing.Action; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import java.awt.Graphics; + +/** + * @author Starryi + * @version 1.0 + * Created by Starryi on 2021/10/19 + */ +public class LoadingMenuItem extends UIMenuItem { + private boolean loading = false; + + private final Icon profileIcon = IOUtils.readIcon("/com/fr/design/form/images/loading.gif"); + + public LoadingMenuItem(Action action) { + super(action); + setOpaque(true); + setBackground(ColorConstants.BACKGROUND); + setUI(new SharedComponentActionMenuItemUI(false)); + } + + public void startLoading() { + loading = true; + setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20)); + revalidate(); + repaint(); + } + + public void stopLoading() { + loading = false; + setBorder(BorderFactory.createEmptyBorder()); + revalidate(); + repaint(); + } + + @Override + protected void paintBorder(Graphics g) { + super.paintBorder(g); + if (loading) { + profileIcon.paintIcon(this, g, getWidth() - 20, 0); + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/SharedComponentActionMenuItemUI.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/SharedComponentActionMenuItemUI.java new file mode 100644 index 0000000000..8a3fe5e1c9 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/SharedComponentActionMenuItemUI.java @@ -0,0 +1,55 @@ +package com.fr.design.mainframe.share.ui.actions; + +import com.fr.design.constants.UIConstants; +import com.fr.design.gui.imenu.UIMenuItemUI; +import com.fr.design.utils.gui.GUIPaintUtils; +import com.fr.stable.Constants; + +import javax.swing.ButtonModel; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.MenuSelectionManager; +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Graphics2D; + +/** + * @author Starryi + * @version 1.0 + * Created by Starryi on 2021/10/18 + */ +public class SharedComponentActionMenuItemUI extends UIMenuItemUI { + + private final boolean autoClosePopup; + + public SharedComponentActionMenuItemUI(boolean autoClosePopup) { + this.autoClosePopup = autoClosePopup; + } + + public SharedComponentActionMenuItemUI() { + this(true); + } + + @Override + protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) { + ButtonModel model = menuItem.getModel(); + Color oldColor = g.getColor(); + int menuWidth = menuItem.getWidth(); + int menuHeight = menuItem.getHeight(); + + if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { + GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 0); + } + + g.setColor(oldColor); + } + + @Override + protected void doClick(MenuSelectionManager msm) { + if (autoClosePopup) { + super.doClick(msm); + } else { + menuItem.doClick(0); + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java index 54a813c43a..3be4f96b9a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java @@ -1,10 +1,10 @@ package com.fr.design.mainframe.share.ui.block; -import com.fr.design.constants.UIConstants; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.mainframe.share.ui.actions.DownloadSuitableThemeAction; import com.fr.design.mainframe.share.ui.actions.Jump2DetailAction; +import com.fr.design.mainframe.share.ui.constants.ColorConstants; import com.fr.design.mainframe.share.ui.online.OnlineResourceManager; import com.fr.design.mainframe.share.ui.online.OnlineWidgetSelectPane; import com.fr.design.mainframe.share.ui.online.ResourceLoader; @@ -116,12 +116,13 @@ public abstract class AbstractOnlineWidgetBlock extends PreviewWidgetBlock UIPopupMenu popupMenu = new UIPopupMenu(); popupMenu.setOnlyText(true); - popupMenu.setBackground(UIConstants.DEFAULT_BG_RULER); - popupMenu.add(new PopupMenuItem(new MoveGroupAction())); - popupMenu.add(new PopupMenuItem(new RemoveAction())); + popupMenu.setOpaque(true); + popupMenu.setBackground(ColorConstants.BACKGROUND); + popupMenu.add(new MoveGroupAction().createMenuItem()); + popupMenu.add(new RemoveAction().createMenuItem()); return popupMenu; } @@ -288,6 +292,15 @@ public class LocalWidgetBlock extends PreviewWidgetBlock this.setName(Toolkit.i18nText("Fine-Design_Share_Group_Move")); } + @Override + public UIMenuItem createMenuItem() { + UIMenuItem menuItem = super.createMenuItem(); + menuItem.setOpaque(true); + menuItem.setBackground(ColorConstants.BACKGROUND); + menuItem.setUI(new SharedComponentActionMenuItemUI()); + return menuItem; + } + @Override public void actionPerformed(ActionEvent e) { new GroupMoveDialog(DesignerContext.getDesignerFrame()) { @@ -314,6 +327,15 @@ public class LocalWidgetBlock extends PreviewWidgetBlock this.setName(Toolkit.i18nText("Fine-Design_Share_Remove")); } + @Override + public UIMenuItem createMenuItem() { + UIMenuItem menuItem = super.createMenuItem(); + menuItem.setOpaque(true); + menuItem.setBackground(ColorConstants.BACKGROUND); + menuItem.setUI(new SharedComponentActionMenuItemUI()); + return menuItem; + } + @Override public void actionPerformed(ActionEvent e) { int rv = FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/constants/ColorConstants.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/constants/ColorConstants.java new file mode 100644 index 0000000000..6bd815142f --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/constants/ColorConstants.java @@ -0,0 +1,12 @@ +package com.fr.design.mainframe.share.ui.constants; + +import java.awt.Color; + +/** + * @author Starryi + * @version 1.0 + * Created by Starryi on 2021/10/19 + */ +public class ColorConstants { + public static final Color BACKGROUND = new Color(0xF0F0F1); +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetPopupPreviewPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetPopupPreviewPane.java index 84083b4048..3113fd06ff 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetPopupPreviewPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetPopupPreviewPane.java @@ -5,6 +5,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.share.ui.base.AbstractWidgetPopupPreviewPane; import com.fr.design.mainframe.share.ui.block.PreviewWidgetBlock; +import com.fr.design.mainframe.share.ui.constants.ColorConstants; import com.fr.form.share.bean.OnlineShareWidget; import com.fr.general.FRFont; import com.fr.general.IOUtils; @@ -15,6 +16,7 @@ import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JSeparator; import javax.swing.SwingConstants; +import javax.swing.plaf.basic.BasicLabelUI; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; @@ -43,10 +45,13 @@ public class OnlineWidgetPopupPreviewPane extends AbstractWidgetPopupPreviewPane private UILabel suitableThemeNameLabel; public OnlineWidgetPopupPreviewPane() { + super(); setPreferredSize(new Dimension(POPUP_WIDTH, getPreferredSize().height)); setLayout(new BorderLayout(0, 0)); - setOpaque(true); - setBackground(new Color(0xF0F0F1)); + setBorder(BorderFactory.createLineBorder(new Color(0xDADADD))); + setBorderPainted(true); + setOpaque(false); + setBackground(ColorConstants.BACKGROUND); suitableThemeNamePane = createSuitableThemeNamePane(); JPanel previewImagePane = createPreviewImagePane(); @@ -57,8 +62,9 @@ public class OnlineWidgetPopupPreviewPane extends AbstractWidgetPopupPreviewPane private JPanel createSuitableThemeNamePane() { suitableThemeNameLabel = new UILabel(); + suitableThemeNameLabel.setUI(new BasicLabelUI()); suitableThemeNameLabel.setOpaque(false); - suitableThemeNameLabel.setBackground(new Color(0xF5F5F7)); + suitableThemeNameLabel.setBackground(null); suitableThemeNameLabel.setIcon(IOUtils.readIcon("/com/fr/design/icon/icon_predefined_style.png")); suitableThemeNameLabel.setIconTextGap(IntervalConstants.INTERVAL_L6); @@ -92,10 +98,12 @@ public class OnlineWidgetPopupPreviewPane extends AbstractWidgetPopupPreviewPane versionLabel = new UILabel(); versionLabel.setVerticalAlignment(SwingConstants.CENTER); versionLabel.setFont(FRFont.getInstance(versionLabel.getFont()).deriveFont(12.0F)); + versionLabel.setForeground(new Color(0x333334)); downloadsLabel = new UILabel(); downloadsLabel.setVerticalAlignment(SwingConstants.TOP); downloadsLabel.setFont(FRFont.getInstance(downloadsLabel.getFont()).deriveFont(12.0F)); + downloadsLabel.setForeground(new Color(0x333334)); priceLabel = new UILabel(); priceLabel.setVerticalAlignment(SwingConstants.CENTER); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPane.java index 4e8f9ffc5f..7623c2e0aa 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPane.java @@ -151,7 +151,7 @@ public class FilterPane extends JPanel { Point p = FilterPane.this.getLocationOnScreen(); popup = pf.getPopup(FilterPane.this, filterPopupPane, p.x, p.y + FilterPane.this.getHeight()); popup.show(); - filterPopupPane.setPreferredSize(new Dimension(228, filterPopupPane.getHeight())); + filterPopupPane.setPreferredSize(new Dimension(filterPopupPane.getWidth(), filterPopupPane.getHeight())); showPopup = true; arrowButton.setIcon(FILTER_COMBO_UP); firePopupStateChange(true); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPopupPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPopupPane.java index e2bcd5344d..f0d3714c7d 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPopupPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPopupPane.java @@ -31,6 +31,8 @@ public abstract class FilterPopupPane extends JPanel { private static final Color BORDER_COLOR = Color.decode("#D9DADD"); private static final String FILTER_ALL_ID = "0"; + public static final int CONTENT_WIDTH = 225; + FilterPane filterPane; private List filterList = new ArrayList<>(); private final List checkBoxList = new ArrayList<>(); @@ -101,7 +103,7 @@ public abstract class FilterPopupPane extends JPanel { jPanel.setBackground(Color.WHITE); UILabel titleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Type")); titleLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); - titleLabel.setPreferredSize(new Dimension(226, 20)); + titleLabel.setPreferredSize(new Dimension(CONTENT_WIDTH - 2, 20)); titleLabel.setOpaque(true); titleLabel.setBackground(Color.decode("#EDEDEE")); jPanel.add(titleLabel, BorderLayout.NORTH); @@ -131,7 +133,7 @@ public abstract class FilterPopupPane extends JPanel { jPanel.setBackground(Color.WHITE); UILabel titleLabel = new UILabel(filterTypeInfo.getTitle()); titleLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); - titleLabel.setPreferredSize(new Dimension(226, 20)); + titleLabel.setPreferredSize(new Dimension(CONTENT_WIDTH - 2, 20)); titleLabel.setOpaque(true); titleLabel.setBackground(Color.decode("#EDEDEE")); jPanel.add(titleLabel, BorderLayout.NORTH); @@ -150,7 +152,7 @@ public abstract class FilterPopupPane extends JPanel { } } int contentPaneHeight = ((displayCount + 1) / 2) * 27; - contentPane.setPreferredSize(new Dimension(228, contentPaneHeight)); + contentPane.setPreferredSize(new Dimension(CONTENT_WIDTH, contentPaneHeight)); for (final WidgetFilterInfo filterInfo : filterTypeInfo.getFilterItems()) { if (ComparatorUtils.equals(FILTER_ALL_ID, filterInfo.getId())) { continue; diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java index e32bc9b071..9507248df3 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java @@ -102,8 +102,10 @@ public class ElementEditorDefinePane extends WTitleLayoutDefinePane { return tabPane.getSelectedIndex() == ONE_INDEX; } - /** - * @param ePane - */ - public void dealWithBorder(ElementCasePane ePane) { - this.reportPane = ePane; + public void dealWithBorder() { + if (reportPane == null) { + return; + } Object[] fourObjectArray = BorderUtils.createCellBorderObject(reportPane); if (fourObjectArray != null && fourObjectArray.length % LENGTH_FOUR == 0) { @@ -130,7 +129,14 @@ public class CustomStylePane extends MultiTabPane