Browse Source

REPORT-28907 同步fire && REPORT-28351 强转问题同步到release && MOBILE-26199 提供tab标题样式接口

feature/big-screen
hades 5 years ago
parent
commit
746ca6e969
  1. 25
      designer-base/src/main/java/com/fr/design/fun/MobileTemplateStyleProvider.java
  2. 25
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractMobileTemplateStyleProvider.java
  3. 43
      designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java
  4. 2
      designer-base/src/main/java/com/fr/exit/DesignerExiter.java
  5. 9
      designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java

25
designer-base/src/main/java/com/fr/design/fun/MobileTemplateStyleProvider.java

@ -0,0 +1,25 @@
package com.fr.design.fun;
import com.fr.design.beans.BasicBeanPane;
import com.fr.general.cardtag.mobile.MobileTemplateStyle;
import com.fr.stable.fun.mark.Mutable;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/3/31
*/
public interface MobileTemplateStyleProvider extends Mutable {
String XML_TAG = "MobileTemplateStyleProvider";
int CURRENT_LEVEL = 1;
Class<? extends MobileTemplateStyle> classFroMobileTemplateStyle();
Class<? extends BasicBeanPane<MobileTemplateStyle>> classFroMobileTemplateStyleAppearance();
String displayName();
}

25
designer-base/src/main/java/com/fr/design/fun/impl/AbstractMobileTemplateStyleProvider.java

@ -0,0 +1,25 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.MobileTemplateStyleProvider;
import com.fr.design.fun.MobileWidgetStyleProvider;
import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/3/31
*/
@API(level = MobileWidgetStyleProvider.CURRENT_LEVEL)
public abstract class AbstractMobileTemplateStyleProvider extends AbstractProvider implements MobileTemplateStyleProvider {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public String mark4Provider() {
return getClass().getName();
}
}

43
designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java

@ -1,11 +1,14 @@
package com.fr.design.mainframe.widget.accessibles;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.fun.MobileTemplateStyleProvider;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.mobile.ui.TemplateStyleDefinePaneFactory;
import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.general.cardtag.mobile.MobileTemplateStyle;
import com.fr.general.cardtag.mobile.MobileTemplateStyleType;
import com.fr.invoke.Reflect;
import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel;
import javax.swing.JList;
@ -18,9 +21,12 @@ import java.awt.Dimension;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class MobileTemplateStylePane extends AbstractTemplateStylePane<MobileTemplateStyle> {
private static final List<MobileTemplateStyleType> STYLE_LIST = new ArrayList<MobileTemplateStyleType>();
@ -36,6 +42,7 @@ public class MobileTemplateStylePane extends AbstractTemplateStylePane<MobileTem
private Map<String, BasicBeanPane<MobileTemplateStyle>> map = new HashMap<>();
private JPanel right;
private CardLayout card;
private Set<Class<? extends MobileTemplateStyle>> extraStyle = new HashSet<>();
public MobileTemplateStylePane(WCardTagLayout tagLayout){
init(tagLayout);
}
@ -52,6 +59,7 @@ public class MobileTemplateStylePane extends AbstractTemplateStylePane<MobileTem
map.put(style.getDisplayName(), styleBasicBeanPane);
right.add(style.getDisplayName(), styleBasicBeanPane);
}
initExtra();
styleList = new JList(listModel);
styleList.setCellRenderer(render);
@ -74,6 +82,20 @@ public class MobileTemplateStylePane extends AbstractTemplateStylePane<MobileTem
this.add(westPane, BorderLayout.WEST);
this.add(centerPane, BorderLayout.CENTER);
}
private void initExtra() {
List<MobileTemplateStyleProvider> list = getMobileTemplateStyleProvider();
for (MobileTemplateStyleProvider provider : list) {
String displayName = provider.displayName();
Class<? extends BasicBeanPane<MobileTemplateStyle>> clazz = provider.classFroMobileTemplateStyleAppearance();
BasicBeanPane<MobileTemplateStyle> styleBasicBeanPane = Reflect.on(clazz).create().get();
listModel.addElement(displayName);
map.put(displayName, styleBasicBeanPane);
right.add(displayName, styleBasicBeanPane);
extraStyle.add(provider.classFroMobileTemplateStyle());
}
}
public static ListCellRenderer render = new DefaultListCellRenderer() {
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
@ -97,16 +119,31 @@ public class MobileTemplateStylePane extends AbstractTemplateStylePane<MobileTem
String style = templateStyle.getStyle();
MobileTemplateStyleType templateStyleType = MobileTemplateStyleType.parse(style);
if((listModel.getElementAt(i)).equals(templateStyleType.getDisplayName())){
styleList.setSelectedIndex(i);
map.get(templateStyle.toString()).populateBean(templateStyle);
card.show(right, templateStyle.toString());
populateStyle(templateStyle, i);
return;
}
if (extraStyle.contains(templateStyle.getClass())) {
populateStyle(templateStyle, i);
return;
}
}
styleList.setSelectedIndex(0);
}
private void populateStyle(MobileTemplateStyle templateStyle, int index) {
styleList.setSelectedIndex(index);
map.get(templateStyle.toString()).populateBean(templateStyle);
card.show(right, templateStyle.toString());
}
public MobileTemplateStyle update() {
return map.get(styleList.getSelectedValue()).updateBean();
}
private List<MobileTemplateStyleProvider> getMobileTemplateStyleProvider() {
List<MobileTemplateStyleProvider> list = new ArrayList<>();
Set<MobileTemplateStyleProvider> sets = ExtraDesignClassManager.getInstance().getArray(MobileTemplateStyleProvider.XML_TAG);
list.addAll(sets);
return Collections.unmodifiableList(list);
}
}

2
designer-base/src/main/java/com/fr/exit/DesignerExiter.java

@ -22,7 +22,7 @@ public class DesignerExiter {
public void execute() {
beforeExit();
if (FineProcessContext.getParentPipe() != null) {
FineProcessContext.getParentPipe().fire(FineProcessEngineEvent.DESTROY);
FineProcessContext.getParentPipe().syncFire(FineProcessEngineEvent.DESTROY);
}
System.exit(0);
}

9
designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java

@ -5,6 +5,7 @@ import com.fr.main.impl.WorkBook;
import com.fr.main.parameter.ReportParameterAttr;
import com.fr.report.cellcase.CellCase;
import com.fr.report.poly.PolyWorkSheet;
import com.fr.report.report.Report;
import com.fr.report.worksheet.WorkSheet;
import java.util.Iterator;
@ -61,8 +62,12 @@ public class JWorkBookProcessInfo extends TemplateProcessInfo<WorkBook> {
int blockCount = 0;
if (!template.isElementCaseBook()) { // 如果是聚合报表
for (int i = 0; i < template.getReportCount(); i++) {
PolyWorkSheet r = (PolyWorkSheet) template.getReport(i);
blockCount += r.getBlockCount();
Report report = template.getReport(i);
// 考虑多个sheet下 包含WorkSheet的情况 需要判断下
if (report instanceof PolyWorkSheet) {
PolyWorkSheet r = (PolyWorkSheet) report;
blockCount += r.getBlockCount();
}
}
}
return blockCount;

Loading…
Cancel
Save