Browse Source

Merge remote-tracking branch 'origin/release/11.0' into release/11.0

bugfix/11.0
pengda 3 years ago
parent
commit
a9733eca86
  1. 6
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java
  2. 5
      designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java
  3. 5
      designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java
  4. 5
      designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java
  5. 6
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  6. 6
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  7. 6
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  8. 6
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  9. 6
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
  10. 27
      designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java
  11. 34
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/DownloadSuitableThemeAction.java
  12. 14
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/Jump2DetailAction.java
  13. 50
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/LoadingMenuItem.java
  14. 55
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/SharedComponentActionMenuItemUI.java
  15. 7
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java
  16. 28
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java
  17. 12
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/constants/ColorConstants.java
  18. 14
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetPopupPreviewPane.java
  19. 2
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPane.java
  20. 8
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPopupPane.java
  21. 10
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java
  22. BIN
      designer-form/src/main/resources/com/fr/design/form/images/loading.gif
  23. BIN
      designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_18.png
  24. 3
      designer-realize/src/main/java/com/fr/design/actions/server/ServerConfigManagerAction.java
  25. 16
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java
  26. 1
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java
  27. 51
      designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java

6
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++) { for (int i = 0; i < lineTips.length; i++) {
String lineTip = lineTips[i]; String lineTip = lineTips[i];
List<JLabel> jLabels = new ArrayList<>(); List<JLabel> 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)) { if (i == (lineTips.length - 1)) {
JLabel jLabel = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Alphafine_No_Remind")); JLabel jLabel = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Alphafine_No_Remind"));
jLabel.setForeground(Color.lightGray); jLabel.setForeground(Color.blue);
jLabel.addMouseListener(new MouseAdapter() { jLabel.addMouseListener(new MouseAdapter() {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {

5
designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java

@ -218,6 +218,10 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript
this.add(editorPane, BorderLayout.CENTER); this.add(editorPane, BorderLayout.CENTER);
} }
public void reset() {
editorPane.populate(new SingleJavaScript[0]);
}
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Basic_Export_JS_Setting"); return Toolkit.i18nText("Fine-Design_Basic_Export_JS_Setting");
@ -773,6 +777,7 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript
public void populateBean(ExportJavaScript ob) { public void populateBean(ExportJavaScript ob) {
if (ob == null) { if (ob == null) {
ob = new ExportJavaScript(); ob = new ExportJavaScript();
otherTemplatePane.reset();
} }
this.templateRadioGroup.selectIndexButton(ob.isCurrentTemplate() ? 0 : 1); this.templateRadioGroup.selectIndexButton(ob.isCurrentTemplate() ? 0 : 1);
if (ob.isCurrentTemplate()) { if (ob.isCurrentTemplate()) {

5
designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java

@ -5,6 +5,7 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.report.fit.menupane.FitPreviewPane; import com.fr.design.report.fit.menupane.FitPreviewPane;
@ -90,9 +91,9 @@ public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> {
} }
for (int i = 0; i < columnSize.length; i++) { for (int i = 0; i < columnSize.length; i++) {
if (i == 0) { if (i == 0) {
columnSize[i] = 80; columnSize[i] = DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.firstColumn").getWidth();
} else { } else {
columnSize[i] = 100; columnSize[i] = DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.column").getWidth();
} }
} }

5
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.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; 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<ReportFitAttr> attrPane) { private void showReportFitDialog(ReportFitAttr fitAttr, final JTemplate jwb, final FitProvider wbTpl, final BasicBeanPane<ReportFitAttr> attrPane) {
attrPane.populateBean(fitAttr); attrPane.populateBean(fitAttr);
UIDialog dialog = attrPane.showMediumWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { UIDialog dialog = attrPane.showWindowWithCustomSize(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
wbTpl.setReportFitAttr(attrPane.updateBean()); wbTpl.setReportFitAttr(attrPane.updateBean());
jwb.fireTargetModified(); jwb.fireTargetModified();
} }
}); }, DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.templatePane.dialog"));
dialog.setVisible(true); dialog.setVisible(true);
} }

6
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.label=750*30
com.fr.design.version.detail.dialog=900*500 com.fr.design.version.detail.dialog=900*500
com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*36 com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*36
com.fr.design.web.pane.text.field=450*20 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

6
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.label=650*30
com.fr.design.version.detail.dialog=800*500 com.fr.design.version.detail.dialog=800*500
com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*36 com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*36
com.fr.design.web.pane.text.field=400*20 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

6
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.label=700*30
com.fr.design.version.detail.dialog=850*500 com.fr.design.version.detail.dialog=850*500
com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*36 com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*36
com.fr.design.web.pane.text.field=450*20 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

6
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.label=450*30
com.fr.design.version.detail.dialog=600*500 com.fr.design.version.detail.dialog=600*500
com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*20 com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*20
com.fr.design.web.pane.text.field=450*20 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

6
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.label=450*30
com.fr.design.version.detail.dialog=600*500 com.fr.design.version.detail.dialog=600*500
com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*20 com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*20
com.fr.design.web.pane.text.field=450*20 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

27
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 { public class CreateComponentAction extends UpdateAction {
private static final double MAX_WIDTH = 960.0;
private static final double MAX_HEIGHT = 540.0;
ShareUIAspect aspect; ShareUIAspect aspect;
/** /**
* 等待时间 500 ms. * 等待时间 500 ms.
@ -114,8 +117,12 @@ public class CreateComponentAction extends UpdateAction {
// 获取选中的组件 // 获取选中的组件
Triple<Widget, XCreator, Rectangle> sharedTriple = ComponentTransformerFactory.getInstance().transform(selection); Triple<Widget, XCreator, Rectangle> sharedTriple = ComponentTransformerFactory.getInstance().transform(selection);
if (sharedTriple == null) { if (sharedTriple == null) {
FineJOptionPane.showMessageDialog(designerFrame, Toolkit.i18nText("Fine-Design_Share_Select_Error_Tip"), showErrMsgDialog(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")); return;
}
if (isBeyondMaxSize(sharedTriple.getRight())) {
showErrMsgDialog(Toolkit.i18nText("Fine-Design_Share_Widget_Size_Error_Tip"));
return; return;
} }
@ -398,4 +405,20 @@ public class CreateComponentAction extends UpdateAction {
} }
return paras; 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")
);
}
} }

34
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.actions.UpdateAction;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.file.HistoryTemplateListCache; 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.i18n.Toolkit;
import com.fr.design.login.DesignerLoginHelper; import com.fr.design.login.DesignerLoginHelper;
import com.fr.design.login.DesignerLoginSource; import com.fr.design.login.DesignerLoginSource;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; 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.share.util.DownloadUtils;
import com.fr.design.mainframe.theme.dialog.TemplateThemeUsingDialog; import com.fr.design.mainframe.theme.dialog.TemplateThemeUsingDialog;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -22,6 +26,7 @@ import com.fr.workspace.WorkContext;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import java.awt.Color;
import java.awt.Window; import java.awt.Window;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.WindowAdapter; import java.awt.event.WindowAdapter;
@ -35,15 +40,37 @@ import java.util.concurrent.ExecutionException;
*/ */
public class DownloadSuitableThemeAction extends UpdateAction { public class DownloadSuitableThemeAction extends UpdateAction {
private final String themePath; private final String themePath;
private final UIPopupMenu popupMenu;
private boolean downloading = false; private boolean downloading = false;
private JTemplate<?, ?> currentTemplate; private JTemplate<?, ?> currentTemplate;
public DownloadSuitableThemeAction(String themePath) { public DownloadSuitableThemeAction(String themePath, UIPopupMenu popupMenu) {
this.themePath = themePath; this.themePath = themePath;
this.popupMenu = popupMenu;
this.putValue(Action.SMALL_ICON, null); this.putValue(Action.SMALL_ICON, null);
this.setName(Toolkit.i18nText("Fine-Design_Share_Download_Suitable_Theme")); 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 @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
@ -78,6 +105,8 @@ public class DownloadSuitableThemeAction extends UpdateAction {
} }
downloading = true; downloading = true;
LoadingMenuItem menuItem = getLoadingMenuItem();
menuItem.startLoading();
new SwingWorker<FormTheme, Void>() { new SwingWorker<FormTheme, Void>() {
@Override @Override
@ -96,11 +125,14 @@ public class DownloadSuitableThemeAction extends UpdateAction {
onThemeFetched(theme); onThemeFetched(theme);
downloading = false; downloading = false;
LoadingMenuItem menuItem = getLoadingMenuItem();
menuItem.stopLoading();
} }
}.execute(); }.execute();
} }
public void onThemeFetched(FormTheme theme) { public void onThemeFetched(FormTheme theme) {
popupMenu.menuSelectionChanged(false);
if (theme == null) { if (theme == null) {
return; return;
} }

14
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; package com.fr.design.mainframe.share.ui.actions;
import com.fr.design.actions.UpdateAction; 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.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 com.fr.stable.StringUtils;
import javax.swing.Action; import javax.swing.Action;
import java.awt.Color;
import java.awt.Desktop; import java.awt.Desktop;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.io.IOException; import java.io.IOException;
@ -27,6 +30,15 @@ public class Jump2DetailAction extends UpdateAction {
this.setName(Toolkit.i18nText("Fine-Design_Share_Jump_To_Detail")); 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 @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (StringUtils.isNotEmpty(id)) { if (StringUtils.isNotEmpty(id)) {

50
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);
}
}
}

55
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);
}
}
}

7
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; 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.ilable.UILabel;
import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.mainframe.share.ui.actions.DownloadSuitableThemeAction; 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.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.OnlineResourceManager;
import com.fr.design.mainframe.share.ui.online.OnlineWidgetSelectPane; import com.fr.design.mainframe.share.ui.online.OnlineWidgetSelectPane;
import com.fr.design.mainframe.share.ui.online.ResourceLoader; import com.fr.design.mainframe.share.ui.online.ResourceLoader;
@ -116,12 +116,13 @@ public abstract class AbstractOnlineWidgetBlock extends PreviewWidgetBlock<Onlin
public JPopupMenu createRightClickPopupMenu() { public JPopupMenu createRightClickPopupMenu() {
UIPopupMenu popupMenu = new UIPopupMenu(); UIPopupMenu popupMenu = new UIPopupMenu();
popupMenu.setOnlyText(true); popupMenu.setOnlyText(true);
popupMenu.setBackground(UIConstants.DEFAULT_BG_RULER); popupMenu.setOpaque(true);
popupMenu.setBackground(ColorConstants.BACKGROUND);
OnlineShareWidget widget = getWidget(); OnlineShareWidget widget = getWidget();
String suitableThemeFile = widget.getThemePath(); String suitableThemeFile = widget.getThemePath();
if (StringUtils.isNotEmpty(suitableThemeFile)) { if (StringUtils.isNotEmpty(suitableThemeFile)) {
popupMenu.add(new DownloadSuitableThemeAction(suitableThemeFile).createMenuItem()); popupMenu.add(new DownloadSuitableThemeAction(suitableThemeFile, popupMenu).createMenuItem());
} }
popupMenu.add(new Jump2DetailAction(getWidget().getId()).createMenuItem()); popupMenu.add(new Jump2DetailAction(getWidget().getId()).createMenuItem());

28
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java

@ -9,13 +9,16 @@ import com.fr.design.designer.creator.XCreator;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.WidgetToolBarPane; import com.fr.design.mainframe.WidgetToolBarPane;
import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.share.group.ui.GroupMoveDialog; import com.fr.design.mainframe.share.group.ui.GroupMoveDialog;
import com.fr.design.mainframe.share.ui.actions.SharedComponentActionMenuItemUI;
import com.fr.design.mainframe.share.ui.base.PopupMenuItem; import com.fr.design.mainframe.share.ui.base.PopupMenuItem;
import com.fr.design.mainframe.share.ui.constants.ColorConstants;
import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane;
import com.fr.design.mainframe.share.ui.local.LocalWidgetSelectPane; import com.fr.design.mainframe.share.ui.local.LocalWidgetSelectPane;
import com.fr.design.mainframe.share.ui.local.WidgetSelectedManager; import com.fr.design.mainframe.share.ui.local.WidgetSelectedManager;
@ -275,9 +278,10 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
UIPopupMenu popupMenu = new UIPopupMenu(); UIPopupMenu popupMenu = new UIPopupMenu();
popupMenu.setOnlyText(true); popupMenu.setOnlyText(true);
popupMenu.setBackground(UIConstants.DEFAULT_BG_RULER); popupMenu.setOpaque(true);
popupMenu.add(new PopupMenuItem(new MoveGroupAction())); popupMenu.setBackground(ColorConstants.BACKGROUND);
popupMenu.add(new PopupMenuItem(new RemoveAction())); popupMenu.add(new MoveGroupAction().createMenuItem());
popupMenu.add(new RemoveAction().createMenuItem());
return popupMenu; return popupMenu;
} }
@ -288,6 +292,15 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
this.setName(Toolkit.i18nText("Fine-Design_Share_Group_Move")); 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 @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
new GroupMoveDialog(DesignerContext.getDesignerFrame()) { new GroupMoveDialog(DesignerContext.getDesignerFrame()) {
@ -314,6 +327,15 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
this.setName(Toolkit.i18nText("Fine-Design_Share_Remove")); 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 @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
int rv = FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), int rv = FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(),

12
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);
}

