Browse Source

Merge pull request #761 in BA/design from ~PAUL/design:master to master

* commit '59a0387289e5d1aed7b4d9a951df7bf0c04f2cf1': (127 commits)
  无jira任务,屏蔽组件隐藏新功能
  无JIRA任务, release设计器支持1.7jdk
  REPORT-2052 漏传
  超级链接中,图表链接正常显示。
  无JIRA任务 国际化
  无jira任务,提交国际化
  分两行显示checkbox和输入框,适应国际化情况。
  分两行显示checkbox和输入框,适应国际化情况。
  8.0插件启用禁用重启设计器confirm对话框保留,在9.0删除
  REPORT-1957,并且修改参数说明资源文件的编码方式为utf-8,加载资源时使用utf-8编码
  REPORT-1858 frm组件隐藏
  分两行显示checkbox和输入框,适应国际化情况。
  REPORT-1980 换成listmap维持原有顺序
  “REPORT-2030删除designer对话框”
  无任务 调整代码
  editlabel not append origin label
  补上句号
  国际化少了句号
  无JIRA任务 tab布局字体、字号无法修改,release同步到dev
  修改国际化文件
  ...
master
richie 8 years ago
parent
commit
3ac56bdd2a
  1. 52
      designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java
  2. 14
      designer/src/com/fr/design/report/ReportColumnsPane.java
  3. 60
      designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java
  4. 4
      designer/src/com/fr/design/report/mobile/MobileUseHtmlGroupPane.java
  5. 2
      designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java
  6. 4
      designer/src/com/fr/design/webattr/PageToolBarPane.java
  7. 14
      designer/src/com/fr/design/webattr/PageWebSettingPane.java
  8. 49
      designer/src/com/fr/design/webattr/ToolBarDragPane.java
  9. 6
      designer/src/com/fr/design/webattr/WriteToolBarPane.java
  10. 9
      designer/src/com/fr/design/webattr/WriteWebSettingPane.java
  11. 129
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  12. 2
      designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java
  13. 36
      designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java
  14. 39
      designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java
  15. 4
      designer/src/com/fr/poly/hanlder/BottomCornerMouseHanlder.java
  16. 38
      designer_base/src/com/fr/design/actions/community/VideoAction.java
  17. 25
      designer_base/src/com/fr/design/actions/help/AboutPane.java
  18. 10
      designer_base/src/com/fr/design/actions/help/TutorialAction.java
  19. 13
      designer_base/src/com/fr/design/beans/location/MoveUtils.java
  20. 2
      designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java
  21. 56
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  22. 8
      designer_base/src/com/fr/design/dialog/mobile/MobileUseHtmlGroupBeanPane.java
  23. 6
      designer_base/src/com/fr/design/editor/editor/DateEditor.java
  24. 2
      designer_base/src/com/fr/design/extra/PluginHelper.java
  25. 221
      designer_base/src/com/fr/design/formula/FormulaPane.java
  26. 14
      designer_base/src/com/fr/design/formula/FunctionManagerPane.java
  27. 22
      designer_base/src/com/fr/design/fun/DBTableDataMenuHandler.java
  28. 20
      designer_base/src/com/fr/design/fun/DesignerStartOpenFileProcessor.java
  29. 34
      designer_base/src/com/fr/design/fun/impl/AbstractDBTableDataMenuHandler.java
  30. 18
      designer_base/src/com/fr/design/fun/impl/AbstractDesignerStartOpenFileProcessor.java
  31. 5
      designer_base/src/com/fr/design/gui/controlpane/JListControlPane.java
  32. 3
      designer_base/src/com/fr/design/gui/date/UIDatePicker.java
  33. 3
      designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java
  34. 33
      designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java
  35. 3
      designer_base/src/com/fr/design/gui/ibutton/UIColorButton.java
  36. 7
      designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java
  37. 54
      designer_base/src/com/fr/design/gui/itable/AbstractPropertyTable.java
  38. 10
      designer_base/src/com/fr/design/gui/itable/PropertyGroup.java
  39. BIN
      designer_base/src/com/fr/design/images/buttonicon/delete.png
  40. BIN
      designer_base/src/com/fr/design/images/reportcolumns/col_en.png
  41. BIN
      designer_base/src/com/fr/design/images/reportcolumns/row_en.png
  42. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/$$$.txt
  43. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/$$page_number.txt
  44. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/$$totalPage_number.txt
  45. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_authority.txt
  46. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_username.txt
  47. 4
      designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_userposition.txt
  48. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/NOFILTER.txt
  49. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/NULL.txt
  50. 4
      designer_base/src/com/fr/design/insert/formula/variable/cn/contextPath.txt
  51. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/curReport.txt
  52. 4
      designer_base/src/com/fr/design/insert/formula/variable/cn/formletName.txt
  53. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/fr_submitinfo.txt
  54. 4
      designer_base/src/com/fr/design/insert/formula/variable/cn/reportName.txt
  55. 4
      designer_base/src/com/fr/design/insert/formula/variable/cn/serverName.txt
  56. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/serverPort.txt
  57. 4
      designer_base/src/com/fr/design/insert/formula/variable/cn/serverSchema.txt
  58. 4
      designer_base/src/com/fr/design/insert/formula/variable/cn/serverURL.txt
  59. 3
      designer_base/src/com/fr/design/insert/formula/variable/cn/servletURL.txt
  60. 5
      designer_base/src/com/fr/design/insert/formula/variable/cn/sessionID.txt
  61. 2
      designer_base/src/com/fr/design/insert/formula/variable/en/$$$.txt
  62. 2
      designer_base/src/com/fr/design/insert/formula/variable/en/$fr_authority.txt
  63. 2
      designer_base/src/com/fr/design/insert/formula/variable/en/$fr_username.txt
  64. 2
      designer_base/src/com/fr/design/insert/formula/variable/en/$fr_userposition.txt
  65. 2
      designer_base/src/com/fr/design/insert/formula/variable/en/NOFILTER.txt
  66. 2
      designer_base/src/com/fr/design/insert/formula/variable/en/contextPath.txt
  67. 4
      designer_base/src/com/fr/design/insert/formula/variable/en/formletName.txt
  68. 2
      designer_base/src/com/fr/design/insert/formula/variable/en/fr_submitinfo.txt
  69. 4
      designer_base/src/com/fr/design/insert/formula/variable/en/reportName.txt
  70. 4
      designer_base/src/com/fr/design/insert/formula/variable/en/serverName.txt
  71. 4
      designer_base/src/com/fr/design/insert/formula/variable/en/serverSchema.txt
  72. 4
      designer_base/src/com/fr/design/insert/formula/variable/en/serverURL.txt
  73. 3
      designer_base/src/com/fr/design/insert/formula/variable/en/servletURL.txt
  74. 15
      designer_base/src/com/fr/design/locale/designer.properties
  75. 15
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  76. 11
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  77. 13
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  78. 11
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  79. 11
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  80. 3
      designer_base/src/com/fr/design/mainframe/DesignerFrame.java
  81. 2
      designer_base/src/com/fr/design/mainframe/WestRegionContainerPane.java
  82. 14
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  83. 10
      designer_base/src/com/fr/design/present/dict/TableDataDictPane.java
  84. 2
      designer_base/src/com/fr/design/roleAuthority/RoleTree.java
  85. 53
      designer_base/src/com/fr/design/style/background/BackgroundButtonPane.java
  86. 48
      designer_base/src/com/fr/design/style/background/BackgroundFactory.java
  87. 8
      designer_base/src/com/fr/design/style/background/gradient/GradientBackgroundPane.java
  88. 55
      designer_base/src/com/fr/design/style/background/impl/ImageBackgroundPane.java
  89. 5
      designer_base/src/com/fr/design/style/background/impl/ImageBackgroundPane4Browser.java
  90. 79
      designer_base/src/com/fr/design/style/background/impl/ImageButtonBackgroundPane.java
  91. 228
      designer_base/src/com/fr/design/style/color/ColorSelectConfigManager.java
  92. 17
      designer_base/src/com/fr/design/style/color/ColorSelectConfigManagerProvider.java
  93. 25
      designer_base/src/com/fr/design/style/color/ColorSelectPane.java
  94. 23
      designer_base/src/com/fr/design/style/color/CustomChooserPanel.java
  95. 11
      designer_base/src/com/fr/design/style/color/NewColorSelectPane.java
  96. 50
      designer_base/src/com/fr/design/style/color/PickColorButtonFactory.java
  97. 39
      designer_base/src/com/fr/design/style/color/UsedColorPane.java
  98. 1
      designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java
  99. 2
      designer_base/src/com/fr/design/write/submit/CustomJobPane.java
  100. 6
      designer_base/src/com/fr/env/RemoteEnv.java
  101. Some files were not shown because too many files have changed in this diff Show More

52
designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java

@ -3,7 +3,9 @@ package com.fr.design.mainframe.cell.settingpane;
import java.awt.*; import java.awt.*;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.Locale;
import com.fr.base.FRContext;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -76,23 +78,23 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize1 = {p, p, p, p, p, p, p}; double[] rowSize1 = {p, p, p, p, p, p, p};
double[] columnSize1 = {p, f}; double[] columnSize1 = {p, f};
UILabel autoAdjustLabel = new UILabel(Inter.getLocText("Auto_Adjust_Size") + ":", SwingConstants.RIGHT); UILabel autoAdjustLabel = new UILabel(Inter.getLocText("FR-Designer_Auto_Adjust_Size") + ":", SwingConstants.RIGHT);
autoAdjustLabel.setVerticalAlignment(UILabel.TOP); autoAdjustLabel.setVerticalAlignment(UILabel.TOP);
Component[][] components1 = new Component[][]{ Component[][] components1 = new Component[][]{
new Component[]{autoAdjustLabel, autoshrik}, new Component[]{autoAdjustLabel, autoshrik},
new Component[]{new UILabel(Inter.getLocText("Preview") + ":", SwingConstants.RIGHT), previewCellContent}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Preview") + ":", SwingConstants.RIGHT), previewCellContent},
new Component[]{new UILabel(Inter.getLocText("CellWrite-Print_Export") + ":", SwingConstants.RIGHT), printAndExportContent}, new Component[]{new UILabel(Inter.getLocText("CellWrite-Print_Export") + ":", SwingConstants.RIGHT), printAndExportContent},
new Component[]{null, printAndExportBackground}, new Component[]{null, printAndExportBackground},
new Component[]{new UILabel(Inter.getLocText("Show_Content") + ":", SwingConstants.RIGHT), showContent}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Show_Content") + ":", SwingConstants.RIGHT), showContent},
new Component[]{null, fileNamePane}, new Component[]{null, fileNamePane},
new Component[]{new UILabel(Inter.getLocText("CellWrite-ToolTip") + ":", SwingConstants.RIGHT), tooltipTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_CellWrite_ToolTip") + ":", SwingConstants.RIGHT), tooltipTextField},
}; };
JPanel northContentPane = TableLayoutHelper.createTableLayoutPane(components1, rowSize1, columnSize1); JPanel northContentPane = TableLayoutHelper.createTableLayoutPane(components1, rowSize1, columnSize1);
double[] rowSize2 = {p, p, p, p, p, p}; double[] rowSize2 = {p, p, p, p, p, p};
double[] columnSize2 = {p, f}; double[] columnSize2 = {p, f};
Component[][] components2 = new Component[][]{ Component[][] components2 = new Component[][]{
new Component[]{new JSeparator(JSeparator.HORIZONTAL), null}, new Component[]{new JSeparator(JSeparator.HORIZONTAL), null},
new Component[]{new UILabel(Inter.getLocText("Pagination")), null}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Pagination")), null},
new Component[]{pageBeforeRowCheckBox, pageAfterRowCheckBox}, new Component[]{pageBeforeRowCheckBox, pageAfterRowCheckBox},
new Component[]{pageBeforeColumnCheckBox, pageAfterColumnCheckBox}, new Component[]{pageBeforeColumnCheckBox, pageAfterColumnCheckBox},
new Component[]{canBreakOnPaginateCheckBox, null}, new Component[]{canBreakOnPaginateCheckBox, null},
@ -121,22 +123,28 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
private JPanel createNormal() { private JPanel createNormal() {
String[] AjustRowTypes = new String[]{ String[] AjustRowTypes = new String[]{
Inter.getLocText("No"), Inter.getLocText("Utils-Row_Height"), Inter.getLocText("Utils-Column_Width"), Inter.getLocText("Default")}; Inter.getLocText("FR-Designer_No"), Inter.getLocText("Utils-Row_Height"), Inter.getLocText("Utils-Column_Width"), Inter.getLocText("FR-Designer_DEFAULT")};
autoshrik = new UIButtonGroup(AjustRowTypes); autoshrik = new UIButtonGroup(AjustRowTypes);
autoshrik.setTwoLine(); if (FRContext.getLocale().equals(Locale.US)) {
autoshrik.setLayout(new GridLayout(2, 2, 1, 1)); // 英文显示不全,故每行一个按钮
autoshrik.setFourLine();
autoshrik.setLayout(new GridLayout(4, 1, 1, 1));
} else {
autoshrik.setTwoLine();
autoshrik.setLayout(new GridLayout(2, 2, 1, 1));
}
previewCellContent = new UICheckBox(Inter.getLocText("CellWrite-Preview_Cell_Content")); previewCellContent = new UICheckBox(Inter.getLocText("CellWrite-Preview_Cell_Content"));
printAndExportContent = new UICheckBox(Inter.getLocText("CellWrite-Print_Content")); printAndExportContent = new UICheckBox(Inter.getLocText("CellWrite-Print_Content"));
printAndExportBackground = new UICheckBox(Inter.getLocText("CellWrite-Print_Background")); printAndExportBackground = new UICheckBox(Inter.getLocText("CellWrite-Print_Background"));
showContent = new UIComboBox(new String[]{Inter.getLocText("Default"), Inter.getLocText("CellWrite-Show_As_Image"), Inter.getLocText("CellWrite-Show_As_HTML"), showContent = new UIComboBox(new String[]{Inter.getLocText("FR-Designer_DEFAULT"), Inter.getLocText("CellWrite-Show_As_Image"), Inter.getLocText("CellWrite-Show_As_HTML"),
Inter.getLocText("ShowAsDownload")}); Inter.getLocText("FR-Designer_Show_As_Download")});
final CardLayout fileNameLayout = new CardLayout(); final CardLayout fileNameLayout = new CardLayout();
final JPanel fileNamePane = new JPanel(fileNameLayout); final JPanel fileNamePane = new JPanel(fileNameLayout);
JPanel fileNameCCPane = new JPanel(new BorderLayout(4, 0)); JPanel fileNameCCPane = new JPanel(new BorderLayout(4, 0));
fileNameCCPane.add(new UILabel(Inter.getLocText("FileNameForDownload")), BorderLayout.WEST); fileNameCCPane.add(new UILabel(Inter.getLocText("FR-Designer_File_Name_For_Download")), BorderLayout.WEST);
fileNameTextField = new UITextField(); fileNameTextField = new UITextField();
tooltipTextField = new UITextField(); tooltipTextField = new UITextField();
@ -186,13 +194,13 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
} }
private void initAllNames() { private void initAllNames() {
autoshrik.setGlobalName(Inter.getLocText("Auto_Adjust_Size")); autoshrik.setGlobalName(Inter.getLocText("FR-Designer_Auto_Adjust_Size"));
previewCellContent.setGlobalName(Inter.getLocText("Preview")); previewCellContent.setGlobalName(Inter.getLocText("FR-Designer_Preview"));
printAndExportContent.setGlobalName(Inter.getLocText("CellWrite-Preview_Cell_Content")); printAndExportContent.setGlobalName(Inter.getLocText("CellWrite-Preview_Cell_Content"));
printAndExportBackground.setGlobalName(Inter.getLocText("CellWrite-Print_Background")); printAndExportBackground.setGlobalName(Inter.getLocText("CellWrite-Print_Background"));
showContent.setGlobalName(Inter.getLocText("Show_Content")); showContent.setGlobalName(Inter.getLocText("FR-Designer_Show_Content"));
fileNameTextField.setGlobalName(Inter.getLocText("Show_Content")); fileNameTextField.setGlobalName(Inter.getLocText("FR-Designer_Show_Content"));
tooltipTextField.setGlobalName(Inter.getLocText("CellWrite-ToolTip")); tooltipTextField.setGlobalName(Inter.getLocText("FR-Designer_CellWrite_ToolTip"));
pageBeforeRowCheckBox.setGlobalName(Inter.getLocText("CellWrite-Page_Before_Row")); pageBeforeRowCheckBox.setGlobalName(Inter.getLocText("CellWrite-Page_Before_Row"));
pageAfterRowCheckBox.setGlobalName(Inter.getLocText("CellWrite-Page_After_Row")); pageAfterRowCheckBox.setGlobalName(Inter.getLocText("CellWrite-Page_After_Row"));
pageBeforeColumnCheckBox.setGlobalName(Inter.getLocText("CellWrite-Page_Before_Column")); pageBeforeColumnCheckBox.setGlobalName(Inter.getLocText("CellWrite-Page_Before_Column"));
@ -224,10 +232,10 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
} else if (cellGUIAttr.isShowAsHTML()) { } else if (cellGUIAttr.isShowAsHTML()) {
showContent.setSelectedItem(Inter.getLocText("CellWrite-Show_As_HTML")); showContent.setSelectedItem(Inter.getLocText("CellWrite-Show_As_HTML"));
} else if (cellGUIAttr.isShowAsDownload()) { } else if (cellGUIAttr.isShowAsDownload()) {
showContent.setSelectedItem(Inter.getLocText("ShowAsDownload")); showContent.setSelectedItem(Inter.getLocText("FR-Designer_Show_As_Download"));
fileNameTextField.setText(cellGUIAttr.getFileName()); fileNameTextField.setText(cellGUIAttr.getFileName());
} else { } else {
showContent.setSelectedItem(Inter.getLocText("Default")); showContent.setSelectedItem(Inter.getLocText("FR-Designer_DEFAULT"));
} }
tooltipTextField.setText(cellGUIAttr.getTooltipText()); tooltipTextField.setText(cellGUIAttr.getTooltipText());
CellPageAttr cellPageAttr = cellElement.getCellPageAttr(); // 分页 CellPageAttr cellPageAttr = cellElement.getCellPageAttr(); // 分页
@ -272,11 +280,11 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
cellGUIAttr = new CellGUIAttr(); cellGUIAttr = new CellGUIAttr();
} }
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("Auto_Adjust_Size"))) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_Auto_Adjust_Size"))) {
cellGUIAttr.setAdjustMode(autoshrik.getSelectedIndex()); cellGUIAttr.setAdjustMode(autoshrik.getSelectedIndex());
} }
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("Preview"))) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_Preview"))) {
cellGUIAttr.setPreviewContent(previewCellContent.isSelected()); cellGUIAttr.setPreviewContent(previewCellContent.isSelected());
} }
@ -288,7 +296,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
cellGUIAttr.setPrintBackground(printAndExportBackground.isSelected()); cellGUIAttr.setPrintBackground(printAndExportBackground.isSelected());
} }
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("Show_Content"))) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_Show_Content"))) {
cellGUIAttr.setShowAsDefault(showContent.getSelectedIndex() == 0); cellGUIAttr.setShowAsDefault(showContent.getSelectedIndex() == 0);
cellGUIAttr.setShowAsImage(showContent.getSelectedIndex() == 1); cellGUIAttr.setShowAsImage(showContent.getSelectedIndex() == 1);
cellGUIAttr.setShowAsHTML(showContent.getSelectedIndex() == 2); cellGUIAttr.setShowAsHTML(showContent.getSelectedIndex() == 2);
@ -300,7 +308,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
} }
} }
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("CellWrite-ToolTip"))) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellWrite_ToolTip"))) {
if (tooltipTextField.getText() == null || tooltipTextField.getText().trim().length() <= 0) { if (tooltipTextField.getText() == null || tooltipTextField.getText().trim().length() <= 0) {
cellGUIAttr.setTooltipText(fieldName); cellGUIAttr.setTooltipText(fieldName);
} else { } else {

14
designer/src/com/fr/design/report/ReportColumnsPane.java

@ -19,6 +19,7 @@ import javax.swing.SpinnerNumberModel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper;
import com.fr.design.border.UIRoundedBorder; import com.fr.design.border.UIRoundedBorder;
import com.fr.design.border.UITitledBorder; import com.fr.design.border.UITitledBorder;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
@ -109,9 +110,12 @@ public class ReportColumnsPane extends BasicPane{
onOffButtonGroup.addActionListener(onOffListener); onOffButtonGroup.addActionListener(onOffListener);
UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_ReportColumns-Columns")); UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_ReportColumns-Columns"));
uiLabel.setFont(FRFont.getInstance(FONT_NAME, Font.PLAIN, FONT_SIZE)); FRFont uiLableFont = FRFont.getInstance(FONT_NAME, Font.PLAIN, FONT_SIZE);
uiLabel.setFont(uiLableFont);
uiLabel.setHorizontalAlignment(SwingConstants.CENTER); uiLabel.setHorizontalAlignment(SwingConstants.CENTER);
uiLabel.setPreferredSize(new Dimension(100,20)); int uiLabelWidth = GraphHelper.getLocTextWidth("FR-Designer_ReportColumns-Columns", uiLableFont);
uiLabel.setPreferredSize(new Dimension(uiLabelWidth, 20));
north.add(uiLabel,BorderLayout.WEST); north.add(uiLabel,BorderLayout.WEST);
JPanel buttonGroupPane = new JPanel(new FlowLayout(FlowLayout.CENTER, 23,11)); JPanel buttonGroupPane = new JPanel(new FlowLayout(FlowLayout.CENTER, 23,11));
buttonGroupPane.add(onOffButtonGroup); buttonGroupPane.add(onOffButtonGroup);
@ -200,7 +204,7 @@ public class ReportColumnsPane extends BasicPane{
JPanel sampleLablePane = new JPanel(new GridLayout(1,2)); JPanel sampleLablePane = new JPanel(new GridLayout(1,2));
sampleLablePane.setPreferredSize(new Dimension(524, 130)); sampleLablePane.setPreferredSize(new Dimension(524, 130));
JPanel rPane = new JPanel(); JPanel rPane = new JPanel();
UILabel rLabel = new UILabel(BaseUtils.readIcon("/com/fr/design/images/reportcolumns/row.png")); UILabel rLabel = new UILabel(BaseUtils.readIcon("/com/fr/design/images/reportcolumns/" + Inter.getLocText("FR-Designer_Row_Icon_File_Name")));
rLabel.setBorder(BorderFactory.createEmptyBorder(5,45,0,49)); rLabel.setBorder(BorderFactory.createEmptyBorder(5,45,0,49));
rPane.add(rLabel); rPane.add(rLabel);
rowButton = new UIRadioButton(Inter.getLocText("ReportColumns-Columns_horizontally")); rowButton = new UIRadioButton(Inter.getLocText("ReportColumns-Columns_horizontally"));
@ -260,7 +264,7 @@ public class ReportColumnsPane extends BasicPane{
GUICoreUtils.setColumnForSpinner(maxNumberSpinner, 6); GUICoreUtils.setColumnForSpinner(maxNumberSpinner, 6);
maxRadioButton.addActionListener(maxBtnListener); maxRadioButton.addActionListener(maxBtnListener);
maxUILabel = new UILabel(COLUMN_ROW_TEXTS[rowOrColumn] ); maxUILabel = new UILabel(COLUMN_ROW_TEXTS[rowOrColumn] );
JPanel maxRowRadioPane = GUICoreUtils.createFlowPane(new JComponent[]{maxRadioButton, maxNumberSpinner, maxUILabel, new UILabel(Inter.getLocText("FR-Designer_ReportColumns-Columns"))}, FlowLayout.CENTER); JPanel maxRowRadioPane = GUICoreUtils.createFlowPane(new JComponent[]{maxRadioButton, maxNumberSpinner, maxUILabel, new UILabel(Inter.getLocText("FR-Designer_ReportColumns_Columns_Optional"))}, FlowLayout.CENTER);
RowMaxOrSetPane.add(maxRowRadioPane); RowMaxOrSetPane.add(maxRowRadioPane);
//marks:分成多少行 //marks:分成多少行
toXRadioButton = new UIRadioButton(Inter.getLocText("ReportColumns-Columns_to")); toXRadioButton = new UIRadioButton(Inter.getLocText("ReportColumns-Columns_to"));
@ -308,7 +312,7 @@ public class ReportColumnsPane extends BasicPane{
rowPane.setBorder(explainBorder); rowPane.setBorder(explainBorder);
rowPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5,13)); rowPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5,13));
rowPane.setPreferredSize(new Dimension(500,80)); rowPane.setPreferredSize(new Dimension(500,80));
rowPane.add(new UILabel(Inter.getLocText(new String[]{"ReportColumns-Columns","Data"}) + ":")); rowPane.add(new UILabel(Inter.getLocText(new String[]{"FR-Designer_ReportColumns_Columns_Optional","Data"}) + ":"));
repeatColDataTextField = new UITextField(); repeatColDataTextField = new UITextField();
repeatColDataTextField.setPreferredSize(new Dimension(107,24)); repeatColDataTextField.setPreferredSize(new Dimension(107,24));
rowPane.add(repeatColDataTextField); rowPane.add(repeatColDataTextField);

