Browse Source

Merge branch 'release/10.0' of http://cloud.finedevelop.com:2015/scm/~neil/design-10 into release/10.0

research/10.0
neil 6 years ago
parent
commit
84228992a8
  1. 3
      designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java
  2. 16
      designer-base/src/main/java/com/fr/design/editor/ValueEditorPane.java
  3. 8
      designer-base/src/main/java/com/fr/design/fun/PreviewProvider.java
  4. 7
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractPreviewProvider.java
  5. 8
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  6. 33
      designer-base/src/main/java/com/fr/design/preview/FormPreview.java
  7. 47
      designer-base/src/main/java/com/fr/design/preview/MobilePreview.java
  8. 2
      designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java
  9. BIN
      designer-base/src/main/resources/com/fr/design/images/buttonicon/mobile.png
  10. BIN
      designer-base/src/main/resources/com/fr/design/images/buttonicon/mobileb24.png
  11. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java
  12. 8
      designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java
  13. 2
      designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java
  14. 9
      designer-form/src/main/java/com/fr/design/mainframe/FormArea.java
  15. 40
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  16. 2
      designer-realize/src/main/java/com/fr/design/mainframe/AuthorityToolBarPane.java
  17. 7
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  18. 2
      designer-realize/src/main/java/com/fr/start/Designer.java
  19. 1
      designer-realize/src/main/java/com/fr/start/module/PreStartActivator.java

3
designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java

@ -9,7 +9,6 @@ import com.fr.design.utils.DesignUtils;
import com.fr.file.FILE;
import com.fr.file.FileNodeFILE;
import com.fr.general.GeneralUtils;
import com.fr.general.web.ParameterConstants;
import com.fr.stable.project.ProjectConstants;
import com.fr.stable.web.AbstractWebletCreator;
@ -27,7 +26,7 @@ public final class WebPreviewUtils {
@SuppressWarnings("unchecked")
public static void preview(JTemplate<?, ?> jt, PreviewProvider provider) {
String baseRoute = jt.route();
actionPerformed(jt, baseRoute, provider == null ? Collections.EMPTY_MAP : provider.parametersForPreview(), ParameterConstants.VIEWLET);
actionPerformed(jt, baseRoute, provider == null ? Collections.EMPTY_MAP : provider.parametersForPreview(), provider.getActionType());
}
private static void actionPerformed(JTemplate<?, ?> jt, String baseRoute, Map<String, Object> map, String actionType) {

16
designer-base/src/main/java/com/fr/design/editor/ValueEditorPane.java

@ -344,8 +344,24 @@ public class ValueEditorPane extends BasicPane implements UIObserver, GlobalName
*
* @param listener 观察者监听事件
*/
@Override
public void registerNameListener(GlobalNameListener listener) {
globalNameListener = listener;
for (Editor card : cards) {
doLoop(card, listener);
}
}
private void doLoop(Container card, GlobalNameListener listener) {
for (int i = 0, len = card.getComponentCount(); i < len; i++) {
Component tmpComp = card.getComponent(i);
if (tmpComp instanceof Container) {
doLoop((Container) tmpComp, listener);
}
if (tmpComp instanceof GlobalNameObserver) {
((GlobalNameObserver) tmpComp).registerNameListener(listener);
}
}
}
/**

8
designer-base/src/main/java/com/fr/design/fun/PreviewProvider.java

@ -54,4 +54,12 @@ public interface PreviewProvider extends Mutable{
*/
Map<String, Object> parametersForPreview();
/**
* 该种预览方式下对模板的处理方式
* 分页填报等需要计算输出模板移动端预览直接输出url
* @return 处理方式
*/
String getActionType();
}

7
designer-base/src/main/java/com/fr/design/fun/impl/AbstractPreviewProvider.java

@ -3,6 +3,7 @@ package com.fr.design.fun.impl;
import com.fr.design.fun.PreviewProvider;
import com.fr.design.mainframe.JTemplate;
import com.fr.general.ComparatorUtils;
import com.fr.general.web.ParameterConstants;
import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API;
@ -45,4 +46,10 @@ public abstract class AbstractPreviewProvider extends AbstractProvider implement
public int hashCode() {
return nameForPopupItem().hashCode();
}
@Override
public String getActionType() {
return ParameterConstants.VIEWLET;
}
}

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

@ -1,5 +1,6 @@
package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.Parameter;
import com.fr.base.ScreenResolution;
@ -15,6 +16,7 @@ import com.fr.design.actions.edit.RedoAction;
import com.fr.design.actions.edit.UndoAction;
import com.fr.design.actions.file.SaveAsTemplateAction;
import com.fr.design.actions.file.SaveTemplateAction;
import com.fr.design.actions.file.WebPreviewUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.TargetComponent;
import com.fr.design.dialog.InformationWarnPane;
@ -1006,7 +1008,9 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
* @return
*/
public Icon getPreviewLargeIcon() {
return UIConstants.RUN_BIG_ICON;
PreviewProvider provider = getPreviewType();
String iconPath = provider.iconPathForLarge();
return BaseUtils.readIcon(iconPath);
}
/**
@ -1099,6 +1103,8 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
* @param provider 预览模式
*/
public void previewMenuActionPerformed(PreviewProvider provider) {
setPreviewType(provider);
WebPreviewUtils.preview(this, provider);
}

