Browse Source

Merge branch 'release/10.0' of https://code.fineres.com/scm/~lucian.chen/design into release/10.0

security/10.0
lucian 3 years ago
parent
commit
c01ace1053
  1. 11
      designer-base/src/main/java/com/fr/design/beans/ErrorMsgTextFieldAdapter.java
  2. 46
      designer-base/src/main/java/com/fr/design/beans/UITextFieldAdapter.java
  3. 3
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  4. 11
      designer-base/src/main/java/com/fr/design/fun/RegPaneProvider.java
  5. 11
      designer-base/src/main/java/com/fr/design/fun/TextFieldAdapterProvider.java
  6. 22
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractRegPaneProvider.java
  7. 22
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractTextFieldAdapterProvider.java
  8. 3
      designer-base/src/main/java/com/fr/design/gui/chart/ChartEditPaneProvider.java
  9. 60
      designer-base/src/main/java/com/fr/design/gui/frpane/RegFieldPane.java
  10. 9
      designer-base/src/main/java/com/fr/design/login/service/DesignerPassportManager.java
  11. 5
      designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java
  12. 36
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  13. 10
      designer-base/src/main/java/com/fr/design/mainframe/OpenFailedPane.java
  14. 4
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  15. 228
      designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java
  16. 51
      designer-base/src/main/java/com/fr/design/report/fit/CptFitAttrModel.java
  17. 44
      designer-base/src/main/java/com/fr/design/report/fit/FitAttrModel.java
  18. 53
      designer-base/src/main/java/com/fr/design/report/fit/FrmFitAttrModel.java
  19. 10
      designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java
  20. 105
      designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java
  21. 18
      designer-base/src/main/java/com/fr/design/report/fit/provider/AbstractFitAttrModelProvider.java
  22. 11
      designer-base/src/main/java/com/fr/design/report/fit/provider/FitAttrModelProvider.java
  23. 5
      designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java
  24. 26
      designer-base/src/main/java/com/fr/design/worker/open/OpenWorker.java
  25. 8
      designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java
  26. 2
      designer-base/src/main/java/com/fr/env/ErrorDialog.java
  27. 3
      designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java
  28. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  29. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  30. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  31. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  32. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
  33. 2
      designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java
  34. 2
      designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java
  35. 2
      designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java
  36. 4
      designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java
  37. 12
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  38. 11
      designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java
  39. 7
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java
  40. 5
      designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java
  41. 47
      designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java
  42. 53
      designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java
  43. 35
      designer-form/src/main/java/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java
  44. 35
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  45. 28
      designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java
  46. 6
      designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java
  47. 25
      designer-realize/src/main/java/com/fr/design/webattr/EditReportServerParameterPane.java
  48. 78
      designer-realize/src/main/java/com/fr/design/webattr/ServerFitAttrPane.java
  49. 42
      designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java
  50. 20
      designer-realize/src/main/java/com/fr/design/widget/ui/TextFieldEditorDefinePane.java
  51. 2
      designer-realize/src/main/java/com/fr/poly/PolyComponentsBar.java

11
designer-base/src/main/java/com/fr/design/beans/ErrorMsgTextFieldAdapter.java

@ -0,0 +1,11 @@
package com.fr.design.beans;
import javax.swing.JComponent;
public interface ErrorMsgTextFieldAdapter {
void setText(String str);
String getText();
JComponent getErrorMsgTextField();
}

46
designer-base/src/main/java/com/fr/design/beans/UITextFieldAdapter.java

@ -0,0 +1,46 @@
package com.fr.design.beans;
import com.fr.design.gui.itextfield.UITextField;
import javax.swing.JComponent;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
public class UITextFieldAdapter implements ErrorMsgTextFieldAdapter {
private final UITextField uiTextField = new UITextField();
public UITextFieldAdapter(){
addDocumentListener();
}
@Override
public void setText(String str) {
uiTextField.setText(str);
}
@Override
public String getText() {
return uiTextField.getText();
}
public void addDocumentListener() {
uiTextField.getDocument().addDocumentListener(new DocumentListener() {
public void changedUpdate(DocumentEvent e) {
uiTextField.setToolTipText(uiTextField.getText());
}
public void insertUpdate(DocumentEvent e) {
uiTextField.setToolTipText(uiTextField.getText());
}
public void removeUpdate(DocumentEvent e) {
uiTextField.setToolTipText(uiTextField.getText());
}
});
}
@Override
public JComponent getErrorMsgTextField() {
return uiTextField;
}
}

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

@ -4,6 +4,7 @@ package com.fr.design.file;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIMenuItem;
@ -753,7 +754,7 @@ public class MutilTempalteTabPane extends JComponent {
/** /**
* 关闭掉一个模板之后激活新的待显示模板 * 关闭掉一个模板之后激活新的待显示模板
*/ */
private void activePrevTemplateAfterClose() { public void activePrevTemplateAfterClose() {
if (openedTemplate.isEmpty()) { if (openedTemplate.isEmpty()) {
//新建并激活模板 //新建并激活模板
DesignerContext.getDesignerFrame().addAndActivateJTemplate(); DesignerContext.getDesignerFrame().addAndActivateJTemplate();

11
designer-base/src/main/java/com/fr/design/fun/RegPaneProvider.java

@ -0,0 +1,11 @@
package com.fr.design.fun;
import com.fr.design.gui.frpane.RegFieldPane;
import com.fr.stable.fun.mark.Immutable;
public interface RegPaneProvider extends Immutable {
int CURRENT_LEVEL = 1;
String XML_TAG = "RegPaneProvider";
RegFieldPane createRegPane();
}

11
designer-base/src/main/java/com/fr/design/fun/TextFieldAdapterProvider.java

@ -0,0 +1,11 @@
package com.fr.design.fun;
import com.fr.design.beans.ErrorMsgTextFieldAdapter;
import com.fr.stable.fun.mark.Immutable;
public interface TextFieldAdapterProvider extends Immutable {
String XML_TAG = "ErrorMesPaneWrapperProvider";
int CURRENT_LEVEL = 1;
ErrorMsgTextFieldAdapter createTextFieldAdapter();
}

22
designer-base/src/main/java/com/fr/design/fun/impl/AbstractRegPaneProvider.java

@ -0,0 +1,22 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.RegPaneProvider;
import com.fr.stable.fun.mark.API;
/**
* @author Joe
* 2021/10/8 15:19
*/
@API(level = RegPaneProvider.CURRENT_LEVEL)
public abstract class AbstractRegPaneProvider implements RegPaneProvider {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
}

22
designer-base/src/main/java/com/fr/design/fun/impl/AbstractTextFieldAdapterProvider.java

@ -0,0 +1,22 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.TextFieldAdapterProvider;
import com.fr.stable.fun.mark.API;
/**
* @author Joe
* 2021/10/8 15:17
*/
@API(level = TextFieldAdapterProvider.CURRENT_LEVEL)
public abstract class AbstractTextFieldAdapterProvider implements TextFieldAdapterProvider {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
}

3
designer-base/src/main/java/com/fr/design/gui/chart/ChartEditPaneProvider.java

@ -16,4 +16,7 @@ public interface ChartEditPaneProvider {
default void removeChartEditPaneActionListener(ChartEditPaneActionListener l) { default void removeChartEditPaneActionListener(ChartEditPaneActionListener l) {
} }
default void resetLastChartCollection() {
}
} }

60
designer-base/src/main/java/com/fr/design/gui/frpane/RegFieldPane.java

@ -1,21 +1,25 @@
package com.fr.design.gui.frpane; package com.fr.design.gui.frpane;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.ErrorMsgTextFieldAdapter;
import com.fr.design.beans.UITextFieldAdapter;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.TextFieldAdapterProvider;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.TextEditor; import com.fr.form.ui.TextEditor;
import com.fr.form.ui.reg.NoneReg; import com.fr.form.ui.reg.NoneReg;
import com.fr.form.ui.reg.RegExp; import com.fr.form.ui.reg.RegExp;
import com.fr.log.FineLoggerFactory;
import javax.swing.BorderFactory;
import javax.swing.*; import javax.swing.JPanel;
import javax.swing.event.DocumentEvent; import java.awt.BorderLayout;
import javax.swing.event.DocumentListener; import java.awt.Component;
import java.awt.*; import java.awt.Dimension;
/** /**
* Created by kerry on 2017/9/4. * Created by kerry on 2017/9/4.
@ -23,7 +27,7 @@ import java.awt.*;
public class RegFieldPane extends RegPane { public class RegFieldPane extends RegPane {
protected RegErrorMsgPane regErrorMsgPane; protected RegErrorMsgPane regErrorMsgPane;
public RegFieldPane(){ public RegFieldPane() {
this(ALL_REG_TYPE); this(ALL_REG_TYPE);
} }
@ -39,8 +43,8 @@ public class RegFieldPane extends RegPane {
@Override @Override
public void regChangeAction() { public void regChangeAction() {
RegExp regExp = (RegExp)getRegComboBox().getSelectedItem(); RegExp regExp = (RegExp) getRegComboBox().getSelectedItem();
if(regExp instanceof NoneReg){ if (regExp instanceof NoneReg) {
regErrorMsgPane.setVisible(false); regErrorMsgPane.setVisible(false);
return; return;
} }
@ -67,33 +71,35 @@ public class RegFieldPane extends RegPane {
} }
private static class RegErrorMsgPane extends BasicPane { private static class RegErrorMsgPane extends BasicPane {
private UITextField regErrorMsgField; private ErrorMsgTextFieldAdapter errorMsgTextFieldAdapter;
public RegErrorMsgPane() { public RegErrorMsgPane() {
initRegErrorMsgField();
setStyle();
}
private void setStyle() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0)); this.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0));
initRegErrorMsgField();
UILabel tipLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip")); UILabel tipLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip"));
tipLabel.setPreferredSize(new Dimension(60, 20)); tipLabel.setPreferredSize(new Dimension(60, 20));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{tipLabel, regErrorMsgField}}, TableLayoutHelper.FILL_LASTCOLUMN, 10, LayoutConstants.VGAP_MEDIUM); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{tipLabel, errorMsgTextFieldAdapter.getErrorMsgTextField()}}, TableLayoutHelper.FILL_LASTCOLUMN, 10, LayoutConstants.VGAP_MEDIUM);
this.add(panel); this.add(panel);
} }
private void initRegErrorMsgField() { private void initRegErrorMsgField() {
regErrorMsgField = new UITextField(); TextFieldAdapterProvider provider = ExtraDesignClassManager.getInstance().getSingle(TextFieldAdapterProvider.XML_TAG);
regErrorMsgField.getDocument().addDocumentListener(new DocumentListener() { if (provider == null) {
public void changedUpdate(DocumentEvent e) { errorMsgTextFieldAdapter = new UITextFieldAdapter();
regErrorMsgField.setToolTipText(regErrorMsgField.getText()); return;
} }
try {
public void insertUpdate(DocumentEvent e) { errorMsgTextFieldAdapter = provider.createTextFieldAdapter();
regErrorMsgField.setToolTipText(regErrorMsgField.getText()); } catch (Exception e) {
} FineLoggerFactory.getLogger().error(e.getMessage(), e);
errorMsgTextFieldAdapter = new UITextFieldAdapter();
public void removeUpdate(DocumentEvent e) { }
regErrorMsgField.setToolTipText(regErrorMsgField.getText());
}
});
} }
@Override @Override
@ -102,11 +108,11 @@ public class RegFieldPane extends RegPane {
} }
public void populate(TextEditor textEditor) { public void populate(TextEditor textEditor) {
regErrorMsgField.setText(textEditor.getRegErrorMessage()); errorMsgTextFieldAdapter.setText(textEditor.getRegErrorMessage());
} }
public void update(TextEditor textEditor) { public void update(TextEditor textEditor) {
textEditor.setRegErrorMessage(regErrorMsgField.getText()); textEditor.setRegErrorMessage(errorMsgTextFieldAdapter.getText());
} }
} }

9
designer-base/src/main/java/com/fr/design/login/service/DesignerPassportManager.java

@ -5,6 +5,7 @@ import com.fr.design.login.DesignerLoginType;
import com.fr.design.upm.event.CertificateEvent; import com.fr.design.upm.event.CertificateEvent;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.stable.StringUtils;
/** /**
* @author Lanlan * @author Lanlan
@ -96,6 +97,14 @@ public class DesignerPassportManager {
return uid; return uid;
} }
/**
* 登出帆软通行证
*/
public void logout() {
saveUserInfo(-1, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, DesignerLoginType.UNKNOWN, StringUtils.EMPTY);
EventDispatcher.fire(CertificateEvent.LOGOUT, StringUtils.EMPTY);
}
/** /**
* 保存登录信息 * 保存登录信息
*/ */

5
designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java

@ -86,7 +86,7 @@ public class DesktopCardPane extends BasicPane implements TargetModifiedListener
} else if (jt.isOpening()) { } else if (jt.isOpening()) {
showOpenStatus(); showOpenStatus();
} else if (jt.isOpenFailed()) { } else if (jt.isOpenFailed()) {
showOpenFailedCover(); showOpenFailedCover(jt.getTemplateOpenFailedTip());
} else { } else {
hideCover(); hideCover();
} }
@ -115,7 +115,8 @@ public class DesktopCardPane extends BasicPane implements TargetModifiedListener
layeredPane.moveToFront(loadingPane); layeredPane.moveToFront(loadingPane);
} }
public void showOpenFailedCover() { public void showOpenFailedCover(String text) {
failedPane.setFailedTip(text);
layeredPane.moveToFront(failedPane); layeredPane.moveToFront(failedPane);
} }

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

