Browse Source

Pull request #2283: REPORT-35149 打包失败

Merge in DESIGN/design from ~KERRY/design_10.0:feature/10.0 to feature/10.0

* commit '5a8b0ac6a27e6a7ddf4a95c36904e12cb06e1f3b':
  单元测试
  REPORT-35149 打包失败
research/11.0
kerry 4 years ago
parent
commit
0270905121
  1. 6
      designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java
  2. 13
      designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java
  3. 9
      designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java
  4. 9
      designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java
  5. 9
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java
  6. 1
      designer-form/src/main/java/com/fr/design/mainframe/ToolBarButton.java
  7. 77
      designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleWLayoutBorderStyleEditor.java
  8. 18
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  9. 5
      designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java

6
designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java

@ -838,6 +838,12 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
return image; return image;
} }
/**
* 初始化组件的预定义信息
*/
public void initWidgetPredefinedInfo(){
}
} }

13
designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java

@ -21,9 +21,12 @@ import com.fr.form.FormProvider;
import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.ElementCaseEditor;
import com.fr.form.ui.ElementCaseEditorProvider; import com.fr.form.ui.ElementCaseEditorProvider;
import com.fr.form.ui.NameLayoutBorderStyle;
import com.fr.form.ui.NamePaddingMargin;
import com.fr.report.fit.ReportFitAttr; import com.fr.report.fit.ReportFitAttr;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.CoreGraphHelper; import com.fr.stable.CoreGraphHelper;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.report.fit.FitProvider; import com.fr.report.fit.FitProvider;
@ -389,4 +392,14 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
} }
} }
/**
* 初始化组件的预定义信息
*/
public void initWidgetPredefinedInfo(){
this.toData().setNameMargin(NamePaddingMargin.createPredefinedStyle(StringUtils.EMPTY));
this.toData().setNameBorderStyle(NameLayoutBorderStyle.createPredefinedStyle(StringUtils.EMPTY));
}
} }

9
designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java

@ -8,8 +8,10 @@ import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor;
import com.fr.design.mainframe.widget.topxcreator.BasicTopXCreator; import com.fr.design.mainframe.widget.topxcreator.BasicTopXCreator;
import com.fr.form.ui.NameFormBackground;
import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import java.awt.Component; import java.awt.Component;
@ -136,4 +138,11 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout {
public BasicTopXCreator getTopXCreator() { public BasicTopXCreator getTopXCreator() {
return null; return null;
} }
/**
* 初始化组件的预定义信息
*/
public void initWidgetPredefinedInfo(){
this.toData().setNameBackground(NameFormBackground.createPredefinedStyle(StringUtils.EMPTY));
}
} }

9
designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java

@ -12,6 +12,7 @@ import com.fr.design.mainframe.FormArea;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.NameFormBackground;
import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.PaddingMargin;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
@ -23,6 +24,7 @@ import com.fr.general.FRLogger;
import com.fr.general.FRScreen; import com.fr.general.FRScreen;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.AssistUtils; import com.fr.stable.AssistUtils;
import com.fr.stable.StringUtils;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import java.awt.Component; import java.awt.Component;
@ -1337,4 +1339,11 @@ public class XWFitLayout extends XLayoutContainer {
} }
} }
} }
/**
* 初始化组件的预定义信息
*/
public void initWidgetPredefinedInfo(){
this.toData().setNameBackground(NameFormBackground.createPredefinedStyle(StringUtils.EMPTY));
}
} }

9
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java

@ -21,12 +21,14 @@ import com.fr.design.mainframe.widget.editors.ButtonTypeEditor;
import com.fr.design.mainframe.widget.editors.ImgBackgroundEditor; import com.fr.design.mainframe.widget.editors.ImgBackgroundEditor;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.NameFormBackground;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.form.ui.container.cardlayout.WTabFitLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.border.Border; import javax.swing.border.Border;
@ -639,4 +641,11 @@ public class XWTabFitLayout extends XWFitLayout {
checkVisible(); checkVisible();
} }
/**
* 初始化组件的预定义信息
*/
public void initWidgetPredefinedInfo(){
this.toData().setNameBackground(NameFormBackground.createCustomStyleWithBackground(null));
}
} }