60
designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java

@ -6,6 +6,7 @@ import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.data.index.Index;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
@ -19,7 +20,7 @@ import java.util.List;
*/ */
public class MobileRadioGroupPane extends BasicBeanPane<MobileFitAttrState>{ public class MobileRadioGroupPane extends BasicBeanPane<MobileFitAttrState>{
private List<UIRadioButton> radioButtons = new ArrayList<UIRadioButton>(); private List<IndexRadioButton> radioButtons = new ArrayList<IndexRadioButton>();
public MobileRadioGroupPane(String title) { public MobileRadioGroupPane(String title) {
initComponents(title); initComponents(title);
@ -30,26 +31,33 @@ public class MobileRadioGroupPane extends BasicBeanPane<MobileFitAttrState>{
double[] rowSize = {p}; double[] rowSize = {p};
double[] columnSize = {p, p, p, p, p, p}; double[] columnSize = {p, p, p, p, p, p};
UIRadioButton defaultRadio = new UIRadioButton(MobileFitAttrState.DEFAULT.description()); IndexRadioButton defaultRadio = new IndexRadioButton(MobileFitAttrState.DEFAULT.description(), MobileFitAttrState.DEFAULT);
defaultRadio.setSelected(true); defaultRadio.setSelected(true);
UIRadioButton horizonRadio = new UIRadioButton(MobileFitAttrState.HORIZONTAL.description()); IndexRadioButton horizonRadio = new IndexRadioButton(MobileFitAttrState.HORIZONTAL.description(), MobileFitAttrState.HORIZONTAL);
UIRadioButton verticalRadio = new UIRadioButton(MobileFitAttrState.VERTICAL.description()); IndexRadioButton verticalRadio = new IndexRadioButton(MobileFitAttrState.VERTICAL.description(), MobileFitAttrState.VERTICAL);
UIRadioButton bidirectionalRadio = new UIRadioButton(MobileFitAttrState.BIDIRECTIONAL.description()); IndexRadioButton bidirectionalRadio = new IndexRadioButton(MobileFitAttrState.BIDIRECTIONAL.description(), MobileFitAttrState.BIDIRECTIONAL);
UIRadioButton notFitRadio = new UIRadioButton(MobileFitAttrState.NONE.description()); IndexRadioButton notFitRadio = new IndexRadioButton(MobileFitAttrState.NONE.description(), MobileFitAttrState.NONE);
addToButtonGroup(defaultRadio, horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio); addToButtonGroup(defaultRadio, horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(title), defaultRadio, horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio} new Component[] {
new UILabel(title),
defaultRadio,
horizonRadio,
verticalRadio,
bidirectionalRadio,
notFitRadio
}
}; };
JPanel fitOpsPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel fitOpsPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
fitOpsPane.setBorder(BorderFactory.createEmptyBorder(10, 13, 10, 10)); fitOpsPane.setBorder(BorderFactory.createEmptyBorder(10, 13, 10, 10));
this.add(fitOpsPane); this.add(fitOpsPane);
} }
private void addToButtonGroup(UIRadioButton... radios) { private void addToButtonGroup(IndexRadioButton... radios) {
ButtonGroup buttonGroup = new ButtonGroup(); ButtonGroup buttonGroup = new ButtonGroup();
for (UIRadioButton radio : radios) { for (IndexRadioButton radio : radios) {
radioButtons.add(radio); radioButtons.add(radio);
buttonGroup.add(radio); buttonGroup.add(radio);
} }
@ -59,7 +67,7 @@ public class MobileRadioGroupPane extends BasicBeanPane<MobileFitAttrState>{
* 设置按钮状态 * 设置按钮状态
*/ */
public void setEnabled(boolean enabled) { public void setEnabled(boolean enabled) {
for (UIRadioButton radioButton : radioButtons) { for (IndexRadioButton radioButton : radioButtons) {
radioButton.setEnabled(enabled); radioButton.setEnabled(enabled);
} }
} }
@ -72,7 +80,7 @@ public class MobileRadioGroupPane extends BasicBeanPane<MobileFitAttrState>{
public int getSelectRadioIndex() { public int getSelectRadioIndex() {
for (int i = 0, len = radioButtons.size(); i < len; i++) { for (int i = 0, len = radioButtons.size(); i < len; i++) {
if (radioButtons.get(i).isSelected()) { if (radioButtons.get(i).isSelected()) {
return i; return radioButtons.get(i).getRadioButtonIndex();
} }
} }
@ -87,15 +95,18 @@ public class MobileRadioGroupPane extends BasicBeanPane<MobileFitAttrState>{
return; return;
} }
UIRadioButton button = radioButtons.get(index); for (IndexRadioButton radioButton : this.radioButtons) {
button.setSelected(true); if (radioButton.getRadioButtonIndex() == index) {
radioButton.setSelected(true);
}
}
} }
/** /**
* 给所有的按钮加上监听 * 给所有的按钮加上监听
*/ */
public void addActionListener(ActionListener actionListener) { public void addActionListener(ActionListener actionListener) {
for (UIRadioButton radioButton : radioButtons) { for (IndexRadioButton radioButton : radioButtons) {
radioButton.addActionListener(actionListener); radioButton.addActionListener(actionListener);
} }
} }
@ -116,3 +127,24 @@ public class MobileRadioGroupPane extends BasicBeanPane<MobileFitAttrState>{
return StringUtils.EMPTY; return StringUtils.EMPTY;
} }
} }
/**
* created by fanglei on 2017/1/16
* 不再用radioButtonGroup的数组下标作为index而是给每个按钮传入MobileFitAttrState的枚举值
*/
class IndexRadioButton extends UIRadioButton {
private int index;
IndexRadioButton(String text, MobileFitAttrState mobileFitAttrState) {
super(text);
this.index = mobileFitAttrState.getState();
}
public int getRadioButtonIndex() {
return this.index;
}
public void setRadioButtonIndex(int index) {
this.index = index;
}
}

4
designer/src/com/fr/design/report/mobile/MobileUseHtmlGroupPane.java

@ -7,6 +7,10 @@ import com.fr.report.mobile.ElementCaseMobileAttr;
* Created by kunsnat on 2016/8/3. * Created by kunsnat on 2016/8/3.
*/ */
public class MobileUseHtmlGroupPane extends MobileUseHtmlGroupBeanPane<ElementCaseMobileAttr> { public class MobileUseHtmlGroupPane extends MobileUseHtmlGroupBeanPane<ElementCaseMobileAttr> {
public MobileUseHtmlGroupPane(String annotation) {
super(annotation);
}
@Override @Override
public void populateBean(ElementCaseMobileAttr mobileAttr) { public void populateBean(ElementCaseMobileAttr mobileAttr) {
if(mobileAttr != null) { if(mobileAttr != null) {

2
designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java

@ -34,7 +34,7 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane); appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane);
jPanel.add(appFitBrowserPane); jPanel.add(appFitBrowserPane);
jPanel.add(htmlGroupPane = new MobileUseHtmlGroupPane()); jPanel.add(htmlGroupPane = new MobileUseHtmlGroupPane(Inter.getLocText("FR-Designer_Mobile_Report_Analysis_Annotation")));
jPanel.add(mobileToolBarPane = new MobileToolBarPane()); jPanel.add(mobileToolBarPane = new MobileToolBarPane());

4
designer/src/com/fr/design/webattr/PageToolBarPane.java

@ -27,8 +27,8 @@ import java.util.List;
public class PageToolBarPane extends AbstractEditToolBarPane { public class PageToolBarPane extends AbstractEditToolBarPane {
private UIRadioButton centerRadioButton = new UIRadioButton(Inter.getLocText(new String[]{"Center", "Display"})); private UIRadioButton centerRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Center_Display"));
private UIRadioButton leftRadioButton = new UIRadioButton(Inter.getLocText(new String[]{"Left", "Display"})); private UIRadioButton leftRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Left_Display"));
private UICheckBox isUseToolBarCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Use_ToolBar")); private UICheckBox isUseToolBarCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Use_ToolBar"));
private UICheckBox isShowAsImageBox; private UICheckBox isShowAsImageBox;

14
designer/src/com/fr/design/webattr/PageWebSettingPane.java

@ -36,8 +36,8 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
@Override @Override
protected JPanel createOtherSetPane() { protected JPanel createOtherSetPane() {
centerRadioButton = new UIRadioButton(Inter.getLocText(new String[]{"Center", "Display"})); centerRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Center_Display"));
leftRadioButton = new UIRadioButton(Inter.getLocText(new String[]{"Left", "Display"})); leftRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Left_Display"));
ButtonGroup buttonGroup = new ButtonGroup(); ButtonGroup buttonGroup = new ButtonGroup();
leftRadioButton.setSelected(true); leftRadioButton.setSelected(true);
buttonGroup.add(centerRadioButton); buttonGroup.add(centerRadioButton);
@ -45,15 +45,15 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
JPanel buttonpane = new JPanel(FRGUIPaneFactory.createBoxFlowLayout()); JPanel buttonpane = new JPanel(FRGUIPaneFactory.createBoxFlowLayout());
buttonpane.add(centerRadioButton); buttonpane.add(centerRadioButton);
buttonpane.add(leftRadioButton); buttonpane.add(leftRadioButton);
isShowAsImageBox = new UICheckBox(Inter.getLocText("Is_Paint_Page")); isShowAsImageBox = new UICheckBox(Inter.getLocText("FR-Designer_Is_Paint_Page"));
isAutoScaleBox = new UICheckBox(Inter.getLocText("IS_Auto_Scale")); isAutoScaleBox = new UICheckBox(Inter.getLocText("FR-Designer_IS_Auto_Scale"));
isTDHeavyBox = new UICheckBox(Inter.getLocText("IS_TD_HEAVY_EXPORT"), false); isTDHeavyBox = new UICheckBox(Inter.getLocText("FR-Designer_IS_TD_HEAVY_EXPORT"), false);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] columnSize = { p,p,p}; double[] columnSize = { p,p,p};
double[] rowSize = { p, p,p,p }; double[] rowSize = { p, p,p,p };
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Report_Show_Location") + ":", UILabel.RIGHT), buttonpane,null}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Report_Show_Location") + ":", UILabel.RIGHT), buttonpane,null},
new Component[]{new UILabel(Inter.getLocText("PageSetup-Page") + ":", UILabel.RIGHT), isShowAsImageBox, isAutoScaleBox}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_PageSetup_Page") + ":", UILabel.RIGHT), isShowAsImageBox, isAutoScaleBox},
new Component[]{null, isTDHeavyBox, null} new Component[]{null, isTDHeavyBox, null}
}; };

49
designer/src/com/fr/design/webattr/ToolBarDragPane.java

@ -126,25 +126,9 @@ public class ToolBarDragPane extends WidgetToolBarPane {
} }
} }
}); });
layoutTable = new JTable(toolbarButtonTableModel);
layoutTable.setDefaultRenderer(Object.class, tableRenderer); initLayoutTable();
layoutTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
layoutTable.setColumnSelectionAllowed(false);
layoutTable.setRowSelectionAllowed(false);
layoutTable.setBackground(Color.white);
layoutTable.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() > 1 && !(SwingUtilities.isRightMouseButton(e)) && isEnabled) {
WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn());
Widget widget = no.createWidget();
ToolBarButton tb = new ToolBarButton(no.optionIcon(), widget);
tb.setNameOption(no);
northToolBar.add(tb);
northToolBar.validate();
northToolBar.repaint();
}
}
});
JPanel center = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel center = FRGUIPaneFactory.createBorderLayout_S_Pane();
center.setBackground(Color.white); center.setBackground(Color.white);
center.add(topButton, BorderLayout.NORTH); center.add(topButton, BorderLayout.NORTH);
@ -178,6 +162,33 @@ public class ToolBarDragPane extends WidgetToolBarPane {
isUseToolBarCheckBox.setSelected(true); isUseToolBarCheckBox.setSelected(true);
} }
private void initLayoutTable() {
layoutTable = new JTable(toolbarButtonTableModel);
layoutTable.setDefaultRenderer(Object.class, tableRenderer);
layoutTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
layoutTable.setColumnSelectionAllowed(false);
layoutTable.setRowSelectionAllowed(false);
layoutTable.setBackground(Color.white);
int columnWidth = Integer.parseInt(Inter.getLocText("FR-Designer_LayoutTable_Column_Width"));
for (int i = 0; i < layoutTable.getColumnModel().getColumnCount(); i++) {
layoutTable.getColumnModel().getColumn(i).setPreferredWidth(columnWidth);
}
layoutTable.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() > 1 && !(SwingUtilities.isRightMouseButton(e)) && isEnabled) {
WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn());
Widget widget = no.createWidget();
ToolBarButton tb = new ToolBarButton(no.optionIcon(), widget);
tb.setNameOption(no);
northToolBar.add(tb);
northToolBar.validate();
northToolBar.repaint();
}
}
});
}
private boolean isSelectedtable() { private boolean isSelectedtable() {
for (int i = 0; i < layoutTable.getColumnCount(); i++) { for (int i = 0; i < layoutTable.getColumnCount(); i++) {
if (layoutTable.isColumnSelected(i)) { if (layoutTable.isColumnSelected(i)) {

6
designer/src/com/fr/design/webattr/WriteToolBarPane.java

@ -39,8 +39,8 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
private UIRadioButton topRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Top")); private UIRadioButton topRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Top"));
private UIRadioButton bottomRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Bottom")); private UIRadioButton bottomRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Bottom"));
private UILabel sheetShowLocationLabel = new UILabel("sheet" + Inter.getLocText(new String[]{"Label", "Page_Number", "Display position"}) + ":"); private UILabel sheetShowLocationLabel = new UILabel("sheet" + Inter.getLocText(new String[]{"Label", "Page_Number", "Display position"}) + ":");
private UIRadioButton centerRadioButton = new UIRadioButton(Inter.getLocText(new String[]{"Center", "Display"})); private UIRadioButton centerRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Center_Display"));
private UIRadioButton leftRadioButton = new UIRadioButton(Inter.getLocText(new String[]{"Left", "Display"})); private UIRadioButton leftRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Left_Display"));
private UILabel rptShowLocationLabel = new UILabel(Inter.getLocText("FR-Designer_Report_Show_Location") + ":", UILabel.LEFT); private UILabel rptShowLocationLabel = new UILabel(Inter.getLocText("FR-Designer_Report_Show_Location") + ":", UILabel.LEFT);
private UICheckBox isUseToolBarCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Use_ToolBar")); private UICheckBox isUseToolBarCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Use_ToolBar"));
private UIButton editToolBarButton = new UIButton(Inter.getLocText("FR-Designer_Edit")); private UIButton editToolBarButton = new UIButton(Inter.getLocText("FR-Designer_Edit"));
@ -76,7 +76,7 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
colorButton = new UIColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/background.png")); colorButton = new UIColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/background.png"));
northPane.add(GUICoreUtils.createFlowPane(new Component[]{colorBox, colorButton}, FlowLayout.LEFT)); northPane.add(GUICoreUtils.createFlowPane(new Component[]{colorBox, colorButton}, FlowLayout.LEFT));
unloadCheck = new UICheckBox(Inter.getLocText(new String[]{"Event-unloadcheck", "Tooltips"})); unloadCheck = new UICheckBox(Inter.getLocText("FR-Designer_Unload_Check"));
unloadCheck.setSelected(true); unloadCheck.setSelected(true);
showWidgets = new UICheckBox(Inter.getLocText("FR-Designer_Event_ShowWidgets")); showWidgets = new UICheckBox(Inter.getLocText("FR-Designer_Event_ShowWidgets"));

9
designer/src/com/fr/design/webattr/WriteWebSettingPane.java