@ -114,6 +114,8 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
private JComponent centerPane; private JComponent centerPane;
private DesignModelAdapter<T, ?> designModel; private DesignModelAdapter<T, ?> designModel;
private PreviewProvider previewType; private PreviewProvider previewType;
private String templateOpenFailedTip;
/** /**
* 统计模板制作耗时 * 统计模板制作耗时
* *
@ -877,7 +879,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
} }
protected boolean export() throws Exception { protected boolean export() throws Exception {
return this.getTarget().export(TemplateResourceManager.getResource().saveTemplate(editingFILE)); return this.getTarget().export(TemplateResourceManager.getResource().saveTemplate(getEditingFILE()));
} }
@ -1051,35 +1053,49 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
/** /**
* 判断是否是新版设计器 * 判断是否是新版设计器
* *
* @param showTipPane 是否需要展示弹窗
* @return 是返回true * @return 是返回true
*/ */
public boolean isNewDesigner() { public boolean isNewDesigner(boolean showTipPane) {
String xmlDesignerVersion = getTarget().getXMLDesignerVersion(); String xmlDesignerVersion = getTarget().getXMLDesignerVersion();
if (isLowerThanHBB(xmlDesignerVersion)) { if (isLowerThanHBB(xmlDesignerVersion)) {
String info = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Open-New_Form_Tip"); String info = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Open-New_Form_Tip");
String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info"); String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info");
new InformationWarnPane(info, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show(); if (showTipPane) {
new InformationWarnPane(info, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show();
}
return true; return true;
} }
return false; return false;
} }
public boolean isNewDesigner() {
return isNewDesigner(true);
}
/** /**
* 是否是就版本设计器 * 是否是就版本设计器
* *
* @param showTipPane 是否需要展示弹窗
* @return 是就返回true * @return 是就返回true
*/ */
public boolean isOldDesigner() { public boolean isOldDesigner(boolean showTipPane) {
String xmlDesignerVersion = getTarget().getXMLDesignerVersion(); String xmlDesignerVersion = getTarget().getXMLDesignerVersion();
if (isHigherThanCurrent(xmlDesignerVersion)) { if (isHigherThanCurrent(xmlDesignerVersion)) {
String infor = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Version_Not_Match", DesignUtils.parseVersion(xmlDesignerVersion)); String infor = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Version_Not_Match", DesignUtils.parseVersion(xmlDesignerVersion));
String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info"); String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info");
new InformationWarnPane(infor, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show(); if (showTipPane) {
new InformationWarnPane(infor, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show();
}
return true; return true;
} }
return false; return false;
} }
public boolean isOldDesigner() {
return isOldDesigner(true);
}
/** /**
* *
*/ */
@ -1460,7 +1476,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
if (editingFILE == null || editingFILE instanceof MemFILE) { if (editingFILE == null || editingFILE instanceof MemFILE) {
return false; return false;
} }
this.getTarget().export(TemplateResourceManager.getResource().saveTemplate(editingFILE)); export();
this.editingFILE = editingFILE; this.editingFILE = editingFILE;
return true; return true;
} }
@ -1628,4 +1644,12 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
public String getRuntimeId() { public String getRuntimeId() {
return runtimeId; return runtimeId;
} }
public String getTemplateOpenFailedTip() {
return templateOpenFailedTip;
}
public void setTemplateOpenFailedTip(String templateOpenFailedTip) {
this.templateOpenFailedTip = templateOpenFailedTip;
}
} }

10
designer-base/src/main/java/com/fr/design/mainframe/OpenFailedPane.java

@ -24,6 +24,7 @@ public class OpenFailedPane extends JPanel {
private UILabel label; private UILabel label;
private MessageWithLink link; private MessageWithLink link;
private String defaultFailedText;
public OpenFailedPane() { public OpenFailedPane() {
this.setLayout(new LayoutManager() { this.setLayout(new LayoutManager() {
@ -83,11 +84,18 @@ public class OpenFailedPane extends JPanel {
}); });
} }
}; };
this.defaultFailedText = link.getText();
link.setBackground(Color.WHITE); link.setBackground(Color.WHITE);
this.add(label); this.add(label);
this.add(link); this.add(link);
} }
public void setFailedTip(String text) {
if (StringUtils.isEmpty(text)) {
this.link.setText(defaultFailedText);
} else {
this.link.setText(text);
}
}
} }