33
designer-base/src/main/java/com/fr/design/preview/FormPreview.java

@ -0,0 +1,33 @@
package com.fr.design.preview;
import com.fr.design.fun.impl.AbstractPreviewProvider;
/**
* @author kerry
* @date 2018/5/22
*/
public class FormPreview extends AbstractPreviewProvider {
private static final int PREVIEW_TYPE = 5;
@Override
public String nameForPopupItem() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Form_Preview");
}
@Override
public String iconPathForPopupItem() {
return "com/fr/design/images/buttonicon/runs.png";
}
@Override
public String iconPathForLarge() {
return "com/fr/design/images/buttonicon/run24.png";
}
@Override
public int previewTypeCode() {
return PREVIEW_TYPE;
}
}

47
designer-base/src/main/java/com/fr/design/preview/MobilePreview.java

@ -0,0 +1,47 @@
package com.fr.design.preview;
import com.fr.design.fun.impl.AbstractPreviewProvider;
import java.util.HashMap;
import java.util.Map;
/**
* @author kerry
* @date 2018/5/11
*/
public class MobilePreview extends AbstractPreviewProvider {
private static final int PREVIEW_TYPE = 4;
private static final String ACTION_TYPE = "path";
@Override
public String nameForPopupItem() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Preview");
}
@Override
public String iconPathForPopupItem() {
return "com/fr/design/images/buttonicon/mobile.png";
}
@Override
public String iconPathForLarge() {
return "com/fr/design/images/buttonicon/mobileb24.png";
}
@Override
public int previewTypeCode() {
return PREVIEW_TYPE;
}
@Override
public String getActionType() {
return ACTION_TYPE;
}
@Override
public Map<String, Object> parametersForPreview() {
Map<String, Object> map = new HashMap<String, Object>();
map.put("op", "mobile");
return map;
}
}

2
designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java

@ -44,7 +44,7 @@ public abstract class CustomJobPane extends BasicBeanPane {
UIButton editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"));
editButton.setPreferredSize(new Dimension(
GraphHelper.getLocTextWidth("Fine-Design_Basic_Edit") + 20,
GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")) + 20,
classNameTextField.getPreferredSize().height));
reportletNamePane.add(browserButton);

BIN
designer-base/src/main/resources/com/fr/design/images/buttonicon/mobile.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

BIN
designer-base/src/main/resources/com/fr/design/images/buttonicon/mobileb24.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java

@ -81,7 +81,7 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
* @return 返回标题.
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Tabledata");
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TableData");
}

8
designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java

@ -26,7 +26,7 @@ public abstract class AbstractExtendedChartReportDataPane<T extends AbstractData
protected void initComponents() {
String[] labels = fieldLabel();
TinyFormulaPane[] formulaPanes = formulaPanes();
Component[] formulaPanes = fieldComponents();
int len = Math.min(labels.length, formulaPanes.length);
@ -42,13 +42,17 @@ public abstract class AbstractExtendedChartReportDataPane<T extends AbstractData
Arrays.fill(rowSize, p);
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 24, 6);
panel.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15));
panel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 15));
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);
}
protected Component[] fieldComponents() {
return formulaPanes();
}
protected abstract String[] fieldLabel();
protected abstract TinyFormulaPane[] formulaPanes();

2
designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java

@ -47,7 +47,7 @@ public abstract class AbstractExtendedChartTableDataPane<T extends AbstractDataC
if (hasFunction()) {
function = new CalculateComboBox();
components[len] = new Component[]{new UILabel("function", SwingConstants.LEFT), function};
components[len] = new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Summary_Method"), SwingConstants.LEFT), function};
}
double p = TableLayout.PREFERRED;

9
designer-form/src/main/java/com/fr/design/mainframe/FormArea.java

@ -540,16 +540,16 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
layout();
if (isValid) {
XLayoutContainer root = designer.getRootComponent();
setScrollBarProperties(root.getWidth() - designer.getWidth(), horScrollBar);
setScrollBarProperties(root.getWidth() - designer.getWidth(), horScrollBar, horizontalValue);
//计算滚动条值的时候应该算上参数面板的高度
setScrollBarProperties(designer.getParaHeight() + root.getHeight() - designer.getHeight(), verScrollBar);
setScrollBarProperties(designer.getParaHeight() + root.getHeight() - designer.getHeight(), verScrollBar, verticalValue);
}
}
/**
* 设置滚动条的属性
*/
private void setScrollBarProperties(int value, FormScrollBar bar) {
private void setScrollBarProperties(int value, FormScrollBar bar, int oldValue) {
if (value == 0 && isScrollNotVisible(bar)) {
return;
}
@ -560,12 +560,11 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
bar.setValue(0);
bar.setEnabled(false);
} else {
//参数面板拖拽过程中value一直为当前value
int oldValue = verticalValue;
setScrollBarMax(value, bar);
bar.setEnabled(true);
bar.setMaximum(value);
bar.setValue(value);
//参数面板拖拽过程中value一直为当前value
bar.setValue(oldValue);
}
}