@ -42,8 +42,7 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
@Override @Override
protected JPanel createOtherSetPane() { protected JPanel createOtherSetPane() {
colorBox = new UICheckBox(Inter.getLocText(new String[]{"Face_Write", "Current", "Edit", "Row", colorBox = new UICheckBox(Inter.getLocText("FR-Designer_Set_BG_Of_Current_Row") + ":");
"Background", "Set"}) + ":");
colorBox.setSelected(true); colorBox.setSelected(true);
colorButton = new UIColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/background.png")); colorButton = new UIColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/background.png"));
colorBox.addActionListener(new ActionListener() { colorBox.addActionListener(new ActionListener() {
@ -66,15 +65,15 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
//Sean: 报表显示位置since 706 //Sean: 报表显示位置since 706
rptShowLocationLabel = new UILabel(Inter.getLocText("FR-Designer_Report_Show_Location") + ":", UILabel.LEFT); rptShowLocationLabel = new UILabel(Inter.getLocText("FR-Designer_Report_Show_Location") + ":", UILabel.LEFT);
centerRadioButton = new UIRadioButton(Inter.getLocText(new String[]{"Center", "Display"})); centerRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Center_Display"));
leftRadioButton = new UIRadioButton(Inter.getLocText(new String[]{"Left", "Display"})); leftRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Left_Display"));
ButtonGroup rptShowButtonGroup = new ButtonGroup(); ButtonGroup rptShowButtonGroup = new ButtonGroup();
leftRadioButton.setSelected(true); leftRadioButton.setSelected(true);
rptShowButtonGroup.add(centerRadioButton); rptShowButtonGroup.add(centerRadioButton);
rptShowButtonGroup.add(leftRadioButton); rptShowButtonGroup.add(leftRadioButton);
JPanel showLocPane = GUICoreUtils.createFlowPane(new Component[]{rptShowLocationLabel, centerRadioButton, leftRadioButton}, FlowLayout.LEFT); JPanel showLocPane = GUICoreUtils.createFlowPane(new Component[]{rptShowLocationLabel, centerRadioButton, leftRadioButton}, FlowLayout.LEFT);
unloadCheck = new UICheckBox(Inter.getLocText(new String[]{"Event-unloadcheck", "Tooltips"})); unloadCheck = new UICheckBox(Inter.getLocText("FR-Designer_Unload_Check"));
unloadCheck.setSelected(true); unloadCheck.setSelected(true);
showWidgets = new UICheckBox(Inter.getLocText(new String[]{"Event-showWidgets"})); showWidgets = new UICheckBox(Inter.getLocText(new String[]{"Event-showWidgets"}));

129
designer/src/com/fr/design/widget/CellWidgetCardPane.java

@ -20,24 +20,28 @@ import java.awt.*;
* carl :单独弄出来 * carl :单独弄出来
*/ */
public class CellWidgetCardPane extends BasicPane { public class CellWidgetCardPane extends BasicPane {
// 当前的编辑器属性定义面板 //当前的编辑器属性定义面板
private DataModify<? extends Widget> currentEditorDefinePane; private DataModify<? extends Widget> currentEditorDefinePane;
//属性配置切换面板
private JTabbedPane tabbedPane; private JTabbedPane tabbedPane;
private BasicWidgetPropertySettingPane widgetPropertyPane; private BasicWidgetPropertySettingPane widgetPropertyPane;
private JPanel attriPane;
private JPanel cardPane;
private CardLayout card;
private JPanel presPane; //通用属性容器
private JPanel cardPaneForPresent; private JPanel attriTabPane;
private CardLayout cardForPresent; private JPanel attriCardPane;
private CardLayout attriCardLayout;
private JPanel cardPaneForTreeSetting; //数字字典属性容器
private JPanel dictTabPane;
private JPanel dictCardPane;
private CardLayout dictCardLayout;
private JPanel formPane; //构建树属性容器
private WidgetEventPane eventTabPane; private JPanel treeTabPane;
//事件属性容器
private JPanel eventTabPane;
private WidgetEventPane eventPane;
public CellWidgetCardPane(ElementCasePane pane) { public CellWidgetCardPane(ElementCasePane pane) {
this.initComponents(pane); this.initComponents(pane);
@ -47,26 +51,26 @@ public class CellWidgetCardPane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
tabbedPane = new UITabbedPane(); tabbedPane = new UITabbedPane();
this.add(tabbedPane, BorderLayout.CENTER); this.add(tabbedPane, BorderLayout.CENTER);
attriPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
formPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); eventTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
eventTabPane = new WidgetEventPane(pane); eventPane = new WidgetEventPane(pane);
formPane.add(eventTabPane, BorderLayout.CENTER); eventTabPane.add(eventPane, BorderLayout.CENTER);
tabbedPane.add(Inter.getLocText("FR-Designer_Attribute"), attriPane); tabbedPane.add(Inter.getLocText("FR-Designer_Attribute"), attriTabPane);
tabbedPane.add(Inter.getLocText("FR-Designer_Form_Editing_Listeners"), formPane); tabbedPane.add(Inter.getLocText("FR-Designer_Form_Editing_Listeners"), eventTabPane);
presPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); dictTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
cardPaneForPresent = FRGUIPaneFactory.createCardLayout_S_Pane(); dictCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
presPane.add(cardPaneForPresent, BorderLayout.CENTER); dictTabPane.add(dictCardPane, BorderLayout.CENTER);
cardForPresent = new CardLayout(); dictCardLayout = new CardLayout();
cardPaneForPresent.setLayout(cardForPresent); dictCardPane.setLayout(dictCardLayout);
cardPaneForTreeSetting = FRGUIPaneFactory.createBorderLayout_L_Pane(); treeTabPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
widgetPropertyPane = new BasicWidgetPropertySettingPane(); widgetPropertyPane = new BasicWidgetPropertySettingPane();
attriPane.add(widgetPropertyPane, BorderLayout.NORTH); attriTabPane.add(widgetPropertyPane, BorderLayout.NORTH);
cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); attriCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
attriPane.add(cardPane, BorderLayout.CENTER); attriTabPane.add(attriCardPane, BorderLayout.CENTER);
card = (CardLayout) cardPane.getLayout(); attriCardLayout = (CardLayout) attriCardPane.getLayout();
this.setPreferredSize(new Dimension(600, 450)); this.setPreferredSize(new Dimension(600, 450));
} }
@ -84,49 +88,53 @@ public class CellWidgetCardPane extends BasicPane {
this.tabbedPane.setEnabled(true); this.tabbedPane.setEnabled(true);
} }
attriPane.remove(widgetPropertyPane); attriTabPane.remove(widgetPropertyPane);
widgetPropertyPane = new BasicWidgetPropertySettingPane(); widgetPropertyPane = new BasicWidgetPropertySettingPane();
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 0, 8)); northPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 0, 8));
JPanel basic = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Form_Basic_Properties")); JPanel basic = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Form_Basic_Properties"));
northPane.add(basic); northPane.add(basic);
basic.add(widgetPropertyPane); basic.add(widgetPropertyPane);
attriPane.add(northPane, BorderLayout.NORTH); attriTabPane.add(northPane, BorderLayout.NORTH);
WidgetDefinePaneFactory.RN rn = WidgetDefinePaneFactory.createWidgetDefinePane(cellWidget, new Operator() { WidgetDefinePaneFactory.RN rn = WidgetDefinePaneFactory.createWidgetDefinePane(cellWidget, new Operator() {
@Override @Override
public void did(DataCreatorUI ui, String cardName) { public void did(DataCreatorUI ui, String cardName) {
if (ui == null) { if (ui == null) {
addPresPane(false); removeDictAttriPane();
addTreeSettingPane(false); removeTreeAttriPane();
} }
if (ui instanceof DictionaryPane) { if (ui instanceof DictionaryPane) {
removeDictAttriPane();
removeTreeAttriPane();
showDictPane(ui, cardName); showDictPane(ui, cardName);
} else if (ui instanceof TreeSettingPane) { } else if (ui instanceof TreeSettingPane) {
removeDictAttriPane();
removeTreeAttriPane();
showTreePane(ui); showTreePane(ui);
} }
} }
}); });
DataModify<? extends Widget> definePane = rn.getDefinePane(); DataModify<? extends Widget> definePane = rn.getDefinePane();
cardPane.add(definePane.toSwingComponent(), rn.getCardName()); attriCardPane.add(definePane.toSwingComponent(), rn.getCardName());
card.show(cardPane, rn.getCardName()); attriCardLayout.show(attriCardPane, rn.getCardName());
currentEditorDefinePane = definePane; currentEditorDefinePane = definePane;
eventTabPane.populate(cellWidget); eventPane.populate(cellWidget);
widgetPropertyPane.populate(cellWidget); widgetPropertyPane.populate(cellWidget);
tabbedPane.setSelectedIndex(0); tabbedPane.setSelectedIndex(0);
} }
private void showDictPane(DataCreatorUI ui, String cardName) { private void showDictPane(DataCreatorUI ui, String cardName) {
cardPaneForPresent.removeAll(); dictCardPane.removeAll();
cardPaneForPresent.add(ui.toSwingComponent(), cardName); dictCardPane.add(ui.toSwingComponent(), cardName);
cardForPresent.show(cardPaneForPresent, cardName); dictCardLayout.show(dictCardPane, cardName);
addPresPane(true); addDictAttriPane();
} }
private void showTreePane(DataCreatorUI ui) { private void showTreePane(DataCreatorUI ui) {
cardPaneForTreeSetting.removeAll(); treeTabPane.removeAll();
cardPaneForTreeSetting.add(ui.toSwingComponent()); treeTabPane.add(ui.toSwingComponent());
addTreeSettingPane(true); addTreeAttriPane();
} }
public Widget update() { public Widget update() {
@ -139,7 +147,7 @@ public class CellWidgetCardPane extends BasicPane {
} }
widgetPropertyPane.update(widget); widgetPropertyPane.update(widget);
Listener[] listener = eventTabPane == null ? new Listener[0] : eventTabPane.updateListeners(); Listener[] listener = eventPane == null ? new Listener[0] : eventPane.updateListeners();
widget.clearListeners(); widget.clearListeners();
for (Listener l : listener) { for (Listener l : listener) {
widget.addListener(l); widget.addListener(l);
@ -155,25 +163,26 @@ public class CellWidgetCardPane extends BasicPane {
*/ */
public void checkValid() throws Exception { public void checkValid() throws Exception {
currentEditorDefinePane.checkValid(); currentEditorDefinePane.checkValid();
eventTabPane.checkValid(); eventPane.checkValid();
} }
//:jackie 如果选择的项有形态,则将形态面板加入tab面板
private void addPresPane(boolean add) { private void addDictAttriPane() {
if (add) { tabbedPane.add(this.dictTabPane, 1);
tabbedPane.add(this.presPane, 1); tabbedPane.setTitleAt(1, Inter.getLocText("FR-Designer_DS_Dictionary"));
tabbedPane.setTitleAt(1, Inter.getLocText("FR-Designer_DS_Dictionary"));
} else {
tabbedPane.remove(presPane);
}
} }
private void addTreeSettingPane(boolean add) { private void addTreeAttriPane() {
if (add) { tabbedPane.add(this.treeTabPane, 1);
tabbedPane.add(this.cardPaneForTreeSetting, 1); tabbedPane.setTitleAt(1, Inter.getLocText("FR-Designer_Create_Tree"));
tabbedPane.setTitleAt(1, Inter.getLocText("FR-Designer_Create_Tree")); }
} else {
tabbedPane.remove(this.cardPaneForTreeSetting); private void removeDictAttriPane() {
} tabbedPane.remove(this.dictTabPane);
} }
}
private void removeTreeAttriPane() {
tabbedPane.remove(this.treeTabPane);
}
}

2
designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java

@ -1 +1 @@
package com.fr.design.widget.ui; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** design.gui.icheckbox.UICheckBox; design.gui.icheckbox.UICheckBox; design.gui.icheckbox.UICheckBox; design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; design.gui.icheckbox.UICheckBox; import com.fr.design.utils.gui.GUICoreUtils; design.gui.icheckbox.UICheckBox; import com.fr.form.ui.CustomWriteAbleRepeatEditor; design.gui.icheckbox.UICheckBox; import com.fr.general.Inter; design.gui.icheckbox.UICheckBox; design.gui.icheckbox.UICheckBox; import javax.swing.*; design.gui.icheckbox.UICheckBox; import java.awt.*; design.gui.icheckbox.UICheckBox; /** import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory; design.gui.icheckbox.UICheckBox; contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; this.customDataCheckBox.setPreferredSize(new Dimension(100, 30)); getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); JPanel otherContentPane = this.setForthContentPane(); if (otherContentPane != null) { contentPane.add(otherContentPane,BorderLayout.CENTER); } return contentPane; } protected abstract JPanel setForthContentPane(); protected void populateSubWritableRepeatEditorBean(T e) { this.customDataCheckBox.setSelected(e.isCustomData()); populateSubCustomWritableRepeatEditorBean(e); } protected abstract void populateSubCustomWritableRepeatEditorBean(T e); protected T updateSubWritableRepeatEditorBean() { T e = updateSubCustomWritableRepeatEditorBean(); e.setCustomData(this.customDataCheckBox.isSelected()); return e; } protected abstract T updateSubCustomWritableRepeatEditorBean(); } package com.fr.design.widget.ui; import com.fr.base.GraphHelper; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; import com.fr.design.utils.gui.GUICoreUtils; design.gui.icheckbox.UICheckBox; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.*; import com.fr.design.utils.gui.GUICoreUtils; import java.awt.*; import com.fr.design.utils.gui.GUICoreUtils; /** import com.fr.design.utils.gui.GUICoreUtils; design.gui.icheckbox.UICheckBox; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.form.ui.CustomWriteAbleRepeatEditor; design.gui.icheckbox.UICheckBox; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; design.gui.icheckbox.UICheckBox; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import javax.swing.*; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import java.awt.*; import com.fr.form.ui.CustomWriteAbleRepeatEditor; /** import com.fr.general.Inter; import com.fr.general.Inter; design.gui.icheckbox.UICheckBox; import com.fr.general.Inter; import com.fr.design.layout.FRGUIPaneFactory; )); getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); JPanel otherContentPane = this.setForthContentPane(); if (otherContentPane != null) { contentPane.add(otherContentPane,BorderLayout.CENTER); } return contentPane; } protected abstract JPanel setForthContentPane(); protected void populateSubWritableRepeatEditorBean(T e) { this.customDataCheckBox.setSelected(e.isCustomData()); populateSubCustomWritableRepeatEditorBean(e); } protected abstract void populateSubCustomWritableRepeatEditorBean(T e); protected T updateSubWritableRepeatEditorBean() { T e = updateSubCustomWritableRepeatEditorBean(); e.setCustomData(this.customDataCheckBox.isSelected()); return e; } protected abstract T updateSubCustomWritableRepeatEditorBean(); }

36
designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java

@ -6,6 +6,7 @@ import java.awt.event.ItemListener;
import javax.swing.*; import javax.swing.*;
import com.fr.base.GraphHelper;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
@ -19,6 +20,8 @@ import com.fr.form.ui.FieldEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> { public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> {
private static final int ALLOW_BLANK_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("FR-Designer_Allow_Null") + 30;
private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30;
private UICheckBox allowBlankCheckBox; private UICheckBox allowBlankCheckBox;
// richer:错误信息,是所有控件共有的属性,所以放到这里来 // richer:错误信息,是所有控件共有的属性,所以放到这里来
private UITextField errorMsgTextField; private UITextField errorMsgTextField;
@ -32,6 +35,24 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8));
initRegErrorMsgTextField();
//JPanel firstPanel = FRGUIPaneFactory.createBorderLayout_M_Pane();
allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null"));
allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT));
allowBlankCheckBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected());
}
});
initErrorMsgPane();
}
protected void initRegErrorMsgTextField() {
regErrorMsgTextField = new UITextField(16); regErrorMsgTextField = new UITextField(16);
regErrorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { regErrorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {
public void changedUpdate(DocumentEvent e) { public void changedUpdate(DocumentEvent e) {
@ -46,18 +67,9 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText()); regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText());
} }
}); });
}
//JPanel firstPanel = FRGUIPaneFactory.createBorderLayout_M_Pane(); protected void initErrorMsgPane() {
allowBlankCheckBox = new UICheckBox(Inter.getLocText("Allow_Blank"));
allowBlankCheckBox.setPreferredSize(new Dimension(75, 30));
allowBlankCheckBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected());
}
});
// 错误信息 // 错误信息
JPanel errorMsgPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); JPanel errorMsgPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
errorMsgPane.add(new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":")); errorMsgPane.add(new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"));
@ -128,7 +140,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
JPanel firstPane = GUICoreUtils.createFlowPane(new JComponent[]{allowBlankCheckBox}, FlowLayout.LEFT, 5); JPanel firstPane = GUICoreUtils.createFlowPane(new JComponent[]{allowBlankCheckBox}, FlowLayout.LEFT, 5);
validatePane.add(firstPane); validatePane.add(firstPane);
JPanel secondPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), errorMsgTextField}, FlowLayout.LEFT, 24); JPanel secondPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), errorMsgTextField}, FlowLayout.LEFT, 24);
secondPane.setPreferredSize(new Dimension(310, 23)); secondPane.setPreferredSize(new Dimension(400, 23));
validatePane.add(secondPane); validatePane.add(secondPane);
} }

39
designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java

@ -1,12 +1,13 @@
package com.fr.design.widget.ui.btn; package com.fr.design.widget.ui.btn;
import java.awt.BorderLayout; import java.awt.*;
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 javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import com.fr.base.background.ColorBackground;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
@ -18,7 +19,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.frpane.ImgChoosePane; import com.fr.design.style.background.BackgroundButtonPane;
import com.fr.form.ui.FreeButton; import com.fr.form.ui.FreeButton;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -44,9 +45,9 @@ public class ButtonSytleDefinedPane extends BasicPane {
JPanel buttonStylePane = new JPanel(); JPanel buttonStylePane = new JPanel();
buttonStylePane.setLayout(new BorderLayout()); buttonStylePane.setLayout(new BorderLayout());
initBackgroundPane = new BackgroundPane(Inter.getLocText("Background-Initial") + ":", Inter.getLocText("The_initial_background_of_the_button")); initBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Initial") + ":", Inter.getLocText("FR-Designer_Initial_Background_Tips"));
overBackgroundPane = new BackgroundPane(Inter.getLocText("Background-Over") + ":", Inter.getLocText("Mouse_move-background")); overBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Over") + ":", Inter.getLocText("FR-Designer_Mouse_Move_Tips"));
clickBackgroundPane = new BackgroundPane(Inter.getLocText("Background-Click") + ":", Inter.getLocText("Mouse_move-background")); clickBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Click") + ":", Inter.getLocText("FR-Designer_Mouse_Click_Tips"));
JPanel table = FRGUIPaneFactory.createYBoxEmptyBorderPane(); JPanel table = FRGUIPaneFactory.createYBoxEmptyBorderPane();
table.setBorder(new TitledBorder(Inter.getLocText(new String[]{"Custom", "Form-Button", "Style"}))); table.setBorder(new TitledBorder(Inter.getLocText(new String[]{"Custom", "Form-Button", "Style"})));
@ -84,7 +85,7 @@ public class ButtonSytleDefinedPane extends BasicPane {
class BackgroundPane extends JPanel { class BackgroundPane extends JPanel {
private UIButton editButton; private UIButton editButton;
private ImgChoosePane choosePane; private BackgroundButtonPane choosePane;
private Background background; private Background background;
private UILabel ImagePreviewPane; private UILabel ImagePreviewPane;
@ -101,13 +102,11 @@ public class ButtonSytleDefinedPane extends BasicPane {
ImagePreviewPane.setPreferredSize(new Dimension(100, 20)); ImagePreviewPane.setPreferredSize(new Dimension(100, 20));
this.add(ImagePreviewPane); this.add(ImagePreviewPane);
editButton = new UIButton(Inter.getLocText("Edit")); editButton = new UIButton(Inter.getLocText("FR-Designer_Edit"));
editButton.addActionListener(new ActionListener() { editButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (choosePane == null) { choosePane = new BackgroundButtonPane();
choosePane = new ImgChoosePane();
}
BasicDialog dlg = choosePane.showWindow(SwingUtilities BasicDialog dlg = choosePane.showWindow(SwingUtilities
.getWindowAncestor(ButtonSytleDefinedPane.this)); .getWindowAncestor(ButtonSytleDefinedPane.this));
dlg.addDialogActionListener(new DialogActionAdapter() { dlg.addDialogActionListener(new DialogActionAdapter() {
@ -116,7 +115,10 @@ public class ButtonSytleDefinedPane extends BasicPane {
populate(choosePane.update()); populate(choosePane.update());
} }
}); });
choosePane.populate((ImageBackground) BackgroundPane.this.background); if(BackgroundPane.this.background == null){
BackgroundPane.this.background = new ColorBackground();
}
choosePane.populate((Background) BackgroundPane.this.background);
dlg.setVisible(true); dlg.setVisible(true);
} }
}); });
@ -125,15 +127,22 @@ public class ButtonSytleDefinedPane extends BasicPane {
public void populate(Background background) { public void populate(Background background) {
this.background = background; this.background = background;
if (background instanceof ImageBackground && ((ImageBackground) background).getImage() != null) { if (background instanceof ImageBackground && ((ImageBackground) background).getImage() != null) {
ImagePreviewPane.setIcon(new ImageIcon(((ImageBackground) background).getImage())); ImagePreviewPane.setIcon(new ImageIcon(((ImageBackground) background).getImage()));
} else { } else if(background instanceof ColorBackground && ((ColorBackground) background).getColor() != null){
ImagePreviewPane.setIcon(null);
ImagePreviewPane.setOpaque(true);
ImagePreviewPane.setBackground(((ColorBackground) background).getColor());
}else{
ImagePreviewPane.setIcon(null); ImagePreviewPane.setIcon(null);
ImagePreviewPane.setOpaque(false);
ImagePreviewPane.setBackground(null);
} }
} }
public ImageBackground update() { public Background update() {
return (ImageBackground) background; return background;
} }
} }
} }

4
designer/src/com/fr/poly/hanlder/BottomCornerMouseHanlder.java

@ -161,7 +161,7 @@ public class BottomCornerMouseHanlder extends MouseInputAdapter {
* @param isIntersects 是否重叠 * @param isIntersects 是否重叠
*/ */
@Override @Override
public void setWidgetsIntersects(boolean isIntersects) { public void setWidgetsIntersected(boolean isIntersects) {
} }
/** /**
@ -170,7 +170,7 @@ public class BottomCornerMouseHanlder extends MouseInputAdapter {
* @return 重叠 * @return 重叠
*/ */
@Override @Override
public boolean getWidgetsIntersects() { public boolean isWidgetsIntersected() {
return false; return false;
} }

38
designer_base/src/com/fr/design/actions/community/VideoAction.java

@ -5,6 +5,7 @@ import java.awt.event.ActionEvent;
import java.io.IOException; import java.io.IOException;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.util.Locale;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.KeyStroke; import javax.swing.KeyStroke;
@ -32,22 +33,27 @@ public class VideoAction extends UpdateAction
@Override @Override
public void actionPerformed(ActionEvent arg0) public void actionPerformed(ActionEvent arg0)
{ {
String url = SiteCenter.getInstance().acquireUrlByKind("bbs.video"); String url;
if (StringUtils.isEmpty(url)) { if (FRContext.getLocale().equals(Locale.US)) {
FRContext.getLogger().info("The URL is empty!"); url = SiteCenter.getInstance().acquireUrlByKind("bbs.video.en");
return; } else {
} url = SiteCenter.getInstance().acquireUrlByKind("bbs.video");
try { }
Desktop.getDesktop().browse(new URI(url)); if (StringUtils.isEmpty(url)) {
} catch (IOException exp) { FRContext.getLogger().info("The URL is empty!");
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); return;
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); }
} catch (URISyntaxException exp) { try {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); Desktop.getDesktop().browse(new URI(url));
} catch (Exception exp) { } catch (IOException exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer_Set_default_browser"));
FRContext.getLogger().error("Can not open the browser for URL: " + url); FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} } catch (URISyntaxException exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (Exception exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
FRContext.getLogger().error("Can not open the browser for URL: " + url);
}
} }
public static final MenuKeySet VIDEO = new MenuKeySet() { public static final MenuKeySet VIDEO = new MenuKeySet() {

25
designer_base/src/com/fr/design/actions/help/AboutPane.java

@ -3,6 +3,7 @@
*/ */
package com.fr.design.actions.help; package com.fr.design.actions.help;
import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.BoldFontTextLabel;
@ -26,6 +27,7 @@ import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.net.URI; import java.net.URI;
import java.util.Locale;
public class AboutPane extends JPanel { public class AboutPane extends JPanel {
private static final String FINEREPORT = "FineReport"; private static final String FINEREPORT = "FineReport";
@ -66,15 +68,20 @@ public class AboutPane extends JPanel {
Inter.getLocText("FR-Designer-Basic_Activation_Key_Copy_OK") Inter.getLocText("FR-Designer-Basic_Activation_Key_Copy_OK")
})); }));
if(ComparatorUtils.equals(ProductConstants.APP_NAME,FINEREPORT)){ // 英文去掉服务电话和 QQ
boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("Service_Phone") + ProductConstants.COMPARE_TELEPHONE); if (FRContext.getLocale().equals(Locale.US)){
// do nothing
} else {
if(ComparatorUtils.equals(ProductConstants.APP_NAME,FINEREPORT)){
boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("FR-Designer_Service_Phone") + ProductConstants.COMPARE_TELEPHONE);
contentPane.add(boxCenterAlignmentPane);
}
boxCenterAlignmentPane = new BoxCenterAligmentPane("QQ:" + SiteCenter.getInstance().acquireUrlByKind("help.qq"));
contentPane.add(boxCenterAlignmentPane); contentPane.add(boxCenterAlignmentPane);
} }
boxCenterAlignmentPane = new BoxCenterAligmentPane("QQ:" + SiteCenter.getInstance().acquireUrlByKind("help.qq"));
contentPane.add(boxCenterAlignmentPane);
BoxCenterAligmentPane actionLabel = getURLActionLabel(ProductConstants.WEBSITE_URL); BoxCenterAligmentPane actionLabel = getURLActionLabel(SiteCenter.getInstance().acquireUrlByKind("website." + FRContext.getLocale(), ProductConstants.WEBSITE_URL));
BoxCenterAligmentPane emailLabel = getEmailActionLabel(ProductConstants.SUPPORT_EMAIL); BoxCenterAligmentPane emailLabel = getEmailActionLabel(SiteCenter.getInstance().acquireUrlByKind("support.email", ProductConstants.SUPPORT_EMAIL));
contentPane.add(actionLabel); contentPane.add(actionLabel);
contentPane.add(emailLabel); contentPane.add(emailLabel);
@ -103,12 +110,12 @@ public class AboutPane extends JPanel {
} }
private String getCopyRight(){ private String getCopyRight(){
return append(Inter.getLocText("About-CopyRight"), COPYRIGHT_LABEL, return append(Inter.getLocText("FR-Designer_About_CopyRight"), COPYRIGHT_LABEL,
ProductConstants.HISTORY, StringUtils.BLANK, ProductConstants.COMPANY_NAME); ProductConstants.HISTORY, StringUtils.BLANK, SiteCenter.getInstance().acquireUrlByKind("company.name", ProductConstants.COMPANY_NAME));
} }
private String getBuildTitle() { private String getBuildTitle() {
return append(ProductConstants.APP_NAME, Inter.getLocText("About-Version"), return append(ProductConstants.APP_NAME, Inter.getLocText("FR-Designer_About_Version"),
StringUtils.BLANK, ProductConstants.RELEASE_VERSION, BUILD_PREFIX); StringUtils.BLANK, ProductConstants.RELEASE_VERSION, BUILD_PREFIX);
} }

10
designer_base/src/com/fr/design/actions/help/TutorialAction.java

@ -59,18 +59,20 @@ public class TutorialAction extends UpdateAction {
* @param evt 事件 * @param evt 事件
*/ */
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
Locale locale = FRContext.getLocale(); String helpURL = SiteCenter.getInstance().acquireUrlByKind("help." + FRContext.getLocale());
if (ComparatorUtils.equals(locale, Locale.CHINA) || ComparatorUtils.equals(locale, Locale.TAIWAN)){
HttpClient client = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("help")); if (helpURL != null) {
HttpClient client = new HttpClient(helpURL);
if(client.getResponseCode() != -1) { if(client.getResponseCode() != -1) {
try { try {
Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("help"))); Desktop.getDesktop().browse(new URI(helpURL));
return; return;
} catch (Exception e) { } catch (Exception e) {
//出了异常的话, 依然打开本地教程 //出了异常的话, 依然打开本地教程
} }
} }
} }
if (OperatingSystem.isMacOS()) { if (OperatingSystem.isMacOS()) {
nativeExcuteMacInstallHomePrograms("helptutorial.app"); nativeExcuteMacInstallHomePrograms("helptutorial.app");
} }

13
designer_base/src/com/fr/design/beans/location/MoveUtils.java