4
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -408,7 +408,9 @@ public abstract class ToolBarMenuDock {
menuDef.addShortCut(new OpenRecentReportMenuDef()); menuDef.addShortCut(new OpenRecentReportMenuDef());
addCloseCurrentTemplateAction(menuDef); if (!DesignModeContext.isDuchampMode()) {
addCloseCurrentTemplateAction(menuDef);
}
scs = plus.shortcut4FileMenu(); scs = plus.shortcut4FileMenu();
if (!ArrayUtils.isEmpty(scs)) { if (!ArrayUtils.isEmpty(scs)) {

228
designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java

@ -0,0 +1,228 @@
package com.fr.design.report.fit;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.report.fit.menupane.FitPreviewPane;
import com.fr.design.report.fit.menupane.FitRadioGroup;
import com.fr.design.report.fit.menupane.FontRadioGroup;
import com.fr.design.report.fit.provider.FitAttrModelProvider;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.report.fit.ReportFitAttr;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Set;
import java.util.stream.Collectors;
import static com.fr.design.i18n.Toolkit.i18nText;
public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> {
protected JPanel contentJPanel;
protected UIComboBox itemChoose;
protected java.util.List<FitAttrModel> fitAttrModelList = new ArrayList<>();
public FontRadioGroup fontRadioGroup;
public FitRadioGroup adaptRadioGroup;
public JPanel attrJPanel;
public FitPreviewPane previewJPanel;
public FitAttrModel fitAttrModel;
protected BaseFitAttrPane() {
initFitAttrModel();
}
private void initFitAttrModel() {
fitAttrModelList.add(new FrmFitAttrModel());
fitAttrModelList.add(new CptFitAttrModel());
Set<FitAttrModelProvider> fitAttrModelProviders = ExtraDesignClassManager.getInstance().getArray(FitAttrModelProvider.XML_TAG);
for (FitAttrModelProvider fitAttrModelProvider : fitAttrModelProviders) {
fitAttrModelList.add(fitAttrModelProvider);
}
fitAttrModelList = fitAttrModelList.stream().sorted(Comparator.comparing(FitAttrModel::getPriority).reversed()).collect(Collectors.toList());
}
protected void populateModel(FitAttrModel fitAttrModel) {
this.fitAttrModel = fitAttrModel;
if (attrJPanel != null) {
contentJPanel.remove(attrJPanel);
}
if (previewJPanel != null) {
contentJPanel.remove(previewJPanel);
}
fontRadioGroup = new FontRadioGroup();
adaptRadioGroup = new FitRadioGroup();
initAttrJPanel();
initPreviewJPanel();
}
protected void initAttrJPanel() {
int colCount = fitAttrModel.getFitTypes().length + 1;
Component[][] components = new Component[2][colCount];
initFitRadioGroup(fontRadioGroup, i18nText("Fine-Designer_Fit-Font"), new String[]{i18nText("Fine-Designer_Fit"), i18nText("Fine-Designer_Fit-No")}, components[0]);
initFitRadioGroup(adaptRadioGroup, fitAttrModel.getFitName(), Arrays.stream(fitAttrModel.getFitTypes()).map(FitType::description).toArray(String[]::new), components[1]);
double[] rowSize = new double[2];
double[] columnSize = new double[colCount];
for (int i = 0; i < rowSize.length; i++) {
rowSize[i] = 20;
}
for (int i = 0; i < columnSize.length; i++) {
if (i == 0) {
columnSize[i] = 80;
} else {
columnSize[i] = 100;
}
}
attrJPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
attrJPanel.setBorder(new EmptyBorder(0, 100, 10, 100));
contentJPanel.add(attrJPanel);
}
private void initFitRadioGroup(FitRadioGroup fitRadioGroup, String name, String[] options, Component[] components) {
components[0] = new UILabel(name);
for (int i = 0; i < options.length; i++) {
if (options[i] != null) {
UIRadioButton fontFitRadio = new UIRadioButton(options[i]);
fitRadioGroup.add(fontFitRadio);
components[i + 1] = fontFitRadio;
} else {
components[i + 1] = null;
}
}
fitRadioGroup.addActionListener(getPreviewActionListener());
}
protected ActionListener getPreviewActionListener() {
return new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
refreshPreviewJPanel();
}
};
}
protected void refreshPreviewJPanel() {
String previewIndex = getPreviewIndex();
previewJPanel.refreshPreview(previewIndex, fontRadioGroup.isEnabled());
}
protected String getPreviewIndex() {
return getStateInPC(adaptRadioGroup.getSelectRadioIndex()) + "" + fontRadioGroup.getSelectRadioIndex();
}
protected void initPreviewJPanel() {
previewJPanel = new FitPreviewPane();
contentJPanel.add(previewJPanel);
}
protected int getStateInPC(int index) {
FitType[] fitTypes = fitAttrModel.getFitTypes();
return fitTypes[index].getState();
}
protected int getOptionIndex(int state) {
FitType[] fitTypes = fitAttrModel.getFitTypes();
for (int i = 0; i < fitTypes.length; i++) {
if (ComparatorUtils.equals(state, fitTypes[i].getState())) {
return i;
}
}
return 0;
}
@Override
public void populateBean(ReportFitAttr ob) {
fontRadioGroup.selectIndexButton(ob.isFitFont() ? 0 : 1);
adaptRadioGroup.selectIndexButton(getOptionIndex(ob.fitStateInPC()));
refreshPreviewJPanel();
}
@Override
public ReportFitAttr updateBean() {
ReportFitAttr reportFitAttr = new ReportFitAttr();
reportFitAttr.setFitFont(fontRadioGroup.isFontFit());
reportFitAttr.setFitStateInPC(getStateInPC(adaptRadioGroup.getSelectRadioIndex()));
return reportFitAttr;
}
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
fontRadioGroup.setEnabled(enabled);
adaptRadioGroup.setEnabled(enabled);
refreshPreviewJPanel();
}
@Override
protected String title4PopupWindow() {
return i18nText("Fine-Designer_PC_Element_Case_Fit_Attr");
}
protected abstract String[] getItemNames();
protected void initComponents() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
contentJPanel = new JPanel();
contentJPanel.setLayout(FRGUIPaneFactory.createCenterFlowLayout());
this.add(contentJPanel);
initItemChoose();
}
private void initItemChoose() {
JPanel chooseJPanel = new JPanel();
chooseJPanel.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
ItemListener itemListener = getItemListener();
itemChoose = new UIComboBox(getItemNames());
itemChoose.addItemListener(itemListener);
UILabel belowSetLabel = new UILabel(i18nText("Fine-Design_Report_Blow_Set"));
JPanel buttonPane = GUICoreUtils.createFlowPane(new Component[]{
belowSetLabel, itemChoose}, FlowLayout.LEFT, 0, 0);
chooseJPanel.add(buttonPane);
chooseJPanel.setPreferredSize(new Dimension(500, 50));
JPanel jPanel = new JPanel();
jPanel.setLayout(FRGUIPaneFactory.createBorderLayout());
jPanel.add(chooseJPanel, BorderLayout.WEST);
contentJPanel.add(jPanel);
}
protected abstract ItemListener getItemListener();
public void populate(ReportFitAttr reportFitAttr) {
}
protected void refresh() {
validate();
repaint();
revalidate();
}
}

51
designer-base/src/main/java/com/fr/design/report/fit/CptFitAttrModel.java

@ -0,0 +1,51 @@
package com.fr.design.report.fit;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.JTemplate;
import com.fr.report.fit.ReportFitAttr;
import com.fr.report.fit.ReportFitConfig;
public class CptFitAttrModel implements FitAttrModel {
@Override
public FitType[] getFitTypes() {
return new FitType[]{
FitType.HORIZONTAL_FIT,
FitType.DOUBLE_FIT,
FitType.NOT_FIT
};
}
@Override
public String getFitName() {
return Toolkit.i18nText("Fine-Designer_Fit-Element");
}
@Override
public String getModelName() {
return Toolkit.i18nText("Fine-Design_Basic_Plain_Report");
}
@Override
public ReportFitAttr getGlobalReportFitAttr() {
return ReportFitConfig.getInstance().getCptFitAttr();
}
@Override
public void setGlobalReportFitAttr(ReportFitAttr reportFitAttr) {
ReportFitConfig.getInstance().setCptFitAttr(reportFitAttr);
}
@Override
public int getPriority() {
return 0;
}
@Override
public boolean isAvailable(JTemplate jTemplate) {
return jTemplate.isJWorkBook();
}
}

44
designer-base/src/main/java/com/fr/design/report/fit/FitAttrModel.java

@ -0,0 +1,44 @@
package com.fr.design.report.fit;
import com.fr.design.mainframe.JTemplate;
import com.fr.report.fit.ReportFitAttr;
public interface FitAttrModel {
/**
* @Description 名称比如普通报表决策报表等
**/
String getModelName();
/**
* @Description 自适应选项的名称比如返回表格
**/
String getFitName();
/**
* @Description 自适应选项
**/
FitType[] getFitTypes();
/**
* @Description 获取全局的自适应属性
**/
ReportFitAttr getGlobalReportFitAttr();
/**
* @Description 设置全局的自适应属性
* @param: reportFitAttr
**/
void setGlobalReportFitAttr(ReportFitAttr reportFitAttr);
/**
* @Description 优先级
**/
int getPriority();
/**
* @Description 是否可用
* @param: jTemplate
**/
boolean isAvailable(JTemplate jTemplate);
}

53
designer-base/src/main/java/com/fr/design/report/fit/FrmFitAttrModel.java

@ -0,0 +1,53 @@
package com.fr.design.report.fit;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.JTemplate;
import com.fr.report.fit.ReportFitAttr;
import com.fr.report.fit.ReportFitConfig;
public class FrmFitAttrModel implements FitAttrModel {
@Override
public String getModelName() {
return Toolkit.i18nText("Fine-Design_Basic_Decision_Report");
}
@Override
public String getFitName() {
return Toolkit.i18nText("Fine-Designer_Fit-Element");
}
public FitType[] getFitTypes() {
return new FitType[]{
FitType.DEFAULT,
FitType.HORIZONTAL_FIT,
FitType.DOUBLE_FIT,
FitType.NOT_FIT
};
}
@Override
public ReportFitAttr getGlobalReportFitAttr() {
return ReportFitConfig.getInstance().getFrmFitAttr();
}
@Override
public void setGlobalReportFitAttr(ReportFitAttr reportFitAttr) {
ReportFitConfig.getInstance().setFrmFitAttr(reportFitAttr);
}
@Override
public int getPriority() {
return 1;
}
@Override
public boolean isAvailable(JTemplate jTemplate) {
return !jTemplate.isJWorkBook();
}
}

10
designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java