14
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.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.share.ui.base.AbstractWidgetPopupPreviewPane; 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.block.PreviewWidgetBlock;
import com.fr.design.mainframe.share.ui.constants.ColorConstants;
import com.fr.form.share.bean.OnlineShareWidget; import com.fr.form.share.bean.OnlineShareWidget;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
@ -15,6 +16,7 @@ import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JSeparator; import javax.swing.JSeparator;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.plaf.basic.BasicLabelUI;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
@ -43,10 +45,13 @@ public class OnlineWidgetPopupPreviewPane extends AbstractWidgetPopupPreviewPane
private UILabel suitableThemeNameLabel; private UILabel suitableThemeNameLabel;
public OnlineWidgetPopupPreviewPane() { public OnlineWidgetPopupPreviewPane() {
super();
setPreferredSize(new Dimension(POPUP_WIDTH, getPreferredSize().height)); setPreferredSize(new Dimension(POPUP_WIDTH, getPreferredSize().height));
setLayout(new BorderLayout(0, 0)); setLayout(new BorderLayout(0, 0));
setOpaque(true); setBorder(BorderFactory.createLineBorder(new Color(0xDADADD)));
setBackground(new Color(0xF0F0F1)); setBorderPainted(true);
setOpaque(false);
setBackground(ColorConstants.BACKGROUND);
suitableThemeNamePane = createSuitableThemeNamePane(); suitableThemeNamePane = createSuitableThemeNamePane();
JPanel previewImagePane = createPreviewImagePane(); JPanel previewImagePane = createPreviewImagePane();
@ -57,8 +62,9 @@ public class OnlineWidgetPopupPreviewPane extends AbstractWidgetPopupPreviewPane
private JPanel createSuitableThemeNamePane() { private JPanel createSuitableThemeNamePane() {
suitableThemeNameLabel = new UILabel(); suitableThemeNameLabel = new UILabel();
suitableThemeNameLabel.setUI(new BasicLabelUI());
suitableThemeNameLabel.setOpaque(false); suitableThemeNameLabel.setOpaque(false);
suitableThemeNameLabel.setBackground(new Color(0xF5F5F7)); suitableThemeNameLabel.setBackground(null);
suitableThemeNameLabel.setIcon(IOUtils.readIcon("/com/fr/design/icon/icon_predefined_style.png")); suitableThemeNameLabel.setIcon(IOUtils.readIcon("/com/fr/design/icon/icon_predefined_style.png"));
suitableThemeNameLabel.setIconTextGap(IntervalConstants.INTERVAL_L6); suitableThemeNameLabel.setIconTextGap(IntervalConstants.INTERVAL_L6);
@ -92,10 +98,12 @@ public class OnlineWidgetPopupPreviewPane extends AbstractWidgetPopupPreviewPane
versionLabel = new UILabel(); versionLabel = new UILabel();
versionLabel.setVerticalAlignment(SwingConstants.CENTER); versionLabel.setVerticalAlignment(SwingConstants.CENTER);
versionLabel.setFont(FRFont.getInstance(versionLabel.getFont()).deriveFont(12.0F)); versionLabel.setFont(FRFont.getInstance(versionLabel.getFont()).deriveFont(12.0F));
versionLabel.setForeground(new Color(0x333334));
downloadsLabel = new UILabel(); downloadsLabel = new UILabel();
downloadsLabel.setVerticalAlignment(SwingConstants.TOP); downloadsLabel.setVerticalAlignment(SwingConstants.TOP);
downloadsLabel.setFont(FRFont.getInstance(downloadsLabel.getFont()).deriveFont(12.0F)); downloadsLabel.setFont(FRFont.getInstance(downloadsLabel.getFont()).deriveFont(12.0F));
downloadsLabel.setForeground(new Color(0x333334));
priceLabel = new UILabel(); priceLabel = new UILabel();
priceLabel.setVerticalAlignment(SwingConstants.CENTER); priceLabel.setVerticalAlignment(SwingConstants.CENTER);

2
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(); Point p = FilterPane.this.getLocationOnScreen();
popup = pf.getPopup(FilterPane.this, filterPopupPane, p.x, p.y + FilterPane.this.getHeight()); popup = pf.getPopup(FilterPane.this, filterPopupPane, p.x, p.y + FilterPane.this.getHeight());
popup.show(); popup.show();
filterPopupPane.setPreferredSize(new Dimension(228, filterPopupPane.getHeight())); filterPopupPane.setPreferredSize(new Dimension(filterPopupPane.getWidth(), filterPopupPane.getHeight()));
showPopup = true; showPopup = true;
arrowButton.setIcon(FILTER_COMBO_UP); arrowButton.setIcon(FILTER_COMBO_UP);
firePopupStateChange(true); firePopupStateChange(true);

8
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 Color BORDER_COLOR = Color.decode("#D9DADD");
private static final String FILTER_ALL_ID = "0"; private static final String FILTER_ALL_ID = "0";
public static final int CONTENT_WIDTH = 225;
FilterPane filterPane; FilterPane filterPane;
private List<WidgetFilterInfo> filterList = new ArrayList<>(); private List<WidgetFilterInfo> filterList = new ArrayList<>();
private final List<UICheckBox> checkBoxList = new ArrayList<>(); private final List<UICheckBox> checkBoxList = new ArrayList<>();
@ -101,7 +103,7 @@ public abstract class FilterPopupPane extends JPanel {
jPanel.setBackground(Color.WHITE); jPanel.setBackground(Color.WHITE);
UILabel titleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Type")); UILabel titleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Type"));
titleLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); 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.setOpaque(true);
titleLabel.setBackground(Color.decode("#EDEDEE")); titleLabel.setBackground(Color.decode("#EDEDEE"));
jPanel.add(titleLabel, BorderLayout.NORTH); jPanel.add(titleLabel, BorderLayout.NORTH);
@ -131,7 +133,7 @@ public abstract class FilterPopupPane extends JPanel {
jPanel.setBackground(Color.WHITE); jPanel.setBackground(Color.WHITE);
UILabel titleLabel = new UILabel(filterTypeInfo.getTitle()); UILabel titleLabel = new UILabel(filterTypeInfo.getTitle());
titleLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); 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.setOpaque(true);
titleLabel.setBackground(Color.decode("#EDEDEE")); titleLabel.setBackground(Color.decode("#EDEDEE"));
jPanel.add(titleLabel, BorderLayout.NORTH); jPanel.add(titleLabel, BorderLayout.NORTH);
@ -150,7 +152,7 @@ public abstract class FilterPopupPane extends JPanel {
} }
} }
int contentPaneHeight = ((displayCount + 1) / 2) * 27; 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()) { for (final WidgetFilterInfo filterInfo : filterTypeInfo.getFilterItems()) {
if (ComparatorUtils.equals(FILTER_ALL_ID, filterInfo.getId())) { if (ComparatorUtils.equals(FILTER_ALL_ID, filterInfo.getId())) {
continue; continue;

10
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java

@ -102,8 +102,10 @@ public class ElementEditorDefinePane extends WTitleLayoutDefinePane<ElementCaseE
paddingBoundPane.update(elementCaseEditor); paddingBoundPane.update(elementCaseEditor);
} }
elementCaseEditor.setToolBars((FormToolBarManager[]) elementCaseToolBarEditor.getValue()); elementCaseEditor.setToolBars((FormToolBarManager[]) elementCaseToolBarEditor.getValue());
ReportFitAttr fitAttr = pcFitExpandablePane.update(); if (DesignerUIModeConfig.getInstance().newUIMode()) {
elementCaseEditor.setReportFitAttr(fitAttr); ReportFitAttr fitAttr = pcFitExpandablePane.update();
elementCaseEditor.setReportFitAttr(fitAttr);
}
return elementCaseEditor; return elementCaseEditor;
} }
@ -112,6 +114,8 @@ public class ElementEditorDefinePane extends WTitleLayoutDefinePane<ElementCaseE
paddingBoundPane.populate(ob); paddingBoundPane.populate(ob);
elementCaseToolBarEditor.setValue(ob.getToolBars()); elementCaseToolBarEditor.setValue(ob.getToolBars());
extraPropertyGroupPane.populate(ob); extraPropertyGroupPane.populate(ob);
pcFitExpandablePane.populate(ob.getReportFitAttr()); if (DesignerUIModeConfig.getInstance().newUIMode()) {
pcFitExpandablePane.populate(ob.getReportFitAttr());
}
} }
} }

