Browse Source

CORE-113 修改功能点记录的API

master
richie 6 years ago
parent
commit
2a0731adeb
  1. 16
      designer-form/src/main/java/com/fr/design/designer/beans/actions/FormWidgetEditAction.java
  2. 10
      designer-form/src/main/java/com/fr/design/mainframe/actions/FormMobileAttrAction.java
  3. 12
      designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java
  4. 10
      designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java
  5. 8
      designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java

16
designer-form/src/main/java/com/fr/design/designer/beans/actions/FormWidgetEditAction.java

@ -3,12 +3,7 @@ package com.fr.design.designer.beans.actions;
import com.fr.design.actions.TemplateComponentAction; import com.fr.design.actions.TemplateComponentAction;
import com.fr.design.designer.beans.actions.behavior.UpdateBehavior; import com.fr.design.designer.beans.actions.behavior.UpdateBehavior;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.general.Inter;
import com.fr.plugin.ExtraClassManager;
import com.fr.stable.ReportFunctionProcessor;
import com.fr.stable.fun.FunctionProcessor;
import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
public abstract class FormWidgetEditAction extends TemplateComponentAction<FormDesigner> { public abstract class FormWidgetEditAction extends TemplateComponentAction<FormDesigner> {
@ -32,17 +27,6 @@ public abstract class FormWidgetEditAction extends TemplateComponentAction<FormD
@Override @Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
super.actionPerformed(evt); super.actionPerformed(evt);
// 记录功能点
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
FunctionProcessor functionProcessor;
if (evt.getSource() instanceof JButton) {
functionProcessor = ReportFunctionProcessor.FORM_WIDGET_EDIT_TOOLBAR;
} else {
functionProcessor = ReportFunctionProcessor.FORM_WIDGET_EDIT_POPUPMENU;
}
processor.recordFunction(functionProcessor);
}
} }
public void setUpdateBehavior(UpdateBehavior updateBehavior) { public void setUpdateBehavior(UpdateBehavior updateBehavior) {

10
designer-form/src/main/java/com/fr/design/mainframe/actions/FormMobileAttrAction.java

@ -15,11 +15,8 @@ import com.fr.file.FILE;
import com.fr.form.main.Form; import com.fr.form.main.Form;
import com.fr.form.main.mobile.FormMobileAttr; import com.fr.form.main.mobile.FormMobileAttr;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.ExtraClassManager;
import com.fr.stable.ReportFunctionProcessor;
import com.fr.stable.fun.FunctionProcessor;
import javax.swing.KeyStroke; import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
/** /**
@ -67,11 +64,6 @@ public class FormMobileAttrAction extends JTemplateAction<JForm> {
// 放到后面。如果提前 return 了,则仍然处于未设置状态,不要添加 // 放到后面。如果提前 return 了,则仍然处于未设置状态,不要添加
jf.getTarget().addAttrMark(new MobileOnlyTemplateAttrMark()); jf.getTarget().addAttrMark(new MobileOnlyTemplateAttrMark());
} }
// 记录功能点
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
processor.recordFunction(ReportFunctionProcessor.MOBILE_TEMPLATE_FRM);
}
// 设置移动端属性并刷新界面 // 设置移动端属性并刷新界面
formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后 formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后
((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified();

12
designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java

@ -7,12 +7,9 @@ import com.fr.design.mainframe.widget.editors.ITextComponent;
import com.fr.design.mainframe.widget.renderer.WatermarkRenderer; import com.fr.design.mainframe.widget.renderer.WatermarkRenderer;
import com.fr.design.mainframe.widget.wrappers.WatermarkWrapper; import com.fr.design.mainframe.widget.wrappers.WatermarkWrapper;
import com.fr.design.report.WatermarkPane; import com.fr.design.report.WatermarkPane;
import com.fr.plugin.ExtraClassManager;
import com.fr.stable.ReportFunctionProcessor;
import com.fr.stable.fun.FunctionProcessor;
import javax.swing.SwingUtilities; import javax.swing.*;
import java.awt.Dimension; import java.awt.*;
/** /**
* Created by plough on 2018/5/15. * Created by plough on 2018/5/15.
@ -43,11 +40,6 @@ public class AccessibleBodyWatermarkEditor extends UneditableAccessibleEditor {
public void doOk() { public void doOk() {
setValue(watermarkPane.update()); setValue(watermarkPane.update());
fireStateChanged(); fireStateChanged();
// 功能点
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
processor.recordFunction(ReportFunctionProcessor.WATERMARK);
}
} }
}); });
watermarkPane.populate((WatermarkAttr) getValue()); watermarkPane.populate((WatermarkAttr) getValue());

10
designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java

@ -12,12 +12,9 @@ import com.fr.file.FILE;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.main.TemplateWorkBook; import com.fr.main.TemplateWorkBook;
import com.fr.plugin.ExtraClassManager;
import com.fr.report.mobile.ElementCaseMobileAttr; import com.fr.report.mobile.ElementCaseMobileAttr;
import com.fr.stable.ReportFunctionProcessor;
import com.fr.stable.fun.FunctionProcessor;
import javax.swing.KeyStroke; import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
/** /**
@ -67,11 +64,6 @@ public class ReportMobileAttrAction extends JWorkBookAction{
// 放到后面。如果提前 return 了,则仍然处于未设置状态,不要添加 // 放到后面。如果提前 return 了,则仍然处于未设置状态,不要添加
wbTpl.addAttrMark(new MobileOnlyTemplateAttrMark()); wbTpl.addAttrMark(new MobileOnlyTemplateAttrMark());
} }
// 记录功能点
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
processor.recordFunction(ReportFunctionProcessor.MOBILE_TEMPLATE_CPT);
}
// 设置移动端属性并刷新界面 // 设置移动端属性并刷新界面
wbTpl.setReportMobileAttr(elementCaseMobileAttr); // 会同时修改页面设置,放到最后 wbTpl.setReportMobileAttr(elementCaseMobileAttr); // 会同时修改页面设置,放到最后
jwb.fireTargetModified(); jwb.fireTargetModified();

8
designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java

@ -9,10 +9,7 @@ import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.report.WatermarkPane; import com.fr.design.report.WatermarkPane;
import com.fr.main.impl.WorkBook; import com.fr.main.impl.WorkBook;
import com.fr.plugin.ExtraClassManager;
import com.fr.report.core.ReportUtils; import com.fr.report.core.ReportUtils;
import com.fr.stable.ReportFunctionProcessor;
import com.fr.stable.fun.FunctionProcessor;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -45,11 +42,6 @@ public class ReportWatermarkAction extends JWorkBookAction {
public void doOk() { public void doOk() {
wbTpl.addAttrMark(watermarkPane.update()); wbTpl.addAttrMark(watermarkPane.update());
jwb.fireTargetModified(); jwb.fireTargetModified();
// 功能点
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
processor.recordFunction(ReportFunctionProcessor.WATERMARK);
}
} }
}).setVisible(true); }).setVisible(true);
} }

Loading…
Cancel
Save