@ -1,6 +1,5 @@
package com.fr.design.report.fit.menupane; package com.fr.design.report.fit.menupane;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.JTemplateAction; import com.fr.design.actions.JTemplateAction;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
@ -82,13 +81,8 @@ public class ReportFitAttrAction extends JTemplateAction {
} }
final FitProvider wbTpl = (FitProvider) jwb.getTarget(); final FitProvider wbTpl = (FitProvider) jwb.getTarget();
ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); ReportFitAttr fitAttr = wbTpl.getReportFitAttr();
if (jwb.isJWorkBook()) { TemplateFitAttrPane templateFitAttrPane = new TemplateFitAttrPane(jwb);
final TemplateFitAttrPane attrPane = new TemplateFitAttrPane(); showReportFitDialog(fitAttr, jwb, wbTpl, templateFitAttrPane);
showReportFitDialog(fitAttr, jwb, wbTpl, attrPane);
} else {
final ReportFitAttrPane attrPane = new ReportFitAttrPane();
showReportFitDialog(fitAttr, jwb, wbTpl, attrPane);
}
} }
private void showReportFitDialog(ReportFitAttr fitAttr, final JTemplate jwb, final FitProvider wbTpl, final BasicBeanPane<ReportFitAttr> attrPane) { private void showReportFitDialog(ReportFitAttr fitAttr, final JTemplate jwb, final FitProvider wbTpl, final BasicBeanPane<ReportFitAttr> attrPane) {

105
designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java

@ -1,55 +1,92 @@
package com.fr.design.report.fit.menupane; package com.fr.design.report.fit.menupane;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.report.fit.BaseFitAttrPane;
import com.fr.design.report.fit.FitAttrModel;
import com.fr.general.ComparatorUtils;
import com.fr.report.fit.FitProvider;
import com.fr.report.fit.ReportFitAttr; import com.fr.report.fit.ReportFitAttr;
import javax.swing.BorderFactory; import java.awt.event.ItemEvent;
import javax.swing.BoxLayout; import java.awt.event.ItemListener;
/**
* Created by 夏翔 on 2016/6/24.
*/
public class TemplateFitAttrPane extends BasicBeanPane<ReportFitAttr> {
private TemplateBrowserFitAttrPane attrPane;
public class TemplateFitAttrPane extends BaseFitAttrPane {
public TemplateFitAttrPane() { private JTemplate jwb;
public TemplateFitAttrPane(JTemplate jwb) {
this.jwb = jwb;
initComponents(); initComponents();
} }
private void initComponents() { @Override
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); protected void initComponents() {
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); super.initComponents();
attrPane = new TemplateBrowserFitAttrPane(); for (FitAttrModel fitAttrModel : fitAttrModelList) {
this.add(attrPane); if (fitAttrModel.isAvailable(jwb)) {
populateModel(fitAttrModel);
break;
}
}
}
@Override
public void populateBean(ReportFitAttr reportFitAttr) {
if (reportFitAttr == null) {
itemChoose.setSelectedItem(Toolkit.i18nText("Fine-Design_Report_Using_Server_Report_View_Settings"));
} else {
itemChoose.setSelectedItem(Toolkit.i18nText("Fine-Design_Report_I_Want_To_Set_Single"));
}
populate(reportFitAttr);
} }
/** public void populate(ReportFitAttr reportFitAttr) {
* 展示界面 if (reportFitAttr == null) {
* reportFitAttr = fitAttrModel.getGlobalReportFitAttr();
* @param fitAttr 自适应属性 }
*/
public void populateBean(ReportFitAttr fitAttr) { super.setEnabled(isTemplateSingleSet());
attrPane.populateBean(fitAttr); super.populateBean(reportFitAttr);
} }
/**
* 提交数据
*
* @return 界面上的更新数据
*/
public ReportFitAttr updateBean() { public ReportFitAttr updateBean() {
return attrPane.updateBean(); if (!isTemplateSingleSet()) {
return null;
} else {
return super.updateBean();
}
}
@Override
protected String[] getItemNames() {
return new String[]{Toolkit.i18nText("Fine-Design_Report_Using_Server_Report_View_Settings"),
Toolkit.i18nText("Fine-Design_Report_I_Want_To_Set_Single")};
}
@Override
protected ItemListener getItemListener() {
return new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
if(isTemplateSingleSet()){
if (jwb != null) {
FitProvider wbTpl = (FitProvider) jwb.getTarget();
ReportFitAttr fitAttr = wbTpl.getReportFitAttr();
populate(fitAttr);
}
}else {
populate(fitAttrModel.getGlobalReportFitAttr());
}
}
}
};
} }
/** private boolean isTemplateSingleSet() {
* 标题 return ComparatorUtils.equals(Toolkit.i18nText("Fine-Design_Report_I_Want_To_Set_Single"), itemChoose.getSelectedItem());
*
* @return 标题
*/
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_PC_Fit_Attr");
} }
} }

18
designer-base/src/main/java/com/fr/design/report/fit/provider/AbstractFitAttrModelProvider.java

@ -0,0 +1,18 @@
package com.fr.design.report.fit.provider;
import com.fr.stable.fun.mark.API;
@API(level = FitAttrModelProvider.CURRENT_LEVEL)
public abstract class AbstractFitAttrModelProvider implements FitAttrModelProvider {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public String mark4Provider() {
return getClass().getName();
}
}

11
designer-base/src/main/java/com/fr/design/report/fit/provider/FitAttrModelProvider.java

@ -0,0 +1,11 @@
package com.fr.design.report.fit.provider;
import com.fr.design.report.fit.FitAttrModel;
import com.fr.stable.fun.mark.Mutable;
public interface FitAttrModelProvider extends Mutable, FitAttrModel {
String XML_TAG = "FitAttrModelProvider";
int CURRENT_LEVEL = 1;
}

5
designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java

