diff --git a/designer-base/pom.xml b/designer-base/pom.xml index 8a725b517..522da84ff 100644 --- a/designer-base/pom.xml +++ b/designer-base/pom.xml @@ -18,5 +18,4 @@ 0.7.0 - \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index f6cfb3186..8e6b1e26e 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -207,7 +207,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { return; } String installHome = StableUtils.getInstallHome(); - if (installHome != null && !".".equals(installHome)) { + //这里不判断路径是.的情况,放在checkValid方法里面,重新选 + if (installHome != null) { String name = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_DEFAULT"); String envPath = designerEnvManager.getDefaultenvPath(installHome); designerEnvManager.putEnv(name, LocalDesignerWorkspaceInfo.create(name, envPath)); diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java index 9b689bc97..98ad28c9c 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java @@ -1,20 +1,15 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; import javax.swing.*; -import java.awt.*; + import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; public class BBSAction extends UpdateAction { @@ -25,33 +20,19 @@ public class BBSAction extends UpdateAction this.setMenuKeySet(BBS); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs.png")); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/bbs.png")); } /** * 动作 - * @param e 事件 + * @param arg0 事件 */ @Override public void actionPerformed(ActionEvent arg0) { String url = CloudCenter.getInstance().acquireUrlByKind("bbs"); - if (StringUtils.isEmpty(url)) { - FRContext.getLogger().info("The URL is empty!"); - return; - } - try { - Desktop.getDesktop().browse(new URI(url)); - } catch (IOException exp) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } + BrowseUtils.browser(url); } public static final MenuKeySet BBS = new MenuKeySet() { @Override diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java index b22093060..d9c75321d 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java @@ -1,20 +1,14 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; - import javax.swing.*; -import java.awt.*; + import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; public class BugAction extends UpdateAction { @@ -23,7 +17,7 @@ public class BugAction extends UpdateAction { this.setMenuKeySet(BUG); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bug.png")); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/bug.png")); } @@ -31,21 +25,7 @@ public class BugAction extends UpdateAction public void actionPerformed(ActionEvent arg0) { String url = CloudCenter.getInstance().acquireUrlByKind("bbs.bugs"); - if (StringUtils.isEmpty(url)) { - FRContext.getLogger().info("The URL is empty!"); - return; - } - try { - Desktop.getDesktop().browse(new URI(url)); - } catch (IOException exp) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } + BrowseUtils.browser(url); } public static final MenuKeySet BUG = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java b/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java new file mode 100644 index 000000000..3ba97c0fc --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java @@ -0,0 +1,47 @@ +package com.fr.design.actions.community; + +import com.fr.base.BaseUtils; +import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; +import com.fr.general.CloudCenter; + +import javax.swing.KeyStroke; +import java.awt.event.ActionEvent; + +/** + * Created by XINZAI on 2018/8/23. + */ +public class CenterAction extends UpAction{ + public CenterAction() + { + this.setMenuKeySet(CENTER); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/center.png")); + + } + + @Override + public void actionPerformed(ActionEvent arg0) + { + String url = CloudCenter.getInstance().acquireUrlByKind("bbs.center"); + BrowseUtils.browser(url); + + } + public static final MenuKeySet CENTER = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'C'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Commuinity_Center"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; +} diff --git a/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java b/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java new file mode 100644 index 000000000..9e294d859 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java @@ -0,0 +1,48 @@ +package com.fr.design.actions.community; + +import com.fr.base.BaseUtils; + +import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; +import com.fr.general.CloudCenter; +import javax.swing.KeyStroke; + +import java.awt.event.ActionEvent; + +/** + * Created by XINZAI on 2018/8/23. + */ +public class CusDemandAction extends UpAction{ + public CusDemandAction() + { + this.setMenuKeySet(DEMAND); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/demand.png")); + + } + + @Override + public void actionPerformed(ActionEvent arg0) + { + String url = CloudCenter.getInstance().acquireUrlByKind("bbs.demand"); + BrowseUtils.browser(url); + + } + public static final MenuKeySet DEMAND = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'D'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Commuinity_Demand"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; +} diff --git a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java index c49a484f7..c604e51d0 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java @@ -1,20 +1,14 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; - import javax.swing.*; -import java.awt.*; + import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; public class NeedAction extends UpdateAction { @@ -24,29 +18,15 @@ public class NeedAction extends UpdateAction this.setMenuKeySet(NEED); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/need.png")); - + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/need.png")); + } @Override public void actionPerformed(ActionEvent arg0) { String url = CloudCenter.getInstance().acquireUrlByKind("bbs.needs"); - if (StringUtils.isEmpty(url)) { - FRContext.getLogger().info("The URL is empty!"); - return; - } - try { - Desktop.getDesktop().browse(new URI(url)); - } catch (IOException exp) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } + BrowseUtils.browser(url); } public static final MenuKeySet NEED = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java b/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java index 390827f16..717537df6 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java @@ -1,20 +1,14 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; - import javax.swing.*; -import java.awt.*; + import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; public class QuestionAction extends UpdateAction { @@ -23,7 +17,7 @@ public class QuestionAction extends UpdateAction { this.setMenuKeySet(QUESTIONS); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/questions.png")); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/question.png")); } @@ -31,22 +25,7 @@ public class QuestionAction extends UpdateAction public void actionPerformed(ActionEvent arg0) { String url = CloudCenter.getInstance().acquireUrlByKind("bbs.questions"); - if (StringUtils.isEmpty(url)) { - FRContext.getLogger().info("The URL is empty!"); - return; - } - try { - Desktop.getDesktop().browse(new URI(url)); - } catch (IOException exp) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } - + BrowseUtils.browser(url); } public static final MenuKeySet QUESTIONS = new MenuKeySet() { @Override diff --git a/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java b/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java index fe59c01f5..c08619b23 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java @@ -1,20 +1,15 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; import javax.swing.*; -import java.awt.*; + import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; public class SignAction extends UpdateAction { @@ -24,7 +19,7 @@ public class SignAction extends UpdateAction this.setMenuKeySet(SIGN); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/signature.png")); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/sign.png")); } @@ -32,21 +27,7 @@ public class SignAction extends UpdateAction public void actionPerformed(ActionEvent arg0) { String url = CloudCenter.getInstance().acquireUrlByKind("bbs.aut"); - if (StringUtils.isEmpty(url)) { - FRContext.getLogger().info("The URL is empty!"); - return; - } - try { - Desktop.getDesktop().browse(new URI(url)); - } catch (IOException exp) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } + BrowseUtils.browser(url); } public static final MenuKeySet SIGN = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java b/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java new file mode 100644 index 000000000..fce0dbda8 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java @@ -0,0 +1,52 @@ +package com.fr.design.actions.community; + +import com.fr.base.BaseUtils; +import com.fr.design.actions.UpdateAction; +import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; +import com.fr.general.CloudCenter; + + +import javax.swing.KeyStroke; + +import java.awt.event.ActionEvent; + + +/** + * Created by XINZAI on 2018/8/23. + */ +public class TechSolutionAction extends UpdateAction{ + public TechSolutionAction() + { + this.setMenuKeySet(TSO); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images//bbs/solotion.png")); + + } + + @Override + public void actionPerformed(ActionEvent arg0) + { + String url = CloudCenter.getInstance().acquireUrlByKind("bbs.solution"); + BrowseUtils.browser(url); + + } + public static final MenuKeySet TSO = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'T'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Commuinity_Solution"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; + +} diff --git a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java index 662fe689b..8e9fd5b32 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java @@ -1,20 +1,14 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import com.fr.general.GeneralContext; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; import javax.swing.*; -import java.awt.*; import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; import java.util.Locale; public class VideoAction extends UpdateAction @@ -25,7 +19,7 @@ public class VideoAction extends UpdateAction this.setMenuKeySet(VIDEO); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/video.png")); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/video.png")); } @@ -38,21 +32,7 @@ public class VideoAction extends UpdateAction } else { url = CloudCenter.getInstance().acquireUrlByKind("bbs.video"); } - if (StringUtils.isEmpty(url)) { - FRContext.getLogger().info("The URL is empty!"); - return; - } - try { - Desktop.getDesktop().browse(new URI(url)); - } catch (IOException exp) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser_Duplicate")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } + BrowseUtils.browser(url); } public static final MenuKeySet VIDEO = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java b/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java index 91cfb5712..3c51f4bbd 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java @@ -31,7 +31,7 @@ public class TutorialAction extends UpdateAction { this.setMenuKeySet(HELP_TUTORIAL); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/help.png")); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/help.png")); this.setAccelerator(getMenuKeySet().getKeyStroke()); } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java index 74cebeb5a..b796ab2d7 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java @@ -29,14 +29,13 @@ import java.awt.event.WindowEvent; */ public abstract class DatabaseConnectionPane extends BasicBeanPane { - // 编码转换. - private UIComboBox originalCharSetComboBox; - private UIComboBox newCharSetComboBox; private UILabel message; private UIButton okButton; private UIButton cancelButton; private JDialog dialog; private UILabel uiLabel; + private String oirginalCharSet = null; + private String newCharSet = null; // Database pane public DatabaseConnectionPane() { @@ -44,8 +43,6 @@ public abstract class DatabaseConnectionPane() { protected PreviewTableModel doInBackground() throws Exception { connectionBar.start(); - if (tableData instanceof DBTableData) { - boolean status = DataOperator.getInstance().testConnection(((DBTableData) tableData).getDatabase()); - if (!status) { - connectionBar.close(); - throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); + try { + if (tableData instanceof DBTableData) { + boolean status = DataOperator.getInstance().testConnection(((DBTableData) tableData).getDatabase()); + if (!status) { + throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); + } } + } finally { + connectionBar.close(); } - connectionBar.close(); TableDataSource dataSource = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getTarget(); previewTableData = DesignTableDataManager.previewTableDataNeedInputParameters(dataSource, tableData, (int) maxPreviewNumberField.getValue(), true); // parameterInputDialog diff --git a/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java index 70de03441..7da0d9fe0 100644 --- a/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java @@ -77,7 +77,8 @@ public class LocalDesignerWorkspaceInfo implements DesignerWorkspaceInfo { @Override public boolean checkValid(){ File file = new File(this.path); - if(!file.isDirectory() || !ComparatorUtils.equals(file.getName(), "WEB-INF")) { + //判断不是文件夹/路径不在WEB-INF下/代码启动三种情况 + if(!file.isDirectory() || !ComparatorUtils.equals(file.getName(), "WEB-INF") || this.path.startsWith(".")) { return false; } diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java b/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java index 19b4d3273..9b166489f 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java @@ -177,7 +177,7 @@ public class PluginUtils { private static String getInterKeyByErrorCode(PluginErrorCode errorCode) { - return ERROR_CODE_I18N_PREFIX + errorCode.getDescription(); + return errorCode.getDescription(); } public static PluginMarker getInstalledPluginMarkerByID(String pluginID) { diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java b/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java index 9acc24ba3..33d527645 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java @@ -570,6 +570,15 @@ public class PluginWebBridge { //todo 初始化设计器其他部分 } + + /** + * 国际化(用来做兼容,暂时不删) + */ + public String parseI18(final String key) { + return com.fr.design.i18n.Toolkit.i18nText(key); + } + + /** * 是否是在设计器中操作 */ diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index ff9e48e5d..cd3c3a5ba 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -1,6 +1,5 @@ package com.fr.design.gui.controlpane; -import com.fr.base.chart.BasePlot; import com.fr.design.constants.UIConstants; import com.fr.design.gui.controlpane.shortcutfactory.ShortCutFactory; import com.fr.design.gui.ilable.UILabel; @@ -49,7 +48,6 @@ import java.awt.event.WindowEvent; abstract class UIControlPane extends JControlPane { private UIToolbar topToolBar; protected Window popupEditDialog; - protected BasePlot plot; private static final int TOP_TOOLBAR_HEIGHT = 20; private static final int TOP_TOOLBAR_WIDTH = 156; // 可能因为用了tablelayout,要比其他地方多一个像素,看起来才正常 private static final int TOP_TOOLBAR_WIDTH_SHORT = 76; @@ -58,11 +56,6 @@ abstract class UIControlPane extends JControlPane { super(); } - UIControlPane(BasePlot plot) { - super(); - this.plot = plot; - } - public abstract void saveSettings(); @Override diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java index de2a42fa8..0dec12421 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java @@ -1,6 +1,5 @@ package com.fr.design.gui.controlpane; -import com.fr.base.chart.BasePlot; import com.fr.design.beans.BasicBeanPane; import com.fr.design.constants.UIConstants; import com.fr.design.gui.icontainer.UIScrollPane; @@ -55,10 +54,6 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon } - public UIListControlPane(BasePlot plot) { - super(plot); - } - private ListControlPaneHelper getHelper() { if (helper == null) { helper = ListControlPaneHelper.newInstance(this); diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java index 51bdba985..eadb94109 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java @@ -1,16 +1,28 @@ package com.fr.design.gui.icontainer; -import com.fr.base.BaseUtils; import com.fr.base.vcs.DesignerMode; import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.DesignerContext; - import com.fr.design.utils.gui.GUICoreUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.JComponent; +import javax.swing.JFrame; +import javax.swing.JLayeredPane; +import javax.swing.JPanel; +import java.awt.AlphaComposite; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Composite; +import java.awt.Container; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.LayoutManager; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionListener; @@ -263,7 +275,7 @@ public class UIModeControlContainer extends JLayeredPane { public HidePane() { setLayout(new FlowLayout(FlowLayout.CENTER, 10, -3)); setBackground(UIConstants.NORMAL_BACKGROUND); - add(new UILabel("" + com.fr.design.i18n.Toolkit.i18nText("Parameter Panel") + "")); + add(new UILabel("" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Parameter_Panel") + "")); UIButton viewButton = new UIButton(UIConstants.VIEW_NORMAL_ICON, UIConstants.VIEW_PRESSED_ICON, UIConstants.VIEW_PRESSED_ICON) { @Override public Dimension getPreferredSize() { diff --git a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java index 93e824acb..77e16e312 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java @@ -1,7 +1,9 @@ package com.fr.design.javascript; import com.fr.design.DesignerEnvManager; +import com.fr.design.border.UIRoundedBorder; import com.fr.design.constants.KeyWords; +import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.autocomplete.AutoCompletion; import com.fr.design.gui.autocomplete.BasicCompletion; @@ -14,7 +16,6 @@ import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.javascript.beautify.JavaScriptFormatHelper; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.IOUtils; @@ -60,10 +61,15 @@ public class JSContentPane extends BasicPane { } }); - this.add(GUICoreUtils.createBorderLayoutPane( - funNameLabel, BorderLayout.WEST, - label, BorderLayout.EAST - ), BorderLayout.NORTH); + //REPORT-10533 用户参数多达25个,导致JS没地方写,增加滚动条显示 + JPanel jsParaPane = new JPanel(new BorderLayout(4, 4)); + jsParaPane.setPreferredSize(new Dimension(300, 80)); + UIScrollPane scrollPane = new UIScrollPane(funNameLabel); + scrollPane.setPreferredSize(new Dimension(400, 80)); + scrollPane.setBorder(new UIRoundedBorder(UIConstants.TITLED_BORDER_COLOR, 1, UIConstants.ARC)); + jsParaPane.add(scrollPane, BorderLayout.WEST); + jsParaPane.add(label, BorderLayout.EAST); + this.add(jsParaPane, BorderLayout.NORTH); contentTextArea = new RSyntaxTextArea(); contentTextArea.setCloseCurlyBraces(true); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java index 7d4f40c86..2ae9e13f7 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java @@ -38,6 +38,7 @@ public class DesignerLogHandler { protected static final int INFO_INT = Level.INFO.toInt(); protected static final int ERROR_INT = Level.ERROR.toInt(); protected static final int WARN_INT = Level.WARN.toInt(); + protected static final int DEBUG_INT = Level.DEBUG.toInt(); private static final int GAP_X = -150; private static final int INFO_GAP_Y = -60; private static final int ERRO_GAP_Y = -40; @@ -209,12 +210,15 @@ public class DesignerLogHandler { public void printStackTrace(String message, Level level, Date date) { int intLevel = level.toInt(); + int logLevel = Log4jConfig.getInstance().getRootLevel().toInt(); if (intLevel == INFO_INT && showInfo.isSelected()) { printMessage(message, intLevel, date); } else if (intLevel == ERROR_INT && showError.isSelected()) { printMessage(message, intLevel, date); } else if (intLevel == WARN_INT && showServer.isSelected()) { printMessage(message, intLevel, date); + } else if (intLevel == DEBUG_INT && logLevel == DEBUG_INT){ + printMessage(message, intLevel, date); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 2bf1343ea..78e440ab7 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -10,9 +10,12 @@ import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.community.BBSAction; import com.fr.design.actions.community.BugAction; +import com.fr.design.actions.community.CenterAction; +import com.fr.design.actions.community.CusDemandAction; import com.fr.design.actions.community.NeedAction; import com.fr.design.actions.community.QuestionAction; import com.fr.design.actions.community.SignAction; +import com.fr.design.actions.community.TechSolutionAction; import com.fr.design.actions.community.UpAction; import com.fr.design.actions.community.VideoAction; import com.fr.design.actions.file.CloseCurrentTemplateAction; @@ -494,9 +497,11 @@ public abstract class ToolBarMenuDock { shortCuts.add(new VideoAction()); shortCuts.add(new TutorialAction()); shortCuts.add(new QuestionAction()); - shortCuts.add(new UpAction()); - shortCuts.add(new NeedAction()); + shortCuts.add(new TechSolutionAction()); shortCuts.add(new BugAction()); + shortCuts.add(new NeedAction()); + shortCuts.add(new CusDemandAction()); + shortCuts.add(new CenterAction()); shortCuts.add(new SignAction()); return shortCuts.toArray(new ShortCut[shortCuts.size()]); } diff --git a/designer-base/src/main/java/com/fr/design/utils/BrowseUtils.java b/designer-base/src/main/java/com/fr/design/utils/BrowseUtils.java new file mode 100644 index 000000000..4de270571 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/utils/BrowseUtils.java @@ -0,0 +1,62 @@ +package com.fr.design.utils; + +import com.fr.base.FRContext; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.OperatingSystem; +import com.fr.stable.StringUtils; + +import javax.swing.JOptionPane; +import java.awt.Desktop; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +/** + * Created by XINZAI on 2018/8/23. + */ +public class BrowseUtils { + + /** + * 处理内存异常,win10下用rundll32打开 + * @param uri 网址 + * @param e + */ + private static void startBrowserFromCommand(String uri, IOException e) { + + if (OperatingSystem.isWindows()) { + try { + // win10 内存用到到80%左右的时候, Desktop.browser经常提示"存储空间不足, 无法处理改命令", 用rundll32可以打开. + Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + uri); + } catch (IOException ee) { + JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser_Duplicate")); + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } else { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + + /** + * 打开网页,用默认浏览器 + * @param url 网址 + */ + public static void browser(String url) { + + if (StringUtils.isEmpty(url)) { + FRContext.getLogger().info("The URL is empty!"); + return; + } + try { + Desktop.getDesktop().browse(new URI(url)); + } catch (IOException exp) { + startBrowserFromCommand(url, exp); + } catch (URISyntaxException exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + } catch (Exception exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); + } + } + + +} diff --git a/designer-base/src/main/java/com/fr/env/EnvListPane.java b/designer-base/src/main/java/com/fr/env/EnvListPane.java index 59eaea4e6..30b4b76f1 100644 --- a/designer-base/src/main/java/com/fr/env/EnvListPane.java +++ b/designer-base/src/main/java/com/fr/env/EnvListPane.java @@ -53,7 +53,7 @@ public class EnvListPane extends JListControlPane { */ @Override public NameableCreator[] createNameableCreators() { - NameableCreator local = new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("FR-Engine-Local_Workspace"), "com/fr/design/images/data/bind/localconnect.png", + NameableCreator local = new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Local_Workspace"), "com/fr/design/images/data/bind/localconnect.png", LocalDesignerWorkspaceInfo.class, LocalEnvPane.class); NameableCreator remote = new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Env_Remote_Server"), "com/fr/design/images/data/bind/distanceconnect.png", RemoteDesignerWorkspaceInfo.class, RemoteEnvPane.class); diff --git a/designer-base/src/main/java/com/fr/start/ServerStarter.java b/designer-base/src/main/java/com/fr/start/ServerStarter.java index 5ea007cd8..01db37eac 100644 --- a/designer-base/src/main/java/com/fr/start/ServerStarter.java +++ b/designer-base/src/main/java/com/fr/start/ServerStarter.java @@ -1,14 +1,13 @@ package com.fr.start; -import com.fr.base.FRContext; import com.fr.base.ServerConfig; import com.fr.design.DesignerEnvManager; +import com.fr.design.utils.BrowseUtils; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import com.fr.log.FineLoggerFactory; import com.fr.stable.OperatingSystem; import com.fr.stable.StableUtils; -import com.fr.stable.StringUtils; import com.fr.start.server.FineEmbedServer; import com.fr.start.server.FineEmbedServerMonitor; import com.fr.workspace.WorkContext; @@ -31,7 +30,7 @@ public class ServerStarter { if (!WorkContext.getCurrent().isLocal()) { //有问题,这里拿不到远程的http端口 - browser(WorkContext.getCurrent().getPath()); + BrowseUtils.browser(WorkContext.getCurrent().getPath()); } else if (ComparatorUtils.equals(StableUtils.getInstallHome(), ".")) {//august:供代码使用 String web = GeneralContext.getCurrentAppNameOfEnv(); @@ -49,7 +48,7 @@ public class ServerStarter { FineEmbedServer.start(); } finally { //先访问Demo, 后访问报表, 不需要重置服务器. - browser("http://localhost:" + DesignerEnvManager.getEnvManager().getEmbedServerPort() + "/" + GeneralContext.getCurrentAppNameOfEnv() + "/" + ServerConfig.getInstance().getServletName()); + BrowseUtils.browser("http://localhost:" + DesignerEnvManager.getEnvManager().getEmbedServerPort() + "/" + GeneralContext.getCurrentAppNameOfEnv() + "/" + ServerConfig.getInstance().getServletName()); } } @@ -77,40 +76,4 @@ public class ServerStarter { browser(url); } } - - private static void browser(String uri) { - - if (StringUtils.isEmpty(uri)) { - FRContext.getLogger().info("The URL is empty!"); - return; - } - try { - Desktop.getDesktop().browse(new URI(uri)); - - } catch (IOException e) { - startBrowserFromCommand(uri, e); - } catch (URISyntaxException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + uri); - } - } - - private static void startBrowserFromCommand(String uri, IOException e) { - - if (OperatingSystem.isWindows()) { - try { - // win10 内存用到到80%左右的时候, Desktop.browser经常提示"存储空间不足, 无法处理改命令", 用rundll32可以打开. - Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + uri); - } catch (IOException ee) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser_Duplicate")); - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } else { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - - } diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/bbs.png b/designer-base/src/main/resources/com/fr/design/images/bbs/bbs.png new file mode 100644 index 000000000..4fd2df684 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/bbs/bbs.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/bug.png b/designer-base/src/main/resources/com/fr/design/images/bbs/bug.png new file mode 100644 index 000000000..24393bc4b Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/bbs/bug.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/center.png b/designer-base/src/main/resources/com/fr/design/images/bbs/center.png new file mode 100644 index 000000000..1d464ba9b Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/bbs/center.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/demand.png b/designer-base/src/main/resources/com/fr/design/images/bbs/demand.png new file mode 100644 index 000000000..b237026fa Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/bbs/demand.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/help.png b/designer-base/src/main/resources/com/fr/design/images/bbs/help.png new file mode 100644 index 000000000..c13f2f192 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/bbs/help.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/need.png b/designer-base/src/main/resources/com/fr/design/images/bbs/need.png new file mode 100644 index 000000000..486ff9846 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/bbs/need.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/question.png b/designer-base/src/main/resources/com/fr/design/images/bbs/question.png new file mode 100644 index 000000000..c8c6fd8a1 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/bbs/question.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/sign.png b/designer-base/src/main/resources/com/fr/design/images/bbs/sign.png new file mode 100644 index 000000000..b1556f7ed Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/bbs/sign.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/solotion.png b/designer-base/src/main/resources/com/fr/design/images/bbs/solotion.png new file mode 100644 index 000000000..f09230674 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/bbs/solotion.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/video.png b/designer-base/src/main/resources/com/fr/design/images/bbs/video.png new file mode 100644 index 000000000..1971f2615 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/bbs/video.png differ diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java index b0da61844..af11a8b96 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java @@ -14,7 +14,6 @@ import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperRelateFloatLink import com.fr.design.chart.series.SeriesCondition.impl.FormHyperlinkPane; import com.fr.design.designer.TargetComponent; import com.fr.design.fun.HyperlinkProvider; -import com.fr.design.gui.HyperlinkFilterHelper; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.imenutable.UIMenuNameableCreator; @@ -23,8 +22,6 @@ import com.fr.design.hyperlink.WebHyperlinkPane; import com.fr.design.javascript.JavaScriptImplPane; import com.fr.design.javascript.ParameterJavaScriptPane; import com.fr.design.module.DesignModuleFactory; -import com.fr.log.FineLoggerFactory; - import com.fr.general.NameObject; import com.fr.js.EmailJavaScript; import com.fr.js.FormHyperlinkProvider; @@ -35,6 +32,7 @@ import com.fr.js.NameJavaScriptGroup; import com.fr.js.ParameterJavaScript; import com.fr.js.ReportletHyperlink; import com.fr.js.WebHyperlink; +import com.fr.log.FineLoggerFactory; import com.fr.stable.ListMap; import com.fr.stable.Nameable; import com.fr.stable.bridge.StableFactory; @@ -93,7 +91,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { } protected Map getHyperLinkEditorMap() { - return plot.getHyperLinkEditorMap(); + return getPlot().getHyperLinkEditorMap(); } /** @@ -147,7 +145,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { } public void populate(Plot plot) { - this.plot = plot; + setPlot(plot); HashMap paneMap = getHyperlinkMap(plot); //安装平台内打开插件时,添加相应按钮 diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java index db76fe301..15e905e10 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java @@ -1,6 +1,5 @@ package com.fr.van.chart.designer.component; -import com.fr.base.chart.BasePlot; import com.fr.chart.chartattr.Plot; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; @@ -13,7 +12,6 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.DesignerContext; import com.fr.design.utils.gui.GUICoreUtils; - import com.fr.stable.Nameable; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -38,15 +36,18 @@ import java.awt.event.ActionListener; public abstract class VanChartUIListControlPane extends UIListControlPane implements UIObserver { private UIObserverListener uiObserverListener; + private Plot plot;//update用 - public VanChartUIListControlPane() { - super(); - this.setBorder(null); - iniListener(); + protected Plot getPlot() { + return plot; } - public VanChartUIListControlPane(BasePlot plot) { - super(plot); + protected void setPlot(Plot plot) { + this.plot = plot; + } + + public VanChartUIListControlPane() { + super(); this.setBorder(null); iniListener(); } @@ -116,7 +117,7 @@ public abstract class VanChartUIListControlPane extends UIListControlPane implem if (isPopulating) { return; } - update((Plot) plot); + update(getPlot()); fireChanged();//图表属性改变,响应事件 } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartConditionAttrContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartConditionAttrContentPane.java index bc37fee56..3028f0720 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartConditionAttrContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartConditionAttrContentPane.java @@ -27,10 +27,16 @@ public class VanChartConditionAttrContentPane extends AbstractConditionAttrConte populateBean(plot, collection, showPane); } - public void populateBean(Plot plot, ConditionCollection collection, Class showPane){ + public void populateBean(final Plot plot, ConditionCollection collection, Class showPane) { if (conditionPane == null) { - conditionPane = new VanChartConditionListControlPane(plot); + conditionPane = new VanChartConditionListControlPane() { + @Override + protected Plot getPlot() { + return plot; + } + }; + } this.setLayout(new BorderLayout()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartConditionListControlPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartConditionListControlPane.java index 871b3afd4..004adba78 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartConditionListControlPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartConditionListControlPane.java @@ -1,6 +1,5 @@ package com.fr.van.chart.designer.other; -import com.fr.base.chart.BasePlot; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionCollection; @@ -9,7 +8,6 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; - import com.fr.general.NameObject; import com.fr.stable.Nameable; import com.fr.van.chart.designer.component.VanChartUIListControlPane; @@ -23,10 +21,6 @@ import java.lang.reflect.InvocationTargetException; */ public class VanChartConditionListControlPane extends VanChartUIListControlPane { - public VanChartConditionListControlPane(BasePlot plot) { - super(plot); - } - public void populate(Nameable[] nameableArray, Class showPane) { initComponentPane(); this.setBorder(null); @@ -37,7 +31,7 @@ public class VanChartConditionListControlPane extends VanChartUIListControlPane @Override public NameableCreator[] createNameableCreators() { - return new NameObjectCreator[]{new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Condition_Attributes"), ConditionAttr.class, ChartTypeInterfaceManager.getInstance().getPlotConditionPane((Plot) plot).getClass())}; + return new NameObjectCreator[]{new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Condition_Attributes"), ConditionAttr.class, ChartTypeInterfaceManager.getInstance().getPlotConditionPane(getPlot()).getClass())}; } @@ -45,7 +39,7 @@ public class VanChartConditionListControlPane extends VanChartUIListControlPane Constructor constructor = null; try { constructor = creator.getUpdatePane().getConstructor(Plot.class); - return constructor.newInstance(plot); + return constructor.newInstance(getPlot()); } catch (InstantiationException e) { throw new RuntimeException(e); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/AlertLineListControlPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/AlertLineListControlPane.java index b482b027e..0acf05632 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/AlertLineListControlPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/AlertLineListControlPane.java @@ -5,7 +5,6 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.ShortCut4JControlPane; import com.fr.general.ComparatorUtils; - import com.fr.general.NameObject; import com.fr.plugin.chart.attr.DefaultAxisHelper; import com.fr.plugin.chart.attr.axis.VanChartAlertValue; @@ -47,7 +46,7 @@ public class AlertLineListControlPane extends VanChartUIListControlPane { } public void populate(Plot plot) { - this.plot = plot; + setPlot(plot); VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; List xAxisList = rectanglePlot.getXAxisList(); List yAxisList = rectanglePlot.getYAxisList(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/BackgroundListControlPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/BackgroundListControlPane.java index 19936829e..096948b8a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/BackgroundListControlPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/BackgroundListControlPane.java @@ -5,7 +5,6 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.ShortCut4JControlPane; import com.fr.general.ComparatorUtils; - import com.fr.general.NameObject; import com.fr.plugin.chart.attr.DefaultAxisHelper; import com.fr.plugin.chart.attr.axis.VanChartAlertValue; @@ -49,7 +48,7 @@ public class BackgroundListControlPane extends VanChartUIListControlPane { } public void populate(Plot plot) { - this.plot = plot; + setPlot(plot); VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; List xAxisList = rectanglePlot.getXAxisList(); List yAxisList = rectanglePlot.getYAxisList(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartStackedAndAxisListControlPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartStackedAndAxisListControlPane.java index e5138a668..a6886e3b0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartStackedAndAxisListControlPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartStackedAndAxisListControlPane.java @@ -6,7 +6,6 @@ import com.fr.chart.chartglyph.ConditionCollection; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.ShortCut4JControlPane; - import com.fr.general.NameObject; import com.fr.plugin.chart.attr.DefaultAxisHelper; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; @@ -47,7 +46,7 @@ public class VanChartStackedAndAxisListControlPane extends VanChartUIListControl } public void populate(VanChartRectanglePlot plot) { - this.plot = plot; + setPlot(plot); String[] axisXNames = DefaultAxisHelper.getXAxisNames(plot); String[] axisYNames = DefaultAxisHelper.getYAxisNames(plot); diff --git a/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPiePlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPiePlotPane.java index 610f6417e..981956be0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPiePlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPiePlotPane.java @@ -30,7 +30,7 @@ public class VanChartPiePlotPane extends AbstractVanChartTypePane { return new String[]{ com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_New_Pie"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_SameArc_Pie"), - com.fr.design.i18n.Toolkit.i18nText("Plugin-ChartF_DifferentArcPie") + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_DifferArc_Pie") }; } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index d7cc7ea85..e59069f71 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -61,6 +61,8 @@ import com.fr.form.ui.container.WLayout; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.page.PaperSettingProvider; +import com.fr.report.cell.Elem; +import com.fr.report.cell.cellattr.CellImage; import com.fr.report.worksheet.FormElementCase; import com.fr.stable.ArrayUtils; import com.fr.stable.Constants; @@ -465,7 +467,10 @@ public class JForm extends JTemplate implements BaseJForm { // ////////////////for toolbarMenuAdapter////////////////////////////// // //////////////////////////////////////////////////////////////////// - + @Override + public void setPictureElem(Elem elem, CellImage cellImage) { + elem.setValue(cellImage.getImage()); + } /** * 目标菜单 * diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java index 60a7f2c79..814a4ebec 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java @@ -87,7 +87,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane { */ public JPanel createContentPane() { JPanel downPane = new JPanel(new BorderLayout()); - downPane.add(new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Auto_Adjust_Size"), HEAD_WDITH, HEAD_HEIGTH, seniorPane()), BorderLayout.NORTH); + downPane.add(new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advaced"), HEAD_WDITH, HEAD_HEIGTH, seniorPane()), BorderLayout.NORTH); downPane.add(new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Pagination"), HEAD_WDITH, HEAD_HEIGTH, pagePane()), BorderLayout.CENTER); JPanel contentPane = new JPanel(new BorderLayout(0, 0)); contentPane.add(new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic"), HEAD_WDITH, HEAD_HEIGTH, basicPane()), BorderLayout.NORTH); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index 33f1558b9..e9b12e7b1 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -6,7 +6,6 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.TemplatePane; import com.fr.design.mainframe.loghandler.DesignerLogHandler; import com.fr.event.EventDispatcher; - import com.fr.log.FineLoggerFactory; import com.fr.serialization.SerializerHelper; import com.fr.stable.ArrayUtils; @@ -21,7 +20,9 @@ import io.socket.client.IO; import io.socket.client.Socket; import io.socket.emitter.Emitter; -import javax.swing.*; +import javax.swing.JOptionPane; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; import java.io.IOException; import java.net.URI; import java.net.URL; @@ -80,9 +81,17 @@ public class DesignerSocketIO { @Override public void call(Object... objects) { if (status != Status.Disconnecting) { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), - null, 0, UIManager.getIcon("OptionPane.errorIcon")); - TemplatePane.getInstance().editItems(); + try { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), + null, 0, UIManager.getIcon("OptionPane.errorIcon")); + TemplatePane.getInstance().editItems(); + } + }); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } } status = Status.Disconnected; } diff --git a/designer-realize/src/main/java/com/fr/start/Designer.java b/designer-realize/src/main/java/com/fr/start/Designer.java index 8747921dd..c362916c9 100644 --- a/designer-realize/src/main/java/com/fr/start/Designer.java +++ b/designer-realize/src/main/java/com/fr/start/Designer.java @@ -38,9 +38,7 @@ import com.fr.design.module.DesignModuleFactory; import com.fr.design.utils.DesignUtils; import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; - import com.fr.module.Module; import com.fr.module.ModuleContext; import com.fr.stable.BuildContext; @@ -57,9 +55,13 @@ import com.fr.start.preload.ImagePreLoader; import com.fr.start.server.ServerTray; import com.fr.workspace.WorkContext; -import javax.swing.*; +import javax.swing.JComponent; +import javax.swing.JPanel; import javax.swing.border.MatteBorder; -import java.awt.*; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; @@ -125,14 +127,6 @@ public class Designer extends BaseDesigner { private static void preloadResource() { ExecutorService service = Executors.newCachedThreadPool(); - service.submit(new Runnable() { - @Override - public void run() { - CloudCenter.getInstance(); - Cursor cursor = UIConstants.CELL_DEFAULT_CURSOR; - } - }); - service.submit(new Runnable() { @Override public void run() {