Browse Source

Merge pull request #2588 in DESIGN/design from bugfix/10.0 to feature/10.0

* commit 'bf29eb3321f1b006099447b6cebcd78b81b12743':
  REPORT-40853 提交单元格组多次点击卡死 && REPORT-40843 选中单元格,点击到样式-单元格,最小化设计器后再打开设计器崩溃
  REPORT-37609 - 日文版屏蔽更新还原功能
  REPORT-37609 - 日文版屏蔽更新还原功能
  REPORT-37609 - 日文版屏蔽更新还原功能
  REPORT-37609 - 日文版屏蔽更新还原功能
research/11.0
superman 4 years ago
parent
commit
bfe6b03302
  1. 17
      designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java
  2. 34
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  3. 3
      designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java
  4. 10
      designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java
  5. 23
      designer-base/src/main/java/com/fr/design/upm/UpmFinder.java
  6. 4
      designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java

17
designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java

@ -156,7 +156,20 @@ public enum SupportLocaleImpl implements SupportLocale {
set.add(Locale.TAIWAN);
return set;
}
}
},
/**
* 更新升级-帮助菜单下
*/
UPDATE_HELP {
@Override
public Set<Locale> support() {
Set<Locale> set = new HashSet<>();
set.add(Locale.US);
set.add(Locale.KOREA);
set.add(Locale.CHINA);
set.add(Locale.TAIWAN);
return set;
}
}
}