@ -26,6 +26,7 @@ import java.awt.BorderLayout;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.io.File;
import java.util.Map; import java.util.Map;
/** /**
@ -170,6 +171,10 @@ public class ModernUIPane<T> extends BasicPane {
public void clearCache() { public void clearCache() {
if (browser != null) { if (browser != null) {
browser.getCacheStorage().clearCache(); browser.getCacheStorage().clearCache();
File file = new File(browser.getContext().getCacheDir());
if (file.exists()) {
file.delete();
}
} }
} }

26
designer-base/src/main/java/com/fr/design/worker/open/OpenWorker.java

@ -7,12 +7,14 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.DesignerFrameFileDealerPane;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.DesignUtils;
import com.fr.design.worker.WorkerManager; import com.fr.design.worker.WorkerManager;
import com.fr.exception.DecryptTemplateException; import com.fr.exception.DecryptTemplateException;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import javax.swing.UIManager; import javax.swing.UIManager;
@ -51,6 +53,7 @@ public class OpenWorker<T> extends SwingWorker<T, Void> {
@Override @Override
protected T doInBackground() throws Exception { protected T doInBackground() throws Exception {
TimeUnit.SECONDS.sleep(5);
return this.callable.call(); return this.callable.call();
} }
@ -61,7 +64,7 @@ public class OpenWorker<T> extends SwingWorker<T, Void> {
} catch (CancellationException ignored) { } catch (CancellationException ignored) {
return; return;
} catch (Throwable t) { } catch (Throwable t) {
processFailed(); processFailed(StringUtils.EMPTY);
Throwable cause = t.getCause(); Throwable cause = t.getCause();
if (cause instanceof DecryptTemplateException) { if (cause instanceof DecryptTemplateException) {
FineJOptionPane.showMessageDialog( FineJOptionPane.showMessageDialog(
@ -91,6 +94,11 @@ public class OpenWorker<T> extends SwingWorker<T, Void> {
if (slowly && templateCallable != null) { if (slowly && templateCallable != null) {
try { try {
JTemplate<?, ?> book = templateCallable.call(); JTemplate<?, ?> book = templateCallable.call();
if (inValidDesigner(book)) {
String text = Toolkit.i18nText("Fine-Design_Report_Template_Version_Not_Match", DesignUtils.parseVersion(book.getTarget().getDesignerVersion()));
processFailed(text);
return;
}
FILE tplFile = book.getEditingFILE(); FILE tplFile = book.getEditingFILE();
JTemplate<?, ?> currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
// 当前tab页是正在打开的模板 // 当前tab页是正在打开的模板
@ -117,11 +125,21 @@ public class OpenWorker<T> extends SwingWorker<T, Void> {
WorkerManager.getInstance().removeWorker(taskName); WorkerManager.getInstance().removeWorker(taskName);
} }
private void processFailed() { private boolean inValidDesigner(JTemplate<?, ?> jt) {
return jt.isOldDesigner(false) || (!jt.isJWorkBook() && jt.isNewDesigner(false));
}
private void processFailed(String text) {
this.template.setOpenFailed(true); this.template.setOpenFailed(true);
this.template.setOpening(false); this.template.setOpening(false);
DesignerContext.getDesignerFrame().getCenterTemplateCardPane().showOpenFailedCover(); JTemplate<?, ?> currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
DesignerFrameFileDealerPane.getInstance().stateChange(); // 需要判断当前打开的模板是不是异步执行后失败的模板 是的话立即展示失败后的提示内容 否则只设置下失败的提示内容
if (ComparatorUtils.equals(currentTemplate.getEditingFILE().getName(), this.template.getName())) {
DesignerContext.getDesignerFrame().getCenterTemplateCardPane().showOpenFailedCover(text);
DesignerFrameFileDealerPane.getInstance().stateChange();
} else {
this.template.setTemplateOpenFailedTip(text);
}
WorkerManager.getInstance().removeWorker(taskName); WorkerManager.getInstance().removeWorker(taskName);
} }

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

@ -13,6 +13,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
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.stable.ListMap;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
@ -115,7 +116,12 @@ public abstract class CustomJobPane extends BasicBeanPane {
@Override @Override
public void populateBean(Object ob) { public void populateBean(Object ob) {
if (ob instanceof AbstractClassJob) { if (ob == null) {
// 自定义提交新增时初始化页面 REPORT-59256
this.classNameTextField.setText(StringUtils.EMPTY);
this.objectProperiesPane.populateBean(new ListMap());
}
else if (ob instanceof AbstractClassJob) {
AbstractClassJob cj = (AbstractClassJob) ob; AbstractClassJob cj = (AbstractClassJob) ob;
this.classNameTextField.setText(cj.getClassName()); this.classNameTextField.setText(cj.getClassName());
this.objectProperiesPane.populateBean(cj.getPropertyMap()); this.objectProperiesPane.populateBean(cj.getPropertyMap());

2
designer-base/src/main/java/com/fr/env/ErrorDialog.java vendored

@ -39,7 +39,7 @@ public class ErrorDialog extends JDialog implements ActionListener {
messagePanel.setBorder(BorderFactory.createEmptyBorder(5,0,0,0)); messagePanel.setBorder(BorderFactory.createEmptyBorder(5,0,0,0));
MessageWithLink messageWithLink = new MessageWithLink(message + ",", Toolkit.i18nText("Fine-Design_Basic_Sync_Help"), CloudCenter.getInstance().acquireUrlByKind("help.replacejars", "https://help.fanruan.com/finereport/doc-view-3268.html")); MessageWithLink messageWithLink = new MessageWithLink(message + ",", Toolkit.i18nText("Fine-Design_Basic_Sync_Help"), CloudCenter.getInstance().acquireUrlByKind("help.replacejars", "https://help.fanruan.com/finereport/doc-view-3268.html"));
messageWithLink.setPreferredSize(new Dimension(108, 20)); messageWithLink.setPreferredSize(new Dimension(150, 20));
JPanel messageLinkPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel messageLinkPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
messageLinkPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 5, 0)); messageLinkPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 5, 0));
messageLinkPane.add(messageWithLink); messageLinkPane.add(messageWithLink);

3
designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java vendored

@ -5,6 +5,7 @@ import com.fr.design.dialog.link.MessageWithLink;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
@ -62,7 +63,7 @@ public class SyncFailedPluginsDialog extends JDialog {
JPanel messagePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel messagePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
MessageWithLink messageWithLink = new MessageWithLink(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugin_Fail_Suggestion"),Toolkit.i18nText("Fine-Design_Basic_Sync_Deal_Immediately"), MessageWithLink messageWithLink = new MessageWithLink(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugin_Fail_Suggestion"),Toolkit.i18nText("Fine-Design_Basic_Sync_Deal_Immediately"),
CloudCenter.getInstance().acquireUrlByKind("help.installplugins", "https://help.fanruan.com/finereport/doc-view-2198.html")); CloudCenter.getInstance().acquireUrlByKind("help.installplugins", "https://help.fanruan.com/finereport/doc-view-2198.html"));
messageWithLink.setPreferredSize(new Dimension(316, 20)); messageWithLink.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.env.SyncFailedPluginsDialog.messageWithLink"));
messagePane.add(messageWithLink); messagePane.add(messageWithLink);
messagePane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 0)); messagePane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 0));

1
designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties

@ -7,4 +7,5 @@ com.fr.env.RemoteEnvPane.dialog=458*132
com.fr.design.version.check.dialog=490*95 com.fr.design.version.check.dialog=490*95
com.fr.design.version.detail.label=750*30 com.fr.design.version.detail.label=750*30
com.fr.design.version.detail.dialog=900*500 com.fr.design.version.detail.dialog=900*500
com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*36
com.fr.design.web.pane.text.field=450*20 com.fr.design.web.pane.text.field=450*20

1
designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties

@ -6,4 +6,5 @@ com.fr.env.RemoteEnvPane.dialog=458*132
com.fr.design.version.check.dialog=430*95 com.fr.design.version.check.dialog=430*95
com.fr.design.version.detail.label=650*30 com.fr.design.version.detail.label=650*30
com.fr.design.version.detail.dialog=800*500 com.fr.design.version.detail.dialog=800*500
com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*36
com.fr.design.web.pane.text.field=400*20 com.fr.design.web.pane.text.field=400*20

1
designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties

@ -6,4 +6,5 @@ com.fr.env.RemoteEnvPane.dialog=458*132
com.fr.design.version.check.dialog=450*95 com.fr.design.version.check.dialog=450*95
com.fr.design.version.detail.label=700*30 com.fr.design.version.detail.label=700*30
com.fr.design.version.detail.dialog=850*500 com.fr.design.version.detail.dialog=850*500
com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*36
com.fr.design.web.pane.text.field=450*20 com.fr.design.web.pane.text.field=450*20

1
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties

@ -7,4 +7,5 @@ com.fr.env.RemoteEnvPane.dialog=308*132
com.fr.design.version.check.dialog=230*95 com.fr.design.version.check.dialog=230*95
com.fr.design.version.detail.label=450*30 com.fr.design.version.detail.label=450*30
com.fr.design.version.detail.dialog=600*500 com.fr.design.version.detail.dialog=600*500
com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*20
com.fr.design.web.pane.text.field=450*20 com.fr.design.web.pane.text.field=450*20

1
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties

@ -6,4 +6,5 @@ com.fr.env.RemoteEnvPane.dialog=308*132
com.fr.design.version.check.dialog=230*95 com.fr.design.version.check.dialog=230*95
com.fr.design.version.detail.label=450*30 com.fr.design.version.detail.label=450*30
com.fr.design.version.detail.dialog=600*500 com.fr.design.version.detail.dialog=600*500
com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*20
com.fr.design.web.pane.text.field=450*20 com.fr.design.web.pane.text.field=450*20

2
designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java

@ -149,7 +149,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
public static WidgetOption[] initWidgetOption() { public static WidgetOption[] initWidgetOption() {
String[] chartIDs = ChartTypeManager.getInstance().getAllChartIDs(); String[] chartIDs = ChartTypeManager.getInstance().getChartIDs4Create();
ChartWidgetOption[] child = new ChartWidgetOption[chartIDs.length]; ChartWidgetOption[] child = new ChartWidgetOption[chartIDs.length];
int index = 0; int index = 0;

2
designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java

@ -31,7 +31,7 @@ import java.awt.Component;
public class ChartTypePane extends ChartCommonWizardPane implements CallbackEvent { public class ChartTypePane extends ChartCommonWizardPane implements CallbackEvent {
private static final long serialVersionUID = -1175602484968520546L; private static final long serialVersionUID = -1175602484968520546L;
private String[] chartIDs = ChartTypeManager.getInstanceWithCheck().getAllChartIDs(); private String[] chartIDs = ChartTypeManager.getInstanceWithCheck().getChartIDs4Create();
private JList mainTypeList = null; private JList mainTypeList = null;
private JList iconViewList = null; private JList iconViewList = null;

2
designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java

@ -55,6 +55,8 @@ public class ChartPropertyPane extends BaseChartPropertyPane {
chartEditPane.setContainer(container); chartEditPane.setContainer(container);
currentID = plotID; currentID = plotID;
resetChartEditPane(); resetChartEditPane();
} else {
chartEditPane.resetLastChartCollection();
} }
} }

4
designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java

@ -118,6 +118,10 @@ public class ChartEditPane extends BasicPane implements AttributeChange, Prepare
this.listenerList.remove(ChartEditPaneActionListener.class, l); this.listenerList.remove(ChartEditPaneActionListener.class, l);
} }
public void resetLastChartCollection() {
this.lastCollection = null;
}
private void fireAttributeChange(ChartCollection chartCollection) { private void fireAttributeChange(ChartCollection chartCollection) {
// Guaranteed to return a non-null array // Guaranteed to return a non-null array
Object[] listeners = listenerList.getListenerList(); Object[] listeners = listenerList.getListenerList();

12
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -4,6 +4,7 @@ import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.charttypes.ChartTypeManager; import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chartx.attr.ChartProvider; import com.fr.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
@ -18,6 +19,7 @@ import com.fr.design.mainframe.chart.gui.item.FlexibleComboBox;
import com.fr.design.mainframe.chart.gui.item.ItemEventType; import com.fr.design.mainframe.chart.gui.item.ItemEventType;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.mainframe.chart.mode.ChartEditMode;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
@ -173,7 +175,7 @@ public class ChartTypePane extends AbstractChartAttrPane {
Map<Integer, Map<String, FurtherBasicBeanPane<? extends ChartProvider>>> allChartTypePane, Map<Integer, Map<String, FurtherBasicBeanPane<? extends ChartProvider>>> allChartTypePane,
ActionListener autoButtonListener) { ActionListener autoButtonListener) {
String[] chartIDs = ChartTypeManager.getInstance().getAllChartIDsIncludeDisabled(); String[] chartIDs = ChartTypeManager.getInstance().getAllChartIDs();
for (String id : chartIDs) { for (String id : chartIDs) {
@ -288,7 +290,9 @@ public class ChartTypePane extends AbstractChartAttrPane {
Map.Entry<String, FurtherBasicBeanPane<? extends ChartProvider>> entry = iterator.next(); Map.Entry<String, FurtherBasicBeanPane<? extends ChartProvider>> entry = iterator.next();
String plotID = entry.getKey(); String plotID = entry.getKey();
if (ignore || ChartTypeManager.enabledChart(plotID)) { if (ignore || ChartTypeManager.enabledChart(plotID)) {
cards.add(entry.getValue()); if (ChartTypeManager.getInstance().isShowInDesigner(plotID)) {
cards.add(entry.getValue());
}
} }
} }
@ -310,7 +314,9 @@ public class ChartTypePane extends AbstractChartAttrPane {
//第一步就是重构cards //第一步就是重构cards
cards.clear(); cards.clear();
if (enabledChart) { if (ChartEditContext.duchampMode()) {
addOnePlotIDCards(priority, chartID);
} else if (enabledChart) {
if (collection.getChartCount() == 1) { if (collection.getChartCount() == 1) {
addAllCards(); addAllCards();
} else { } else {

11
designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java

@ -471,7 +471,11 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
} }
protected Component[][] createToolBarComponents() { protected Component[][] createToolBarComponents() {
return new Component[][]{ return ChartEditContext.duchampMode() ? new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")), isSort},
new Component[]{null, fullScreenDisplay},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")), collapse},
} : new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")), isSort}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")), isSort},
new Component[]{null, exportImages}, new Component[]{null, exportImages},
new Component[]{null, fullScreenDisplay}, new Component[]{null, fullScreenDisplay},
@ -480,7 +484,10 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
} }
protected Component[][] createToolBarComponentsWithOutSort() { protected Component[][] createToolBarComponentsWithOutSort() {
return new Component[][]{ return ChartEditContext.duchampMode() ? new Component[][]{
new Component[]{null, fullScreenDisplay},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")), collapse}
} : new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")), exportImages}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")), exportImages},
new Component[]{null, fullScreenDisplay}, new Component[]{null, fullScreenDisplay},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")), collapse} new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")), collapse}

7
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java

@ -101,7 +101,12 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {f}; double[] columnSize = {f};
double[] rowSize = {p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p};
Component[][] components = new Component[][]{ Component[][] components = ChartEditContext.duchampMode() ? new Component[][]{
new Component[]{null},
new Component[]{createTitlePane(Toolkit.i18nText("Fine-Design_Chart_Character"), textAttrPane)},
new Component[]{backgroundPane},
new Component[]{selectBackgroundPane}
} : new Component[][]{
new Component[]{null}, new Component[]{null},
new Component[]{createTitlePane(Toolkit.i18nText("Fine-Design_Chart_Character"), textAttrPane)}, new Component[]{createTitlePane(Toolkit.i18nText("Fine-Design_Chart_Character"), textAttrPane)},
new Component[]{backgroundPane}, new Component[]{backgroundPane},

5
designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java

@ -16,6 +16,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.style.series.ColorPickerPaneWithMaxMin; import com.fr.design.mainframe.chart.gui.style.series.ColorPickerPaneWithMaxMin;
import com.fr.design.mainframe.chart.gui.style.series.UIColorPickerPane; import com.fr.design.mainframe.chart.gui.style.series.UIColorPickerPane;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.attr.GaugeDetailStyle; import com.fr.plugin.chart.attr.GaugeDetailStyle;
@ -199,7 +200,9 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
if (attrLabelDetail == null || attrLabelDetail.getTextAttr() == null) { if (attrLabelDetail == null || attrLabelDetail.getTextAttr() == null) {
return; return;
} }
attrLabelDetail.getTextAttr().setFRFont(VanChartGaugePlot.THERMOMETER_LABEL_FONT); if (!ChartEditContext.duchampMode()) {
attrLabelDetail.getTextAttr().setFRFont(VanChartGaugePlot.THERMOMETER_LABEL_FONT);
}
if (gaugeLayout.getSelectedIndex() == 0) { if (gaugeLayout.getSelectedIndex() == 0) {
attrLabel.getAttrLabelDetail().setPosition(Constants.LEFT); attrLabel.getAttrLabelDetail().setPosition(Constants.LEFT);
attrLabel.getGaugeValueLabelDetail().setPosition(Constants.LEFT); attrLabel.getGaugeValueLabelDetail().setPosition(Constants.LEFT);

47
designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java

@ -22,6 +22,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.JForm; import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.backgroundpane.GradientBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.GradientBackgroundQuickPane;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.WidgetTitle; import com.fr.form.ui.WidgetTitle;
import com.fr.general.Background; import com.fr.general.Background;
@ -30,11 +31,23 @@ import com.fr.general.IOUtils;
import com.fr.general.act.TitlePacker; import com.fr.general.act.TitlePacker;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.*; import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.border.LineBorder; import javax.swing.border.LineBorder;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.BasicStroke;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Stroke;
/** /**
* @author Starryi * @author Starryi
@ -145,16 +158,16 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
double[] rowSize = supportCornerRadius ? new double[] {p, p, p, p} : new double[]{p, p, p}; double[] rowSize = supportCornerRadius ? new double[] {p, p, p, p} : new double[]{p, p, p};
double[] columnSize = {SETTING_LABEL_WIDTH, f}; double[] columnSize = {SETTING_LABEL_WIDTH, f};
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Background_Style")); UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Background_Style"));
Font font = uiLabel.getFont().deriveFont(Font.BOLD); Font font = uiLabel.getFont().deriveFont(Font.BOLD);
uiLabel.setFont(font); uiLabel.setFont(font);
uiLabel.setForeground(new Color(143, 143, 146)); uiLabel.setForeground(new Color(143, 143, 146));
JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane(new JComponent[][]{ JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane(new JComponent[][]{
{uiLabel, null}, {uiLabel, null},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Render_Style")), borderStyleCombo}, {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Render_Style")), createBorderLayoutNorthPaneWithComponent(borderStyleCombo)},
{this.borderLineAndImagePane, null}, {this.borderLineAndImagePane, null},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")), cornerSpinner}, {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")), cornerSpinner},
}, },
rowSize, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); rowSize, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1);
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
@ -180,7 +193,7 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
this.backgroundPane, this.backgroundPane,
this.backgroundOpacityPane); this.backgroundOpacityPane);
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Body_Content")); UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Body_Content"));
Font font = uiLabel.getFont().deriveFont(Font.BOLD); Font font = uiLabel.getFont().deriveFont(Font.BOLD);
uiLabel.setFont(font); uiLabel.setFont(font);
uiLabel.setForeground(new Color(143, 143, 146)); uiLabel.setForeground(new Color(143, 143, 146));
@ -297,11 +310,11 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
double[] columnSize = {SETTING_LABEL_WIDTH, f}; double[] columnSize = {SETTING_LABEL_WIDTH, f};
final JPanel bottomPane = TableLayoutHelper.createCommonTableLayoutPane( new JComponent[][]{ final JPanel bottomPane = TableLayoutHelper.createCommonTableLayoutPane( new JComponent[][]{
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Content")), titleTextPane}, {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Content")), titleTextPane},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Format")), titleFontFamilyComboBox}, {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Format")), createBorderLayoutNorthPaneWithComponent(titleFontFamilyComboBox)},
{null, createTitleFontButtonPane()}, {null, createTitleFontButtonPane()},
{titleInsetImagePane, null}, {titleInsetImagePane, null},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Text_Align")), titleAlignPane}, {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Text_Align")), titleAlignPane},
{this.createTitleBackgroundAndOpacityPane(), null}, {this.createTitleBackgroundAndOpacityPane(), null},
}, },
rowSize, columnSize, IntervalConstants.INTERVAL_L1); rowSize, columnSize, IntervalConstants.INTERVAL_L1);
@ -312,9 +325,9 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
titleVisibleCheckbox.setSelected(false); titleVisibleCheckbox.setSelected(false);
visibleComposedPane.add(titleVisibleCheckbox, BorderLayout.WEST); visibleComposedPane.add(titleVisibleCheckbox, BorderLayout.WEST);
visibleComposedPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Visible")), BorderLayout.CENTER); visibleComposedPane.add(FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Visible")), BorderLayout.CENTER);
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title")); UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title"));
Font font = uiLabel.getFont().deriveFont(Font.BOLD); Font font = uiLabel.getFont().deriveFont(Font.BOLD);
uiLabel.setFont(font); uiLabel.setFont(font);
uiLabel.setForeground(new Color(143, 143, 146)); uiLabel.setForeground(new Color(143, 143, 146));
@ -339,6 +352,12 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
return container; return container;
} }
private JPanel createBorderLayoutNorthPaneWithComponent(JComponent content) {
JPanel jPanel = new JPanel(new BorderLayout());
jPanel.add(content, BorderLayout.NORTH);
return jPanel;
}
protected JPanel createTitleFontButtonPane(){ protected JPanel createTitleFontButtonPane(){
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
@ -511,8 +530,8 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
// 确保BackgroundSpecialPane高度变化时,Label依然保持与其顶部对齐 // 确保BackgroundSpecialPane高度变化时,Label依然保持与其顶部对齐
JPanel backgroundLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel backgroundLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
backgroundLabelPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0)); backgroundLabelPane.setBorder(BorderFactory.createEmptyBorder(7, 0, 0, 0));
backgroundLabelPane.add(new UILabel(name), BorderLayout.NORTH); backgroundLabelPane.add(FRWidgetFactory.createLineWrapLabel(name), BorderLayout.NORTH);
JPanel backgroundComposedPane = TableLayoutHelper.createGapTableLayoutPane( JPanel backgroundComposedPane = TableLayoutHelper.createGapTableLayoutPane(
new JComponent[][]{ new JComponent[][]{
@ -522,7 +541,7 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
JPanel opacityComposedPane = TableLayoutHelper.createGapTableLayoutPane( JPanel opacityComposedPane = TableLayoutHelper.createGapTableLayoutPane(
new JComponent[][]{ new JComponent[][]{
{new UILabel(""), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Alpha"))}, {new UILabel(""), FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Alpha"))},
{new UILabel(""), opacityPane} {new UILabel(""), opacityPane}
}, },
new double[]{p, p}, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); new double[]{p, p}, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1);

53
designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java

@ -1,9 +1,17 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.ErrorMsgTextFieldAdapter;
import com.fr.design.beans.UITextFieldAdapter;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.*; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.fun.TextFieldAdapterProvider;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
@ -11,19 +19,19 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.ui.designer.component.FontSizeComboPane; import com.fr.design.widget.ui.designer.component.FontSizeComboPane;
import com.fr.form.ui.FieldEditor; import com.fr.form.ui.FieldEditor;
import com.fr.log.FineLoggerFactory;
import javax.swing.BorderFactory;
import javax.swing.*; import javax.swing.JPanel;
import javax.swing.event.DocumentEvent; import java.awt.BorderLayout;
import javax.swing.event.DocumentListener; import java.awt.Component;
import java.awt.*;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> { public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> {
protected UICheckBox allowBlankCheckBox; protected UICheckBox allowBlankCheckBox;
// richer:错误信息,是所有控件共有的属性,所以放到这里来 // richer:错误信息,是所有控件共有的属性,所以放到这里来
protected UITextField errorMsgTextField; protected ErrorMsgTextFieldAdapter errorMsgTextField;
protected JPanel validatePane; protected JPanel validatePane;
protected FontSizeComboPane fontSizePane; protected FontSizeComboPane fontSizePane;
protected UITextField labelNameTextField; protected UITextField labelNameTextField;
@ -40,7 +48,6 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
allowBlankCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Null")); allowBlankCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Null"));
allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
fontSizePane = new FontSizeComboPane(); fontSizePane = new FontSizeComboPane();
errorMsgTextField = new UITextField();
JPanel contentPane = this.setFirstContentPane(); JPanel contentPane = this.setFirstContentPane();
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.add(contentPane, BorderLayout.CENTER); jPanel.add(contentPane, BorderLayout.CENTER);
@ -76,23 +83,17 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initErrorMsgPane() { protected void initErrorMsgPane() {
// 错误信息 // 错误信息
errorMsgTextField = new UITextField(); TextFieldAdapterProvider provider = ExtraDesignClassManager.getInstance().getSingle(TextFieldAdapterProvider.XML_TAG);
// // richer:主要为了方便查看比较长的错误信息 if (provider == null) {
errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { errorMsgTextField = new UITextFieldAdapter();
return;
public void changedUpdate(DocumentEvent e) { }
errorMsgTextField.setToolTipText(errorMsgTextField.getText()); try {
} errorMsgTextField = provider.createTextFieldAdapter();
} catch (Exception e) {
public void insertUpdate(DocumentEvent e) { FineLoggerFactory.getLogger().error(e.getMessage(), e);
errorMsgTextField.setToolTipText(errorMsgTextField.getText()); errorMsgTextField = new UITextFieldAdapter();
} }
public void removeUpdate(DocumentEvent e) {
errorMsgTextField.setToolTipText(errorMsgTextField.getText());
}
});
} }
@ -111,7 +112,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip")); final UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip"));
JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final JPanel errorTipPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{uiLabel, errorMsgTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); final JPanel errorTipPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{uiLabel, errorMsgTextField.getErrorMsgTextField()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM);
errorTipPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0)); errorTipPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0));
borderPane.add(errorTipPane, BorderLayout.CENTER); borderPane.add(errorTipPane, BorderLayout.CENTER);
allowBlankCheckBox.addItemListener(new ItemListener() { allowBlankCheckBox.addItemListener(new ItemListener() {

35
designer-form/src/main/java/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java

@ -1,7 +1,9 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.fun.RegPaneProvider;
import com.fr.design.gui.frpane.RegFieldPane; import com.fr.design.gui.frpane.RegFieldPane;
import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.frpane.RegPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -11,10 +13,12 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.TextEditor; import com.fr.form.ui.TextEditor;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*; import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.Component;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
@ -65,27 +69,36 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
widgetValueLabel.setVerticalAlignment(SwingConstants.TOP); widgetValueLabel.setVerticalAlignment(SwingConstants.TOP);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField},
new Component[]{widgetValueLabel, formWidgetValuePane}, new Component[]{widgetValueLabel, formWidgetValuePane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark"), SwingConstants.LEFT), waterMarkDictPane}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark"), SwingConstants.LEFT), waterMarkDictPane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size"), SwingConstants.LEFT), fontSizePane} new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size"), SwingConstants.LEFT), fontSizePane}
}; };
double[] rowSize = {p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p};
double[] columnSize = {p,f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 3},{1, 1},{1, 1}}; int[][] rowCount = {{1, 1}, {1, 3}, {1, 1}, {1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
boundsPane.add(panel); boundsPane.add(panel);
return boundsPane; return boundsPane;
} }
public JPanel setValidatePane(){ public JPanel setValidatePane() {
return regPane; return regPane;
} }
protected RegFieldPane createRegPane() { protected RegFieldPane createRegPane() {
return new RegFieldPane(); RegPaneProvider provider = ExtraDesignClassManager.getInstance().getSingle(RegPaneProvider.XML_TAG);
if (provider == null) {
return new RegFieldPane();
}
try {
return provider.createRegPane();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return new RegFieldPane();
}
} }
@Override @Override
@ -102,7 +115,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
@Override @Override
protected TextEditor updateSubFieldEditorBean() { protected TextEditor updateSubFieldEditorBean() {
TextEditor ob = (TextEditor)creator.toData(); TextEditor ob = (TextEditor) creator.toData();
this.regPane.update(ob); this.regPane.update(ob);
ob.setWaterMark(waterMarkDictPane.getText()); ob.setWaterMark(waterMarkDictPane.getText());
formWidgetValuePane.update(ob); formWidgetValuePane.update(ob);

35
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -32,19 +32,17 @@ import com.fr.design.mainframe.alphafine.search.manager.impl.RecentSearchManager
import com.fr.design.mainframe.alphafine.search.manager.impl.RecommendSearchManager; import com.fr.design.mainframe.alphafine.search.manager.impl.RecommendSearchManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.SegmentationManager; import com.fr.design.mainframe.alphafine.search.manager.impl.SegmentationManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.SimilarSearchManager; import com.fr.design.mainframe.alphafine.search.manager.impl.SimilarSearchManager;
import com.fr.form.main.Form;
import com.fr.form.main.FormIO;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.io.TemplateWorkBookIO;
import com.fr.io.exporter.ImageExporter;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.main.impl.WorkBook;
import com.fr.stable.CodeUtils; import com.fr.stable.CodeUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.exporter.LocalExportOperator;
import com.fr.workspace.server.exporter.TemplateExportOperator;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.DefaultListModel; import javax.swing.DefaultListModel;
@ -601,14 +599,15 @@ public class AlphaFineDialog extends UIDialog {
checkWorker(); checkWorker();
this.showWorker = new SwingWorker<BufferedImage, Void>() { this.showWorker = new SwingWorker<BufferedImage, Void>() {
@Override @Override
protected BufferedImage doInBackground() { protected BufferedImage doInBackground() throws Exception {
Form form = null; byte[] bytes = null;
try { try {
form = FormIO.readForm(fileName); bytes = WorkContext.getCurrent().get(TemplateExportOperator.class).exportFormAsImageData(fileName);
} catch (Exception e) { } catch (Exception ignored) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); // 兼容下老版本
bytes = new LocalExportOperator().exportFormAsImageData(fileName);
} }
return FormIO.exportFormAsImage(form); return TemplateExportOperator.byteDataToImage(bytes);
} }
@Override @Override
@ -631,15 +630,15 @@ public class AlphaFineDialog extends UIDialog {
checkWorker(); checkWorker();
this.showWorker = new SwingWorker<BufferedImage, Void>() { this.showWorker = new SwingWorker<BufferedImage, Void>() {
@Override @Override
protected BufferedImage doInBackground() { protected BufferedImage doInBackground() throws Exception {
WorkBook workBook = null; byte[] bytes = null;
try { try {
workBook = (WorkBook) TemplateWorkBookIO.readTemplateWorkBook(fileName); bytes = WorkContext.getCurrent().get(TemplateExportOperator.class).exportWorkBookAsImageData(fileName);
} catch (Exception e) { } catch (Exception ignored) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); // 兼容下老版本
bytes = new LocalExportOperator().exportWorkBookAsImageData(fileName);
} }
BufferedImage bufferedImage = new ImageExporter().exportToImage(workBook); return TemplateExportOperator.byteDataToImage(bytes);
return bufferedImage;
} }
@Override @Override

28
designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java

@ -6,6 +6,7 @@ package com.fr.design.mainframe.bbs;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.bbs.BBSLoginUtils; import com.fr.design.bbs.BBSLoginUtils;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.extra.LoginContextListener; import com.fr.design.extra.LoginContextListener;
import com.fr.design.extra.UserLoginContext; import com.fr.design.extra.UserLoginContext;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -14,6 +15,7 @@ import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.locale.impl.BbsSpaceMark; import com.fr.design.locale.impl.BbsSpaceMark;
import com.fr.design.login.DesignerLoginHelper; import com.fr.design.login.DesignerLoginHelper;
import com.fr.design.login.DesignerLoginSource; import com.fr.design.login.DesignerLoginSource;
import com.fr.design.login.service.DesignerPassportManager;
import com.fr.design.login.utils.DesignerLoginUtils; import com.fr.design.login.utils.DesignerLoginUtils;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.os.impl.SupportOSImpl;
@ -29,6 +31,7 @@ import com.fr.general.locale.LocaleMark;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.EncodeConstants; import com.fr.stable.EncodeConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.JOptionPane;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.Frame; import java.awt.Frame;
@ -120,8 +123,33 @@ public class UserInfoLabel extends UILabel {
UserLoginContext.fireLoginContextListener(DesignerLoginSource.SWITCH_ACCOUNT); UserLoginContext.fireLoginContextListener(DesignerLoginSource.SWITCH_ACCOUNT);
} }
}); });
//退出登录
UIMenuItem logout = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_BBSLogin_Logout"));
logout.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
String[] options = new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_BBSLogin_Logout"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_Cancel")
};
int rv = FineJOptionPane.showConfirmDialog(
DesignerLoginHelper.getDialog(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_BBSLogin_Logout_Tip"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"),
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.WARNING_MESSAGE,
null,
options,
options[1]
);
if (rv == JOptionPane.YES_OPTION) {
DesignerPassportManager.getInstance().logout();
}
}
});
menu.add(priviteMessage); menu.add(priviteMessage);
menu.add(closeOther); menu.add(closeOther);
menu.add(logout);
GUICoreUtils.showPopupMenu(menu, UserInfoLabel.this, 0, MENU_HEIGHT); GUICoreUtils.showPopupMenu(menu, UserInfoLabel.this, 0, MENU_HEIGHT);
} else { } else {
UserLoginContext.fireLoginContextListener(DesignerLoginSource.NORMAL); UserLoginContext.fireLoginContextListener(DesignerLoginSource.NORMAL);

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

@ -86,6 +86,12 @@ public class UserInfoPane extends BasicPane {
markSignIn(text); markSignIn(text);
} }
}); });
EventDispatcher.listen(CertificateEvent.LOGOUT, new Listener<String>() {
@Override
public void on(Event event, String text) {
markUnSignIn();
}
});
} }
public UserInfoLabel getUserInfoLabel() { public UserInfoLabel getUserInfoLabel() {

25
designer-realize/src/main/java/com/fr/design/webattr/EditReportServerParameterPane.java

@ -9,6 +9,7 @@ import com.fr.config.PrintConfig;
import com.fr.config.ServerPreferenceConfig; import com.fr.config.ServerPreferenceConfig;
import com.fr.design.gui.frpane.LoadingBasicPane; import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.webattr.printsettings.GlobalNativePrintSettingPane; import com.fr.design.webattr.printsettings.GlobalNativePrintSettingPane;
import com.fr.design.webattr.printsettings.PrintSettingPane; import com.fr.design.webattr.printsettings.PrintSettingPane;
@ -17,6 +18,7 @@ import com.fr.report.web.WebPage;
import com.fr.report.web.WebView; import com.fr.report.web.WebView;
import com.fr.report.web.WebWrite; import com.fr.report.web.WebWrite;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebAttr;
import com.fr.workspace.WorkContext;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -44,9 +46,11 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
private PrintSettingPane printSettingPane; private PrintSettingPane printSettingPane;
private ServerFitAttrPane serverFitAttrPane;
@Override @Override
protected synchronized void initComponents(JPanel container) { protected synchronized void initComponents(JPanel container) {
JPanel defaultPane = container; JPanel defaultPane = container;
defaultPane.setLayout(FRGUIPaneFactory.createBorderLayout()); defaultPane.setLayout(FRGUIPaneFactory.createBorderLayout());
@ -61,11 +65,14 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportServerP_Import_JavaScript"), jsPane = new WebJsPane()); tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportServerP_Import_JavaScript"), jsPane = new WebJsPane());
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Error_Handler_Template"), errorTemplatePane = new ErrorTemplatePane()); tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Error_Handler_Template"), errorTemplatePane = new ErrorTemplatePane());
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Print_Setting"), printSettingPane = new PrintSettingPane(new GlobalNativePrintSettingPane())); tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Print_Setting"), printSettingPane = new PrintSettingPane(new GlobalNativePrintSettingPane()));
if (WorkContext.getCurrent().isRoot()) {
tabbedPane.addTab(Toolkit.i18nText("Fine-Designer_PC_Fit_Attr"), serverFitAttrPane = new ServerFitAttrPane());
}
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportServerP_Report_Server_Parameter"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportServerP_Report_Server_Parameter");
} }
public void populate(ServerPreferenceConfig reportServerPreferenceConfig) { public void populate(ServerPreferenceConfig reportServerPreferenceConfig) {
@ -78,13 +85,13 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
WebPage webPage = webAttr.getWebPage(); WebPage webPage = webAttr.getWebPage();
WebView webView = webAttr.getWebView(); WebView webView = webAttr.getWebView();
WebWrite webWrite = webAttr.getWebWrite(); WebWrite webWrite = webAttr.getWebWrite();
if(webPage != null){ if (webPage != null) {
pagePane.populateBean(webPage); pagePane.populateBean(webPage);
} }
if(webView != null){ if (webView != null) {
viewPane.populateBean(webView); viewPane.populateBean(webView);
} }
if(webWrite != null){ if (webWrite != null) {
writePane.populateBean(webWrite); writePane.populateBean(webWrite);
} }
cssPane.populate(webAttr); cssPane.populate(webAttr);
@ -93,13 +100,16 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
printSettingPane.populate(printSettings); printSettingPane.populate(printSettings);
this.errorTemplatePane.populateBean(reportServerPreferenceConfig.getErrorTemplate()); this.errorTemplatePane.populateBean(reportServerPreferenceConfig.getErrorTemplate());
if (serverFitAttrPane != null) {
serverFitAttrPane.populateBean(null);
}
} }
/** /**
* Update. * Update.
*/ */
public void update(ServerPreferenceConfig reportServerPreferenceConfig) { public void update(ServerPreferenceConfig reportServerPreferenceConfig) {
ReportWebAttr webAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); ReportWebAttr webAttr = ((ReportWebAttr) ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class));
webAttr.setWebPage(pagePane.updateBean()); webAttr.setWebPage(pagePane.updateBean());
webAttr.setWebView(viewPane.updateBean()); webAttr.setWebView(viewPane.updateBean());
webAttr.setWebWrite(writePane.updateBean()); webAttr.setWebWrite(writePane.updateBean());
@ -110,5 +120,8 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
PrintConfig.getInstance().setPrintSettings(printSettings); PrintConfig.getInstance().setPrintSettings(printSettings);
reportServerPreferenceConfig.setErrorTemplate(this.errorTemplatePane.updateBean()); reportServerPreferenceConfig.setErrorTemplate(this.errorTemplatePane.updateBean());
if (serverFitAttrPane != null) {
serverFitAttrPane.updateBean();
}
} }
} }