@ -16,6 +16,7 @@ import java.util.ArrayList;
public class MoveUtils { public class MoveUtils {
public static final int SORPTION_UNIT = 5; public static final int SORPTION_UNIT = 5;
private static final int EQUIDISTANTLINE_UNIT = 4;
public static WidgetForbidWindow widgetForbidWindow = new WidgetForbidWindow(); public static WidgetForbidWindow widgetForbidWindow = new WidgetForbidWindow();
@ -77,13 +78,13 @@ public class MoveUtils {
* 设置designer内部组件是否重叠的标志位 * 设置designer内部组件是否重叠的标志位
* @param isIntersects 是否重叠 * @param isIntersects 是否重叠
*/ */
void setWidgetsIntersects(boolean isIntersects); void setWidgetsIntersected(boolean isIntersects);
/** /**
* 获取designer内部组件是否重叠的标志位 * 获取designer内部组件是否重叠的标志位
* @return 重叠 * @return 重叠
*/ */
boolean getWidgetsIntersects(); boolean isWidgetsIntersected();
/** /**
* 获取designer相对屏幕的位置 * 获取designer相对屏幕的位置
@ -357,10 +358,10 @@ public class MoveUtils {
if(designer.getDesignerLocationOnScreen() != null) { if(designer.getDesignerLocationOnScreen() != null) {
displayForbidWindow(x + designer.getDesignerLocationOnScreen().x, y + designer.getDesignerLocationOnScreen().y); displayForbidWindow(x + designer.getDesignerLocationOnScreen().x, y + designer.getDesignerLocationOnScreen().y);
} }
designer.setWidgetsIntersects(true); designer.setWidgetsIntersected(true);
} }
else{ else{
designer.setWidgetsIntersects(false); designer.setWidgetsIntersected(false);
hideForbidWindow(); hideForbidWindow();
} }
} }
@ -479,10 +480,10 @@ public class MoveUtils {
} }
private static void processEquidistantLinesList(PlacePointing pEquidistantX, PlacePointing pEquidistantY, Rectangle operatingRectangle){ private static void processEquidistantLinesList(PlacePointing pEquidistantX, PlacePointing pEquidistantY, Rectangle operatingRectangle){
EquidistantLine[] equidistantLines1 = new EquidistantLine[4]; EquidistantLine[] equidistantLines1 = new EquidistantLine[EQUIDISTANTLINE_UNIT];
//先按方向处理,只保留四个方向上距离最近 //先按方向处理,只保留四个方向上距离最近
for(int count = 0; count < equidistantLines.size(); count++){ for(int count = 0; count < equidistantLines.size(); count++){
for (int direction = 0; direction < 4; direction++){ for (int direction = 0; direction < EQUIDISTANTLINE_UNIT; direction++){
if(equidistantLines.get(count).getDirection() == (direction + 1)){//direction 1,2,3,4 分别对应top,left,bottom,right if(equidistantLines.get(count).getDirection() == (direction + 1)){//direction 1,2,3,4 分别对应top,left,bottom,right
if(equidistantLines1[direction] != null if(equidistantLines1[direction] != null
&& equidistantLines1[direction].getDistance() > equidistantLines.get(count).getDistance() && equidistantLines1[direction].getDistance() > equidistantLines.get(count).getDistance()

2
designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java

@ -84,7 +84,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
GeneralContext.addPluginReadListener(new PluginReadListener() { GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override @Override
public void success() { public void success(Status status) {
addMenuDef.clearShortCuts(); addMenuDef.clearShortCuts();
createAddMenuDef(); createAddMenuDef();
} }

56
designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -7,6 +7,7 @@ import com.fr.base.ParameterHelper;
import com.fr.data.core.db.TableProcedure; import com.fr.data.core.db.TableProcedure;
import com.fr.data.impl.DBTableData; import com.fr.data.impl.DBTableData;
import com.fr.data.impl.NameDatabaseConnection; import com.fr.data.impl.NameDatabaseConnection;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.border.UIRoundedBorder; import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
@ -17,6 +18,7 @@ import com.fr.design.data.datapane.sqlpane.SQLEditPane;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.fun.DBTableDataMenuHandler;
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.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.ParameterTableModel;
@ -34,7 +36,6 @@ import com.fr.general.Inter;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
@ -53,11 +54,13 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
private ConnectionTableProcedurePane connectionTableProcedurePane; private ConnectionTableProcedurePane connectionTableProcedurePane;
private UITableEditorPane<ParameterProvider> editorPane; private UITableEditorPane<ParameterProvider> editorPane;
private DBTableDataMenuHandler dbTableDataMenuHandler;
private SQLEditPane sqlTextPane; private SQLEditPane sqlTextPane;
private UICheckBox isShareCheckBox; private UICheckBox isShareCheckBox;
private MaxMemRowCountPanel maxPanel; private MaxMemRowCountPanel maxPanel;
private String pageQuery = null; private String pageQuery = null;
private String customCountQuery = null; private DBTableData dbTableData;
public DBTableDataPane() { public DBTableDataPane() {
@ -149,11 +152,9 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
} }
private void refresh() { private void refresh() {
String[] paramTexts = new String[3]; String[] paramTexts = new String[2];
paramTexts[0] = sqlTextPane.getText(); paramTexts[0] = sqlTextPane.getText();
paramTexts[1] = pageQuery; paramTexts[1] = pageQuery;
paramTexts[2] = customCountQuery;
List<ParameterProvider> existParameterList = editorPane.update(); List<ParameterProvider> existParameterList = editorPane.update();
Parameter[] ps = existParameterList == null ? new Parameter[0] : existParameterList.toArray(new Parameter[existParameterList.size()]); Parameter[] ps = existParameterList == null ? new Parameter[0] : existParameterList.toArray(new Parameter[existParameterList.size()]);
@ -166,8 +167,11 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
toolBarDef.addShortCut(new PreviewAction()); toolBarDef.addShortCut(new PreviewAction());
toolBarDef.addShortCut(SeparatorDef.DEFAULT); toolBarDef.addShortCut(SeparatorDef.DEFAULT);
toolBarDef.addShortCut(new EditPageQueryAction()); toolBarDef.addShortCut(new EditPageQueryAction());
toolBarDef.addShortCut(SeparatorDef.DEFAULT); dbTableDataMenuHandler = ExtraDesignClassManager.getInstance().getSingle(DBTableDataMenuHandler.MARK_STRING);
toolBarDef.addShortCut(new EditCustomCountQueryAction()); if (dbTableDataMenuHandler != null) {
toolBarDef.addShortCut(SeparatorDef.DEFAULT);
toolBarDef.addShortCut(dbTableDataMenuHandler.createQueryAction());
}
isShareCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Is_Share_DBTableData")); isShareCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Is_Share_DBTableData"));
maxPanel = new MaxMemRowCountPanel(); maxPanel = new MaxMemRowCountPanel();
maxPanel.setBorder(null); maxPanel.setBorder(null);
@ -179,11 +183,9 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
} }
private void checkParameter() { private void checkParameter() {
String[] paramTexts = new String[3]; String[] paramTexts = new String[2];
paramTexts[0] = sqlTextPane.getText(); paramTexts[0] = sqlTextPane.getText();
paramTexts[1] = pageQuery; paramTexts[1] = pageQuery;
paramTexts[2] = customCountQuery;
Parameter[] parameters = ParameterHelper.analyze4Parameters(paramTexts, false); Parameter[] parameters = ParameterHelper.analyze4Parameters(paramTexts, false);
if (parameters.length < 1 && editorPane.update().size() < 1) { if (parameters.length < 1 && editorPane.update().size() < 1) {
@ -210,6 +212,10 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
@Override @Override
public void populateBean(DBTableData dbtabledata) { public void populateBean(DBTableData dbtabledata) {
this.dbTableData = dbtabledata;
if (dbTableDataMenuHandler != null) {
dbTableDataMenuHandler.populate(dbtabledata);
}
ParameterProvider[] parameters = null; ParameterProvider[] parameters = null;
Calculator c = Calculator.createCalculator(); Calculator c = Calculator.createCalculator();
@ -227,8 +233,6 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
isShare = dbtabledata.isShare(); isShare = dbtabledata.isShare();
maxMemeryRow = dbtabledata.getMaxMemRowCount(); maxMemeryRow = dbtabledata.getMaxMemRowCount();
this.pageQuery = dbtabledata.getPageQuerySql(); this.pageQuery = dbtabledata.getPageQuerySql();
this.customCountQuery = dbtabledata.getCustomCountQuery();
this.connectionTableProcedurePane.setSelectedDatabaseConnection(db); this.connectionTableProcedurePane.setSelectedDatabaseConnection(db);
this.sqlTextPane.setText(query); this.sqlTextPane.setText(query);
this.sqlTextPane.requestFocus(); this.sqlTextPane.requestFocus();
@ -253,7 +257,6 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
List<ParameterProvider> parameterList = editorPane.update(); List<ParameterProvider> parameterList = editorPane.update();
Parameter[] parameters = parameterList.toArray(new Parameter[parameterList.size()]); Parameter[] parameters = parameterList.toArray(new Parameter[parameterList.size()]);
DBTableData dbTableData = new DBTableData();
dbTableData.setDatabase(new NameDatabaseConnection(dbName)); dbTableData.setDatabase(new NameDatabaseConnection(dbName));
// p:必须先设置Parameters数组,因为setQuery里面会自动设置的 // p:必须先设置Parameters数组,因为setQuery里面会自动设置的
@ -264,8 +267,9 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
dbTableData.setShare(isShareCheckBox.isSelected()); dbTableData.setShare(isShareCheckBox.isSelected());
dbTableData.setMaxMemRowCount(maxPanel.getValue()); dbTableData.setMaxMemRowCount(maxPanel.getValue());
dbTableData.setPageQuerySql(this.pageQuery); dbTableData.setPageQuerySql(this.pageQuery);
dbTableData.setCustomCountQuery(this.customCountQuery); if (dbTableDataMenuHandler != null) {
dbTableDataMenuHandler.update();
}
return dbTableData; return dbTableData;
} }
@ -318,28 +322,6 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
} }
} }
private class EditCustomCountQueryAction extends UpdateAction {
public EditCustomCountQueryAction() {
this.setName(Inter.getLocText("FR-Designer-LayerPageReport_CustomCountQuery"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/text.png"));
}
@Override
public void actionPerformed(ActionEvent e) {
final QueryPane editPane = new QueryPane(Inter.getLocText("FR-Designer-LayerPageReport_Define_CustomCountQuery"));
editPane.populate(customCountQuery);
BasicDialog dialog = editPane.showWindow(DesignerContext.getDesignerFrame());
dialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
customCountQuery = editPane.update();
checkParameter();
}
});
dialog.setVisible(true);
}
}
private class QueryPane extends BasicPane { private class QueryPane extends BasicPane {
private SQLEditPane pageQueryPane; private SQLEditPane pageQueryPane;
private String title; private String title;

8
designer_base/src/com/fr/design/dialog/mobile/MobileUseHtmlGroupBeanPane.java

@ -23,11 +23,11 @@ public abstract class MobileUseHtmlGroupBeanPane<T> extends BasicBeanPane<T> {
private List<UIRadioButton> radioButtons = new ArrayList<UIRadioButton>(); private List<UIRadioButton> radioButtons = new ArrayList<UIRadioButton>();
public MobileUseHtmlGroupBeanPane() { public MobileUseHtmlGroupBeanPane(String annotation) {
initComponents(); initComponents(annotation);
} }
private void initComponents() { private void initComponents(String annotation) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(UITitledBorder.createBorderWithTitle(this.title4PopupWindow())); this.setBorder(UITitledBorder.createBorderWithTitle(this.title4PopupWindow()));
@ -43,7 +43,7 @@ public abstract class MobileUseHtmlGroupBeanPane<T> extends BasicBeanPane<T> {
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-mobile_analysis_style")), useApp, useHTML5}, new Component[]{new UILabel(Inter.getLocText("FR-mobile_analysis_style")), useApp, useHTML5},
new Component[]{new UILabel(Inter.getLocText("FR-mobile_analysis_annotation")), null, null} new Component[]{new UILabel(annotation), null, null}
}; };
JPanel usePane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel usePane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
usePane.setBorder(BorderFactory.createEmptyBorder(10, 13, 10, 10)); usePane.setBorder(BorderFactory.createEmptyBorder(10, 13, 10, 10));

6
designer_base/src/com/fr/design/editor/editor/DateEditor.java

@ -15,6 +15,7 @@ import java.awt.event.ItemListener;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.Locale;
/** /**
* CellEditor used to edit Date object. * CellEditor used to edit Date object.
@ -59,7 +60,10 @@ public class DateEditor extends Editor<Date> {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
uiDatePicker = new UIDatePicker(); uiDatePicker = new UIDatePicker();
if (format) { if (format) {
uiDatePicker.setStyle(uiDatePicker.STYLE_CN_DATE); int dateStyle = (FRContext.getLocale() == Locale.ENGLISH
|| FRContext.getLocale() == Locale.US
|| FRContext.getLocale() == Locale.UK) ? uiDatePicker.STYLE_EN_DATE : uiDatePicker.STYLE_CN_DATE;
uiDatePicker.setStyle(dateStyle);
uiDatePicker.setEditable(false); uiDatePicker.setEditable(false);
} }
uiDatePicker.addItemListener(new ItemListener() { uiDatePicker.addItemListener(new ItemListener() {

2
designer_base/src/com/fr/design/extra/PluginHelper.java

@ -256,7 +256,7 @@ public class PluginHelper {
if (PluginLoader.getLoader().isInstalled(plugin)) { if (PluginLoader.getLoader().isInstalled(plugin)) {
throw new com.fr.plugin.PluginVerifyException(Inter.getLocText("FR-Designer-Plugin_Has_Been_Installed")); throw new com.fr.plugin.PluginVerifyException(Inter.getLocText("FR-Designer-Plugin_Has_Been_Installed"));
} }
if (plugin.isJarExpired()) { if (plugin.checkIfJarExpired()) {
String jarExpiredInfo = Inter.getLocText(new String[]{"FR-Designer-Plugin_Jar_Expired", ",", "FR-Designer-Plugin_Install_Failed", ",", "FR-Designer-Plugin_Please_Update_Jar", plugin.getRequiredJarTime()}); String jarExpiredInfo = Inter.getLocText(new String[]{"FR-Designer-Plugin_Jar_Expired", ",", "FR-Designer-Plugin_Install_Failed", ",", "FR-Designer-Plugin_Please_Update_Jar", plugin.getRequiredJarTime()});
FRLogger.getLogger().error(jarExpiredInfo); FRLogger.getLogger().error(jarExpiredInfo);
throw new com.fr.plugin.PluginVerifyException(jarExpiredInfo); throw new com.fr.plugin.PluginVerifyException(jarExpiredInfo);

221
designer_base/src/com/fr/design/formula/FormulaPane.java

@ -22,6 +22,7 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.parser.FRLexer; import com.fr.parser.FRLexer;
import com.fr.parser.FRParser; import com.fr.parser.FRParser;
import com.fr.stable.EncodeConstants;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.script.Expression; import com.fr.stable.script.Expression;
@ -38,12 +39,14 @@ import java.awt.event.*;
import java.io.*; import java.io.*;
import java.util.Locale; import java.util.Locale;
import java.util.Set; import java.util.Set;
/** /**
* 公式编辑面板 * 公式编辑面板
*
* @editor zhou * @editor zhou
* @since 2012-3-29下午1:50:53 * @since 2012-3-29下午1:50:53
*/ */
public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
protected VariableTreeAndDescriptionArea variableTreeAndDescriptionArea; protected VariableTreeAndDescriptionArea variableTreeAndDescriptionArea;
protected RSyntaxTextArea formulaTextArea; protected RSyntaxTextArea formulaTextArea;
@ -62,17 +65,17 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
public FormulaPane() { public FormulaPane() {
initComponents(); initComponents();
} }
private void initFormulaTextAreaKeyListener(){ private void initFormulaTextAreaKeyListener() {
formulaTextArea.addKeyListener(this); formulaTextArea.addKeyListener(this);
formulaTextArea.addKeyListener(new KeyAdapter() { formulaTextArea.addKeyListener(new KeyAdapter() {
public void keyReleased(KeyEvent e) { public void keyReleased(KeyEvent e) {
formulaTextArea.setForeground(Color.black); formulaTextArea.setForeground(Color.black);
String text = formulaTextArea.getText(); String text = formulaTextArea.getText();
// 判断在中文输入状态是否还包含提示符 要删掉 // 判断在中文输入状态是否还包含提示符 要删掉
//Tips:You_Can_Input_B1_To_Input_The_Data_Of_The_First_Row_Second_Column //Tips:You_Can_Input_B1_To_Input_The_Data_Of_The_First_Row_Second_Column
String tip = "\n\n\n" + Inter.getLocText("FR-Designer_FormulaPane_Tips"); String tip = "\n\n\n" + Inter.getLocText("FR-Designer_FormulaPane_Tips");
if(text.contains(tip)) { if (text.contains(tip)) {
text = text.substring(0, text.indexOf(tip)); text = text.substring(0, text.indexOf(tip));
insertPosition = 0; insertPosition = 0;
formulaTextArea.setText(text); formulaTextArea.setText(text);
@ -80,9 +83,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
} }
}); });
} }
private void initFormulaTextAreaMouseListener(){ private void initFormulaTextAreaMouseListener() {
formulaTextArea.addMouseListener(new MouseAdapter() { formulaTextArea.addMouseListener(new MouseAdapter() {
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
insertPosition = formulaTextArea.getCaretPosition(); insertPosition = formulaTextArea.getCaretPosition();
@ -106,22 +109,24 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
} }
}); });
} }
private void initFormulaTextArea(){ private void initFormulaTextArea() {
formulaTextArea = new RSyntaxTextArea(); formulaTextArea = new RSyntaxTextArea();
configFormulaArea(); configFormulaArea();
initFormulaTextAreaKeyListener(); initFormulaTextAreaKeyListener();
initFormulaTextAreaMouseListener(); initFormulaTextAreaMouseListener();
} }
private void initKeyWordTextFieldKeyListener(){ private void initKeyWordTextFieldKeyListener() {
keyWordTextField.addKeyListener(new KeyListener() { keyWordTextField.addKeyListener(new KeyListener() {
@Override @Override
public void keyTyped(KeyEvent e) { public void keyTyped(KeyEvent e) {
} }
@Override @Override
public void keyReleased(KeyEvent e) { public void keyReleased(KeyEvent e) {
} }
@Override @Override
public void keyPressed(KeyEvent e) { public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) { if (e.getKeyCode() == KeyEvent.VK_ENTER) {
@ -133,9 +138,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
} }
}); });
} }
private void initTipsPane(){ private void initTipsPane() {
// tipsPane // tipsPane
JPanel tipsPane = new JPanel(new BorderLayout(4, 4)); JPanel tipsPane = new JPanel(new BorderLayout(4, 4));
this.add(tipsPane, BorderLayout.EAST); this.add(tipsPane, BorderLayout.EAST);
@ -161,7 +166,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
} }
}); });
} }
protected void initComponents() { protected void initComponents() {
this.setLayout(new BorderLayout(4, 4)); this.setLayout(new BorderLayout(4, 4));
// text // text
@ -172,7 +177,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
+ " "); + " ");
formulaLabel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); formulaLabel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
initFormulaTextArea(); initFormulaTextArea();
UIScrollPane formulaTextAreaScrollPane = new UIScrollPane(formulaTextArea); UIScrollPane formulaTextAreaScrollPane = new UIScrollPane(formulaTextArea);
formulaTextAreaScrollPane.setBorder(null); formulaTextAreaScrollPane.setBorder(null);
textPane.add(formulaLabel, BorderLayout.NORTH); textPane.add(formulaLabel, BorderLayout.NORTH);
@ -259,6 +264,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
this.formulaTextArea.setText(StringUtils.EMPTY); this.formulaTextArea.setText(StringUtils.EMPTY);
} }
} }
//hugh:为啥会是10呢?搞不懂~~~ //hugh:为啥会是10呢?搞不懂~~~
private static final int KEY_10 = 10; private static final int KEY_10 = 10;
//上下左右 //上下左右
@ -266,6 +272,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
private static final int KEY_38 = 38; private static final int KEY_38 = 38;
private static final int KEY_39 = 39; private static final int KEY_39 = 39;
private static final int KEY_40 = 40; private static final int KEY_40 = 40;
@Override @Override
public void keyReleased(KeyEvent e) { public void keyReleased(KeyEvent e) {
int key = e.getKeyCode(); int key = e.getKeyCode();
@ -452,10 +459,10 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
formulaTextArea.requestFocus(); formulaTextArea.requestFocus();
insertPosition = formulaTextArea.getCaretPosition(); insertPosition = formulaTextArea.getCaretPosition();
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Inter.getLocText("FormulaD-Formula_Definition"); return Inter.getLocText("FormulaD-Formula_Definition");
} }
/** /**
@ -561,9 +568,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
public VariableTreeAndDescriptionArea() { public VariableTreeAndDescriptionArea() {
this.initComponents(); this.initComponents();
} }
private void initFunctionTypeList(JPanel functionPane){ private void initFunctionTypeList(JPanel functionPane) {
functionTypeList = new QuickList(functionTypeListModel); functionTypeList = new QuickList(functionTypeListModel);
UIScrollPane functionTypeScrollPane = new UIScrollPane(functionTypeList); UIScrollPane functionTypeScrollPane = new UIScrollPane(functionTypeList);
functionTypeScrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC)); functionTypeScrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC));
functionTypeScrollPane.setPreferredSize(new Dimension(140, 200)); functionTypeScrollPane.setPreferredSize(new Dimension(140, 200));
@ -572,23 +579,23 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
initGroupTypeModel(); initGroupTypeModel();
initTypeListSelectionListener(); initTypeListSelectionListener();
} }
private void initTypeListCellRenderer(){ private void initTypeListCellRenderer() {
functionTypeList.setCellRenderer( functionTypeList.setCellRenderer(
new DefaultListCellRenderer() { new DefaultListCellRenderer() {
@Override @Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof FunctionGroup) { if (value instanceof FunctionGroup) {
this.setText(((FunctionGroup) value).getGroupName()); this.setText(((FunctionGroup) value).getGroupName());
} }
return this; return this;
} }
}); });
} }
private void initTypeListSelectionListener(){ private void initTypeListSelectionListener() {
functionTypeList.addListSelectionListener(new ListSelectionListener() { functionTypeList.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent evt) { public void valueChanged(ListSelectionEvent evt) {
Object selectedValue = ((JList) evt.getSource()).getSelectedValue(); Object selectedValue = ((JList) evt.getSource()).getSelectedValue();
if (!(selectedValue instanceof FunctionGroup)) { if (!(selectedValue instanceof FunctionGroup)) {
@ -607,22 +614,22 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
} }
}); });
} }
private void initGroupTypeModel(){ private void initGroupTypeModel() {
functionTypeListModel.addElement(FunctionConstants.COMMON); functionTypeListModel.addElement(FunctionConstants.COMMON);
for (int i = 0; i < FunctionConstants.EMBFUNCTIONS.length; i++) { for (int i = 0; i < FunctionConstants.EMBFUNCTIONS.length; i++) {
functionTypeListModel.addElement(FunctionConstants.EMBFUNCTIONS[i]); functionTypeListModel.addElement(FunctionConstants.EMBFUNCTIONS[i]);
} }
functionTypeListModel.addElement(FunctionConstants.ALL); functionTypeListModel.addElement(FunctionConstants.ALL);
functionTypeListModel.addElement(FunctionConstants.CUSTOM); functionTypeListModel.addElement(FunctionConstants.CUSTOM);
functionTypeListModel.addElement(FunctionConstants.PLUGIN); functionTypeListModel.addElement(FunctionConstants.PLUGIN);
//hugh: 从函数分组插件中添加分组 //hugh: 从函数分组插件中添加分组
FunctionConstants.addFunctionGroupFromPlugins(functionTypeListModel); FunctionConstants.addFunctionGroupFromPlugins(functionTypeListModel);
} }
private void initFunctionNameListCellRenderer(){ private void initFunctionNameListCellRenderer() {
functionNameList.setCellRenderer(new DefaultListCellRenderer() { functionNameList.setCellRenderer(new DefaultListCellRenderer() {
@Override @Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
@ -633,10 +640,10 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
return this; return this;
} }
}); });
} }
private void initFunctionNameListSelectionListener(){ private void initFunctionNameListSelectionListener() {
functionNameList.addListSelectionListener(new ListSelectionListener() { functionNameList.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent evt) { public void valueChanged(ListSelectionEvent evt) {
Object selectedValue = functionNameList.getSelectedValue(); Object selectedValue = functionNameList.getSelectedValue();
@ -651,9 +658,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
} }
}); });
} }
private void initFunctionNameListMouseListener(){ private void initFunctionNameListMouseListener() {
functionNameList.addMouseListener(new MouseAdapter() { functionNameList.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent evt) { public void mouseClicked(MouseEvent evt) {
if (evt.getClickCount() >= 2) { if (evt.getClickCount() >= 2) {
Object selectedValue = functionNameList.getSelectedValue(); Object selectedValue = functionNameList.getSelectedValue();
@ -675,9 +682,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
} }
}); });
} }
private void initFunctionNameList(JPanel functionPane){ private void initFunctionNameList(JPanel functionPane) {
functionNameList = new JList(new DefaultListModel()); functionNameList = new JList(new DefaultListModel());
UIScrollPane functionNameScrollPane = new UIScrollPane(functionNameList); UIScrollPane functionNameScrollPane = new UIScrollPane(functionNameList);
functionNameScrollPane.setPreferredSize(new Dimension(140, 200)); functionNameScrollPane.setPreferredSize(new Dimension(140, 200));
functionPane.add( functionPane.add(
@ -688,9 +695,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
initFunctionNameListSelectionListener(); initFunctionNameListSelectionListener();
initFunctionNameListMouseListener(); initFunctionNameListMouseListener();
} }
private void initDescriptionTextArea(){ private void initDescriptionTextArea() {
// Description // Description
descriptionTextArea = new UITextArea(16, 27); descriptionTextArea = new UITextArea(16, 27);
UIScrollPane desScrollPane = new UIScrollPane(descriptionTextArea); UIScrollPane desScrollPane = new UIScrollPane(descriptionTextArea);
@ -710,16 +717,16 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
}); });
} }
private StringBuilder getText(TextUserObject selectedValue,String path) throws IOException{ private StringBuilder getText(TextUserObject selectedValue, String path) throws IOException {
Reader desReader; Reader desReader;
StringBuilder desBuf = new StringBuilder(); StringBuilder desBuf = new StringBuilder();
InputStream desInputStream = BaseUtils.readResource(path+ ((TextUserObject) selectedValue).displayText+".txt"); InputStream desInputStream = BaseUtils.readResource(path + ((TextUserObject) selectedValue).displayText + ".txt");
if (desInputStream == null) { if (desInputStream == null) {
String description = ""; String description = "";
desReader = new StringReader(description); desReader = new StringReader(description);
} else { } else {
desReader = new InputStreamReader(desInputStream); desReader = new InputStreamReader(desInputStream, EncodeConstants.ENCODING_UTF_8);
} }
BufferedReader reader = new BufferedReader(desReader); BufferedReader reader = new BufferedReader(desReader);
String lineText; String lineText;
@ -732,12 +739,12 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
reader.close(); reader.close();
desReader.close(); desReader.close();
return desBuf; return desBuf;
} }
private void initVariablesTreeSelectionListener(){ private void initVariablesTreeSelectionListener() {
variablesTree.addTreeSelectionListener(new TreeSelectionListener() { variablesTree.addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) { public void valueChanged(TreeSelectionEvent e) {
Object selectedValue = ((DefaultMutableTreeNode) variablesTree.getLastSelectedPathComponent()).getUserObject(); Object selectedValue = ((DefaultMutableTreeNode) variablesTree.getLastSelectedPathComponent()).getUserObject();
if (selectedValue == null) { if (selectedValue == null) {
return; return;
} }
@ -751,7 +758,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
path = "/com/fr/design/insert/formula/variable/en/"; path = "/com/fr/design/insert/formula/variable/en/";
} }
if (selectedValue instanceof TextUserObject) { if (selectedValue instanceof TextUserObject) {
desBuf = getText((TextUserObject)selectedValue,path); desBuf = getText((TextUserObject) selectedValue, path);
} }
} catch (IOException exp) { } catch (IOException exp) {
FRContext.getLogger().error(exp.getMessage(), exp); FRContext.getLogger().error(exp.getMessage(), exp);
@ -761,9 +768,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
} }
}); });
} }
private void initVariablesTree(){ private void initVariablesTree() {
// vairable. // vairable.
variablesTree = new JTree(); variablesTree = new JTree();
UIScrollPane variablesTreePane = new UIScrollPane(variablesTree); UIScrollPane variablesTreePane = new UIScrollPane(variablesTree);
variablesTreePane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC)); variablesTreePane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC));
@ -773,12 +780,12 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
variablesTree.setShowsRootHandles(true); variablesTree.setShowsRootHandles(true);
variablesTree.addMouseListener(applyTextMouseListener); variablesTree.addMouseListener(applyTextMouseListener);
variablesTree.setCellRenderer(applyTreeCellRenderer); variablesTree.setCellRenderer(applyTreeCellRenderer);
initDescriptionTextArea(); initDescriptionTextArea();
initVariablesTreeSelectionListener(); initVariablesTreeSelectionListener();
} }
private void initComponents() { private void initComponents() {
this.setLayout(new BorderLayout(4, 4)); this.setLayout(new BorderLayout(4, 4));
// Function // Function
@ -810,10 +817,10 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
private void showPopupPane() { private void showPopupPane() {
BasicPane basicPane = new BasicPane() { BasicPane basicPane = new BasicPane() {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Inter.getLocText("FR-Designer_FormulaPane_Function_Detail"); return Inter.getLocText("FR-Designer_FormulaPane_Function_Detail");
} }
}; };
basicPane.setLayout(FRGUIPaneFactory.createBorderLayout()); basicPane.setLayout(FRGUIPaneFactory.createBorderLayout());
UITextArea desArea = new UITextArea(); UITextArea desArea = new UITextArea();
@ -889,7 +896,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
return this; return this;
} }
}; };
public void populate(VariableResolver variableResolver) { public void populate(VariableResolver variableResolver) {
// varibale tree. // varibale tree.
DefaultTreeModel variableModel = (DefaultTreeModel) variablesTree.getModel(); DefaultTreeModel variableModel = (DefaultTreeModel) variablesTree.getModel();
@ -902,28 +909,28 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
DefaultMutableTreeNode bindCellNode = new DefaultMutableTreeNode(new TextUserObject("$$$")); DefaultMutableTreeNode bindCellNode = new DefaultMutableTreeNode(new TextUserObject("$$$"));
rootNode.add(bindCellNode); rootNode.add(bindCellNode);
} }
rootNode.add(new TextFolderUserObject(Inter.getLocText("FormulaD-Data_Fields"), rootNode.add(new TextFolderUserObject(Inter.getLocText("FormulaD-Data_Fields"),
BaseUtils.readIcon("/com/fr/design/images/dialog/table.png"), BaseUtils.readIcon("/com/fr/design/images/dialog/table.png"),
variableResolver.resolveColumnNames()).createMutableTreeNode()); variableResolver.resolveColumnNames()).createMutableTreeNode());
// Set cutReport Variable // Set cutReport Variable
rootNode.add(new TextFolderUserObject(Inter.getLocText("FR-Designer_FormulaPane_Variables"), rootNode.add(new TextFolderUserObject(Inter.getLocText("FR-Designer_FormulaPane_Variables"),
BaseUtils.readIcon("/com/fr/design/images/dialog/variable.png"), BaseUtils.readIcon("/com/fr/design/images/dialog/variable.png"),
variableResolver.resolveCurReportVariables()).createMutableTreeNode()); variableResolver.resolveCurReportVariables()).createMutableTreeNode());
rootNode.add(new TextFolderUserObject(Inter.getLocText(new String[]{"Datasource-Datasource", "Parameter"}), rootNode.add(new TextFolderUserObject(Inter.getLocText(new String[]{"Datasource-Datasource", "Parameter"}),
BaseUtils.readIcon("/com/fr/design/images/dialog/parameter.gif"), BaseUtils.readIcon("/com/fr/design/images/dialog/parameter.gif"),
variableResolver.resolveTableDataParameterVariables()).createMutableTreeNode()); variableResolver.resolveTableDataParameterVariables()).createMutableTreeNode());
rootNode.add(new TextFolderUserObject(Inter.getLocText("ParameterD-Report_Parameter"), rootNode.add(new TextFolderUserObject(Inter.getLocText("ParameterD-Report_Parameter"),
BaseUtils.readIcon("/com/fr/design/images/m_report/p.gif"), BaseUtils.readIcon("/com/fr/design/images/m_report/p.gif"),
variableResolver.resolveReportParameterVariables()).createMutableTreeNode()); variableResolver.resolveReportParameterVariables()).createMutableTreeNode());
rootNode.add(new TextFolderUserObject(Inter.getLocText("M_Server-Global_Parameters"), rootNode.add(new TextFolderUserObject(Inter.getLocText("M_Server-Global_Parameters"),
BaseUtils.readIcon("/com/fr/design/images/dialog/parameter.gif"), BaseUtils.readIcon("/com/fr/design/images/dialog/parameter.gif"),
variableResolver.resolveGlobalParameterVariables()).createMutableTreeNode()); variableResolver.resolveGlobalParameterVariables()).createMutableTreeNode());
variableModel.reload(); variableModel.reload();
// Expand // Expand
for (int row = 0; row < this.variablesTree.getRowCount(); row++) { for (int row = 0; row < this.variablesTree.getRowCount(); row++) {

14
designer_base/src/com/fr/design/formula/FunctionManagerPane.java

@ -20,6 +20,7 @@ import com.fr.file.FunctionManagerProvider;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.ProductConstants;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.stable.script.FunctionDef; import com.fr.stable.script.FunctionDef;
@ -159,10 +160,11 @@ public class FunctionManagerPane extends BasicPane {
descriptionArea.setWrapStyleWord(true); descriptionArea.setWrapStyleWord(true);
descriptionArea.setLineWrap(true); descriptionArea.setLineWrap(true);
northPane.add(descriptionArea); northPane.add(descriptionArea);
descriptionArea.setText(Inter.getLocText(new String[]{"Function-The_class_must_inherit","Fuction-The_compiled_class_should_be_copied_to",
"Function-J2EE_server", "Directory", "Function-Source_Code", "Example"}, String path1 = getEscapePath(File.separator + ProjectConstants.WEBINF_NAME + File.separator + ProjectConstants.CLASSES_NAME);
new String[]{" \"com.fr.script.AbstractFunction\".", "\n", " \"" + File.separator + "WEB-INF" + File.separator + "classes\"", String path2 = getEscapePath(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.CLASSES_NAME);
",", ".\n", ":" + FRContext.getCurrentEnv().getPath() + File.separator + "classes"})); descriptionArea.setText(Inter.getLocText("FR-Designer_Function_Description_Area_Text", path1, path2));
JPanel descriptionPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); //Description Pane JPanel descriptionPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); //Description Pane
this.add(descriptionPane, BorderLayout.SOUTH); this.add(descriptionPane, BorderLayout.SOUTH);
descriptionPane.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); descriptionPane.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
@ -170,6 +172,10 @@ public class FunctionManagerPane extends BasicPane {
this.descriptionTextArea = new UITextArea(6, 24); this.descriptionTextArea = new UITextArea(6, 24);
descriptionPane.add(new JScrollPane(this.descriptionTextArea), BorderLayout.CENTER); descriptionPane.add(new JScrollPane(this.descriptionTextArea), BorderLayout.CENTER);
} }
private String getEscapePath(String path) {
return path.replace("\\", "\\\\");
}
private ActionListener createEditorButtonActionListener() { private ActionListener createEditorButtonActionListener() {
return new ActionListener() { return new ActionListener() {

22
designer_base/src/com/fr/design/fun/DBTableDataMenuHandler.java

@ -0,0 +1,22 @@
package com.fr.design.fun;
import com.fr.data.impl.DBTableData;
import com.fr.design.actions.UpdateAction;
import com.fr.stable.fun.mark.Immutable;
/**
* Created by xiaxiang on 2017/1/15.
*/
public interface DBTableDataMenuHandler extends Immutable {
String MARK_STRING = "DBTableDataMenuHandler";
int CURRENT_LEVEL = 1;
UpdateAction createQueryAction();
void populate(DBTableData dbTableData);
DBTableData update();
}

