From e51bfb69a3499db0df18b75b25cb712a6e0aae20 Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 20 Jul 2018 16:18:15 +0800 Subject: [PATCH 1/4] =?UTF-8?q?CORE-113=20=E5=8A=9F=E8=83=BD=E7=82=B9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=EF=BC=8C=E5=85=A8=E9=83=A8=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3=20@Focus=E6=9D=A5=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/ChartTypeButtonPane.java | 16 +++------------ .../designer/data/comp/DrillMapDataPane.java | 9 ++------- .../comp/EachLayerDataDefinitionPane.java | 9 ++------- .../mobile/ChartEditorDefinePane.java | 20 ++++--------------- 4 files changed, 11 insertions(+), 43 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index 6690224c8..c29616d2c 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -18,21 +18,12 @@ import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.mainframe.chart.gui.ChartTypePane.ComboBoxPane; import com.fr.general.ComparatorUtils; -import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; -import javax.swing.BorderFactory; -import javax.swing.BoxLayout; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Graphics; -import java.awt.GridLayout; -import java.awt.Image; -import java.awt.Rectangle; +import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; @@ -140,7 +131,6 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen try { Chart newChart = (Chart) chart.clone(); editingCollection.addNamedChart(name, newChart); - editingCollection.addFunctionRecord(newChart); } catch (CloneNotSupportedException e1) { FineLoggerFactory.getLogger().error("Error in Clone"); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java index 0d7f07c06..44c314df5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java @@ -1,6 +1,5 @@ package com.fr.van.chart.drillmap.designer.data.comp; -import com.fr.base.chart.BaseChart; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.beans.BasicBeanPane; @@ -13,7 +12,7 @@ import com.fr.plugin.chart.drillmap.data.DrillMapDefinition; import com.fr.plugin.chart.type.MapType; import com.fr.van.chart.map.designer.data.MapDataPaneHelper; -import java.awt.BorderLayout; +import java.awt.*; import java.util.ArrayList; import java.util.List; @@ -102,11 +101,7 @@ public class DrillMapDataPane extends BasicBeanPane { } if(dataDefinitionType.getSelectedIndex() == 0){ drillMapDefinition.setFromBottomData(true); - ChartCollection temp = new ChartCollection(new Chart()){ - @Override - public void addFunctionRecord(BaseChart chart) { - } - }; + ChartCollection temp = new ChartCollection(new Chart()); bottomDataDefinitionPane.updateBean(temp); drillMapDefinition.setBottomDataDefinition(temp.getSelectedChart().getFilterDefinition()); } else { diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java index 15256e82f..4c3c44329 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java @@ -1,6 +1,5 @@ package com.fr.van.chart.drillmap.designer.data.comp; -import com.fr.base.chart.BaseChart; import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; @@ -18,7 +17,7 @@ import com.fr.plugin.chart.type.MapType; import com.fr.van.chart.map.designer.data.MapDataPaneHelper; import javax.swing.tree.DefaultMutableTreeNode; -import java.awt.CardLayout; +import java.awt.*; import java.util.ArrayList; import java.util.List; @@ -116,11 +115,7 @@ public class EachLayerDataDefinitionPane extends MultiTabPane { List eachLayerDataDefinitionList = new ArrayList(); for(BasicPane basicPane : paneList){ if(basicPane instanceof SingleLayerDataDefinitionPane){ - ChartCollection temp = new ChartCollection(new Chart()){ - @Override - public void addFunctionRecord(BaseChart chart) { - } - }; + ChartCollection temp = new ChartCollection(new Chart()); ((SingleLayerDataDefinitionPane) basicPane).updateBean(temp); eachLayerDataDefinitionList.add(temp.getSelectedChart().getFilterDefinition()); } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java index fe299bfaa..67a5edd7a 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java @@ -18,20 +18,12 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; -import com.fr.form.FormFunctionProcessor; import com.fr.form.ui.BaseChartEditor; import com.fr.form.ui.container.WFitLayout; import com.fr.general.Inter; -import com.fr.plugin.ExtraClassManager; -import com.fr.stable.fun.FunctionProcessor; - -import javax.swing.BorderFactory; -import javax.swing.JPanel; -import javax.swing.SwingConstants; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; + +import javax.swing.*; +import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; @@ -175,11 +167,7 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane { updateTipLabel(); ChartMobileFitAttrState selectedAttr = (ChartMobileFitAttrState)((Item)e.getItem()).getValue(); if (selectedAttr.getState() != ChartMobileFitAttrState.AUTO.getState()) { - // 功能埋点 - FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor(); - if (processor != null) { - processor.recordFunction(FormFunctionProcessor.MOBILE_CHART_ADAPTIVITY); - } + } } }); From 9a944e03a5ca4737b6ead3c6539fe94e152589da Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 20 Jul 2018 16:30:12 +0800 Subject: [PATCH 2/4] =?UTF-8?q?REPORT-9843=20=E3=80=9010.0=E4=BA=8C?= =?UTF-8?q?=E8=BD=AE=E5=9B=9E=E5=BD=92=E3=80=91ie9=E5=8F=8A=E4=BB=A5?= =?UTF-8?q?=E4=B8=8A=E7=89=88=E6=9C=AC=EF=BC=8C=E9=A2=84=E8=A7=88=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0css=E6=A0=B7=E5=BC=8F=E7=9A=84=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=EF=BC=8C=E6=A0=B7=E5=BC=8F=E4=B8=8D=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/FineEmbedServerActivator.java | 61 +++++++------------ 1 file changed, 23 insertions(+), 38 deletions(-) diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java index 2292da99a..176db579a 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java @@ -12,8 +12,6 @@ import com.fr.third.springframework.web.context.support.AnnotationConfigWebAppli import com.fr.workspace.WorkContext; import org.apache.catalina.Context; import org.apache.catalina.LifecycleException; -import org.apache.catalina.Wrapper; - import org.apache.catalina.loader.WebappLoader; import org.apache.catalina.startup.Tomcat; @@ -25,12 +23,12 @@ import java.util.Set; * Created by juhaoyu on 2018/6/5. */ public class FineEmbedServerActivator extends Activator { - + private Tomcat tomcat; - + @Override public synchronized void start() { - + try { //初始化tomcat initTomcat(); @@ -39,10 +37,10 @@ public class FineEmbedServerActivator extends Activator { FineLoggerFactory.getLogger().error(e.getMessage(), e); } } - + @Override public synchronized void stop() { - + try { stopSpring(); stopServerActivator(); @@ -51,75 +49,62 @@ public class FineEmbedServerActivator extends Activator { FineLoggerFactory.getLogger().error(e.getMessage(), e); } } - + private void initTomcat() { - + tomcat = new Tomcat(); - + tomcat.setPort(DesignerEnvManager.getEnvManager().getEmbedServerPort()); // 设置解码uri使用的字符编码 tomcat.getConnector().setURIEncoding(EncodeConstants.ENCODING_UTF_8); String docBase = new File(WorkContext.getCurrent().getPath()).getParent(); String appName = "/" + FRContext.getCommonOperator().getAppName(); Context context = tomcat.addContext(appName, docBase); - addDefaultServlet(context); + Tomcat.initWebappDefaults(context); //覆盖tomcat的WebAppClassLoader context.setLoader(new FRTomcatLoader()); - + //直接指定initializer,tomcat就不用再扫描一遍了 SpringServletContainerInitializer initializer = new SpringServletContainerInitializer(); Set> classes = new HashSet>(); classes.add(FineWebApplicationInitializer.class); context.addServletContainerInitializer(initializer, classes); } - - private void addDefaultServlet(Context context) { - - Wrapper defaultServlet = context.createWrapper(); - defaultServlet.setName("default"); - defaultServlet.setServletClass("org.apache.catalina.servlets.DefaultServlet"); - defaultServlet.addInitParameter("debug", "0"); - defaultServlet.addInitParameter("listings", "false"); - defaultServlet.setLoadOnStartup(1); - defaultServlet.setOverridable(true); - context.addChild(defaultServlet); - context.addServletMapping("/","default"); - } - - + + private void stopServerActivator() { - + ModuleRole.ServerRoot.stop(); } - + private void stopSpring() { - + AnnotationConfigWebApplicationContext context = ModuleRole.ServerRoot.getSingleton(AnnotationConfigWebApplicationContext.class); if (context != null) { context.stop(); context.destroy(); } } - + private void stopTomcat() throws LifecycleException { - + tomcat.stop(); tomcat.destroy(); } - - + + /** * Created by juhaoyu on 2018/6/5. * 自定义的tomcat loader,主要用于防止内置服务器再加载一遍class */ private static class FRTomcatLoader extends WebappLoader { - + @Override public ClassLoader getClassLoader() { - + return this.getClass().getClassLoader(); } - + } - + } From bdceb6ababca43118a94f09ea99440b8e1195047 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Fri, 20 Jul 2018 16:34:48 +0800 Subject: [PATCH 3/4] REPORT-9845 & REPORT-9849 & REPORT-9883 --- .../java/com/fr/design/file/HistoryTemplateListPane.java | 6 ++++-- .../main/java/com/fr/grid/selection/FloatSelection.java | 6 +++++- .../fr/quickeditor/floatquick/FloatStringQuickEditor.java | 7 ++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java index cff8675c4..22b9ab7c0 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java @@ -22,6 +22,7 @@ import com.fr.general.Inter; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; import com.fr.workspace.WorkContext; @@ -246,8 +247,9 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C */ public int contains(String filename) { for (int i = 0; i < historyList.size(); i++) { - String historyPath = historyList.get(i).getPath(); - if (ComparatorUtils.equals(historyPath, filename)) { + String historyPath = historyList.get(i).getPath().replaceAll("/", "\\\\"); + //文件路径是全路径,历史路径是reportlets/模板名 + if (filename.endsWith(historyPath)) { return i; } } diff --git a/designer-realize/src/main/java/com/fr/grid/selection/FloatSelection.java b/designer-realize/src/main/java/com/fr/grid/selection/FloatSelection.java index d6d3f627f..15fc359eb 100644 --- a/designer-realize/src/main/java/com/fr/grid/selection/FloatSelection.java +++ b/designer-realize/src/main/java/com/fr/grid/selection/FloatSelection.java @@ -235,7 +235,11 @@ public class FloatSelection extends Selection { public QuickEditor getQuickEditor(TargetComponent tc) { ElementCasePane ePane = (ElementCasePane) tc; FloatElement selectedFloat = ePane.getEditingElementCase().getFloatElement(selectedFloatName); - Object value = selectedFloat.getValue(); + Object value = null; + //处理撤销时npe + if(selectedFloat != null) { + value = selectedFloat.getValue(); + } value = value == null ? "" : value; value = value instanceof Number ? value.toString() : value; QuickEditor editor = ActionFactory.getFloatEditor(value.getClass()); diff --git a/designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java index eae3e81dc..3e3211259 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java @@ -90,7 +90,12 @@ public class FloatStringQuickEditor extends FloatQuickEditor { @Override protected void refreshDetails() { String str; - Object value = floatElement.getValue(); + Object value = null; + //处理撤销时npe + if (floatElement != null){ + value = floatElement.getValue(); + } + if (value == null) { str = StringUtils.EMPTY; } else if (value instanceof BaseFormula) { From 7675f2ad2775156c40488a0a3564fee773631e43 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Fri, 20 Jul 2018 16:37:36 +0800 Subject: [PATCH 4/4] REPORT-9845 & REPORT-9849 & REPORT-9883 --- .../main/java/com/fr/design/file/HistoryTemplateListPane.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java index 22b9ab7c0..7e2f34593 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java @@ -22,7 +22,6 @@ import com.fr.general.Inter; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; import com.fr.stable.StableUtils; -import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; import com.fr.workspace.WorkContext;