78
designer-realize/src/main/java/com/fr/design/webattr/ServerFitAttrPane.java

@ -0,0 +1,78 @@
package com.fr.design.webattr;
import com.fr.config.Configuration;
import com.fr.design.report.fit.BaseFitAttrPane;
import com.fr.design.report.fit.FitAttrModel;
import com.fr.general.ComparatorUtils;
import com.fr.report.fit.ReportFitAttr;
import com.fr.report.fit.ReportFitConfig;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
public class ServerFitAttrPane extends BaseFitAttrPane {
public ServerFitAttrPane() {
super();
initComponents();
}
@Override
protected void initComponents() {
super.initComponents();
populateModel(fitAttrModelList.get(0));
}
@Override
public void populateBean(ReportFitAttr reportFitAttr) {
reportFitAttr = fitAttrModel.getGlobalReportFitAttr();
super.populateBean(reportFitAttr);
}
public ReportFitAttr updateBean() {
ReportFitAttr reportFitAttr = super.updateBean();
Configurations.update(new Worker() {
@Override
public void run() {
fitAttrModel.setGlobalReportFitAttr(reportFitAttr);
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ReportFitConfig.class};
}
});
return null;
}
@Override
protected String[] getItemNames() {
return fitAttrModelList.stream().map(FitAttrModel::getModelName).toArray(String[]::new);
}
@Override
protected ItemListener getItemListener() {
ServerFitAttrPane self = this;
return new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
for (FitAttrModel fitAttrModel : fitAttrModelList) {
if (ComparatorUtils.equals(e.getItem(), fitAttrModel.getModelName())) {
self.populateModel(fitAttrModel);
populateBean(null);
refresh();
}
}
}
}
};
}
}