40
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -25,6 +25,7 @@ import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.properties.FormWidgetAuthorityEditPane;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.fun.PreviewProvider;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider;
import com.fr.design.gui.ilable.UILabel;
@ -46,6 +47,8 @@ import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.parameter.ParameterPropertyPane;
import com.fr.design.preview.FormPreview;
import com.fr.design.preview.MobilePreview;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.file.FILE;
@ -80,7 +83,9 @@ import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
private static final String FORM_CARD = "FORM";
@ -683,7 +688,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
*
*/
public Icon getPreviewLargeIcon() {
return UIConstants.RUN_BIG_ICON;
return super.getPreviewLargeIcon();
}
@Override
@ -698,14 +703,19 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
* @return 菜单
*/
public UIMenuItem[] createMenuItem4Preview() {
UIMenuItem form = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Form_Preview"), UIConstants.RUN_SMALL_ICON);
form.addActionListener(new ActionListener() {
List<UIMenuItem> menuItems = new ArrayList<UIMenuItem>();
PreviewProvider[] previewProviders = supportPreview();
for (final PreviewProvider provider : previewProviders) {
UIMenuItem item = new UIMenuItem(provider.nameForPopupItem(), BaseUtils.readIcon(provider.iconPathForPopupItem()));
item.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
WebPreviewUtils.preview(JForm.this);
provider.onClick(JForm.this);
}
});
return new UIMenuItem[]{form};
menuItems.add(item);
}
return menuItems.toArray(new UIMenuItem[menuItems.size()]);
}
/**
@ -922,6 +932,26 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
return creator.toData();
}
/**
* 支持的预览模式
* @return 预览模式
*/
@Override
public PreviewProvider[] supportPreview() {
return new PreviewProvider[]{new FormPreview(), new MobilePreview()};
}
/**
* 预览按钮点击事件
*
* @param provider 预览接口
*/
@Override
public void previewMenuActionPerformed(PreviewProvider provider) {
super.previewMenuActionPerformed(provider);
}
@Override
public String route() {
return ViewRequestConstants.FORM_VIEW_PATH;

2
designer-realize/src/main/java/com/fr/design/mainframe/AuthorityToolBarPane.java

@ -273,7 +273,7 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
this.remove(title);
// 如果是空值就说明采用服务器配置了
if (reportWebAttr == null || this.getWebContent(reportWebAttr) == null) {
title = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ServerToolbar_Choose_Role"));
title = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Server_Toolbar_Choose_Role"));
populateServerSettings();
this.add(title, 0);
return;

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

@ -10,7 +10,6 @@ import com.fr.design.DesignModelAdapter;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.AllowAuthorityEditAction;
import com.fr.design.actions.ExitAuthorityEditAction;
import com.fr.design.actions.file.WebPreviewUtils;
import com.fr.design.actions.file.export.CSVExportAction;
import com.fr.design.actions.file.export.EmbeddedExportExportAction;
import com.fr.design.actions.file.export.ExcelExportAction;
@ -53,6 +52,7 @@ import com.fr.design.menu.ToolBarDef;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.parameter.ParameterDefinitePane;
import com.fr.design.parameter.ParameterInputPane;
import com.fr.design.preview.MobilePreview;
import com.fr.design.preview.PagePreview;
import com.fr.design.preview.ViewPreview;
import com.fr.design.preview.WriteEnhancePreview;
@ -890,7 +890,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
public PreviewProvider[] supportPreview() {
Set<PreviewProvider> set = ExtraDesignClassManager.getInstance().getArray(PreviewProvider.MARK_STRING);
return ArrayUtils.addAll(new PreviewProvider[]{
new PagePreview(), new WritePreview(), new ViewPreview(), new WriteEnhancePreview()
new PagePreview(), new WritePreview(), new ViewPreview(), new WriteEnhancePreview(), new MobilePreview()
}, set.toArray(new PreviewProvider[set.size()]));
}
@ -923,8 +923,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
*/
@Override
public void previewMenuActionPerformed(PreviewProvider provider) {
setPreviewType(provider);
WebPreviewUtils.preview(this, provider);
super.previewMenuActionPerformed(provider);
}
/**

2
designer-realize/src/main/java/com/fr/start/Designer.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.file.WebPreviewUtils;
import com.fr.design.actions.file.newReport.NewPolyReportAction;
@ -102,6 +103,7 @@ public class Designer extends BaseDesigner {
DesignUtils.clientSend(args);
return;
}
RestartHelper.deleteRecordFilesWhenStart();
preloadResource();

1
designer-realize/src/main/java/com/fr/start/module/PreStartActivator.java

@ -23,7 +23,6 @@ public class PreStartActivator extends Activator {
@Override
public void start() {
RestartHelper.deleteRecordFilesWhenStart();
CloudCenter.getInstance();
if (checkMultiStart()) {
return;

Loading…
Cancel
Save