Browse Source

Merge pull request #152 in BA/design from ~XIAXIANG/design1:dev to dev

* commit '30edd83e8f84197c0f8b8efd9ea5e2cfe6a45acb':
  rt
  rt
  rt
  rt
  rt
  rt
  rt
  rt
  rt
  rt
  rt
master
superman 9 years ago
parent
commit
e39fbcb2d1
  1. 12
      designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java
  2. 15
      designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java
  3. 24
      designer_form/src/com/fr/design/designer/creator/XElementCase.java

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

@ -1,6 +1,7 @@
package com.fr.design.fun;
import com.fr.stable.fun.Level;
import com.fr.stable.fun.ReportFitAttrProvider;
import java.beans.PropertyDescriptor;
@ -17,8 +18,17 @@ public interface FormElementCaseEditorProcessor extends Level{
/**
* 生成属性表
* @param temp 传入当前操作的class
* @param reportFitAttr 传入的自适应属性
* @return 返回属性表
*/
PropertyDescriptor[] createPropertyDescriptor(Class<?> temp);
PropertyDescriptor[] createPropertyDescriptor(Class<?> temp, ReportFitAttrProvider reportFitAttr);
/**
* 返回pc自适应属性值
* @param fitAttrProvider 传入的自适应属性
* @return 返回pc自适应属性值
*/
int getFitStateInPC(ReportFitAttrProvider fitAttrProvider);
}

15
designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java

@ -1,6 +1,7 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.FormElementCaseEditorProcessor;
import com.fr.stable.fun.ReportFitAttrProvider;
import java.beans.PropertyDescriptor;
@ -17,9 +18,21 @@ public abstract class AbstractFormElementCaseEditorProcessor implements FormElem
/**
* 生成属性表
* @param temp 传入当前操作的class
* @param reportFitAttr 传入的自适应属性
* @return 返回属性表
*/
public PropertyDescriptor[] createPropertyDescriptor(Class<?> temp){
@Override
public PropertyDescriptor[] createPropertyDescriptor(Class<?> temp, ReportFitAttrProvider reportFitAttr) {
return new PropertyDescriptor[0];
}
/**
* 返回pc自适应属性值
* @param fitAttrProvider 传入的自适应属性
* @return 返回pc自适应属性值
*/
@Override
public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) {
return 0;
}
}

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

@ -9,7 +9,10 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.CoverReportPane;
import com.fr.design.mainframe.EditingMouseListener;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.widget.editors.*;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.editors.BooleanEditor;
import com.fr.design.mainframe.widget.editors.PaddingMarginEditor;
import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor;
import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer;
import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer;
import com.fr.form.FormElementCaseContainerProvider;
@ -18,6 +21,8 @@ import com.fr.form.ui.ElementCaseEditor;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.stable.fun.FitProvider;
import com.fr.stable.fun.ReportFitAttrProvider;
import javax.swing.*;
import java.awt.*;
@ -29,13 +34,17 @@ import java.beans.PropertyDescriptor;
public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider{
private UILabel imageLable;
private JPanel coverPanel;
private FormDesigner designer;
public XElementCase(ElementCaseEditor widget, Dimension initSize) {
super(widget, initSize);
}
protected void initXCreatorProperties() {
super.initXCreatorProperties();
// 报表块初始化时要加载对应的borderStyle
initBorderStyle();
}
@ -78,14 +87,21 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
};
FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getPropertyTableEditor();
if (processor == null){
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner();
FitProvider wbTpl = (FitProvider) designer.getTarget();
ReportFitAttrProvider fitAttr = wbTpl.getFitAttr();
ElementCaseEditor editor = this.toData();
ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : editor.getReportFitAttr();
PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), reportFitAttr);
if (processor == null) {
return propertyTableEditor;
}
PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass());
if (editor.getReportFitAttr() == null) {
editor.setReportFitInPc(processor.getFitStateInPC(fitAttr));
}
return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor);
}
@Override
protected String getIconName() {
return "text_field_16.png";

Loading…
Cancel
Save