42
designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java

@ -1,19 +1,21 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.ErrorMsgTextFieldAdapter;
import com.fr.design.beans.UITextFieldAdapter;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.fun.TextFieldAdapterProvider;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.FieldEditor; import com.fr.form.ui.FieldEditor;
import com.fr.log.FineLoggerFactory;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
@ -22,7 +24,7 @@ import java.awt.event.ItemListener;
public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> { public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> {
protected UICheckBox allowBlankCheckBox; protected UICheckBox allowBlankCheckBox;
// richer:错误信息,是所有控件共有的属性,所以放到这里来 // richer:错误信息,是所有控件共有的属性,所以放到这里来
protected UITextField errorMsgTextField; protected ErrorMsgTextFieldAdapter errorMsgTextField;
protected JPanel validatePane; protected JPanel validatePane;
public FieldEditorDefinePane() { public FieldEditorDefinePane() {
@ -45,23 +47,17 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initErrorMsgPane() { protected void initErrorMsgPane() {
// 错误信息 // 错误信息
errorMsgTextField = new UITextField(); TextFieldAdapterProvider provider = ExtraDesignClassManager.getInstance().getSingle(TextFieldAdapterProvider.XML_TAG);
// // richer:主要为了方便查看比较长的错误信息 if (provider == null) {
errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { errorMsgTextField = new UITextFieldAdapter();
return;
public void changedUpdate(DocumentEvent e) { }
errorMsgTextField.setToolTipText(errorMsgTextField.getText()); try {
} errorMsgTextField = provider.createTextFieldAdapter();
} catch (Exception e) {
public void insertUpdate(DocumentEvent e) { FineLoggerFactory.getLogger().error(e.getMessage(), e);
errorMsgTextField.setToolTipText(errorMsgTextField.getText()); errorMsgTextField = new UITextFieldAdapter();
} }
public void removeUpdate(DocumentEvent e) {
errorMsgTextField.setToolTipText(errorMsgTextField.getText());
}
});
} }
@Override @Override
@ -101,7 +97,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
allowBlankCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Null")); allowBlankCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Null"));
allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final JPanel errorTipPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{uiLabel, errorMsgTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); final JPanel errorTipPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{uiLabel, errorMsgTextField.getErrorMsgTextField()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM);
errorTipPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0)); errorTipPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0));
borderPane.add(errorTipPane, BorderLayout.CENTER); borderPane.add(errorTipPane, BorderLayout.CENTER);
allowBlankCheckBox.addItemListener(new ItemListener() { allowBlankCheckBox.addItemListener(new ItemListener() {
@ -117,7 +113,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
new Component[]{allowBlankCheckBox}, new Component[]{allowBlankCheckBox},
new Component[]{borderPane}, new Component[]{borderPane},
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,TableLayoutHelper.FILL_LASTCOLUMN, 5, 5); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, 5, 5);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L6, 0)); panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L6, 0));
validatePane.add(panel, BorderLayout.NORTH); validatePane.add(panel, BorderLayout.NORTH);

