Browse Source

Merge pull request #82 in BA/design from ~GARYTU/design:dev to dev

* commit 'd5e6b3fcdf9403945f398a8a4a6c9af3aa8a639d':
  代码可读性改进
  上上次对资讯框的更改撤销
  新功能已实现,手机报表最大高度的限制,测试可行。默认高度比:0.75(75%)。
  设计器资讯框兼容,新的资讯框接受地址
master
superman 9 years ago
parent
commit
2b729b1f38
  1. 97
      designer_form/src/com/fr/design/designer/creator/XElementCase.java

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

@ -7,9 +7,7 @@ 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;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.widget.editors.BooleanEditor; import com.fr.design.mainframe.widget.editors.*;
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.LayoutBorderStyleRenderer;
import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer; import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer;
import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseContainerProvider;
@ -25,6 +23,8 @@ 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.ArrayList;
import java.util.List;
public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider{ public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider{
private UILabel imageLable; private UILabel imageLable;
@ -53,37 +53,66 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
* @return 返回组件属性值 * @return 返回组件属性值
* @throws IntrospectionException 异常 * @throws IntrospectionException 异常
*/ */
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] crp = ((ElementCaseEditor) data).isHeightRestrict() ? revealHeightLimit() : getDefault();
CRPropertyDescriptor[] propertyTableEditor = new CRPropertyDescriptor[]{ FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getPropertyTableEditor();
new CRPropertyDescriptor("widgetName", this.data.getClass()) if (processor == null) {
.setI18NName(Inter.getLocText("Form-Widget_Name")), return crp;
new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( }
WLayoutBorderStyleEditor.class).setRendererClass(LayoutBorderStyleRenderer.class).setI18NName( PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass());
Inter.getLocText("FR-Designer-Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") return (CRPropertyDescriptor[]) ArrayUtils.addAll(crp, extraEditor);
.setPropertyChangeListener(new PropertyChangeAdapter() { }
@Override protected List<CRPropertyDescriptor> createNonListenerProperties() throws IntrospectionException {
public void propertyChange() { CRPropertyDescriptor[] propertyTableEditor = {
initStyle(); new CRPropertyDescriptor("widgetName", this.data.getClass())
} .setI18NName(Inter.getLocText("Form-Widget_Name")),
}), new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass(
new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) WLayoutBorderStyleEditor.class).setRendererClass(LayoutBorderStyleRenderer.class).setI18NName(
.setRendererClass(PaddingMarginCellRenderer.class).setI18NName(Inter.getLocText("FR-Layout_Padding")) Inter.getLocText("FR-Designer-Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced").
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), setPropertyChangeListener(new PropertyChangeAdapter() {
new CRPropertyDescriptor("showToolBar", this.data.getClass()).setEditorClass(BooleanEditor.class)
.setI18NName(Inter.getLocText("Form-EC_toolbar")) @Override
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), public void propertyChange() {
initStyle();
}; }
}),
FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getPropertyTableEditor(); new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class)
if (processor == null){ .setRendererClass(PaddingMarginCellRenderer.class).setI18NName(Inter.getLocText("FR-Layout_Padding"))
return propertyTableEditor; .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
} new CRPropertyDescriptor("showToolBar", this.data.getClass()).setEditorClass(BooleanEditor.class)
PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass()); .setI18NName(Inter.getLocText("Form-EC_toolbar"))
return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
} new CRPropertyDescriptor("heightRestrict", this.data.getClass()).setEditorClass(InChangeBooleanEditor.class)
.setI18NName(Inter.getLocText("Form-EC_heightrestrict"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
};
List<CRPropertyDescriptor> defaultList = new ArrayList<>();
for (CRPropertyDescriptor propertyDescriptor : propertyTableEditor) {
defaultList.add(propertyDescriptor);
}
return defaultList;
}
protected CRPropertyDescriptor[] revealHeightLimit() throws IntrospectionException {
CRPropertyDescriptor heightLimitProperty = new CRPropertyDescriptor("heightPercent", this.data.getClass())
.setEditorClass(DoubleEditor.class)
.setI18NName(Inter.getLocText("Form-EC_heightpercent"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced");
ArrayList<CRPropertyDescriptor> defaultList = (ArrayList<CRPropertyDescriptor>) createNonListenerProperties();
defaultList.add(heightLimitProperty);
return defaultList.toArray(new CRPropertyDescriptor[defaultList.size()]);
}
protected CRPropertyDescriptor[] getDefault() throws IntrospectionException {
ArrayList<CRPropertyDescriptor> defaultList = (ArrayList<CRPropertyDescriptor>) createNonListenerProperties();
return defaultList.toArray(new CRPropertyDescriptor[defaultList.size()]);
}
@Override @Override
protected String getIconName() { protected String getIconName() {

Loading…
Cancel
Save