BIN
designer-form/src/main/resources/com/fr/design/form/images/loading.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
designer-form/src/main/resources/com/fr/design/form/layouts/images/simple_style_18.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 10 KiB

3
designer-realize/src/main/java/com/fr/design/actions/server/ServerConfigManagerAction.java

@ -8,6 +8,7 @@ import com.fr.config.ServerPreferenceConfig;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
import com.fr.design.webattr.EditReportServerParameterPane; import com.fr.design.webattr.EditReportServerParameterPane;
@ -54,7 +55,7 @@ public class ServerConfigManagerAction extends UpdateAction {
}; };
final BasicDialog editReportServerParameterDialog = editReportServerParameterPane.showWindowWithCustomSize( final BasicDialog editReportServerParameterDialog = editReportServerParameterPane.showWindowWithCustomSize(
DesignerContext.getDesignerFrame(), null, DEFAULT DesignerContext.getDesignerFrame(), null, DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.actions.server.dialog")
); );
editReportServerParameterDialog.addDialogActionListener(new DialogActionAdapter() { editReportServerParameterDialog.addDialogActionListener(new DialogActionAdapter() {

16
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java

@ -114,11 +114,10 @@ public class CustomStylePane extends MultiTabPane<Style> {
return tabPane.getSelectedIndex() == ONE_INDEX; return tabPane.getSelectedIndex() == ONE_INDEX;
} }
/** public void dealWithBorder() {
* @param ePane if (reportPane == null) {
*/ return;
public void dealWithBorder(ElementCasePane ePane) { }
this.reportPane = ePane;
Object[] fourObjectArray = BorderUtils.createCellBorderObject(reportPane); Object[] fourObjectArray = BorderUtils.createCellBorderObject(reportPane);
if (fourObjectArray != null && fourObjectArray.length % LENGTH_FOUR == 0) { if (fourObjectArray != null && fourObjectArray.length % LENGTH_FOUR == 0) {
@ -130,7 +129,14 @@ public class CustomStylePane extends MultiTabPane<Style> {
(Color) fourObjectArray[THREE_INDEX]); (Color) fourObjectArray[THREE_INDEX]);
} }
} }
}
/**
* @param ePane
*/
public void dealWithBorder(ElementCasePane ePane) {
this.reportPane = ePane;
dealWithBorder();
} }
/** /**

1
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java

@ -107,6 +107,7 @@ public class StylePane extends BasicPane implements UIObserver {
lastSelectedRealStyle = (Style) lastSelectedRealStyle.clone(); lastSelectedRealStyle = (Style) lastSelectedRealStyle.clone();
if (lastSelectedRealStyle != null) { if (lastSelectedRealStyle != null) {
customStylePane.populateBean(lastSelectedRealStyle); customStylePane.populateBean(lastSelectedRealStyle);
customStylePane.dealWithBorder();
} }
} catch (CloneNotSupportedException ex) { } catch (CloneNotSupportedException ex) {
FineLoggerFactory.getLogger().error(ex.getMessage(), ex); FineLoggerFactory.getLogger().error(ex.getMessage(), ex);

51
designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java

@ -19,24 +19,22 @@ import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.share.exception.LackOfValueException; import com.fr.design.mainframe.share.exception.LackOfValueException;
import com.fr.design.mainframe.share.generate.ComponentGeneratorCenter; import com.fr.design.mainframe.share.generate.ComponentGeneratorCenter;
import com.fr.design.mainframe.share.select.ComponentTransformerFactory; import com.fr.design.mainframe.share.select.ComponentTransformerFactory;
import com.fr.design.mod.ContentObjectManager;
import com.fr.form.share.exception.NetWorkFailedException;
import com.fr.form.share.group.DefaultShareGroup;
import com.fr.design.mainframe.share.util.ShareUIUtils; import com.fr.design.mainframe.share.util.ShareUIUtils;
import com.fr.design.mod.ContentObjectManager;
import com.fr.design.share.effect.EffectItemGroup; import com.fr.design.share.effect.EffectItemGroup;
import com.fr.design.share.utils.EffectItemUtils; import com.fr.design.share.utils.EffectItemUtils;
import com.fr.design.share.utils.ShareDialogUtils; import com.fr.design.share.utils.ShareDialogUtils;
import com.fr.form.share.DefaultSharableWidget; import com.fr.form.share.DefaultSharableWidget;
import com.fr.form.share.Group;
import com.fr.form.share.config.ComponentReuseConfigManager; import com.fr.form.share.config.ComponentReuseConfigManager;
import com.fr.form.share.exception.NetWorkFailedException;
import com.fr.form.share.group.DefaultShareGroup;
import com.fr.form.share.group.DefaultShareGroupManager; import com.fr.form.share.group.DefaultShareGroupManager;
import com.fr.form.share.Group;
import com.fr.form.share.record.ShareWidgetInfoManager; import com.fr.form.share.record.ShareWidgetInfoManager;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import java.util.HashSet;
import java.util.Set;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
@ -51,7 +49,9 @@ import java.awt.Image;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -65,8 +65,6 @@ public class ShareGeneratePane extends BasicPane {
private static final Dimension DIALOG_SIZE = new Dimension(670, 760); private static final Dimension DIALOG_SIZE = new Dimension(670, 760);
private static final Dimension DIALOG_NORMAL_SIZE = new Dimension(670, 610); private static final Dimension DIALOG_NORMAL_SIZE = new Dimension(670, 610);
private static final Border DIALOG_BORDER = BorderFactory.createEmptyBorder(0, 6, 4, 6); private static final Border DIALOG_BORDER = BorderFactory.createEmptyBorder(0, 6, 4, 6);
private static final double MAX_WIDTH = 500.0;
private static final double MAX_HEIGHT = 260.0;
private JPanel mainPane = null; private JPanel mainPane = null;
private ShareMainPane uploadPane = null; private ShareMainPane uploadPane = null;
@ -213,7 +211,6 @@ public class ShareGeneratePane extends BasicPane {
dialog.setButtonEnabled(false); dialog.setButtonEnabled(false);
ShareDialogUtils.getInstance().setShareDialog(dialog); ShareDialogUtils.getInstance().setShareDialog(dialog);
dialog.addDialogActionListener(new DialogActionAdapter() { dialog.addDialogActionListener(new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
ShareMainPane mainPane = getSelectMainPane(); ShareMainPane mainPane = getSelectMainPane();
@ -297,29 +294,11 @@ public class ShareGeneratePane extends BasicPane {
} }
private boolean generateModule(DefaultSharableWidget info) throws Exception { private boolean generateModule(DefaultSharableWidget info) throws Exception {
ComponentGenerateInfo generateInfo = new ComponentGenerateInfo(uploadCheckbox.isSelected(), jt, paraMap, shareWidget, info);
DefaultSharableWidget transformInfo = transform(info);
ComponentGenerateInfo generateInfo = new ComponentGenerateInfo(uploadCheckbox.isSelected(), jt, paraMap, shareWidget, transformInfo);
ComponentGeneratorCenter center = new ComponentGeneratorCenter(generateInfo); ComponentGeneratorCenter center = new ComponentGeneratorCenter(generateInfo);
return center.generate(); return center.generate();
} }
private DefaultSharableWidget transform(DefaultSharableWidget info) {
confineSize(info);
//先屏蔽
//if (shareWidget instanceof AbstractBorderStyleWidget) {
// AbstractBorderStyleWidget styleWidget = (AbstractBorderStyleWidget) shareWidget;
// ExtendSharableAttrMark attrMark = styleWidget.getWidgetAttrMark(ExtendSharableAttrMark.XML_TAG);
// if (attrMark != null) {
// String shareId = attrMark.getShareId();
// info.setId(shareId);
// }
//}
return info;
}
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Share_Module_Msg"); return Toolkit.i18nText("Fine-Design_Share_Module_Msg");
@ -328,20 +307,4 @@ public class ShareGeneratePane extends BasicPane {
private Dimension getDialogSize() { private Dimension getDialogSize() {
return effectItemGroups.size() > 0 ? DIALOG_SIZE : DIALOG_NORMAL_SIZE; return effectItemGroups.size() > 0 ? DIALOG_SIZE : DIALOG_NORMAL_SIZE;
} }
private void confineSize(DefaultSharableWidget info) {
double width = info.getWidth();
double height = info.getHeight();
if (width > 0 && height > 0 && (width > MAX_WIDTH || height > MAX_HEIGHT)) {
double aspectRatio = width / height;
if (width / height > MAX_WIDTH / MAX_HEIGHT) {
info.setWidth((int) MAX_WIDTH);
info.setHeight((int) (MAX_WIDTH / aspectRatio));
} else {
info.setHeight((int) MAX_HEIGHT);
info.setWidth((int) (MAX_HEIGHT * aspectRatio));
}
}
}
} }

Loading…
Cancel
Save