20
designer_base/src/com/fr/design/fun/DesignerStartOpenFileProcessor.java

@ -0,0 +1,20 @@
package com.fr.design.fun;
import com.fr.file.FILE;
import com.fr.stable.fun.mark.Immutable;
/**
* 指定设计器启动时默认打开的文件
* Created by rinoux on 2016/12/16.
*/
public interface DesignerStartOpenFileProcessor extends Immutable {
int CURRENT_LEVEL = 1;
String XML_TAG = "DesignerStartOpenFileProcessor";
/**
* 显示需要打开的报表文件
*/
FILE fileToShow();
}

34
designer_base/src/com/fr/design/fun/impl/AbstractDBTableDataMenuHandler.java

@ -0,0 +1,34 @@
package com.fr.design.fun.impl;
import com.fr.data.impl.DBTableData;
import com.fr.design.actions.UpdateAction;
import com.fr.design.fun.DBTableDataMenuHandler;
import com.fr.stable.fun.mark.API;
/**
* Created by xiaxiang on 2017/1/15.
*/
@API(level = DBTableDataMenuHandler.CURRENT_LEVEL)
public abstract class AbstractDBTableDataMenuHandler implements DBTableDataMenuHandler {
public int currentAPILevel() {
return CURRENT_LEVEL;
}
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
public UpdateAction createQueryAction() {
return null;
}
@Override
public DBTableData update() {
return null;
}
@Override
public void populate(DBTableData dbTableData) {
}
}

18
designer_base/src/com/fr/design/fun/impl/AbstractDesignerStartOpenFileProcessor.java

@ -0,0 +1,18 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.DesignerStartOpenFileProcessor;
import com.fr.stable.fun.mark.API;
/**
* Created by rinoux on 2016/12/16.
*/
@API(level = DesignerStartOpenFileProcessor.CURRENT_LEVEL)
public abstract class AbstractDesignerStartOpenFileProcessor implements DesignerStartOpenFileProcessor {
public int currentAPILevel() {
return DesignerStartOpenFileProcessor.CURRENT_LEVEL;
}
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
}

5
designer_base/src/com/fr/design/gui/controlpane/JListControlPane.java

