Browse Source

REPORT-55243:修改不合理的方法名 & 改变报表引擎属性界面对应的类名

research/11.0
fly.li 3 years ago
parent
commit
c7c511aa36
  1. 3
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  2. 8
      designer-base/src/main/java/com/fr/nx/app/designer/utils/CptAndCptxCompatibilityUtil.java
  3. 5
      designer-base/src/main/java/com/fr/nx/app/designer/utils/CptCompileUtil.java
  4. 6
      designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java
  5. 6
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  6. 10
      designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java

3
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -69,7 +69,6 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.main.impl.WorkBook;
import com.fr.nx.app.designer.utils.CptAndCptxCompatibilityUtil;
import com.fr.nx.app.designer.utils.CptCompileUtil;
import com.fr.nx.cptx.entry.metadata.CptxMetadata;
@ -1471,7 +1470,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
* 设置新引擎后有不支持的功能时设计器中模板的标题需要加上兼容模式或者不支持分页引擎来提示用户
* */
private String compatibilityTip() {
if (!CptAndCptxCompatibilityUtil.enableNewEngine(this.getTarget(), getEditingFILE().getPath())){
if (!CptAndCptxCompatibilityUtil.isEngineXEnable(this.getTarget(), getEditingFILE().getPath())){
return StringUtils.EMPTY;
}
String path = this.getEditingFILE().getPath();

8
designer-base/src/main/java/com/fr/nx/app/designer/utils/CptAndCptxCompatibilityUtil.java

@ -33,7 +33,7 @@ public class CptAndCptxCompatibilityUtil {
* 判断是不是cptx模板或者开启了的新引擎的cpt模板的另存为操作
**/
private static boolean isSaveAs(JTemplate jTemplate, String oldName, String newName){
return enableNewEngine(jTemplate.getTarget(), newName) && ((FileExtension.CPTX.matchExtension(oldName) && FileExtension.CPTX.matchExtension(newName)) || (FileExtension.CPT.matchExtension(oldName) && FileExtension.CPT.matchExtension(newName)));
return isEngineXEnable(jTemplate.getTarget(), newName) && ((FileExtension.CPTX.matchExtension(oldName) && FileExtension.CPTX.matchExtension(newName)) || (FileExtension.CPT.matchExtension(oldName) && FileExtension.CPT.matchExtension(newName)));
}
/**
@ -59,10 +59,10 @@ public class CptAndCptxCompatibilityUtil {
* 是否启用了新引擎的判断
* cptx自动走新引擎非兼容模式cpt需要进行设置
* */
public static boolean enableNewEngine(Object workBook, String fileName){
public static boolean isEngineXEnable(Object workBook, String fileName){
WorkSheet workSheet = gainWorkSheet(workBook);
LayerReportAttr layerReportAttr = gainLayerReportAttr(workSheet);
return enableNewEngine(layerReportAttr, fileName);
return isEngineXEnable(layerReportAttr, fileName);
}
private static LayerReportAttr gainLayerReportAttr(WorkSheet workSheet){
@ -82,7 +82,7 @@ public class CptAndCptxCompatibilityUtil {
return report instanceof WorkSheet ? (WorkSheet)report : null;
}
private static boolean enableNewEngine(LayerReportAttr layerReportAttr, String fileName){
private static boolean isEngineXEnable(LayerReportAttr layerReportAttr, String fileName){
return (layerReportAttr!= null && layerReportAttr.isClientPaging() && layerReportAttr.getEngineState() == 0) || FileExtension.CPTX.matchExtension(fileName);
}
}

5
designer-base/src/main/java/com/fr/nx/app/designer/utils/CptCompileUtil.java

@ -23,9 +23,6 @@ import com.fr.nx.cptx.utils.CptxFileUtils;
import com.fr.nx.data.layer.LayerItem;
import com.fr.nx.data.layer.LayerProps;
import com.fr.nx.template.compile.CompiledReport;
import com.fr.report.report.Report;
import com.fr.report.stable.LayerReportAttr;
import com.fr.report.worksheet.WorkSheet;
import java.io.OutputStream;
@ -44,7 +41,7 @@ public class CptCompileUtil {
* 应该是流程的误改动这里改回来保存时仍然执行预编译
* 预编译本不应该受引擎模式的影响但是cpt文件在设置为新引擎后是需要进行编译的
* */
if (!CptAndCptxCompatibilityUtil.enableNewEngine(workbook, path)){
if (!CptAndCptxCompatibilityUtil.isEngineXEnable(workbook, path)){
return;
}
TransformResultInfo resultInfo = compile0(workbook, file);

6
designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java

@ -7,7 +7,7 @@ import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.WorkSheetDesigner;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.report.LayerReportEnginePane;
import com.fr.design.report.ReportEnginePane;
import com.fr.report.worksheet.WorkSheet;
public class ReportEngineAttrAction extends ReportComponentAction<WorkSheetDesigner> {
@ -18,7 +18,7 @@ public class ReportEngineAttrAction extends ReportComponentAction<WorkSheetDesig
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon("/com/fr/design/images/m_report/reportEngineAttr");
this.generateAndSetSearchText(LayerReportEnginePane.class.getName());
this.generateAndSetSearchText(ReportEnginePane.class.getName());
}
@ -35,7 +35,7 @@ public class ReportEngineAttrAction extends ReportComponentAction<WorkSheetDesig
return false;
}
final WorkSheet tplEC = jws.getTemplateReport();
final LayerReportEnginePane layerReportEnginePane = new LayerReportEnginePane(tplEC);
final ReportEnginePane layerReportEnginePane = new ReportEnginePane(tplEC);
layerReportEnginePane.populateBean(tplEC.getLayerReportAttr());
BasicDialog dialog = layerReportEnginePane.showWindow(DesignerContext.getDesignerFrame());
isChange = false;

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

@ -5,7 +5,6 @@ import com.fr.base.DynamicUnitList;
import com.fr.base.Parameter;
import com.fr.base.ScreenResolution;
import com.fr.base.extension.FileExtension;
import com.fr.base.theme.FormTheme;
import com.fr.base.theme.TemplateThemeCompatible;
import com.fr.base.vcs.DesignerMode;
import com.fr.base.theme.ReportTheme;
@ -91,7 +90,6 @@ import com.fr.main.impl.WorkBookX;
import com.fr.main.parameter.ReportParameterAttr;
import com.fr.nx.app.designer.menu.CalculateAttrAction;
import com.fr.nx.app.designer.utils.CptAndCptxCompatibilityUtil;
import com.fr.nx.app.designer.utils.CptCompileUtil;
import com.fr.poly.PolyDesigner;
import com.fr.poly.creator.BlockCreator;
import com.fr.privilege.finegrain.WorkSheetPrivilegeControl;
@ -720,7 +718,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
}
protected void addShortCut(MenuDef exportMenuDef, MenuDef excelExportMenuDef) {
if (CptAndCptxCompatibilityUtil.enableNewEngine(this.getTarget(), getEditingFILE().getPath())){
if (CptAndCptxCompatibilityUtil.isEngineXEnable(this.getTarget(), getEditingFILE().getPath())){
exportMenuDef.addShortCut(excelExportMenuDef, new PDFExportAction(this), new WordExportAction(this), new SVGExportAction(this),
new CSVExportAction(this), new TextExportAction(this));
}else {
@ -750,7 +748,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
*/
@Override
public ShortCut[] shortcut4TemplateMenu() {
boolean enableNewEngine = CptAndCptxCompatibilityUtil.enableNewEngine(this.getTarget(), getEditingFILE().getPath());
boolean enableNewEngine = CptAndCptxCompatibilityUtil.isEngineXEnable(this.getTarget(), getEditingFILE().getPath());
ShortCut[] commonShortCut = ArrayUtils.addAll(new ShortCut[]{
new ReportWebAttrAction(this),
new ReportExportAttrAction(this),

10
designer-realize/src/main/java/com/fr/design/report/LayerReportEnginePane.java → designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java

@ -31,7 +31,7 @@ import java.util.List;
* @version 10.0
* Created on 2021/08/22
*/
public class LayerReportEnginePane extends BasicBeanPane<LayerReportAttr> {
public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
private static final int LABEL_HEIGHT = 55;
private UICheckBox isClientPaging;
private UICheckBox isShowDataNumber;
@ -40,12 +40,12 @@ public class LayerReportEnginePane extends BasicBeanPane<LayerReportAttr> {
private WorkSheet worksheet;
private List<JRadioButton> radioButtons = new ArrayList<>(2);
public LayerReportEnginePane(WorkSheet worksheet) {
public ReportEnginePane(WorkSheet worksheet) {
this.worksheet = worksheet;
this.initComponents();
}
public LayerReportEnginePane() {
public ReportEnginePane() {
this(null);
}
@ -162,8 +162,8 @@ public class LayerReportEnginePane extends BasicBeanPane<LayerReportAttr> {
isPageQueryBox.setSelected(false);
countPerPageEditor.setEnabled(false);
}
radioButtons.get(0).setSelected(ob.getEngineState() == 0 ? true : false);
radioButtons.get(1).setSelected(ob.getEngineState() == 1 ? true : false);
radioButtons.get(0).setSelected(ob.getEngineState() == LayerReportAttr.ENGINE_X ? true : false);
radioButtons.get(1).setSelected(ob.getEngineState() == LayerReportAttr.LINE_ENGINE ? true : false);
}
@Override
Loading…
Cancel
Save