Browse Source

Pull request #8138: REPORT-67348 & REPORT-67303

Merge in DESIGN/design from ~STARRYI/design:feature/x to feature/x

* commit '9531c526b0a67ab4e0f225dfdc135cbe8626615a':
  REPORT-67303 【视觉验收】组件商城面向风格化
  REPORT-67348 组件包下载提示文本中的数量不符合设计意图
feature/x
starryi 3 years ago
parent
commit
1b36033dfe
  1. 15
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopDialog.java
  2. 39
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java

15
designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopDialog.java

@ -1,15 +1,13 @@
package com.fr.design.mainframe.share.ui.online.mini; package com.fr.design.mainframe.share.ui.online.mini;
import com.fr.base.ScreenResolution;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.share.mini.MiniShopDisposingChecker; import com.fr.design.mainframe.share.mini.MiniShopDisposingChecker;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.Constants;
import com.fr.stable.unit.FU;
import com.fr.stable.unit.UNIT;
import javax.swing.JFrame; import javax.swing.JFrame;
import java.awt.Container; import java.awt.Container;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;
import java.awt.Window; import java.awt.Window;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.awt.event.WindowListener; import java.awt.event.WindowListener;
@ -36,10 +34,11 @@ public class MiniComponentShopDialog {
final JFrame frame = new JFrame(); final JFrame frame = new JFrame();
final MiniComponentShopPane shopPane = new MiniComponentShopPane(); final MiniComponentShopPane shopPane = new MiniComponentShopPane();
final UNIT width = FU.getInstance(900 * Constants.FU_PER_OLD_PIX); GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment();
final UNIT height = FU.getInstance(600 * Constants.FU_PER_OLD_PIX); Rectangle rect =ge.getMaximumWindowBounds();
int resolution = ScreenResolution.getScreenResolution(); int width = (int) (rect.width * 0.8);
frame.setSize(width.toPixI(resolution), height.toPixI(resolution)); int height = (int) (rect.height * 0.9);
frame.setSize(width, height);
frame.setTitle(Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Window_Title")); frame.setTitle(Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Window_Title"));
frame.add(shopPane); frame.add(shopPane);
frame.setResizable(false); frame.setResizable(false);

39
designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java

@ -254,9 +254,9 @@ public class NativeProductBridge {
MiniComponentShopDialog.getInstance().getContentPane(), MiniComponentShopDialog.getInstance().getContentPane(),
Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Download_Incompatible_Component_Tip"), Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Download_Incompatible_Component_Tip"),
"", "",
FineJOptionPane.YES_NO_OPTION FineJOptionPane.OK_CANCEL_OPTION
); );
allowedDownload = result == JOptionPane.YES_OPTION; allowedDownload = result == JOptionPane.OK_OPTION;
} }
if (allowedDownload) { if (allowedDownload) {
fireStartEvent(null); fireStartEvent(null);
@ -353,33 +353,14 @@ public class NativeProductBridge {
SwingUtilities.invokeLater(new Runnable() { SwingUtilities.invokeLater(new Runnable() {
@Override @Override
public void run() { public void run() {
boolean allowedDownload; OnlineShareWidget[] childrenWidgets = OnlineShopUtils.getPackageWidgets(widget, true);
OnlineShareWidget[] childrenWidgets = OnlineShopUtils.getPackageWidgets(widget, false); int result = FineJOptionPane.showConfirmDialog(
boolean isCompatibleWithCurrentEnv = true; MiniComponentShopDialog.getInstance().getContentPane(),
for (OnlineShareWidget children: childrenWidgets) { Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Download_Components_Package_Tip", childrenWidgets.length),
if (!children.isCompatibleWithCurrentEnv()) { "",
isCompatibleWithCurrentEnv = false; FineJOptionPane.OK_CANCEL_OPTION
break; );
} if (result == JOptionPane.OK_OPTION) {
}
int result;
if (!isCompatibleWithCurrentEnv) {
result = FineJOptionPane.showConfirmDialog(
MiniComponentShopDialog.getInstance().getContentPane(),
Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Download_Incompatible_Components_Package_Tip", childrenCount),
"",
FineJOptionPane.YES_NO_OPTION
);
} else {
result = FineJOptionPane.showConfirmDialog(
MiniComponentShopDialog.getInstance().getContentPane(),
Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Download_Components_Package_Tip", childrenCount),
"",
FineJOptionPane.YES_NO_OPTION
);
}
allowedDownload = result == JOptionPane.YES_OPTION;
if (allowedDownload) {
fireStartEvent(null); fireStartEvent(null);
action.install(); action.install();
} else { } else {

Loading…
Cancel
Save