1
designer-form/src/main/java/com/fr/design/mainframe/ToolBarButton.java

@ -94,6 +94,7 @@ public class ToolBarButton extends UIButton implements MouseListener, MouseMotio
} }
if (creatorSource != null) { if (creatorSource != null) {
XCreator xCreator = XCreatorUtils.createXCreator(creatorSource); XCreator xCreator = XCreatorUtils.createXCreator(creatorSource);
xCreator.initWidgetPredefinedInfo();
WidgetToolBarPane.getTarget().startDraggingBean(xCreator); WidgetToolBarPane.getTarget().startDraggingBean(xCreator);
FormDesignerUtils.addWidgetProcessInfo(xCreator.toData()); FormDesignerUtils.addWidgetProcessInfo(xCreator.toData());
lastPressEvent = null; lastPressEvent = null;

77
designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleWLayoutBorderStyleEditor.java

@ -4,35 +4,33 @@
package com.fr.design.mainframe.widget.accessibles; package com.fr.design.mainframe.widget.accessibles;
import com.fr.design.Exception.ValidationException;
import com.fr.design.designer.properties.Decoder;
import com.fr.design.designer.properties.Encoder;
import com.fr.design.gui.xpane.PredefinedComponentStyleSettingPane;
import com.fr.design.mainframe.widget.editors.ITextComponent; import com.fr.design.mainframe.widget.editors.ITextComponent;
import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer; import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer;
import com.fr.design.mainframe.widget.wrappers.LayoutBorderStyleWrapper;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.widget.ui.designer.layout.ComponentStyle; import com.fr.design.gui.xpane.LayoutBorderPane;
import com.fr.form.ui.LayoutBorderStyle;
import javax.swing.SwingUtilities; import javax.swing.*;
import java.awt.Dimension; import java.awt.*;
public class AccessibleWLayoutBorderStyleEditor extends UneditableAccessibleEditor { public class AccessibleWLayoutBorderStyleEditor extends UneditableAccessibleEditor {
private PredefinedComponentStyleSettingPane borderPane; private LayoutBorderPane borderPane;
public AccessibleWLayoutBorderStyleEditor() { public AccessibleWLayoutBorderStyleEditor() {
super(new ComponentStyleWrapper()); super(new LayoutBorderStyleWrapper());
} }
@Override @Override
protected ITextComponent createTextField() { protected ITextComponent createTextField() {
return new RendererField(new ComponentStyleRenderer()); return new RendererField(new LayoutBorderStyleRenderer());
} }
@Override @Override
protected void showEditorPane() { protected void showEditorPane() {
if (borderPane == null) { if (borderPane == null) {
borderPane = new PredefinedComponentStyleSettingPane(); borderPane = new LayoutBorderPane();
borderPane.setPreferredSize(new Dimension(600, 400)); borderPane.setPreferredSize(new Dimension(600, 400));
} }
BasicDialog dlg = borderPane.showWindow(SwingUtilities.getWindowAncestor(this)); BasicDialog dlg = borderPane.showWindow(SwingUtilities.getWindowAncestor(this));
@ -40,62 +38,11 @@ public class AccessibleWLayoutBorderStyleEditor extends UneditableAccessibleEdit
@Override @Override
public void doOk() { public void doOk() {
setValue(borderPane.updateBean()); setValue(borderPane.update());
fireStateChanged(); fireStateChanged();
} }
}); });
borderPane.populateBean((ComponentStyle) getValue()); borderPane.populate((LayoutBorderStyle)getValue());
dlg.setVisible(true); dlg.setVisible(true);
} }
private static class ComponentStyleWrapper implements Encoder, Decoder {
public ComponentStyleWrapper() {
}
/**
* 将属性转化成字符串
*
* @param v 属性对象
* @return 字符串
*/
public String encode(Object v) {
if (v == null) {
return null;
}
ComponentStyle style = (ComponentStyle) v;
//todo
return "标准";
}
/**
* 将字符串转化成属性
*
* @param txt 字符串
* @return 属性对象
*/
public Object decode(String txt) {
return null;
}
/**
* 符合规则
*
* @param txt 字符串
* @throws ValidationException 抛错
*/
public void validate(String txt) throws ValidationException {
}
}
private static class ComponentStyleRenderer extends EncoderCellRenderer {
public ComponentStyleRenderer() {
super(new ComponentStyleWrapper());
}
}
} }

