Browse Source

REPORT-364 和自适应用的同一个接口处理

master
PanLi320 8 years ago
parent
commit
ccc9c645af
  1. 12
      designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java
  2. 17
      designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java
  3. 26
      designer_form/src/com/fr/design/designer/creator/XElementCase.java

12
designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java → designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java

@ -1,20 +1,26 @@
package com.fr.design.fun; package com.fr.design.fun;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.stable.fun.ReportFitAttrProvider; import com.fr.stable.fun.ReportFitAttrProvider;
import com.fr.stable.fun.mark.Immutable; import com.fr.form.main.Form;
import com.fr.stable.fun.mark.Mutable;
import java.beans.PropertyDescriptor; import java.beans.PropertyDescriptor;
/** /**
* Created by zhouping on 2015/9/10. * Created by zhouping on 2015/9/10.
*/ */
public interface FormElementCaseEditorProcessor extends Immutable { public interface FormElementCaseEditorProvider extends Mutable {
String MARK_STRING = "PropertyEditor"; String MARK_STRING = "PropertyEditor";
int CURRENT_LEVEL = 1; int CURRENT_LEVEL = 1;
//加个provider返回tab的接口
//design_base依赖了form
PropertyDescriptor[] createPropertyDescriptor (Class<?> temp, Form reportAttr, ElementCaseEditor editor);
/** /**
* 生成属性表 * 生成属性表
* @param temp 传入当前操作的class * @param temp 传入当前操作的class
@ -29,6 +35,4 @@ public interface FormElementCaseEditorProcessor extends Immutable {
* @return 返回pc自适应属性值 * @return 返回pc自适应属性值
*/ */
int getFitStateInPC(ReportFitAttrProvider fitAttrProvider); int getFitStateInPC(ReportFitAttrProvider fitAttrProvider);
} }

17
designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java → designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java

@ -1,6 +1,8 @@
package com.fr.design.fun.impl; package com.fr.design.fun.impl;
import com.fr.design.fun.FormElementCaseEditorProcessor; import com.fr.design.fun.FormElementCaseEditorProvider;
import com.fr.form.main.Form;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.stable.fun.ReportFitAttrProvider; import com.fr.stable.fun.ReportFitAttrProvider;
import com.fr.stable.fun.mark.API; import com.fr.stable.fun.mark.API;
@ -9,17 +11,22 @@ import java.beans.PropertyDescriptor;
/** /**
* Created by zhouping on 2015/9/10. * Created by zhouping on 2015/9/10.
*/ */
@API(level = FormElementCaseEditorProcessor.CURRENT_LEVEL) @API(level = FormElementCaseEditorProvider.CURRENT_LEVEL)
public abstract class AbstractFormElementCaseEditorProcessor implements FormElementCaseEditorProcessor { public abstract class AbstractFormElementCaseEditorProvider implements FormElementCaseEditorProvider {
public int currentAPILevel() { public int currentAPILevel() {
return CURRENT_LEVEL; return CURRENT_LEVEL;
} }
public int layerIndex() { @Override
return DEFAULT_LAYER_INDEX; public String mark4Provider() {
return this.getClass().getName();
} }
@Override
public PropertyDescriptor[] createPropertyDescriptor(Class<?> temp, Form reportAttr, ElementCaseEditor editor) {
return new PropertyDescriptor[0];
}
/** /**
* 生成属性表 * 生成属性表

26
designer_form/src/com/fr/design/designer/creator/XElementCase.java

@ -4,8 +4,9 @@ import com.fr.base.BaseUtils;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.designer.properties.mobile.ElementCasePropertyUI; import com.fr.design.designer.properties.mobile.ElementCasePropertyUI;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.fun.FormElementCaseEditorProcessor; import com.fr.design.fun.FormElementCaseEditorProvider;
import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.fun.impl.AbstractFormElementCaseEditorProvider;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.CoverReportPane; import com.fr.design.mainframe.CoverReportPane;
import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.EditingMouseListener;
@ -23,8 +24,7 @@ import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.CoreGraphHelper; import com.fr.stable.CoreGraphHelper;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.stable.fun.FitProvider; import com.fr.form.main.Form;
import com.fr.stable.fun.ReportFitAttrProvider;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -32,6 +32,7 @@ import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.beans.IntrospectionException; import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor; import java.beans.PropertyDescriptor;
import java.util.Set;
public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider{ public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider{
private UILabel imageLable; private UILabel imageLable;
@ -100,25 +101,18 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
}; };
FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getSingle(FormElementCaseEditorProcessor.MARK_STRING); Set<FormElementCaseEditorProvider> set = ExtraDesignClassManager.getInstance().getArray(AbstractFormElementCaseEditorProvider.MARK_STRING);
for (FormElementCaseEditorProvider processor : set) {
if (processor == null) { if (processor == null) {
return propertyTableEditor; return propertyTableEditor;
} }
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner();
FitProvider wbTpl = (FitProvider) designer.getTarget(); Form attr = designer.getTarget();
ReportFitAttrProvider fitAttr = wbTpl.getFitAttr();
ElementCaseEditor editor = this.toData();
//兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应)
if (editor.getFitStateInPC() == 0) {
editor.setReportFitAttr(null);
}
ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : editor.getReportFitAttr();
PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), reportFitAttr);
if (editor.getReportFitAttr() == null) { PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), attr, this.toData());
editor.setReportFitInPc(processor.getFitStateInPC(fitAttr)); propertyTableEditor = (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor);
} }
return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); return propertyTableEditor;
} }
@Override @Override

Loading…
Cancel
Save