@ -109,6 +109,10 @@ public abstract class JListControlPane extends JControlPane {
} }
protected void doBeforePopulate(ListModelElement el, Object obj) {
}
@Override @Override
protected ShortCut4JControlPane addItemShortCut() { protected ShortCut4JControlPane addItemShortCut() {
ShortCut addItemShortCut; ShortCut addItemShortCut;
@ -832,6 +836,7 @@ public abstract class JListControlPane extends JControlPane {
cardPane.add(updatePanes[i], String.valueOf(i)); cardPane.add(updatePanes[i], String.valueOf(i));
} }
card.show(cardPane, String.valueOf(i)); card.show(cardPane, String.valueOf(i));
doBeforePopulate(el, ob2Populate);
updatePanes[i].populateBean(ob2Populate); updatePanes[i].populateBean(ob2Populate);
doWhenPopulate(updatePanes[i]); doWhenPopulate(updatePanes[i]);
break; break;

3
designer_base/src/com/fr/design/gui/date/UIDatePicker.java

@ -31,6 +31,7 @@ public class UIDatePicker extends UIComboBox implements Serializable {
public static final int STYLE_CN_DATE1 = 1; public static final int STYLE_CN_DATE1 = 1;
public static final int STYLE_CN_DATETIME = 2; public static final int STYLE_CN_DATETIME = 2;
public static final int STYLE_CN_DATETIME1 = 3; public static final int STYLE_CN_DATETIME1 = 3;
public static final int STYLE_EN_DATE = 4;
public boolean isWillHide = false; public boolean isWillHide = false;
/** /**
* 日期格式类型 * 日期格式类型
@ -113,6 +114,8 @@ public class UIDatePicker extends UIComboBox implements Serializable {
return new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); return new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
case STYLE_CN_DATETIME1: case STYLE_CN_DATETIME1:
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
case STYLE_EN_DATE:
return new SimpleDateFormat("MM/dd/yyyy");
default: default:
throw new UnsupportedOperationException( throw new UnsupportedOperationException(
"invalid formatStyle parameter!"); "invalid formatStyle parameter!");

3
designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java

@ -13,6 +13,7 @@ import com.fr.js.JavaScript;
import com.fr.js.NameJavaScript; import com.fr.js.NameJavaScript;
import com.fr.js.NameJavaScriptGroup; import com.fr.js.NameJavaScriptGroup;
import com.fr.plugin.PluginManager; import com.fr.plugin.PluginManager;
import com.fr.stable.ListMap;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import java.util.ArrayList; import java.util.ArrayList;
@ -34,7 +35,7 @@ public class HyperlinkGroupPane extends JListControlPane {
* @return 返回Nameable按钮数组. * @return 返回Nameable按钮数组.
*/ */
public NameableCreator[] createNameableCreators() { public NameableCreator[] createNameableCreators() {
Map<String, NameableCreator> nameCreators = new TreeMap<String, NameableCreator>(); Map<String, NameableCreator> nameCreators = new ListMap<>();
NameableCreator[] creators = DesignModuleFactory.getHyperlinkGroupType().getHyperlinkCreators(); NameableCreator[] creators = DesignModuleFactory.getHyperlinkGroupType().getHyperlinkCreators();
for (NameableCreator creator : creators) { for (NameableCreator creator : creators) {
nameCreators.put(creator.menuName(), creator); nameCreators.put(creator.menuName(), creator);

33
designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java

@ -28,6 +28,7 @@ import com.fr.design.utils.gui.GUICoreUtils;
public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver { public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
private boolean isTwoLine = false; private boolean isTwoLine = false;
private boolean isFourLine = false;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
protected List<UIToggleButton> labelButtonList; protected List<UIToggleButton> labelButtonList;
protected int selectedIndex = -1; protected int selectedIndex = -1;
@ -176,6 +177,10 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
this.isTwoLine = true; this.isTwoLine = true;
} }
public void setFourLine() {
this.isFourLine = true;
}
/** /**
* paintComponent * paintComponent
* *
@ -201,32 +206,40 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
} }
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
g2d.setColor(UIConstants.LINE_COLOR); g2d.setColor(UIConstants.LINE_COLOR);
if (!isTwoLine) { if (isTwoLine) {
int width = 0; int width = 0;
for (int i = 0; i < labelButtonList.size() - 1; i++) { int upCount = (labelButtonList.size() - 1) / 2 + 1;
for (int i = 0; i < upCount - 1; i++) {
width += labelButtonList.get(i).getWidth() + 1; width += labelButtonList.get(i).getWidth() + 1;
int height = labelButtonList.get(i).getHeight(); int height = labelButtonList.get(i).getHeight() * 2 + 1;
g.drawLine(width, 0, width, height); g.drawLine(width, 0, width, height);
} }
width += labelButtonList.get(labelButtonList.size() - 1).getWidth() + 1; width += labelButtonList.get(upCount).getWidth() + 1;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.drawRoundRect(0, 0, width, getHeight() - 1, UIConstants.ARC, UIConstants.ARC); g2d.drawRoundRect(0, 0, width, getHeight() - 1, UIConstants.ARC, UIConstants.ARC);
g2d.drawLine(0, getHeight() / 2, width, getHeight() / 2);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
} else if (isFourLine) {
// 4 * 1
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.drawRoundRect(0, 0, getWidth() - 1, getHeight() - 1, UIConstants.ARC, UIConstants.ARC);
for (int i = 1; i <= 3; i++) {
g2d.drawLine(0, getHeight() / 4 * i, getWidth() - 1, getHeight() / 4 * i);
}
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
} else { } else {
int width = 0; int width = 0;
int upCount = (labelButtonList.size() - 1) / 2 + 1; for (int i = 0; i < labelButtonList.size() - 1; i++) {
for (int i = 0; i < upCount - 1; i++) {
width += labelButtonList.get(i).getWidth() + 1; width += labelButtonList.get(i).getWidth() + 1;
int height = labelButtonList.get(i).getHeight() * 2 + 1; int height = labelButtonList.get(i).getHeight();
g.drawLine(width, 0, width, height); g.drawLine(width, 0, width, height);
} }
width += labelButtonList.get(upCount).getWidth() + 1; width += labelButtonList.get(labelButtonList.size() - 1).getWidth() + 1;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.drawRoundRect(0, 0, width, getHeight() - 1, UIConstants.ARC, UIConstants.ARC); g2d.drawRoundRect(0, 0, width, getHeight() - 1, UIConstants.ARC, UIConstants.ARC);
g2d.drawLine(0, getHeight() / 2, width, getHeight() / 2);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
} }

3
designer_base/src/com/fr/design/gui/ibutton/UIColorButton.java

@ -30,6 +30,7 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G
private static final int SIZE_2 = 2; private static final int SIZE_2 = 2;
private static final int SIZE_4 = 4; private static final int SIZE_4 = 4;
private static final int SIZE_6 = 6; private static final int SIZE_6 = 6;
private static final int POPUP_MENU_SHIFT = -70;
private Color color = Color.BLACK; private Color color = Color.BLACK;
private ColorControlWindow popupWin; private ColorControlWindow popupWin;
private EventListenerList colorChangeListenerList = new EventListenerList(); private EventListenerList colorChangeListenerList = new EventListenerList();
@ -126,7 +127,7 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G
popupWin = this.getColorControlWindow(); popupWin = this.getColorControlWindow();
GUICoreUtils.showPopupMenu(popupWin, this, 0, this.getSize().height); GUICoreUtils.showPopupMenu(popupWin, this, POPUP_MENU_SHIFT, this.getSize().height);
} }
/** /**

7
designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -5,6 +5,7 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.collections.utils.MathUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -14,10 +15,12 @@ import java.awt.event.MouseMotionListener;
public class UIResizableContainer extends JPanel { public class UIResizableContainer extends JPanel {
private static final long serialVersionUID = 1854340560790476907L; private static final long serialVersionUID = 1854340560790476907L;
private static final int MAX_PARA_HEIGHT = 240;
private int containerWidth = 240; private int containerWidth = 240;
private int preferredWidth = 240; private int preferredWidth = 240;
private int toolPaneY = 300; private int toolPaneY = 300;
private int toolPaneHeight = 10; private int toolPaneHeight = 10;
private int bottomHeight = 30;
private JComponent upPane; private JComponent upPane;
private JComponent downPane; private JComponent downPane;
@ -139,7 +142,7 @@ public class UIResizableContainer extends JPanel {
* @param height * @param height
*/ */
public void setParameterHeight(int height) { public void setParameterHeight(int height) {
paraHeight = hasParameterPane? height : 0; paraHeight = hasParameterPane? Math.min(height, MAX_PARA_HEIGHT) : 0;
refreshContainer(); refreshContainer();
} }
@ -208,7 +211,7 @@ public class UIResizableContainer extends JPanel {
if(isDownPaneVisible){ if(isDownPaneVisible){
upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY); upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY);
horizontToolPane.setBounds(0, toolPaneY, containerWidth - toolPaneHeight, toolPaneHeight); horizontToolPane.setBounds(0, toolPaneY, containerWidth - toolPaneHeight, toolPaneHeight);
downPane.setBounds(0, toolPaneY + toolPaneHeight, containerWidth - toolPaneHeight, parent.getHeight() - toolPaneY - toolPaneHeight-30); downPane.setBounds(0, toolPaneY + toolPaneHeight, containerWidth - toolPaneHeight, parent.getHeight() - toolPaneY - toolPaneHeight - bottomHeight);
verticalToolPane.setBounds(containerWidth - toolPaneHeight, 0, toolPaneHeight, getHeight()); verticalToolPane.setBounds(containerWidth - toolPaneHeight, 0, toolPaneHeight, getHeight());
}else{ }else{
upPane.setBounds(0, 0, containerWidth - toolPaneHeight, getHeight()); upPane.setBounds(0, 0, containerWidth - toolPaneHeight, getHeight());

54
designer_base/src/com/fr/design/gui/itable/AbstractPropertyTable.java

@ -26,32 +26,39 @@ import com.fr.general.Inter;
*/ */
public abstract class AbstractPropertyTable extends JTable { public abstract class AbstractPropertyTable extends JTable {
// 属性分 // // 所有数据组, 把数据分组,一个可折叠的项里面的所有行 为一
protected ArrayList<PropertyGroup> groups; protected ArrayList<PropertyGroup> groups;
protected TableModel default_table_model;
// 属性表被选中的行加一个浅蓝色的背景 // 属性表被选中的行加一个浅蓝色的背景
public static final Color PROPERTY_SELECTION_BACKGROUND = new Color(153, 204, 255); public static final Color PROPERTY_SELECTION_BACKGROUND = new Color(153, 204, 255);
// 属性表的行高 // 属性表的行高
public static final int PROPERTY_TABLE_ROW_HEIGHT = 22; public static final int PROPERTY_TABLE_ROW_HEIGHT = 22;
private static final int PROPERTY_ICON_WIDTH = 10;
public AbstractPropertyTable() { public AbstractPropertyTable() {
this.setRowHeight(PROPERTY_TABLE_ROW_HEIGHT); this.setTableProperties();
this.initPopup();
this.setModel(new DefaultTableModel());
}
private void setTableProperties() {
JTableHeader header = getTableHeader(); JTableHeader header = getTableHeader();
header.setReorderingAllowed(false); header.setReorderingAllowed(false);
header.setPreferredSize(new Dimension(0, PROPERTY_TABLE_ROW_HEIGHT)); header.setPreferredSize(new Dimension(0, PROPERTY_TABLE_ROW_HEIGHT));
header.setDefaultRenderer(new HeaderRenderer()); header.setDefaultRenderer(new HeaderRenderer());
this.setRowHeight(PROPERTY_TABLE_ROW_HEIGHT);
this.setGridColor(new Color(212, 208, 200)); this.setGridColor(new Color(212, 208, 200));
this.setSelectionBackground(PROPERTY_SELECTION_BACKGROUND); this.setSelectionBackground(PROPERTY_SELECTION_BACKGROUND);
this.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); this.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
this.setColumnSelectionAllowed(false); this.setColumnSelectionAllowed(false);
this.setRowSelectionAllowed(true); this.setRowSelectionAllowed(true);
this.setFillsViewportHeight(true); this.setFillsViewportHeight(true);
this.initPopup();
default_table_model = new DefaultTableModel();
this.setModel(default_table_model);
this.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); this.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
} }
/**
* 在这个函数里面初始化表格数据再repaint
* @param source
*/
public abstract void initPropertyGroups(Object source); public abstract void initPropertyGroups(Object source);
public void fireValueChanged(Object old_value, boolean success, Object newValue) { public void fireValueChanged(Object old_value, boolean success, Object newValue) {
@ -64,12 +71,15 @@ public abstract class AbstractPropertyTable extends JTable {
@Override @Override
public TableCellRenderer getCellRenderer(int row, int column) { public TableCellRenderer getCellRenderer(int row, int column) {
//如果数据组不为空
if (groups != null) { if (groups != null) {
Point pIndex = getGroupIndex(row); Point pIndex = getGroupIndex(row);
if (pIndex == null){ if (pIndex == null){
return super.getCellRenderer(row, column); return super.getCellRenderer(row, column);
} }
//拿出当前行所在的那个属性组
PropertyGroup group = groups.get(pIndex.x); PropertyGroup group = groups.get(pIndex.x);
//如果是标题行
if (pIndex.y == 0) { if (pIndex.y == 0) {
if (column == 0) { if (column == 0) {
return group.getFirstRenderer(); return group.getFirstRenderer();
@ -77,11 +87,13 @@ public abstract class AbstractPropertyTable extends JTable {
return group.getSecondRenderer(); return group.getSecondRenderer();
} }
} else { } else {
//如果是非标题行第一列,采用默认渲染器
if (column == 0) { if (column == 0) {
return super.getCellRenderer(row, column); return super.getCellRenderer(row, column);
} else { } else {
TableCellRenderer renderer = group.getModel().getRenderer(pIndex.y - 1); TableCellRenderer renderer = group.getModel().getRenderer(pIndex.y - 1);
if (renderer instanceof Component) { if (renderer instanceof Component) {
//如果这个渲染器是继承自Component,根据当前行列是否可编辑决定该控件是否可用
((Component) renderer).setEnabled(isCellEditable(row, column)); ((Component) renderer).setEnabled(isCellEditable(row, column));
} }
return renderer; return renderer;
@ -115,6 +127,12 @@ public abstract class AbstractPropertyTable extends JTable {
} }
} }
/**
* 看懂了写个注释先
* 获取当前row行的Point(x, y), x代表当前row行是属于groups中的第x个组y代表当前row行所在的第x组里面的第y行
* @param row
* @return
*/
private Point getGroupIndex(int row) { private Point getGroupIndex(int row) {
int count = 0; int count = 0;
for (int i = 0; i < groups.size(); i++) { for (int i = 0; i < groups.size(); i++) {
@ -135,6 +153,10 @@ public abstract class AbstractPropertyTable extends JTable {
this.addMouseListener(new MouseAdapter() { this.addMouseListener(new MouseAdapter() {
/**
* 如果点到标题行就要触发折叠事件
* @param e
*/
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (!e.isPopupTrigger() && groups != null) { if (!e.isPopupTrigger() && groups != null) {
@ -148,13 +170,18 @@ public abstract class AbstractPropertyTable extends JTable {
} }
} }
/**
* 这个mousePressed和上面的mouseClicked唯一不同的地方是单双击和e.getX() < 10 的判断
* 这个意思应该就是说点到图标加号减号立即触发折叠效果否则点其他处要双击才能触发
* @param e
*/
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
if (!e.isPopupTrigger() && groups != null) { if (!e.isPopupTrigger() && groups != null) {
int row = AbstractPropertyTable.super.rowAtPoint(e.getPoint()); int row = AbstractPropertyTable.super.rowAtPoint(e.getPoint());
if (row != -1) { if (row != -1) {
Point pIndex = getGroupIndex(row); Point pIndex = getGroupIndex(row);
if (pIndex.y == 0 && e.getClickCount() == 1 && e.getX() < 10) { if (pIndex.y == 0 && e.getClickCount() == 1 && e.getX() < PROPERTY_ICON_WIDTH) {
toggleCollapse(pIndex.x); toggleCollapse(pIndex.x);
} }
} }
@ -163,16 +190,27 @@ public abstract class AbstractPropertyTable extends JTable {
}); });
} }
/**
* 切换属性组折叠属性true/false
* @param groupIndex
*/
private void toggleCollapse(int groupIndex) { private void toggleCollapse(int groupIndex) {
PropertyGroup group = groups.get(groupIndex); PropertyGroup group = groups.get(groupIndex);
group.setCollapsed(!group.isCollapsed()); group.setCollapsed(!group.isCollapsed());
//这里获取表格的父控件是为了当表格被折叠了后,装表格的父控件也要相应的重新布局一下
//比如折叠之后表格行数应该比原来的少,占用父容器空间应该小点,不重新布局父容器,表格大小不会改变
Container parent = AbstractPropertyTable.this.getParent(); Container parent = AbstractPropertyTable.this.getParent();
if (parent != null) { if (parent != null) {
parent.doLayout(); // parent.doLayout(); // 这里还是用revalidate吧。。daLayout有时候会失效不知道为什么
parent.revalidate();
} }
repaint(); repaint();
} }
/**
* BeanTableModel类提供表格数据
* 它的所有数据来源均来自PropertyGroup中的AbstractPropertyGroupModel中的descriptor
*/
public class BeanTableModel extends AbstractTableModel { public class BeanTableModel extends AbstractTableModel {
@Override @Override

10
designer_base/src/com/fr/design/gui/itable/PropertyGroup.java

@ -4,11 +4,14 @@ import javax.swing.table.TableCellRenderer;
import com.fr.design.beans.GroupModel; import com.fr.design.beans.GroupModel;
/**
* PropertyGroup类描述了属性表中一个属性分组
*/
public class PropertyGroup { public class PropertyGroup {
private GroupModel model; private GroupModel model; // 描述这个属性组中的数据model
private String name; private String name; // 这组属性的标题名称
private boolean collapsed; private boolean collapsed; // 这组属性是否折叠
private GroupRenderer renderer1; private GroupRenderer renderer1;
private GroupRenderer renderer2; private GroupRenderer renderer2;
@ -55,4 +58,5 @@ public class PropertyGroup {
public TableCellRenderer getSecondRenderer() { public TableCellRenderer getSecondRenderer() {
return renderer2; return renderer2;
} }
} }

BIN
designer_base/src/com/fr/design/images/buttonicon/delete.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

BIN
designer_base/src/com/fr/design/images/reportcolumns/col_en.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
designer_base/src/com/fr/design/images/reportcolumns/row_en.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

2
designer_base/src/com/fr/design/insert/formula/variable/cn/$$$.txt

@ -1 +1 @@
΅±Η°Φ΅ 当前值

2
designer_base/src/com/fr/design/insert/formula/variable/cn/$$page_number.txt

@ -1 +1 @@
当前的页数。 当前的页数。

2
designer_base/src/com/fr/design/insert/formula/variable/cn/$$totalPage_number.txt

@ -1 +1 @@
总页数。 总页数。

2
designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_authority.txt

@ -1 +1 @@
使用权限时保存角色的参数 使用权限时保存角色的参数

2
designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_username.txt

@ -1 +1 @@
使用权限时保存用户名的参数 使用权限时保存用户名的参数

4
designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_userposition.txt

@ -1,3 +1 @@
使用权限时,$fr_userposition就是部门角色, 使用权限时,$fr_userposition就是部门角色,格式如:{"jobTitle":"销售经理","departments":"销售"},部门角色是以部门和职务组成的数组。
格式如:{"departments":"销售","jobTitle":"销售经理"},
部门角色是以部门和职务组成的数组。

2
designer_base/src/com/fr/design/insert/formula/variable/cn/NOFILTER.txt

@ -1 +1 @@
NOFILTER是一个与任意值比较都为true的参数。 NOFILTER是一个与任意值比较都为true的参数。

2
designer_base/src/com/fr/design/insert/formula/variable/cn/NULL.txt

@ -1 +1 @@
空值的参数。 空值的参数。

4
designer_base/src/com/fr/design/insert/formula/variable/cn/contextPath.txt

@ -1,3 +1 @@
contextPath是指绝对路径的服务器别名,即虚拟目录. contextPath是指绝对路径的服务器别名,即虚拟目录.假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,contextPath是/WebReport
假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,
contextPath是/WebReport

2
designer_base/src/com/fr/design/insert/formula/variable/cn/curReport.txt

@ -1 +1 @@
当前报表。 当前报表。

4
designer_base/src/com/fr/design/insert/formula/variable/cn/formletName.txt

@ -1,3 +1 @@
表单名字 表单名字假如访问:http://localhost:8080/WebReport/ReportServer?formlet=Form1.frm,formName就是Form1.frm
假如访问:http://localhost:8080/WebReport/ReportServer?formlet=Form1.frm,
formName就是Form1.frm

2
designer_base/src/com/fr/design/insert/formula/variable/cn/fr_submitinfo.txt

@ -1 +1 @@
提交入库事件的返回信息。 fr_submitinfo.success记录成功与否 fr_submitinfo.failinfo简单记录出错信息 提交入库事件的返回信息。fr_submitinfo.success记录成功与否fr_submitinfo.failinfo简单记录出错信息

4
designer_base/src/com/fr/design/insert/formula/variable/cn/reportName.txt

@ -1,3 +1 @@
报表名字 报表名字假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,reportName就是WorkBook1.cpt
假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,
reportName就是WorkBook1.cpt

4
designer_base/src/com/fr/design/insert/formula/variable/cn/serverName.txt

@ -1,3 +1 @@
serverName,是指服务器地址或名称. serverName,是指服务器地址或名称.假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverName指的是:localhost,即访问机子的IP
假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,
serverName指的是:localhost,即访问机子的IP

2
designer_base/src/com/fr/design/insert/formula/variable/cn/serverPort.txt

@ -1 +1 @@
serverPort指的是访问的端口 serverPort指的是访问的端口

4
designer_base/src/com/fr/design/insert/formula/variable/cn/serverSchema.txt

@ -1,3 +1 @@
serverSchema,是指协议名称. serverSchema,是指协议名称.假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverSchema指的是:http
假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,
serverSchema指的是:http

4
designer_base/src/com/fr/design/insert/formula/variable/cn/serverURL.txt

@ -1,3 +1 @@
serverURL是指访问服务的URL serverURL是指访问服务的URL假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverURL就是http://localhost:8080
假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,
serverURL就是http://localhost:8080

3
designer_base/src/com/fr/design/insert/formula/variable/cn/servletURL.txt

@ -1,2 +1 @@
假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt, 假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,servletURL指的是:/WebReport/ReportServer
servletURL指的是:/WebReport/ReportServer

5
designer_base/src/com/fr/design/insert/formula/variable/cn/sessionID.txt

@ -1,4 +1 @@
SessionID属性是返回用户会话的标识。 SessionID属性是返回用户会话的标识。在创建会话时,服务器会为每一个会话生成一个单独的标识,会话标识以长整形数据类型返回。SessionID等于本次会话ID的记录,SessionID 多数情况是用于WEB页面的统计。
在创建会话时,服务器会为每一个会话生成一个单独的标识,
会话标识以长整形数据类型返回。SessionID等于本次会话ID的记录,
SessionID 多数情况是用于WEB页面的统计。

2
designer_base/src/com/fr/design/insert/formula/variable/en/$$$.txt

@ -1 +1 @@
The current value The current value

2
designer_base/src/com/fr/design/insert/formula/variable/en/$fr_authority.txt

@ -1 +1 @@
Parameter of user authority Parameter of user authority

2
designer_base/src/com/fr/design/insert/formula/variable/en/$fr_username.txt

@ -1 +1 @@
Parameter of username Parameter of username

2
designer_base/src/com/fr/design/insert/formula/variable/en/$fr_userposition.txt

@ -1 +1 @@
department role of user department role of user

2
designer_base/src/com/fr/design/insert/formula/variable/en/NOFILTER.txt

@ -1 +1 @@
The result is aways true when NOFILTER is compared with any other values. The result is aways true when NOFILTER is compared with any other values.

2
designer_base/src/com/fr/design/insert/formula/variable/en/contextPath.txt

@ -1 +1 @@
absolute path of the server http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt£¬ contextPath is /WebReport absolute path of the serverhttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cptcontextPath is /WebReport

4
designer_base/src/com/fr/design/insert/formula/variable/en/formletName.txt

@ -1,3 +1 @@
form name form namehttp://localhost:8080/WebReport/ReportServer?formlet=Form1.frm,formName is Form1.frm
http://localhost:8080/WebReport/ReportServer?formlet=Form1.frm£¬
formName is Form1.frm

2
designer_base/src/com/fr/design/insert/formula/variable/en/fr_submitinfo.txt

@ -1 +1 @@
callback status of form submit contains fr_submitinfo.success and fr_submitinfo.failinfo callback status of form submitcontains fr_submitinfo.success and fr_submitinfo.failinfo

4
designer_base/src/com/fr/design/insert/formula/variable/en/reportName.txt

@ -1,3 +1 @@
report name report namehttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,reportName is WorkBook1.cpt
http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt£¬
reportName is WorkBook1.cpt

4
designer_base/src/com/fr/design/insert/formula/variable/en/serverName.txt

@ -1,3 +1 @@
address or name of the server address or name of the serverhttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverName means localhost
http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt£¬
serverName means localhost

4
designer_base/src/com/fr/design/insert/formula/variable/en/serverSchema.txt

@ -1,3 +1 @@
serverSchema serverSchemahttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverSchema is http
http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt£¬
serverSchema is http

4
designer_base/src/com/fr/design/insert/formula/variable/en/serverURL.txt

@ -1,3 +1 @@
URL of the server URL of the serverhttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverURL is http://localhost:8080
http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt£¬
serverURL is http://localhost:8080

3
designer_base/src/com/fr/design/insert/formula/variable/en/servletURL.txt

@ -1,2 +1 @@
http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt£¬ http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,servletURL is /WebReport/ReportServer
servletURL is /WebReport/ReportServer

15
designer_base/src/com/fr/design/locale/designer.properties

@ -573,3 +573,18 @@ FR-Designer_Plugin_Should_Update_Please_Contact_Developer=Plugin version is too
FR-Designer_WidgetOrder=Widget Order FR-Designer_WidgetOrder=Widget Order
FR-Designer_Mobile_Form_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the form in the APP. FR-Designer_Mobile_Form_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the form in the APP.
FR-Designer_Mobile_Report_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the report in the APP, only to support the paging preview, fill in the preview of the property is invalid. FR-Designer_Mobile_Report_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the report in the APP, only to support the paging preview, fill in the preview of the property is invalid.
FR-Designer_Background_Null=
FR-Designer_Background_Color=
FR-Designer_Background_Texture=
FR-Designer_Background_Pattern=
FR-Designer_Background_Gradient_Color=
FR-Designer_Background_Image=
FR-Designer_Background_Clear=
FR-Designer_Background_Image_Select=
FR-Designer_Initial_Background_Tips=
FR-Designer_Mouse_Move_Tips=
FR-Designer_Mouse_Click_Tips=
FR-Designer-Move_Tab_First=move to first
FR-Designer-Move_Tab_End=move to end
FR-Designer-Move_Tab_Next=move to next
FR-Designer-Move_Tab_Prev=move to previous

15
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -573,3 +573,18 @@ FR-Designer_Plugin_Should_Update_Please_Contact_Developer=Plugin version is too
FR-Designer_WidgetOrder=Widget Order FR-Designer_WidgetOrder=Widget Order
FR-Designer_Mobile_Form_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the form in the APP. FR-Designer_Mobile_Form_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the form in the APP.
FR-Designer_Mobile_Report_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the report in the APP, only to support the paging preview, fill in the preview of the property is invalid. FR-Designer_Mobile_Report_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the report in the APP, only to support the paging preview, fill in the preview of the property is invalid.
FR-Designer_Background_Null=No Background
FR-Designer_Background_Color=Color
FR-Designer_Background_Texture=Texture
FR-Designer_Background_Pattern=Pattern
FR-Designer_Background_Gradient_Color=Gradient Color
FR-Designer_Background_Image=Image
FR-Designer_Background_Clear=Clear
FR-Designer_Background_Image_Select=Select Picture
FR-Designer_Initial_Background_Tips=Initial background of the button
FR-Designer_Mouse_Move_Tips=Move the mouse to the button on the background, in the absence of not changing the background
FR-Designer_Mouse_Click_Tips=The background of the mouse to click the button, in the absence of not changing the background
FR-Designer-Move_Tab_First=move to first
FR-Designer-Move_Tab_End=move to end
FR-Designer-Move_Tab_Next=move to next
FR-Designer-Move_Tab_Prev=move to previous

11
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -543,4 +543,15 @@ FR-Designer-Move_Tab_Next=
FR-Designer-Move_Tab_Prev= FR-Designer-Move_Tab_Prev=
FR-Designer_DS_TableData=\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9 FR-Designer_DS_TableData=\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9
FR-Designer_Parameter-Formula=\u6570\u5F0F FR-Designer_Parameter-Formula=\u6570\u5F0F
FR-Designer_Background_Null=
FR-Designer_Background_Color=
FR-Designer_Background_Texture=
FR-Designer_Background_Pattern=
FR-Designer_Background_Gradient_Color=
FR-Designer_Background_Image=
FR-Designer_Background_Clear=
FR-Designer_Background_Image_Select=
FR-Designer_Initial_Background_Tips=
FR-Designer_Mouse_Move_Tips=
FR-Designer_Mouse_Click_Tips=
FR-Designer_Plugin_Should_Update_Please_Contact_Developer= FR-Designer_Plugin_Should_Update_Please_Contact_Developer=

13
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -540,4 +540,15 @@ FR-Designer-Move_Tab_Next=
FR-Designer-Move_Tab_Prev= FR-Designer-Move_Tab_Prev=
FR-Designer_DS_TableData=\uB370\uC774\uD130\uC138\uD2B8 FR-Designer_DS_TableData=\uB370\uC774\uD130\uC138\uD2B8
FR-Designer_Parameter-Formula=\uC218\uC2DD FR-Designer_Parameter-Formula=\uC218\uC2DD
FR-Designer_Plugin_Should_Update_Please_Contact_Developer= FR-Designer_Background_Null=
FR-Designer_Background_Color=
FR-Designer_Background_Texture=
FR-Designer_Background_Pattern=
FR-Designer_Background_Gradient_Color=
FR-Designer_Background_Image=
FR-Designer_Background_Clear=
FR-Designer_Background_Image_Select=
FR-Designer_Initial_Background_Tips=
FR-Designer_Mouse_Move_Tips=
FR-Designer_Mouse_Click_Tips=
FR-Designer_Plugin_Should_Update_Please_Contact_Developer=

11
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -577,3 +577,14 @@ FR-Designer_Plugin_Should_Update_Please_Contact_Developer=\u63D2\u4EF6\u7248\u67
FR-Designer_WidgetOrder=\u63A7\u4EF6\u987A\u5E8F FR-Designer_WidgetOrder=\u63A7\u4EF6\u987A\u5E8F
FR-Designer_Mobile_Form_Analysis_Annotation=\u6CE8\u91CA\uFF1A\u53EF\u4EE5\u901A\u8FC7\u8BE5\u5C5E\u6027\u63A7\u5236\u8868\u5355\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\u3002 FR-Designer_Mobile_Form_Analysis_Annotation=\u6CE8\u91CA\uFF1A\u53EF\u4EE5\u901A\u8FC7\u8BE5\u5C5E\u6027\u63A7\u5236\u8868\u5355\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\u3002
FR-Designer_Mobile_Report_Analysis_Annotation=\u6CE8\u91CA: \u53EF\u4EE5\u901A\u8FC7\u8BE5\u5C5E\u6027\u63A7\u5236\u62A5\u8868\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\uFF0C\u53EA\u652F\u6301\u5206\u9875\u9884\u89C8\uFF0C\u586B\u62A5\u9884\u89C8\u65F6\u5C5E\u6027\u65E0\u6548\u3002 FR-Designer_Mobile_Report_Analysis_Annotation=\u6CE8\u91CA: \u53EF\u4EE5\u901A\u8FC7\u8BE5\u5C5E\u6027\u63A7\u5236\u62A5\u8868\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\uFF0C\u53EA\u652F\u6301\u5206\u9875\u9884\u89C8\uFF0C\u586B\u62A5\u9884\u89C8\u65F6\u5C5E\u6027\u65E0\u6548\u3002
FR-Designer_Background_Null=\u6CA1\u6709\u80CC\u666F
FR-Designer_Background_Color=\u989C\u8272
FR-Designer_Background_Texture=\u7EB9\u7406
FR-Designer_Background_Pattern=\u56FE\u6848
FR-Designer_Background_Gradient_Color=\u6E10\u53D8\u8272
FR-Designer_Background_Image=\u56FE\u7247
FR-Designer_Background_Clear=\u6E05\u9664
FR-Designer_Background_Image_Select=\u9009\u62E9\u56FE\u7247
FR-Designer_Initial_Background_Tips=\u6309\u94AE\u7684\u521D\u59CB\u80CC\u666F
FR-Designer_Mouse_Move_Tips=\u9F20\u6807\u79FB\u52A8\u5230\u6309\u94AE\u4E0A\u7684\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F
FR-Designer_Mouse_Click_Tips=\u9F20\u6807\u70B9\u51FB\u6309\u94AE\u65F6\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F

11
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -565,3 +565,14 @@ FR-Designer_Plugin_Should_Update_Please_Contact_Developer=\u633F\u4EF6\u7248\u67
FR-Designer_WidgetOrder=\u63A7\u4EF6\u9806\u5E8F FR-Designer_WidgetOrder=\u63A7\u4EF6\u9806\u5E8F
FR-Designer_Mobile_Form_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u8868\u55AE\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\u3002 FR-Designer_Mobile_Form_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u8868\u55AE\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\u3002
FR-Designer_Mobile_Report_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u5831\u8868\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\uFF0C\u53EA\u652F\u6301\u5206\u9801\u9810\u89BD\uFF0C\u586B\u5831\u9810\u89BD\u6642\u5C6C\u6027\u7121\u6548\u3002 FR-Designer_Mobile_Report_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u5831\u8868\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\uFF0C\u53EA\u652F\u6301\u5206\u9801\u9810\u89BD\uFF0C\u586B\u5831\u9810\u89BD\u6642\u5C6C\u6027\u7121\u6548\u3002
FR-Designer_Background_Null=
FR-Designer_Background_Color=
FR-Designer_Background_Texture=
FR-Designer_Background_Pattern=
FR-Designer_Background_Gradient_Color=
FR-Designer_Background_Image=
FR-Designer_Background_Clear=
FR-Designer_Background_Image_Select=
FR-Designer_Initial_Background_Tips=
FR-Designer_Mouse_Move_Tips=
FR-Designer_Mouse_Click_Tips=

3
designer_base/src/com/fr/design/mainframe/DesignerFrame.java

@ -169,7 +169,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
/** /**
* 初始menuPane的方法 方便OEM时修改该组件 * 初始menuPane的方法 方便OEM时修改该组件
* @param ad
*/ */
protected void initMenuPane(){ protected void initMenuPane(){
menuPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); menuPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -189,7 +188,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
GeneralContext.addPluginReadListener(new PluginReadListener() { GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override @Override
public void success() { public void success(Status status) {
TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING); TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING);
if (processor == null) { if (processor == null) {
processor = new DefaultTitlePlace(); processor = new DefaultTitlePlace();

2
designer_base/src/com/fr/design/mainframe/WestRegionContainerPane.java

@ -29,7 +29,7 @@ public class WestRegionContainerPane extends UIResizableContainer {
super(DesignerFrameFileDealerPane.getInstance(), Constants.RIGHT); super(DesignerFrameFileDealerPane.getInstance(), Constants.RIGHT);
GeneralContext.addPluginReadListener(new PluginReadListener() { GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override @Override
public void success() { public void success(Status status) {
setDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); setDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
} }
}); });

14
designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -10,7 +10,9 @@ import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.community.*; import com.fr.design.actions.community.*;
import com.fr.design.actions.file.*; import com.fr.design.actions.file.*;
import com.fr.design.actions.help.*; import com.fr.design.actions.help.AboutAction;
import com.fr.design.actions.help.TutorialAction;
import com.fr.design.actions.help.WebDemoAction;
import com.fr.design.actions.server.*; import com.fr.design.actions.server.*;
import com.fr.design.file.NewTemplatePane; import com.fr.design.file.NewTemplatePane;
import com.fr.design.fun.MenuHandler; import com.fr.design.fun.MenuHandler;
@ -28,7 +30,6 @@ import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.env.RemoteEnv; import com.fr.env.RemoteEnv;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
@ -148,7 +149,7 @@ public abstract class ToolBarMenuDock {
public void addCommunityMenuDef(java.util.List<MenuDef> menuList){ public void addCommunityMenuDef(java.util.List<MenuDef> menuList){
Locale locale = FRContext.getLocale(); Locale locale = FRContext.getLocale();
Locale [] locales = supportCommunityLocales(); Locale [] locales =supportCommunityLocales();
for(int i = 0; i < locales.length; i++) { for(int i = 0; i < locales.length; i++) {
if(locale.equals(locales[i])){ if(locale.equals(locales[i])){
menuList.add(createCommunityMenuDef()); menuList.add(createCommunityMenuDef());
@ -313,6 +314,11 @@ public abstract class ToolBarMenuDock {
public ShortCut[] createHelpShortCuts() { public ShortCut[] createHelpShortCuts() {
java.util.List<ShortCut> shortCuts = new ArrayList<ShortCut>(); java.util.List<ShortCut> shortCuts = new ArrayList<ShortCut>();
shortCuts.add(new WebDemoAction()); shortCuts.add(new WebDemoAction());
// 英文,把 video 和帮助文档放到 Help 下面
if (FRContext.getLocale().equals(Locale.US)) {
shortCuts.add(new VideoAction());
shortCuts.add(new TutorialAction());
}
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
//shortCuts.add(new TutorialAction()); //shortCuts.add(new TutorialAction());
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
@ -397,7 +403,7 @@ public abstract class ToolBarMenuDock {
return toolBar; return toolBar;
} else { } else {
return polyToolBar(Inter.getLocText(new String[]{"Polybolck", "Edit"})); return polyToolBar(Inter.getLocText("FR-Designer_Polyblock_Edit"));
} }
} }

10
designer_base/src/com/fr/design/present/dict/TableDataDictPane.java

@ -77,7 +77,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
} }
}); });
keyColumnPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}); keyColumnPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()});
FormulaEditor formulaEditor = new FormulaEditor(Inter.getLocText("Parameter-Formula")); FormulaEditor formulaEditor = new FormulaEditor(Inter.getLocText("FR-Designer_Parameter-Formula"));
formulaEditor.setEnabled(true); formulaEditor.setEnabled(true);
valueDictPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor(), formulaEditor}); valueDictPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor(), formulaEditor});
} }
@ -95,9 +95,9 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(" " + Inter.getLocText("DS-TableData") + ":", UILabel.RIGHT), firstLine}, new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_DS_TableData") + ":", UILabel.RIGHT), firstLine},
new Component[]{new UILabel(Inter.getLocText("Actual_Value") + ":", UILabel.RIGHT), keyColumnPane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Actual_Value") + ":", UILabel.RIGHT), keyColumnPane},
new Component[]{new UILabel(Inter.getLocText("Display_Value") + ":", UILabel.RIGHT), valueDictPane} new Component[]{new UILabel(Inter.getLocText("FR-Designer_Display_Value") + ":", UILabel.RIGHT), valueDictPane}
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
@ -158,7 +158,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
columnIndexEditor1.addItemListener(itemListener); columnIndexEditor1.addItemListener(itemListener);
keyColumnPane.setEditors(new Editor[]{columnNameEditor1, columnIndexEditor1}, columnNames[0]); keyColumnPane.setEditors(new Editor[]{columnNameEditor1, columnIndexEditor1}, columnNames[0]);
FormulaEditor formulaEditor = new FormulaEditor(Inter.getLocText("Parameter-Formula")); FormulaEditor formulaEditor = new FormulaEditor(Inter.getLocText("FR-Designer_Parameter-Formula"));
formulaEditor.setEnabled(true); formulaEditor.setEnabled(true);
formulaEditor.addChangeListener(new ChangeListener() { formulaEditor.addChangeListener(new ChangeListener() {

2
designer_base/src/com/fr/design/roleAuthority/RoleTree.java

File diff suppressed because one or more lines are too long

53
designer_base/src/com/fr/design/style/background/BackgroundButtonPane.java

@ -0,0 +1,53 @@
package com.fr.design.style.background;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.Background;
import com.fr.general.Inter;
/**
* Created by ibm on 2017/1/5.
*/
public class BackgroundButtonPane extends BackgroundPane {
public BackgroundButtonPane() {
super();
}
protected void initTabPane() {
int index = 0;
for (Class<? extends Background> key : BackgroundFactory.buttonKindsOfKey()) {
BackgroundUIWrapper wrapper = BackgroundFactory.getButtonWrapper(key);
wrapper.setIndex(index++);
tabbedPane.addTab(Inter.getLocText(wrapper.getTitle()), FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane());
}
}
protected BackgroundUIWrapper getBackgroundUIWrapper(Background background) {
return BackgroundFactory.getButtonWrapper(background == null ? null : background.getClass());
}
protected BackgroundDetailPane getTabItemPane(Background background, int index) {
BackgroundDetailPane quickPane = cacheMap.get(index);
if (quickPane == null) {
quickPane = BackgroundFactory.createButtonIfAbsent(background == null ? null : background.getClass());
quickPane.addChangeListener(backgroundChangeListener);
cacheMap.put(index, quickPane);
}
tabbedPane.setComponentAt(index, quickPane);
tabbedPane.setSelectedIndex(index);
return quickPane;
}
protected BackgroundDetailPane getTabItemPaneByIndex(int index) {
BackgroundDetailPane quickPane = cacheMap.get(index);
if (quickPane == null) {
quickPane = BackgroundFactory.createButtonIfAbsent(index);
tabbedPane.setComponentAt(index, quickPane);
cacheMap.put(index, quickPane);
quickPane.addChangeListener(backgroundChangeListener);
}
return quickPane;
}
}

48
designer_base/src/com/fr/design/style/background/BackgroundFactory.java

@ -3,7 +3,6 @@ package com.fr.design.style.background;
import com.fr.base.background.*; import com.fr.base.background.*;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.BackgroundQuickUIProvider;
import com.fr.design.fun.BackgroundUIProvider; import com.fr.design.fun.BackgroundUIProvider;
import com.fr.design.style.background.gradient.GradientBackgroundPane; import com.fr.design.style.background.gradient.GradientBackgroundPane;
import com.fr.design.style.background.impl.*; import com.fr.design.style.background.impl.*;
@ -21,6 +20,7 @@ public class BackgroundFactory {
private static Map<Class<? extends Background>, BackgroundUIWrapper> map = new LinkedHashMap<>(); private static Map<Class<? extends Background>, BackgroundUIWrapper> map = new LinkedHashMap<>();
private static Map<Class<? extends Background>, BackgroundUIWrapper> browser = new LinkedHashMap<>(); private static Map<Class<? extends Background>, BackgroundUIWrapper> browser = new LinkedHashMap<>();
private static Map<Class<? extends Background>, BackgroundUIWrapper> button = new LinkedHashMap<>();
static { static {
registerUniversal(map); registerUniversal(map);
@ -29,29 +29,38 @@ public class BackgroundFactory {
registerBrowserImageBackground(browser); registerBrowserImageBackground(browser);
registerExtra(map); registerExtra(map);
registerExtra(browser); registerExtra(browser);
registerButtonBackground(button);
} }
private static void registerUniversal(Map<Class<? extends Background>, BackgroundUIWrapper> map) { private static void registerUniversal(Map<Class<? extends Background>, BackgroundUIWrapper> map) {
map.put(null, BackgroundUIWrapper.create() map.put(null, BackgroundUIWrapper.create()
.setType(NullBackgroundPane.class).setTitle(Inter.getLocText("Background-Null"))); .setType(NullBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Null")));
map.put(ColorBackground.class, BackgroundUIWrapper.create() map.put(ColorBackground.class, BackgroundUIWrapper.create()
.setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("Color"))); .setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Color")));
map.put(TextureBackground.class, BackgroundUIWrapper.create() map.put(TextureBackground.class, BackgroundUIWrapper.create()
.setType(TextureBackgroundPane.class).setTitle(Inter.getLocText("Background-Texture"))); .setType(TextureBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Texture")));
map.put(PatternBackground.class, BackgroundUIWrapper.create() map.put(PatternBackground.class, BackgroundUIWrapper.create()
.setType(PatternBackgroundPane.class).setTitle(Inter.getLocText("Background-Pattern"))); .setType(PatternBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Pattern")));
map.put(GradientBackground.class, BackgroundUIWrapper.create() map.put(GradientBackground.class, BackgroundUIWrapper.create()
.setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("Gradient-Color"))); .setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Gradient_Color")));
} }
private static void registerImageBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map) { private static void registerImageBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map) {
map.put(ImageBackground.class, BackgroundUIWrapper.create() map.put(ImageBackground.class, BackgroundUIWrapper.create()
.setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("Image"))); .setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Image")));
} }
private static void registerBrowserImageBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map) { private static void registerBrowserImageBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map) {
map.put(ImageBackground.class, BackgroundUIWrapper.create() map.put(ImageBackground.class, BackgroundUIWrapper.create()
.setType(ImageBackgroundPane4Browser.class).setTitle(Inter.getLocText("Image"))); .setType(ImageBackgroundPane4Browser.class).setTitle(Inter.getLocText("FR-Designer_Background_Image")));
}
private static void registerButtonBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map){
map.put(ColorBackground.class, BackgroundUIWrapper.create()
.setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Color")));
map.put(ImageBackground.class, BackgroundUIWrapper.create()
.setType(ImageButtonBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Image")));
} }
private static void registerExtra(Map<Class<? extends Background>, BackgroundUIWrapper> map) { private static void registerExtra(Map<Class<? extends Background>, BackgroundUIWrapper> map) {
@ -85,6 +94,29 @@ public class BackgroundFactory {
return new NullBackgroundPane(); return new NullBackgroundPane();
} }
public static Set<Class<? extends Background>> buttonKindsOfKey() {
return button.keySet();
}
public static BackgroundUIWrapper getButtonWrapper(Class<? extends Background> category) {
return button.get(category);
}
public static BackgroundDetailPane createButtonIfAbsent(Class<? extends Background> category) {
BackgroundUIWrapper wrapper = button.get(category);
return createByWrapper(wrapper);
}
public static BackgroundDetailPane createButtonIfAbsent(int index) {
for (BackgroundUIWrapper wrapper : button.values()) {
if (wrapper.getIndex() == index) {
return createByWrapper(wrapper);
}
}
return new NullBackgroundPane();
}
public static Set<Class<? extends Background>> browserKindsOfKey() { public static Set<Class<? extends Background>> browserKindsOfKey() {
return browser.keySet(); return browser.keySet();
} }

8
designer_base/src/com/fr/design/style/background/gradient/GradientBackgroundPane.java

@ -43,7 +43,7 @@ public class GradientBackgroundPane extends BackgroundDetailPane {
JPanel blankJp = new JPanel(); JPanel blankJp = new JPanel();
gradientBar = new GradientBar(4, 254); gradientBar = new GradientBar(4, 254);
blankJp.add(gradientBar); blankJp.add(gradientBar);
UILabel jl = new UILabel(Inter.getLocText("Drag_to_select_gradient")); UILabel jl = new UILabel(Inter.getLocText("FR-Designer_Drag_To_Select_Gradient"));
jl.setHorizontalAlignment(SwingConstants.CENTER); jl.setHorizontalAlignment(SwingConstants.CENTER);
gradientPanel.add(jl, BorderLayout.NORTH); gradientPanel.add(jl, BorderLayout.NORTH);
gradientPanel.add(blankJp, BorderLayout.SOUTH); gradientPanel.add(blankJp, BorderLayout.SOUTH);
@ -53,14 +53,14 @@ public class GradientBackgroundPane extends BackgroundDetailPane {
JPanel innercenterPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel innercenterPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
centerPane.add(new UILabel(" ")); centerPane.add(new UILabel(" "));
centerPane.add(innercenterPane); centerPane.add(innercenterPane);
innercenterPane.add(new UILabel(Inter.getLocText("Gradient-Direction") + ":")); innercenterPane.add(new UILabel(Inter.getLocText("FR-Designer_Gradient_Direction") + ":"));
left2right = new UIRadioButton(Inter.getLocText("PageSetup-Landscape")); left2right = new UIRadioButton(Inter.getLocText("FR-Designer_PageSetup_Horizontal"));
innercenterPane.add(left2right); innercenterPane.add(left2right);
left2right.setSelected(true); left2right.setSelected(true);
left2right.addActionListener(reviewListener); left2right.addActionListener(reviewListener);
top2bottom = new UIRadioButton(Inter.getLocText("PageSetup-Portrait")); top2bottom = new UIRadioButton(Inter.getLocText("FR-Designer_PageSetup_Vertical"));
innercenterPane.add(top2bottom); innercenterPane.add(top2bottom);
top2bottom.addActionListener(reviewListener); top2bottom.addActionListener(reviewListener);

55
designer_base/src/com/fr/design/style/background/impl/ImageBackgroundPane.java

@ -28,16 +28,16 @@ import java.io.File;
*/ */
public class ImageBackgroundPane extends BackgroundDetailPane { public class ImageBackgroundPane extends BackgroundDetailPane {
private ImagePreviewPane previewPane = null; protected ImagePreviewPane previewPane = null;
private Style imageStyle = null; private Style imageStyle = null;
private ChangeListener changeListener = null; private ChangeListener changeListener = null;
private ImageFileChooser imageFileChooser = null; private ImageFileChooser imageFileChooser = null;
private UILabel imageSizeLabel = new UILabel(); protected UILabel imageSizeLabel = new UILabel();
protected JRadioButton defaultRadioButton = null; protected UIRadioButton defaultRadioButton = null;
protected JRadioButton tiledRadioButton = null; protected UIRadioButton tiledRadioButton = null;
private JRadioButton extendRadioButton = null; private UIRadioButton extendRadioButton = null;
private JRadioButton adjustRadioButton = null; private UIRadioButton adjustRadioButton = null;
public ImageBackgroundPane() { public ImageBackgroundPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
@ -46,21 +46,27 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
JPanel previewContainerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel previewContainerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(previewContainerPane, BorderLayout.CENTER); this.add(previewContainerPane, BorderLayout.CENTER);
JPanel previewOwnerPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Preview")); JPanel previewOwnerPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Preview"));
previewOwnerPane.setLayout(new BorderLayout()); previewOwnerPane.setLayout(new BorderLayout());
previewContainerPane.add(previewOwnerPane, BorderLayout.CENTER); previewContainerPane.add(previewOwnerPane, BorderLayout.CENTER);
previewContainerPane.add(initSelectFilePane(), BorderLayout.EAST);
previewPane = new ImagePreviewPane(); previewPane = new ImagePreviewPane();
previewOwnerPane.add(new JScrollPane(previewPane)); previewOwnerPane.add(new JScrollPane(previewPane));
previewPane.addChangeListener(imageSizeChangeListener); previewPane.addChangeListener(imageSizeChangeListener);
// init image file chooser.
imageFileChooser = new ImageFileChooser();
imageFileChooser.setMultiSelectionEnabled(false);
}
public JPanel initSelectFilePane(){
JPanel selectFilePane = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel selectFilePane = FRGUIPaneFactory.createBorderLayout_L_Pane();
previewContainerPane.add(selectFilePane, BorderLayout.EAST);
selectFilePane.setBorder(BorderFactory.createEmptyBorder(8, 2, 4, 0)); selectFilePane.setBorder(BorderFactory.createEmptyBorder(8, 2, 4, 0));
UIButton selectPictureButton = new UIButton( UIButton selectPictureButton = new UIButton(
Inter.getLocText("Image-Select_Picture")); Inter.getLocText("FR-Designer_Background_Image_Select"));
selectFilePane.add(selectPictureButton, BorderLayout.NORTH); selectFilePane.add(selectPictureButton, BorderLayout.NORTH);
selectPictureButton.setMnemonic('S'); selectPictureButton.setMnemonic('S');
selectPictureButton.addActionListener(selectPictureActionListener); selectPictureButton.addActionListener(selectPictureActionListener);
@ -68,10 +74,10 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
selectFilePane.add(layoutPane, BorderLayout.CENTER); selectFilePane.add(layoutPane, BorderLayout.CENTER);
//布局 //布局
defaultRadioButton = new UIRadioButton(Inter.getLocText("Default")); defaultRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer-StyleAlignment_Layout_Default"));
tiledRadioButton = new UIRadioButton(Inter.getLocText("Image-Titled")); tiledRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer-StyleAlignment_Layout_Image_Titled"));
extendRadioButton = new UIRadioButton(Inter.getLocText("Image-Extend")); extendRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer-StyleAlignment_Layout_Image_Extend"));
adjustRadioButton = new UIRadioButton(Inter.getLocText("Image-Adjust")); adjustRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer-StyleAlignment_Layout_Image_Adjust"));
defaultRadioButton.addActionListener(layoutActionListener); defaultRadioButton.addActionListener(layoutActionListener);
tiledRadioButton.addActionListener(layoutActionListener); tiledRadioButton.addActionListener(layoutActionListener);
@ -79,7 +85,7 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
adjustRadioButton.addActionListener(layoutActionListener); adjustRadioButton.addActionListener(layoutActionListener);
JPanel jp = new JPanel(new GridLayout(4, 1, 15, 15)); JPanel jp = new JPanel(new GridLayout(4, 1, 15, 15));
for (JRadioButton button : imageLayoutButtons()) { for (UIRadioButton button : imageLayoutButtons()) {
jp.add(button); jp.add(button);
} }
layoutPane.add(jp); layoutPane.add(jp);
@ -91,14 +97,11 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
layoutBG.add(adjustRadioButton); layoutBG.add(adjustRadioButton);
defaultRadioButton.setSelected(true); defaultRadioButton.setSelected(true);
return selectFilePane;
// init image file chooser.
imageFileChooser = new ImageFileChooser();
imageFileChooser.setMultiSelectionEnabled(false);
} }
protected JRadioButton[] imageLayoutButtons() { protected UIRadioButton[] imageLayoutButtons() {
return new JRadioButton[]{ return new UIRadioButton[]{
defaultRadioButton, defaultRadioButton,
tiledRadioButton, tiledRadioButton,
extendRadioButton, extendRadioButton,
@ -121,8 +124,7 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
CoreGraphHelper.waitForImage(image); CoreGraphHelper.waitForImage(image);
previewPane.setImage(image); previewPane.setImage(image);
setImageStyle(); imageStyleRepaint();
previewPane.setImageStyle(imageStyle);
previewPane.repaint(); previewPane.repaint();
} else { } else {
previewPane.setImage(null); previewPane.setImage(null);
@ -133,6 +135,11 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
} }
}; };
public void imageStyleRepaint(){
setImageStyle();
previewPane.setImageStyle(imageStyle);
}
private void setImageStyle() { private void setImageStyle() {
if (tiledRadioButton.isSelected()) { if (tiledRadioButton.isSelected()) {
imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_TILED); imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_TILED);

5
designer_base/src/com/fr/design/style/background/impl/ImageBackgroundPane4Browser.java

@ -1,5 +1,6 @@
package com.fr.design.style.background.impl; package com.fr.design.style.background.impl;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import javax.swing.*; import javax.swing.*;
@ -15,9 +16,9 @@ public class ImageBackgroundPane4Browser extends ImageBackgroundPane {
} }
@Override @Override
protected JRadioButton[] imageLayoutButtons() { protected UIRadioButton[] imageLayoutButtons() {
return (JRadioButton[]) ArrayUtils.addAll(super.imageLayoutButtons(), new JRadioButton[] { return (UIRadioButton[]) ArrayUtils.addAll(super.imageLayoutButtons(), new UIRadioButton[] {
defaultRadioButton, defaultRadioButton,
tiledRadioButton, tiledRadioButton,
}); });

79
designer_base/src/com/fr/design/style/background/impl/ImageButtonBackgroundPane.java

@ -0,0 +1,79 @@
package com.fr.design.style.background.impl;
import com.fr.base.Style;
import com.fr.base.background.ImageBackground;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.general.Background;
import com.fr.general.Inter;
import com.fr.stable.Constants;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Created by ibm on 2017/1/5.
*/
public class ImageButtonBackgroundPane extends ImageBackgroundPane {
private UIButton chooseButton;
private UIButton clearButton;
public ImageButtonBackgroundPane(){
super();
Style imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_CENTER);
previewPane.setImageStyle(imageStyle);
}
public JPanel initSelectFilePane(){
JPanel choosePane = new JPanel(new BorderLayout(0, 10));
choosePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
JPanel choosePane1 = new JPanel(new BorderLayout(0, 10));
initButton();
choosePane.add(chooseButton, BorderLayout.NORTH);
choosePane1.add(clearButton,BorderLayout.NORTH);
choosePane.add(choosePane1,BorderLayout.CENTER);
imageSizeLabel.setHorizontalAlignment(SwingConstants.CENTER);
choosePane1.add(imageSizeLabel,BorderLayout.CENTER);
this.add(choosePane,BorderLayout.EAST);
return choosePane;
}
private void initButton() {
chooseButton = new UIButton(Inter.getLocText("FR-Designer_Background_Image_Select"));
chooseButton.addActionListener(selectPictureActionListener);
clearButton = new UIButton(Inter.getLocText("FR-Designer_Background_Clear"));
clearButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
previewPane.setImage(null);
previewPane.repaint();
}
});
}
public void imageStyleRepaint(){
}
public void populate(Background background) {
if(background != null && background instanceof ImageBackground){
ImageBackground imageBackground = (ImageBackground) background;
if(imageBackground.getImage() != null) {
previewPane.setImage(imageBackground.getImage());
}
}
}
public Background update() {
if(previewPane.getImage() == null) {
return null;
}
return new ImageBackground(previewPane.getImage());
}
}

228
designer_base/src/com/fr/design/style/color/ColorSelectConfigManager.java

@ -1,56 +1,192 @@
package com.fr.design.style.color; package com.fr.design.style.color;
import com.fr.file.XMLFileManager;
import com.fr.base.FRContext;
import com.fr.cluster.rpc.RPC;
import com.fr.file.BaseClusterHelper;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLTools;
import com.fr.stable.xml.XMLableReader;
import com.fr.general.FRLogger;
import java.awt.Color; import java.awt.Color;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.io.InputStream;
/** /**
* 最近使用颜色 * 最近使用颜色
* @author focus
* *
* @author focus
*/ */
public class ColorSelectConfigManager{ public class ColorSelectConfigManager extends XMLFileManager implements ColorSelectConfigManagerProvider {
// 最近使用的颜色个数 // 最近使用的颜色个数
private int colorNums = 20; private int colorNums = 20;
// 最近使用颜色
private List<Color> colors; private static ColorSelectConfigManagerProvider configManager = null;
private static ColorSelectConfigManager colorSelectConfigManager = null;
private static ColorSelectConfigManager colorSelectConfigManager = null; private boolean init = true;
// 最近使用颜色
public Color[] getColors() { private List<Color> colors = new ArrayList<Color>();
if(colors == null){ private static final String RECENT_COLOR_TAG = "RecentColors";
colors = new ArrayList<Color>(); private static final String COLOR_TAG = "Color";
}
return colors.toArray(new Color[colors.size()]); static {
} GeneralContext.addEnvChangedListener(new EnvChangedListener() {
public void envChanged() {
public int getColorNum() { ColorSelectConfigManager.envChanged();
return colorNums; }
} });
public void setColorNum(int colorNums) { }
this.colorNums = colorNums;
} private static void envChanged() {
configManager = null;
public synchronized static ColorSelectConfigManager getInstance() { }
if (colorSelectConfigManager == null) {
colorSelectConfigManager = new ColorSelectConfigManager(); public Color[] getColors() {
}
return colorSelectConfigManager; //初次打开软件时从xml文件中获取历史颜色信息
} if (init) {
ColorSelectConfigManagerProvider manager = ColorSelectConfigManager.getProviderInstance();
/** this.colors = manager.getColorsFromFile();
* 添加颜色到最近使用队列中 init = false;
* }
* @param color 颜色 if (colors == null) {
* colors = new ArrayList<Color>();
*/ }
public void addToColorQueue(Color color){ return colors.toArray(new Color[colors.size()]);
// 过滤重复的最近使用颜色 }
// 因为有个后进先出的问题,最近使用的颜色需要放到最前面所以没用set
if(colors.contains(color)){ public int getColorNum() {
colors.remove(color); return colorNums;
} }
colors.add(color);
} public void setColorNum(int colorNums) {
} this.colorNums = colorNums;
}
public synchronized static ColorSelectConfigManager getInstance() {
if (colorSelectConfigManager == null) {
colorSelectConfigManager = new ColorSelectConfigManager();
}
return colorSelectConfigManager;
}
/**
* 添加颜色到最近使用队列中
*
* @param color 颜色
*/
public void addToColorQueue(Color color) {
// 过滤重复的最近使用颜色
// 因为有个后进先出的问题,最近使用的颜色需要放到最前面所以没用set
if (colors.contains(color)) {
colors.remove(color);
}
colors.add(color);
/*@author yaohwu*/
//将历史颜色信息保存到xml文件中去
ColorSelectConfigManagerProvider manager = ColorSelectConfigManager.getProviderInstance();
if (colors != null && !colors.isEmpty()) {
manager.setColorsToFile(colors);
}
try {
FRContext.getCurrentEnv().writeResource(manager);
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
}
/**
* 读取配置文件流
*
* @param input
* @throws Exception 异常
*/
@Override
public void readFromInputStream(InputStream input) throws Exception {
ColorSelectConfigManager manager = new ColorSelectConfigManager();
XMLTools.readInputStreamXML(manager, input);
configManager = manager;
FRContext.getCurrentEnv().writeResource(configManager);
}
/**
* 获取配置管理接口
*
* @return 配置管理接口ConfigManagerProvider
*/
public synchronized static ColorSelectConfigManagerProvider getProviderInstance() {
if (configManager == null) {
if (isClusterMember()) {
return configManager;
}
configManager.readXMLFile();
}
return configManager;
}
private synchronized static boolean isClusterMember() {
switch (BaseClusterHelper.getClusterState()) {
case LEADER:
configManager = new ColorSelectConfigManager();
RPC.registerSkeleton(configManager);
return false;
case MEMBER:
String ip = BaseClusterHelper.getMainServiceIP();
configManager = (ColorSelectConfigManagerProvider) RPC.getProxy(ColorSelectConfigManager.class, ip);
return true;
default:
configManager = new ColorSelectConfigManager();
break;
}
return false;
}
public boolean writeResource() throws Exception {
return FRContext.getCurrentEnv().writeResource(ColorSelectConfigManager.getProviderInstance());
}
public String fileName() {
return "recentcolors.xml";
}
public void readXML(XMLableReader reader) {
String name = reader.getTagName();
if (reader.isChildNode()) {
if (ComparatorUtils.equals(COLOR_TAG, name)) {
Color color = null;
colors.add(reader.getAttrAsColor("colors", color));
}
}
}
public void writeXML(XMLPrintWriter writer) {
writer.startTAG(RECENT_COLOR_TAG);
if (this.colors != null && !this.colors.isEmpty()) {
for (int i = 0; i < this.colors.size(); i++) {
writer.startTAG(COLOR_TAG);
writer.attr("colors", colors.get(i).getRGB());
writer.end();
}
}
writer.end();
}
public List<Color> getColorsFromFile() {
return this.colors;
}
public void setColorsToFile(List<Color> colors) {
this.colors = colors;
}
}

17
designer_base/src/com/fr/design/style/color/ColorSelectConfigManagerProvider.java

@ -0,0 +1,17 @@
package com.fr.design.style.color;
import com.fr.stable.file.RemoteXMLFileManagerProvider;
import java.awt.Color;
import java.util.List;
/**
* Created by yaohwu on 2017/2/8.
*/
public interface ColorSelectConfigManagerProvider extends RemoteXMLFileManagerProvider {
List<Color> getColorsFromFile();
void setColorsToFile(List<Color> colors);
}

25
designer_base/src/com/fr/design/style/color/ColorSelectPane.java

@ -71,11 +71,8 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable
centerPane.add(getRow1Pane()); centerPane.add(getRow1Pane());
JPanel menuColorPane1 = new JPanel(); JPanel menuColorPane1 = getMenuColorPane();
centerPane.add(menuColorPane1); centerPane.add(menuColorPane1);
menuColorPane1.setLayout(new GridLayout(5, 8, 1, 1));
menuColorPane1.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8));
Color[] colorArray = this.getColorArray(); Color[] colorArray = this.getColorArray();
for (int i = 0; i < colorArray.length; i++) { for (int i = 0; i < colorArray.length; i++) {
Color color = colorArray[i] == null ? UsedColorPane.DEFAULT_COLOR : colorArray[i]; Color color = colorArray[i] == null ? UsedColorPane.DEFAULT_COLOR : colorArray[i];
@ -94,24 +91,28 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable
}); });
customButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); customButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
JPanel centerPane1 = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel centerPane1 = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane1.setBorder(BorderFactory.createEmptyBorder(2, 8, 0, 8)); centerPane1.setBorder(BorderFactory.createEmptyBorder(2, 8, 8, 8));
centerPane1.add(customButton, BorderLayout.NORTH); centerPane1.add(customButton, BorderLayout.NORTH);
centerPane.add(centerPane1); centerPane.add(centerPane1);
} }
protected JPanel getMenuColorPane() {
JPanel menuColorPane = new JPanel();
menuColorPane.setLayout(new GridLayout(5, 8, 1, 1));
menuColorPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8));
return menuColorPane;
}
// 第一行,1个取色按钮 + 7个最近使用的颜色 // 第一行,1个取色按钮 + 7个最近使用的颜色
private JPanel getRow1Pane() { protected JPanel getRow1Pane() {
JPanel row1Pane = new JPanel(FRGUIPaneFactory.createBorderLayout()); JPanel row1Pane = new JPanel(FRGUIPaneFactory.createBorderLayout());
row1Pane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 0)); row1Pane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 0));
row1Pane.setPreferredSize(new Dimension(135, 24)); // 宽度为 16 * 8 + 7 row1Pane.setPreferredSize(new Dimension(135, 24)); // 宽度为 16 * 8 + 7
// 取色按钮
UIButton pickColorButton = PickColorButtonFactory.getPickColorButton(this, PickColorButtonFactory.IconType.ICON16, true);
row1Pane.add(pickColorButton, BorderLayout.WEST);
// 最近使用 // 最近使用
UsedColorPane usedColorPane = new UsedColorPane(1, 7, ColorSelectConfigManager.getInstance().getColors(),this); UsedColorPane usedColorPane = new UsedColorPane(1, 8, 1, ColorSelectConfigManager.getInstance().getColors(), this, true, true);
usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 8)); usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 8));
row1Pane.add(usedColorPane.getPane()); row1Pane.add(usedColorPane.getPane());
return row1Pane; return row1Pane;
} }

23
designer_base/src/com/fr/design/style/color/CustomChooserPanel.java

@ -1,15 +1,7 @@
package com.fr.design.style.color; package com.fr.design.style.color;
import java.awt.BorderLayout; import java.awt.*;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Point;
import java.awt.event.*; import java.awt.event.*;
import java.awt.image.MemoryImageSource; import java.awt.image.MemoryImageSource;
import java.util.regex.Matcher; import java.util.regex.Matcher;
@ -29,6 +21,7 @@ import javax.swing.event.DocumentListener;
import javax.swing.text.BadLocationException; import javax.swing.text.BadLocationException;
import javax.swing.text.Document; import javax.swing.text.Document;
import com.fr.design.gui.ibutton.SpecialUIButton;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -709,12 +702,20 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
hexPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 8, 0)); hexPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 8, 0));
hexPanel.add(new UILabel("#")); hexPanel.add(new UILabel("#"));
hexPanel.add(field); hexPanel.add(field);
UIButton pickColorButton = PickColorButtonFactory.getPickColorButton(this, PickColorButtonFactory.IconType.ICON18, true);
hexPanel.add(pickColorButton);
mainPanel.add(hslAndRgbPanel, BorderLayout.CENTER); mainPanel.add(hslAndRgbPanel, BorderLayout.CENTER);
mainPanel.add(hexPanel, BorderLayout.SOUTH); mainPanel.add(hexPanel, BorderLayout.SOUTH);
JPanel rightPane = new JPanel(new BorderLayout());
SpecialUIButton pickColorButton = PickColorButtonFactory.getPickColorButton(this, PickColorButtonFactory.IconType.ICON18, true);
JPanel blankArea = new JPanel();
blankArea.setPreferredSize(new Dimension(100, 175));
rightPane.add(blankArea, BorderLayout.CENTER);
JPanel buttonPane = new JPanel(new BorderLayout());
buttonPane.add(pickColorButton, BorderLayout.WEST);
rightPane.add(buttonPane, BorderLayout.SOUTH);
container.add(rightPane);
return container; return container;
} }

11
designer_base/src/com/fr/design/style/color/NewColorSelectPane.java

@ -79,19 +79,14 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
// 第一行,1个取色按钮 + 7个最近使用的颜色 // 第一行
JPanel row1Pane = new JPanel(FRGUIPaneFactory.createBorderLayout()); JPanel row1Pane = new JPanel(FRGUIPaneFactory.createBorderLayout());
row1Pane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 0)); row1Pane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 0));
row1Pane.setPreferredSize(new Dimension(135, 16)); // 宽度为 16 * 8 + 7 row1Pane.setPreferredSize(new Dimension(135, 16)); // 宽度为 16 * 8 + 7
centerPane.add(row1Pane); centerPane.add(row1Pane);
// 取色按钮
UIButton pickColorButton = PickColorButtonFactory.getPickColorButton(this, PickColorButtonFactory.IconType.ICON16);
row1Pane.add(pickColorButton, BorderLayout.WEST);
// 最近使用 // 最近使用
usedColorPane = new UsedColorPane(1, 7, ColorSelectConfigManager.getInstance().getColors(),this); usedColorPane = new UsedColorPane(1, 8, 1, ColorSelectConfigManager.getInstance().getColors(), this, true, false);
usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 8)); usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 8));
row1Pane.add(usedColorPane.getPane()); row1Pane.add(usedColorPane.getPane());
JPanel menuColorPane1 = new JPanel(); JPanel menuColorPane1 = new JPanel();