18
designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.DynamicUnitList; import com.fr.base.DynamicUnitList;
import com.fr.form.ui.NameBackground;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.ScreenResolution; import com.fr.base.ScreenResolution;
import com.fr.base.extension.FileExtension; import com.fr.base.extension.FileExtension;
@ -93,6 +94,8 @@ import com.fr.report.cell.cellattr.CellImage;
import com.fr.report.cell.painter.CellImagePainter; import com.fr.report.cell.painter.CellImagePainter;
import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.poly.PolyWorkSheet; import com.fr.report.poly.PolyWorkSheet;
import com.fr.report.report.Report;
import com.fr.report.stable.ReportSettings;
import com.fr.report.worksheet.WorkSheet; import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.AssistUtils; import com.fr.stable.AssistUtils;
@ -135,9 +138,21 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
public JWorkBook() { public JWorkBook() {
super(new WorkBook(new WorkSheet()), DEFAULT_WB_FILE_PREFIX); super(new WorkBook(new WorkSheet()), DEFAULT_WB_FILE_PREFIX);
initPredefinedInfo();
populateReportParameterAttr(); populateReportParameterAttr();
} }
private void initPredefinedInfo() {
WorkBook workBook = this.getTarget();
for (int i = 0; i < workBook.getReportCount(); i++) {
Report report = workBook.getReport(i);
if (report != null) {
NameBackground initBackground = NameBackground.createPredefinedStyle(StringUtils.EMPTY);
((ReportSettings) report.getReportSettings()).setNameBackground(initBackground);
}
}
}
public JWorkBook(WorkBookX workBookX) { public JWorkBook(WorkBookX workBookX) {
super(new WorkBookAdapter(workBookX), DEFAULT_WBX_FILE_PREFIX); super(new WorkBookAdapter(workBookX), DEFAULT_WBX_FILE_PREFIX);
populateReportParameterAttr(); populateReportParameterAttr();
@ -153,9 +168,6 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
populateReportParameterAttr(); populateReportParameterAttr();
} }
public void resetPreferenceStyle(){
}
@Override @Override
protected void addPane(PropertyItemPaneProvider provider) { protected void addPane(PropertyItemPaneProvider provider) {

5
designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java

@ -1,6 +1,7 @@
package com.fr.design.report; package com.fr.design.report;
import com.fr.base.NameBackground; import com.fr.config.predefined.PredefinedNameStyleProvider;
import com.fr.form.ui.NameBackground;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.predefined.ui.PredefinedStyleSettingPane; import com.fr.design.mainframe.predefined.ui.PredefinedStyleSettingPane;
@ -66,7 +67,7 @@ public class ReportPredefinedBackgroundPane extends PredefinedStyleSettingPane<R
@Override @Override
public void populateBean(ReportSettingsProvider reportSettings) { public void populateBean(ReportSettingsProvider reportSettings) {
this.setPopulating(true); this.setPopulating(true);
NameBackground nameBackground = reportSettings.getNameBackground(); PredefinedNameStyleProvider nameBackground = reportSettings.getNameBackground();
super.populate(nameBackground); super.populate(nameBackground);
this.backgroundPane.populateBean(reportSettings.getBackground()); this.backgroundPane.populateBean(reportSettings.getBackground());
this.isPrintBackgroundCheckBox.setSelected(reportSettings.isPrintBackground()); this.isPrintBackgroundCheckBox.setSelected(reportSettings.isPrintBackground());

Loading…
Cancel
Save