From 5bd4469238c15b8dd97d2943159acf261c5faa40 Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Tue, 10 Oct 2017 16:10:31 +0800 Subject: [PATCH] =?UTF-8?q?RES-21=09=E5=9C=A8core=E4=B8=AD=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BA=91=E6=8E=88=E6=9D=83=E7=9A=84=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=20=E4=BA=91=E6=8E=88=E6=9D=83=E7=9A=84=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=BF=98=E6=B2=A1=E5=86=99=EF=BC=8C=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E7=9A=84=E5=86=99=E5=AE=8C=E5=8F=AF=E4=BB=A5=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/errorinfo/ErrorInfoUploader.java | 10 +++++++--- .../fr/design/actions/file/SwitchExistEnv.java | 2 -- .../help/alphafine/AlphaFineConfigManager.java | 6 +++--- .../com/fr/design/mainframe/DesignerFrame.java | 5 +++-- designer_base/src/com/fr/env/RemoteEnv.java | 15 ++++++--------- designer_base/src/com/fr/env/SignIn.java | 7 ++++--- .../src/com/fr/design/chart/ChartTypePane.java | 10 ++++------ 7 files changed, 27 insertions(+), 28 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java b/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java index 07aadbe915..2651fdd1cb 100644 --- a/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java +++ b/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java @@ -1,11 +1,15 @@ package com.fr.design.mainframe.errorinfo; import com.fr.base.FRContext; -import com.fr.base.FRCoreContext; -import com.fr.general.*; +import com.fr.general.ComparatorUtils; +import com.fr.general.FRLogger; +import com.fr.general.GeneralContext; +import com.fr.general.IOUtils; +import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONException; import com.fr.json.JSONObject; +import com.fr.license.function.VT4FR; import com.fr.stable.CodeUtils; import com.fr.stable.EnvChangedListener; import com.fr.stable.ProductConstants; @@ -41,7 +45,7 @@ public class ErrorInfoUploader { }); // 这个控制没啥意义, 主要在于宣传功能. - licSupport = VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support(); + licSupport = VT4FR.AlphaFine.support(); } private ErrorInfoUploader() { diff --git a/designer_base/src/com/fr/design/actions/file/SwitchExistEnv.java b/designer_base/src/com/fr/design/actions/file/SwitchExistEnv.java index fbb7d0ae1e..6b26887671 100644 --- a/designer_base/src/com/fr/design/actions/file/SwitchExistEnv.java +++ b/designer_base/src/com/fr/design/actions/file/SwitchExistEnv.java @@ -3,7 +3,6 @@ package com.fr.design.actions.file; import com.fr.base.BaseUtils; import com.fr.base.Env; import com.fr.base.FRContext; -import com.fr.base.FRCoreContext; import com.fr.dav.LocalEnv; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.UpdateAction; @@ -118,7 +117,6 @@ public class SwitchExistEnv extends MenuDef { return; } SignIn.signIn(selectedEnv); - FRCoreContext.resetBytes(); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshToolArea(); fireDSChanged(); } catch (Exception em) { diff --git a/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java b/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java index 8d58ce4578..b601a34298 100644 --- a/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java +++ b/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java @@ -1,8 +1,7 @@ package com.fr.design.actions.help.alphafine; import com.fr.base.FRContext; -import com.fr.base.FRCoreContext; -import com.fr.general.VT4FR; +import com.fr.license.function.VT4FR; import com.fr.stable.OperatingSystem; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; @@ -75,7 +74,8 @@ public class AlphaFineConfigManager implements XMLable { } public static boolean isALPHALicAvailable() { - return FRContext.getCurrentEnv() != null && VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support(); + + return FRContext.getCurrentEnv() != null && VT4FR.AlphaFine.support(); } @Override diff --git a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java index 5135cf2998..6bf974e9dc 100644 --- a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java +++ b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java @@ -10,7 +10,6 @@ import com.fr.design.DesignModelAdapter; import com.fr.design.DesignState; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; -import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; import com.fr.design.constants.UIConstants; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.TableDataTreePane; @@ -42,6 +41,7 @@ import com.fr.general.ComparatorUtils; import com.fr.general.FRLogger; import com.fr.general.GeneralContext; import com.fr.general.Inter; +import com.fr.general.env.EnvContext; import com.fr.plugin.context.PluginContext; import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.manage.PluginFilter; @@ -966,8 +966,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta Env currentEnv = FRContext.getCurrentEnv(); try { + EnvContext.fireBeforeSignOut(); currentEnv.signOut(); - GeneralContext.fireEnvSignOutListener(); + EnvContext.fireAfterSignOut(); } catch (Exception e) { FRContext.getLogger().error(e.getMessage(), e); } diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index 165ed3468a..efcf5f5832 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -3,7 +3,6 @@ package com.fr.env; import com.fr.base.AbstractEnv; import com.fr.base.EnvException; import com.fr.base.FRContext; -import com.fr.base.FRCoreContext; import com.fr.base.ModifiedTable; import com.fr.base.Parameter; import com.fr.base.StoreProcedureParameter; @@ -35,16 +34,16 @@ import com.fr.general.FRLogger; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.general.LogRecordTime; -import com.fr.general.VT4FR; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; import com.fr.json.JSONException; import com.fr.json.JSONObject; +import com.fr.license.function.VT4FR; +import com.fr.regist.License; import com.fr.share.ShareConstants; import com.fr.stable.ArrayUtils; import com.fr.stable.EncodeConstants; import com.fr.stable.JavaCompileInfo; -import com.fr.stable.LicUtils; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; @@ -56,8 +55,7 @@ import com.fr.stable.xml.XMLTools; import com.fr.stable.xml.XMLableReader; import com.fr.web.ResourceConstants; -import javax.swing.JOptionPane; -import javax.swing.UIManager; +import javax.swing.*; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; @@ -65,7 +63,7 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import java.awt.Component; +import java.awt.*; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -198,7 +196,7 @@ public class RemoteEnv extends AbstractEnv { private String createUserID() throws EnvException { // 如果登录之后userID还是null if (this.userID == null) { - if (!VT4FR.REMOTE_DESIGN.support() && licNotSupport <= 0) { + if (!VT4FR.RemoteDesign.support() && licNotSupport <= 0) { licNotSupport++; JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Lic_does_not_Support_Remote")); } @@ -1438,7 +1436,6 @@ public class RemoteEnv extends AbstractEnv { return; } SignIn.signIn(remoteEnv); - FRCoreContext.resetBytes(); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshToolArea(); } catch (Exception em) { FRContext.getLogger().error(em.getMessage(), em); @@ -2036,7 +2033,7 @@ public class RemoteEnv extends AbstractEnv { @Override public String getLicName() { - return LicUtils.FILE_NAME; + return License.FILE_NAME; } @Override diff --git a/designer_base/src/com/fr/env/SignIn.java b/designer_base/src/com/fr/env/SignIn.java index 79e6772341..355fb3c92f 100644 --- a/designer_base/src/com/fr/env/SignIn.java +++ b/designer_base/src/com/fr/env/SignIn.java @@ -3,9 +3,9 @@ package com.fr.env; import com.fr.base.Env; import com.fr.base.FRContext; -import com.fr.general.ComparatorUtils; import com.fr.design.utils.DesignUtils; -import com.fr.general.GeneralContext; +import com.fr.general.ComparatorUtils; +import com.fr.general.env.EnvContext; public class SignIn { @@ -33,8 +33,9 @@ public class SignIn { return; } try { - GeneralContext.fireEnvSignOutListener(); + EnvContext.fireBeforeSignOut(); lastSelectedEnv.signOut(); + EnvContext.fireAfterSignOut(); } catch (Exception e) { FRContext.getLogger().error(e.getMessage(), e); } diff --git a/designer_chart/src/com/fr/design/chart/ChartTypePane.java b/designer_chart/src/com/fr/design/chart/ChartTypePane.java index 01040d6c54..1c056cd23b 100644 --- a/designer_chart/src/com/fr/design/chart/ChartTypePane.java +++ b/designer_chart/src/com/fr/design/chart/ChartTypePane.java @@ -5,7 +5,6 @@ package com.fr.design.chart; */ import com.fr.base.FRContext; -import com.fr.base.FRCoreContext; import com.fr.chart.base.ChartInternationalNameContentBean; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; @@ -17,8 +16,8 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; -import com.fr.general.RegistEditionException; -import com.fr.general.VT4FR; +import com.fr.license.exception.RegistEditionException; +import com.fr.license.function.VT4FR; import javax.swing.*; import javax.swing.event.ListSelectionEvent; @@ -159,7 +158,7 @@ public class ChartTypePane extends ChartCommonWizardPane { if(chart.getPlot() != null){ if(chart.getPlot() instanceof MapPlot && !supportMap()){ JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Chart-Map_Not_Supported")); - throw new RegistEditionException(VT4FR.CHART_MAP); + throw new RegistEditionException(VT4FR.ChartMap); } if (chart.getPlot() != null) { @@ -173,8 +172,7 @@ public class ChartTypePane extends ChartCommonWizardPane { } private boolean supportMap() { - byte[] bytes = FRCoreContext.getBytes(); - return VT4FR.isLicAvailable(bytes) && VT4FR.CHART_MAP.support(); + return VT4FR.ChartMap.support(); } public void update(ChartCollection cc) {