50
designer_base/src/com/fr/design/style/color/PickColorButtonFactory.java

@ -1,8 +1,10 @@
package com.fr.design.style.color; package com.fr.design.style.color;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.SpecialUIButton;
import javax.swing.*;
import javax.swing.plaf.ButtonUI;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
@ -10,21 +12,29 @@ import java.awt.event.*;
* Created by plough on 2016/12/22. * Created by plough on 2016/12/22.
*/ */
public class PickColorButtonFactory { public class PickColorButtonFactory {
private static int iconSize;
private static final int SIZE_16 = 16;
private static final int SIZE_18 = 18;
private static IconType iconType;
private static Image iconImage;
public static UIButton getPickColorButton(ColorSelectable colorSelectable, IconType iconType) { public static SpecialUIButton getPickColorButton(ColorSelectable colorSelectable, IconType iconType) {
return getPickColorButton(colorSelectable, iconType, false); return getPickColorButton(colorSelectable, iconType, false);
} }
public static UIButton getPickColorButton(final ColorSelectable colorSelectable, IconType iconType, final Boolean setColorRealTime) { public static SpecialUIButton getPickColorButton(final ColorSelectable colorSelectable, IconType iconType, final boolean setColorRealTime) {
UIButton pickColorButton = new UIButton(); SpecialUIButton pickColorButton = new SpecialUIButton(new WhiteButtonUI());
PickColorButtonFactory.iconType = iconType;
if (iconType == IconType.ICON16) { if (iconType == IconType.ICON16) {
pickColorButton.setIcon(BaseUtils.readIcon("/com/fr/design/images/gui/colorPicker/colorPicker16.png")); iconImage = BaseUtils.readImage("/com/fr/design/images/gui/colorPicker/colorPicker16.png");
pickColorButton.setPreferredSize(new Dimension(16, 16)); iconSize = SIZE_16;
} else { } else {
pickColorButton.setIcon(BaseUtils.readIcon("/com/fr/design/images/gui/colorPicker/colorPicker18.png")); iconImage = BaseUtils.readImage("/com/fr/design/images/gui/colorPicker/colorPicker18.png");
pickColorButton.setPreferredSize(new Dimension(18, 18)); iconSize = SIZE_18;
pickColorButton.setBorderPainted(false);
} }
pickColorButton.setPreferredSize(new Dimension(iconSize, iconSize));
pickColorButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); pickColorButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
pickColorButton.addMouseListener(new MouseAdapter() { pickColorButton.addMouseListener(new MouseAdapter() {
@ -41,4 +51,28 @@ public class PickColorButtonFactory {
public enum IconType { public enum IconType {
ICON16, ICON18 ICON16, ICON18
} }
private static class WhiteButtonUI extends ButtonUI {
@Override
public void paint(Graphics g, JComponent c) {
super.paint(g, c);
Dimension size = c.getSize();
g.setColor(Color.white);
g.fillRoundRect(0, 0, size.width - 1, size.height - 1, 1, 1);
g.setColor(new Color(153, 153, 153)); // #999999
g.drawRoundRect(0, 0, size.width - 1, size.height - 1, 1, 1);
if (iconType == IconType.ICON16) {
g.drawImage(
iconImage,
(size.width - iconImage.getWidth(null)) / 2,
(size.height - iconImage.getHeight(null)) / 2,
iconImage.getWidth(null),
iconImage.getHeight(null),
null
);
} else {
g.drawImage(iconImage, 0, 0, iconSize, iconSize, null);
}
}
}
} }

39
designer_base/src/com/fr/design/style/color/UsedColorPane.java

@ -7,6 +7,7 @@ import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.SpecialUIButton;
public class UsedColorPane extends BasicPane{ public class UsedColorPane extends BasicPane{
@ -16,6 +17,12 @@ public class UsedColorPane extends BasicPane{
private int columns; private int columns;
// 最近使用面板行数 // 最近使用面板行数
private int rows; private int rows;
// 留白的单元格数量
private int reserveCells;
// 是否需要取色器按钮
private boolean needPickColorButton;
// 是否在取色时实时设定颜色
private boolean setColorRealTime;
// 最近使用颜色 // 最近使用颜色
private Object[] colors; private Object[] colors;
// 最近使用面板 // 最近使用面板
@ -40,15 +47,25 @@ public class UsedColorPane extends BasicPane{
* *
* @param rows * @param rows
* @param columns * @param columns
* @param reserveCells 留白的单元格个数
* @param colors 最近使用的颜色 * @param colors 最近使用的颜色
* @param needPickColorButton 是否需要加上取色器按钮
* @param setColorRealTime 取色器是否实时设定颜色
*/ */
public UsedColorPane(int rows,int columns,Object[] colors,ColorSelectable selectable){ public UsedColorPane(int rows,int columns,int reserveCells, Object[] colors, ColorSelectable selectable, boolean needPickColorButton, boolean setColorRealTime){
this.columns = columns; this.columns = columns;
this.rows = rows; this.rows = rows;
this.reserveCells = reserveCells;
this.colors = colors; this.colors = colors;
this.selectable = selectable; this.selectable = selectable;
this.needPickColorButton = needPickColorButton;
this.setColorRealTime = setColorRealTime;
initialComponents(); initialComponents();
} }
public UsedColorPane(int rows,int columns, Object[] colors,ColorSelectable selectable){
this(rows, columns, 0, colors, selectable, false, false);
}
private void initialComponents(){ private void initialComponents(){
int total = columns * rows; int total = columns * rows;
@ -57,9 +74,25 @@ public class UsedColorPane extends BasicPane{
panel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8)); panel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8));
Color[] colors = ColorSelectConfigManager.getInstance().getColors(); Color[] colors = ColorSelectConfigManager.getInstance().getColors();
int size = colors.length; int size = colors.length;
for (int i = 0; i < total; i++) {
int i = 0;
if (needPickColorButton) {
// 取色按钮
SpecialUIButton pickColorButton = PickColorButtonFactory.getPickColorButton(selectable, PickColorButtonFactory.IconType.ICON16, setColorRealTime);
panel.add(pickColorButton);
i++;
this.reserveCells += 1;
}
while (i < this.reserveCells) {
ColorCell cc = new ColorCell(DEFAULT_COLOR, selectable);
cc.setVisible(false);
panel.add(cc);
i++;
}
while (i < total) {
Color color = i < size ? colors[size-1-i]: DEFAULT_COLOR; Color color = i < size ? colors[size-1-i]: DEFAULT_COLOR;
panel.add(new ColorCell(color == null ? DEFAULT_COLOR : color, selectable)); panel.add(new ColorCell(color == null ? DEFAULT_COLOR : color, selectable));
i++;
} }
this.pane = panel; this.pane = panel;
} }
@ -72,7 +105,7 @@ public class UsedColorPane extends BasicPane{
int total = columns * rows; int total = columns * rows;
Color[] colors = ColorSelectConfigManager.getInstance().getColors(); Color[] colors = ColorSelectConfigManager.getInstance().getColors();
int size = colors.length; int size = colors.length;
for(int i=0; i<total; i++){ for(int i=this.reserveCells; i<total; i++){
ColorCell cell = (ColorCell) this.pane.getComponent(i); ColorCell cell = (ColorCell) this.pane.getComponent(i);
Color color = i < size ? colors[size-1-i]: DEFAULT_COLOR; Color color = i < size ? colors[size-1-i]: DEFAULT_COLOR;
cell.setColor(color == null ? DEFAULT_COLOR : color); cell.setColor(color == null ? DEFAULT_COLOR : color);

1
designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java

@ -31,6 +31,7 @@ public abstract class ButtonWithHotkeysDetailPane<T extends Button> extends Butt
} }
private void initComponents() { private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced")); JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
advancedPane.setPreferredSize(new Dimension(600, 341)); advancedPane.setPreferredSize(new Dimension(600, 341));
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();

2
designer_base/src/com/fr/design/write/submit/CustomJobPane.java

@ -1 +1 @@
package com.fr.design.write.submit; import com.fr.data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.beans.BasicBeanPane; import com.fr.design.formula.JavaEditorPane; import com.fr.design.gui.frpane.ObjectProperiesPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.dialog.BasicDialog; data.AbstractClassJob; data.AbstractClassJob; data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; data.AbstractClassJob; import com.fr.design.beans.BasicBeanPane; data.AbstractClassJob; import com.fr.design.formula.JavaEditorPane; data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; data.AbstractClassJob; import com.fr.design.gui.ibutton.UIButton; data.AbstractClassJob; import com.fr.design.gui.itextarea.UITextArea; data.AbstractClassJob; import com.fr.design.gui.itextfield.UITextField; data.AbstractClassJob; import com.fr.design.layout.FRGUIPaneFactory; data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; /** * Author : Shockway * Date: 13-7-29 * Time: 下午6:48 */ public abstract class CustomJobPane extends BasicBeanPane { protected UITextField classNameTextField; protected ObjectProperiesPane objectProperiesPane; public static final int DEFAULT_LENGTH = 30; data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; public CustomJobPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel reportletNamePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); classNameTextField = new UITextField(getLengthOfTextField()); reportletNamePane.add(classNameTextField); data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; UIButton browserButton = new UIButton(Inter.getLocText("FR-Designer_Select_panel")); browserButton.setPreferredSize(new Dimension( browserButton.getPreferredSize().width, classNameTextField.getPreferredSize().height)); data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; UIButton editButton = new UIButton(Inter.getLocText("FR-Designer_Edit_panel")); editButton.setPreferredSize(new Dimension( browserButton.getPreferredSize().width, classNameTextField.getPreferredSize().height)); data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; reportletNamePane.add(browserButton); reportletNamePane.add(editButton); data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; browserButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { final ClassNameSelectPane bPane = new ClassNameSelectPane(); bPane.setClassPath(classNameTextField.getText()); bPane.showWindow( SwingUtilities.getWindowAncestor(getWindowAncestor()), new DialogActionAdapter() { public void doOk() { classNameTextField.setText(bPane.getClassPath()); checkAddButtonEnable(); } }).setVisible(true); } }); editButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final JavaEditorPane javaEditorPane = new JavaEditorPane(classNameTextField.getText(), JavaEditorPane.DEFAULT_SUBMIT_JOB); final BasicDialog dlg = javaEditorPane.showMediumWindow(SwingUtilities.getWindowAncestor(CustomJobPane.this), new DialogActionAdapter() { public void doOk() { classNameTextField.setText(javaEditorPane.getClassText()); checkAddButtonEnable(); } }); javaEditorPane.addSaveActionListener(new ActionListener() { @Override import com.fr.design.gui.itextarea.UITextArea; dlg.doOK(); import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; }); dlg.setVisible(true); } import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.ibutton.UIButton; data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; reportletNamePane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_ClassName_panel"), null)); import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextfield.UITextField; data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.layout.FRGUIPaneFactory; objectProperiesPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Property_panel"), null)); import com.fr.design.gui.itextfield.UITextField; data.AbstractClassJob; data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.beans.BasicBeanPane; JPanel dsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); dsPane.add(area); dsPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Description_panel"), null)); this.add(dsPane, BorderLayout.SOUTH); checkAddButtonEnable(); } public int getLengthOfTextField() { return DEFAULT_LENGTH; } protected String title4PopupWindow() { return "CustomJob"; } protected Component getWindowAncestor() { return this; } @Override public void populateBean(Object ob) { if (ob instanceof AbstractClassJob) { AbstractClassJob cj = (AbstractClassJob) ob; this.classNameTextField.setText(cj.getClassName()); this.objectProperiesPane.populateBean(cj.getPropertyMap()); checkAddButtonEnable(); } } /** * 添加按钮可用 */ public void checkAddButtonEnable() { objectProperiesPane.enableAddButton(StringUtils.isNotEmpty(classNameTextField.getText())); } /** * 重置 */ public void reset() { this.classNameTextField.setText(null); this.checkAddButtonEnable(); } } package com.fr.design.write.submit; import com.fr.base.GraphHelper; import com.fr.data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.beans.BasicBeanPane; import com.fr.design.layout.FRGUIPaneFactory; data.AbstractClassJob; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.beans.BasicBeanPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.formula.JavaEditorPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.gui.frpane.ObjectProperiesPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.dialog.BasicDialog; data.AbstractClassJob; data.AbstractClassJob; data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; data.AbstractClassJob; import com.fr.design.beans.BasicBeanPane; data.AbstractClassJob; import com.fr.design.formula.JavaEditorPane; data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; data.AbstractClassJob; import com.fr.design.gui.ibutton.UIButton; data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.dialog.BasicDialog; import com.fr.design.gui.itextarea.UITextArea; data.AbstractClassJob; import com.fr.design.gui.itextfield.UITextField; data.AbstractClassJob; import com.fr.design.layout.FRGUIPaneFactory; data.AbstractClassJob; import com.fr.design.dialog.BasicDialog; */ public abstract class CustomJobPane extends BasicBeanPane { protected UITextField classNameTextField; protected ObjectProperiesPane objectProperiesPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.frpane.ObjectProperiesPane; public CustomJobPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel reportletNamePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); classNameTextField = new UITextField(getLengthOfTextField()); data.AbstractClassJob; /** data.AbstractClassJob; * Author : Shockway data.AbstractClassJob; * Date: 13-7-29 data.AbstractClassJob; * Time: 下午6:48 data.AbstractClassJob; */ data.AbstractClassJob; public abstract class CustomJobPane extends BasicBeanPane { data.AbstractClassJob; protected UITextField classNameTextField; data.AbstractClassJob; protected ObjectProperiesPane objectProperiesPane; data.AbstractClassJob; public static final int DEFAULT_LENGTH = 30; data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; data.AbstractClassJob; public CustomJobPane() { data.AbstractClassJob; this.setLayout(FRGUIPaneFactory.createBorderLayout()); data.AbstractClassJob; JPanel reportletNamePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); data.AbstractClassJob; classNameTextField = new UITextField(getLengthOfTextField()); data.AbstractClassJob; reportletNamePane.add(classNameTextField); data.AbstractClassJob; UIButton browserButton = new UIButton(Inter.getLocText("FR-Designer_Select_panel")); data.AbstractClassJob; browserButton.setPreferredSize(new Dimension( data.AbstractClassJob; browserButton.getPreferredSize().width, data.AbstractClassJob; classNameTextField.getPreferredSize().height)); data.AbstractClassJob; UIButton editButton = new UIButton(Inter.getLocText("FR-Designer_Edit_panel")); data.AbstractClassJob; editButton.setPreferredSize(new Dimension( data.AbstractClassJob; browserButton.getPreferredSize().width, data.AbstractClassJob; classNameTextField.getPreferredSize().height)); data.AbstractClassJob; reportletNamePane.add(browserButton); data.AbstractClassJob; reportletNamePane.add(editButton); data.AbstractClassJob; browserButton.addActionListener(new ActionListener() { data.AbstractClassJob; public void actionPerformed(ActionEvent evt) { data.AbstractClassJob; final ClassNameSelectPane bPane = new ClassNameSelectPane(); data.AbstractClassJob; bPane.setClassPath(classNameTextField.getText()); data.AbstractClassJob; bPane.showWindow( data.AbstractClassJob; SwingUtilities.getWindowAncestor(getWindowAncestor()), data.AbstractClassJob; new DialogActionAdapter() { data.AbstractClassJob; public void doOk() { data.AbstractClassJob; classNameTextField.setText(bPane.getClassPath()); checkAddButtonEnable(); data.AbstractClassJob; checkAddButtonEnable(); data.AbstractClassJob; } data.AbstractClassJob; }).setVisible(true); data.AbstractClassJob; } data.AbstractClassJob; }); data.AbstractClassJob; editButton.addActionListener(new ActionListener() { data.AbstractClassJob; @Override data.AbstractClassJob; public void actionPerformed(ActionEvent e) { data.AbstractClassJob; final JavaEditorPane javaEditorPane = new JavaEditorPane(classNameTextField.getText(), JavaEditorPane.DEFAULT_SUBMIT_JOB); data.AbstractClassJob; final BasicDialog dlg = javaEditorPane.showMediumWindow(SwingUtilities.getWindowAncestor(CustomJobPane.this), data.AbstractClassJob; new DialogActionAdapter() { data.AbstractClassJob; public void doOk() { data.AbstractClassJob; classNameTextField.setText(javaEditorPane.getClassText()); data.AbstractClassJob; } data.AbstractClassJob; }); data.AbstractClassJob; javaEditorPane.addSaveActionListener(new ActionListener() { data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; data.AbstractClassJob; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.layout.FRGUIPaneFactory; data.AbstractClassJob; import com.fr.design.gui.itextarea.UITextArea; data.AbstractClassJob; import com.fr.design.gui.itextarea.UITextArea; data.AbstractClassJob; data.AbstractClassJob; import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import java.awt.*; import com.fr.design.beans.BasicBeanPane; "), null)); this.add(dsPane, BorderLayout.SOUTH); checkAddButtonEnable(); } public int getLengthOfTextField() { return DEFAULT_LENGTH; } protected String title4PopupWindow() { return "CustomJob"; } protected Component getWindowAncestor() { return this; } @Override public void populateBean(Object ob) { if (ob instanceof AbstractClassJob) { AbstractClassJob cj = (AbstractClassJob) ob; this.classNameTextField.setText(cj.getClassName()); this.objectProperiesPane.populateBean(cj.getPropertyMap()); checkAddButtonEnable(); } } /** * 添加按钮可用 */ public void checkAddButtonEnable() { objectProperiesPane.enableAddButton(StringUtils.isNotEmpty(classNameTextField.getText())); } /** * 重置 */ public void reset() { this.classNameTextField.setText(null); this.checkAddButtonEnable(); } }