20
designer-realize/src/main/java/com/fr/design/widget/ui/TextFieldEditorDefinePane.java

@ -1,14 +1,16 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.RegPaneProvider;
import com.fr.design.gui.frpane.RegFieldPane; import com.fr.design.gui.frpane.RegFieldPane;
import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.frpane.RegPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.TextEditor; import com.fr.form.ui.TextEditor;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
@ -60,7 +62,17 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
protected RegFieldPane createRegPane() { protected RegFieldPane createRegPane() {
return new RegFieldPane(); RegPaneProvider provider = ExtraDesignClassManager.getInstance().getSingle(RegPaneProvider.XML_TAG);
if (provider == null) {
return new RegFieldPane();
}
try {
return provider.createRegPane();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return new RegFieldPane();
}
} }
@Override @Override

2
designer-realize/src/main/java/com/fr/poly/PolyComponentsBar.java

@ -46,7 +46,7 @@ public class PolyComponentsBar extends JToolBar {
setFloatable(false); setFloatable(false);
setBackground(UIConstants.TOOLBARUI_BACKGROUND); setBackground(UIConstants.TOOLBARUI_BACKGROUND);
setLayout(FRGUIPaneFactory.create1ColumnGridLayout()); setLayout(FRGUIPaneFactory.create1ColumnGridLayout());
String[] iDs = ChartTypeManager.getInstance().getAllChartIDs(); String[] iDs = ChartTypeManager.getInstance().getChartIDs4Create();
int typeLen = iDs.length < MAX_BAR_NUM ? iDs.length : MAX_BAR_NUM; int typeLen = iDs.length < MAX_BAR_NUM ? iDs.length : MAX_BAR_NUM;
serIcons = new SerIcon[typeLen + 1]; serIcons = new SerIcon[typeLen + 1];
serIcons[0] = new SerIcon( serIcons[0] = new SerIcon(

Loading…
Cancel
Save