34
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -528,35 +528,18 @@ public abstract class ToolBarMenuDock {
* @return 帮组菜单的子菜单
*/
public ShortCut[] createHelpShortCuts() {
final java.util.List<ShortCut> shortCuts = new ArrayList<ShortCut>();
Locale locale = GeneralContext.getLocale();
final java.util.List<ShortCut> shortCuts = new ArrayList<>();
LocaleCenter.buildAction(new LocaleAction() {
@Override
public void execute() {
shortCuts.add(new VideoAction());
}
}, SupportLocaleImpl.VIDEO);
LocaleCenter.buildAction(() -> shortCuts.add(new VideoAction()), SupportLocaleImpl.VIDEO);
LocaleCenter.buildAction(new LocaleAction() {
@Override
public void execute() {
shortCuts.add(new TutorialAction());
}
}, SupportLocaleImpl.TUTORIAL_HELP);
LocaleCenter.buildAction(() -> shortCuts.add(new TutorialAction()), SupportLocaleImpl.TUTORIAL_HELP);
LocaleCenter.buildAction(new LocaleAction() {
@Override
public void execute() {
shortCuts.add(new TechSupportAction());
}
}, SupportLocaleImpl.TECH_SUPPORT_HELP);
LocaleCenter.buildAction(() -> shortCuts.add(new TechSupportAction()), SupportLocaleImpl.TECH_SUPPORT_HELP);
//远程不使用更新升级,产品演示
if (WorkContext.getCurrent().isLocal()) {
shortCuts.add(new WebDemoAction());
shortCuts.add(new SoftwareUpdateAction());
LocaleCenter.buildAction(() -> shortCuts.add(new SoftwareUpdateAction()), SupportLocaleImpl.UPDATE_HELP);
}
if (AlphaFineConfigManager.isALPHALicAvailable()) {
shortCuts.add(new AlphaFineAction());
@ -564,12 +547,7 @@ public abstract class ToolBarMenuDock {
shortCuts.add(SeparatorDef.DEFAULT);
if (DesignerEnvManager.getEnvManager().isOpenDebug()) {
OSSupportCenter.buildAction(new OSBasedAction() {
@Override
public void execute(Object... objects) {
shortCuts.add(new FineUIAction());
}
}, SupportOSImpl.FINEUI);
OSSupportCenter.buildAction(objects -> shortCuts.add(new FineUIAction()), SupportOSImpl.FINEUI);
}
shortCuts.add(new AboutAction());

3
designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java

@ -26,6 +26,7 @@ import java.awt.event.ActionListener;
*/
public class GradientBackgroundPane extends BackgroundDetailPane {
private static final long serialVersionUID = -6854603990673031897L;
public static final int DEFAULT_GRADIENT_WIDTH = 254;
private UIRadioButton left2right, top2bottom;
private GradientBar gradientBar;
@ -41,7 +42,7 @@ public class GradientBackgroundPane extends BackgroundDetailPane {
// neil:增加渐变色拖动条
JPanel gradientPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel blankJp = new JPanel();
gradientBar = new GradientBar(4, 254);
gradientBar = new GradientBar(4, DEFAULT_GRADIENT_WIDTH);
blankJp.add(gradientBar);
UILabel jl = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Drag_To_Select_Gradient"));
jl.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20));

10
designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java

@ -192,7 +192,15 @@ public class GradientBar extends JComponent implements UIObserver, ColorSelectab
}
float[] dist = new float[list.size()];
for (int i = 0; i < list.size(); i++) {
dist[i] = (float) ((list.get(i).getX() - 4) / (max - 4));
double value = list.get(i).getX() - 4;
double defaultMax = max - 4;
if (Double.compare(value, defaultMax) > 0) {
// 设置了预定义的渐变色 渐变色起始位置比较大 然后由预定义样式切换到自定义样式 做下等比例转换
dist[i] = (float) (value / (GradientBackgroundPane.DEFAULT_GRADIENT_WIDTH - 4));
list.get(i).setX(max * dist[i]);
} else {
dist[i] = (float) (value / defaultMax);
}
}
LinearGradientPaint paint = new LinearGradientPaint(start, end, dist, c);

23
designer-base/src/main/java/com/fr/design/upm/UpmFinder.java

@ -10,6 +10,7 @@ import com.fr.design.update.ui.dialog.UpdateMainDialog;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
import com.fr.general.GeneralContext;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StableUtils;
import com.fr.workspace.Workspace;
@ -17,6 +18,7 @@ import com.fr.workspace.WorkspaceEvent;
import javax.swing.*;
import java.io.File;
import java.util.Locale;
/**
* @author richie
@ -27,6 +29,7 @@ public class UpmFinder {
private static final String UPM_DIR = "/upm";
private static final String MAIN_RESOURCE_PATH = UPM_DIR + "/plugin_design.html";
private static final String JXBROWSER = "com.teamdev.jxbrowser.chromium.Browser";
public static String installHome = FRContext.getCommonOperator().getWebRootPath();
@ -56,13 +59,20 @@ public class UpmFinder {
}
public static void showUPMDialog() {
boolean flag = true;
boolean hasJxBrowser = true;
try {
Class.forName("com.teamdev.jxbrowser.chromium.Browser");
Class.forName(JXBROWSER);
} catch (ClassNotFoundException e) {
flag = false;
hasJxBrowser = false;
}
if (flag) {
if (hasJxBrowser) {
showUpmPane();
} else {
showUpdatePane();
}
}
private static void showUpmPane() {
if (!checkUPMResourcesExist()){
// upm下载
int val = FineJOptionPane.showConfirmDialog(null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Shop_Need_Install"),
@ -87,8 +97,11 @@ public class UpmFinder {
}
dialog.setVisible(true);
}
} else {
}
private static void showUpdatePane() {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Update_Info_Plugin_Message"));
if (!GeneralContext.getLocale().equals(Locale.JAPAN)) {
UpdateMainDialog dialog = new UpdateMainDialog(DesignerContext.getDesignerFrame());
dialog.setAutoUpdateAfterInit();
dialog.showDialog();

4
designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java

@ -53,6 +53,7 @@ import javax.swing.BorderFactory;
import javax.swing.DefaultCellEditor;
import javax.swing.DefaultComboBoxModel;
import javax.swing.Icon;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
@ -867,13 +868,14 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
textLabel = new UILabel();
textLabel.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
vPaneDLG.setAlwaysOnTop(true);
vPaneDLG.setVisible(true);
}
});
vPane = new ValuePane(types);
vPaneDLG = vPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
vPaneDLG = vPane.showSmallWindow(new JFrame(), new DialogActionAdapter() {
public void doOk() {
fireEditingStopped(); // Make the renderer
// reappear.

Loading…
Cancel
Save