6
designer_base/src/com/fr/env/RemoteEnv.java vendored

@ -55,7 +55,7 @@ import java.util.Timer;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.regex.Pattern; import java.util.regex.Pattern;
public class RemoteEnv implements Env { public class RemoteEnv extends AbstractEnv {
private static final int TIME_OUT = 30 * 1000; private static final int TIME_OUT = 30 * 1000;
private static final int PLAIN_SOCKET_PORT = 80; private static final int PLAIN_SOCKET_PORT = 80;
private static final int SSL_PORT = 443; private static final int SSL_PORT = 443;
@ -1483,6 +1483,8 @@ public class RemoteEnv implements Env {
* @throws Exception 异常 * @throws Exception 异常
*/ */
public boolean writeSvgFile(SvgProvider svgFile) throws Exception { public boolean writeSvgFile(SvgProvider svgFile) throws Exception {
testServerConnection();
HashMap<String, String> para = new HashMap<String, String>(); HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design"); para.put("op", "fr_remote_design");
para.put("cmd", "design_save_svg"); para.put("cmd", "design_save_svg");
@ -1534,6 +1536,8 @@ public class RemoteEnv implements Env {
*/ */
@Override @Override
public boolean writeResource(XMLFileManagerProvider mgr) throws Exception { public boolean writeResource(XMLFileManagerProvider mgr) throws Exception {
testServerConnection();
HashMap<String, String> para = new HashMap<String, String>(); HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design"); para.put("op", "fr_remote_design");
para.put("cmd", "design_save_resource"); para.put("cmd", "design_save_resource");

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save