Browse Source

Merging in latest from upstream (DESIGN/design:refs/heads/release/10.0)

* commit 'a64caed38ac74f2e4c1ae5be6717484f7b8707dd':
  REPORT-9845 & REPORT-9849 & REPORT-9883
  REPORT-9845 & REPORT-9849 & REPORT-9883
  REPORT-9843 【10.0二轮回归】ie9及以上版本,预览添加css样式的模板,样式不加载
  CORE-113 功能点监控,全部使用注解 @Focus来实现
master
yaoh.wu 6 years ago
parent
commit
a1020a6869
  1. 5
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java
  2. 61
      designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java
  3. 16
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  4. 9
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java
  5. 9
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java
  6. 20
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java
  7. 6
      designer-realize/src/main/java/com/fr/grid/selection/FloatSelection.java
  8. 7
      designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java

5
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java

@ -246,8 +246,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;
}
}

61
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<Class<?>> classes = new HashSet<Class<?>>();
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();
}
}
}

16
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<ChartCollection> implemen
try {
Chart newChart = (Chart) chart.clone();
editingCollection.addNamedChart(name, newChart);
editingCollection.addFunctionRecord(newChart);
} catch (CloneNotSupportedException e1) {
FineLoggerFactory.getLogger().error("Error in Clone");
}

9
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<ChartCollection> {
}
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 {

9
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<ChartCollection> {
List<TopDefinitionProvider> eachLayerDataDefinitionList = new ArrayList<TopDefinitionProvider>();
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());
}

20
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);
}
}
}
});

6
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());

7
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) {

Loading…
Cancel
Save