Browse Source

Pull request #5581: REPORT-58270 新前端填报剥离插件

Merge in DESIGN/design from ~YUAN.WANG/design:release/11.0 to release/11.0

* commit 'f0d45dcb689e8561e28527a032fc8885e3bb6a91':
  REPORT-58270 新前端填报剥离插件
  REPORT-58270 新前端填报剥离插件
persist/11.0
Yuan.Wang 3 years ago
parent
commit
ae0c2bae8c
  1. 39
      designer-base/src/main/java/com/fr/design/preview/NewWritePreview.java
  2. 10
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

39
designer-base/src/main/java/com/fr/design/preview/NewWritePreview.java

@ -1,39 +0,0 @@
package com.fr.design.preview;
import com.fr.design.fun.impl.AbstractPreviewProvider;
import java.util.HashMap;
import java.util.Map;
/**
* 新前端填报预览
* by abel 2021/07/08
*/
public class NewWritePreview extends AbstractPreviewProvider {
@Override
public String nameForPopupItem() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Write_New_Preview");
}
@Override
public String iconPathForPopupItem() {
return "com/fr/design/images/buttonicon/writes.png";
}
@Override
public String iconPathForLarge() {
return "com/fr/design/images/buttonicon/writeb24.png";
}
@Override
public int previewTypeCode() {
return 99;
}
@Override
public Map<String, Object> parametersForPreview() {
Map<String, Object> map = new HashMap<String, Object>();
map.put("op", "write_new");
return map;
}
}

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

@ -62,7 +62,6 @@ import com.fr.design.module.DesignModuleFactory;
import com.fr.design.parameter.ParameterDefinitePane; import com.fr.design.parameter.ParameterDefinitePane;
import com.fr.design.parameter.ParameterInputPane; import com.fr.design.parameter.ParameterInputPane;
import com.fr.design.preview.MobilePreview; import com.fr.design.preview.MobilePreview;
import com.fr.design.preview.NewWritePreview;
import com.fr.design.preview.PagePreview; import com.fr.design.preview.PagePreview;
import com.fr.design.preview.ViewPreview; import com.fr.design.preview.ViewPreview;
import com.fr.design.preview.WritePreview; import com.fr.design.preview.WritePreview;
@ -152,6 +151,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
super(workBook, fileName); super(workBook, fileName);
populateReportParameterAttr(); populateReportParameterAttr();
} }
public JWorkBook(WorkBook workBook, FILE file, Parameter[] parameters) { public JWorkBook(WorkBook workBook, FILE file, Parameter[] parameters) {
super(workBook, file, parameters); super(workBook, file, parameters);
populateReportParameterAttr(); populateReportParameterAttr();
@ -510,7 +510,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
double creatorWidth = blockCreator.getEditorBounds().width; double creatorWidth = blockCreator.getEditorBounds().width;
double areaHeight = polyDezi.polyArea.getHeight(); double areaHeight = polyDezi.polyArea.getHeight();
double areaWidth = polyDezi.polyArea.getWidth(); double areaWidth = polyDezi.polyArea.getWidth();
if(AssistUtils.equals(creatorWidth,0) || AssistUtils.equals(creatorHeight,0)){ if (AssistUtils.equals(creatorWidth, 0) || AssistUtils.equals(creatorHeight, 0)) {
return resolution; return resolution;
} }
double time = (areaHeight / creatorHeight) < (areaWidth / creatorWidth) ? (areaHeight / creatorHeight) : (areaWidth / creatorWidth); double time = (areaHeight / creatorHeight) < (areaWidth / creatorWidth) ? (areaHeight / creatorHeight) : (areaWidth / creatorWidth);
@ -527,7 +527,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
int row = reportPane.getSelection().getSelectedRows()[0]; int row = reportPane.getSelection().getSelectedRows()[0];
double rowLength = reportPane.getSelection().getSelectedRows().length; double rowLength = reportPane.getSelection().getSelectedRows().length;
double rowExtent = reportPane.getGrid().getVerticalExtent(); double rowExtent = reportPane.getGrid().getVerticalExtent();
if(AssistUtils.equals(columnLength,0) || AssistUtils.equals(rowLength,0)){ if (AssistUtils.equals(columnLength, 0) || AssistUtils.equals(rowLength, 0)) {
return resolution; return resolution;
} }
double time = (columnExtent / columnLength) < (rowExtent / rowLength) ? (columnExtent / columnLength) : (rowExtent / rowLength); double time = (columnExtent / columnLength) < (rowExtent / rowLength) ? (columnExtent / columnLength) : (rowExtent / rowLength);
@ -950,7 +950,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
public PreviewProvider[] supportPreview() { public PreviewProvider[] supportPreview() {
PreviewProvider[] templatePreviews = super.supportPreview(); PreviewProvider[] templatePreviews = super.supportPreview();
return ArrayUtils.addAll(new PreviewProvider[]{ return ArrayUtils.addAll(new PreviewProvider[]{
new PagePreview(), new WritePreview(), new ViewPreview(), new MobilePreview(), new NewWritePreview() new PagePreview(), new WritePreview(), new ViewPreview(), new MobilePreview()
}, templatePreviews); }, templatePreviews);
} }
@ -1233,7 +1233,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
addExtraChooseFILEFilter(fileChooser); addExtraChooseFILEFilter(fileChooser);
} }
protected void addExtraChooseFILEFilter(FILEChooserPane fileChooser){ protected void addExtraChooseFILEFilter(FILEChooserPane fileChooser) {
Set<ReportSupportedFileUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG); Set<ReportSupportedFileUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG);
for (ReportSupportedFileUIProvider provider : providers) { for (ReportSupportedFileUIProvider provider : providers) {
provider.addChooseFileFilter(fileChooser, this.suffix()); provider.addChooseFileFilter(fileChooser, this.suffix());

Loading…
Cancel
Save