Browse Source

Merge branch 'dev' of http://www.finedevelop.com:2015/scm/~fanglei/design into dev

# Conflicts:
#	designer_base/src/com/fr/design/locale/designer.properties
#	designer_base/src/com/fr/design/locale/designer_en_US.properties
#	designer_base/src/com/fr/design/locale/designer_zh_CN.properties
#	designer_base/src/com/fr/design/locale/designer_zh_TW.properties
master
fanglei 8 years ago
parent
commit
2f5f702952
  1. 48
      designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java
  2. 14
      designer/src/com/fr/design/report/ReportColumnsPane.java
  3. 4
      designer/src/com/fr/design/webattr/PageToolBarPane.java
  4. 14
      designer/src/com/fr/design/webattr/PageWebSettingPane.java
  5. 49
      designer/src/com/fr/design/webattr/ToolBarDragPane.java
  6. 6
      designer/src/com/fr/design/webattr/WriteToolBarPane.java
  7. 9
      designer/src/com/fr/design/webattr/WriteWebSettingPane.java
  8. 121
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  9. 2
      designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java
  10. 34
      designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java
  11. 39
      designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java
  12. 10
      designer_base/src/com/fr/design/actions/community/VideoAction.java
  13. 19
      designer_base/src/com/fr/design/actions/help/AboutPane.java
  14. 10
      designer_base/src/com/fr/design/actions/help/TutorialAction.java
  15. 54
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  16. 6
      designer_base/src/com/fr/design/editor/editor/DateEditor.java
  17. 5
      designer_base/src/com/fr/design/formula/FunctionManagerPane.java
  18. 22
      designer_base/src/com/fr/design/fun/DBTableDataMenuHandler.java
  19. 20
      designer_base/src/com/fr/design/fun/DesignerStartOpenFileProcessor.java
  20. 2
      designer_base/src/com/fr/design/fun/HyperlinkProvider.java
  21. 34
      designer_base/src/com/fr/design/fun/impl/AbstractDBTableDataMenuHandler.java
  22. 18
      designer_base/src/com/fr/design/fun/impl/AbstractDesignerStartOpenFileProcessor.java
  23. 3
      designer_base/src/com/fr/design/gui/date/UIDatePicker.java
  24. 33
      designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java
  25. 3
      designer_base/src/com/fr/design/gui/ibutton/UIColorButton.java
  26. 7
      designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java
  27. BIN
      designer_base/src/com/fr/design/images/reportcolumns/col_en.png
  28. BIN
      designer_base/src/com/fr/design/images/reportcolumns/row_en.png
  29. 46
      designer_base/src/com/fr/design/locale/designer.properties
  30. 44
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  31. 41
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  32. 50
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  33. 42
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  34. 42
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  35. 9
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  36. 10
      designer_base/src/com/fr/design/present/dict/TableDataDictPane.java
  37. 2
      designer_base/src/com/fr/design/roleAuthority/RoleTree.java
  38. 8
      designer_base/src/com/fr/design/style/background/gradient/GradientBackgroundPane.java
  39. 152
      designer_base/src/com/fr/design/style/color/ColorSelectConfigManager.java
  40. 17
      designer_base/src/com/fr/design/style/color/ColorSelectConfigManagerProvider.java
  41. 25
      designer_base/src/com/fr/design/style/color/ColorSelectPane.java
  42. 23
      designer_base/src/com/fr/design/style/color/CustomChooserPanel.java
  43. 11
      designer_base/src/com/fr/design/style/color/NewColorSelectPane.java
  44. 50
      designer_base/src/com/fr/design/style/color/PickColorButtonFactory.java
  45. 39
      designer_base/src/com/fr/design/style/color/UsedColorPane.java
  46. 1
      designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java
  47. 2
      designer_base/src/com/fr/design/write/submit/CustomJobPane.java
  48. 4
      designer_base/src/com/fr/env/RemoteEnv.java
  49. 14
      designer_base/src/com/fr/start/BaseDesigner.java
  50. 12
      designer_chart/src/com/fr/design/mainframe/chart/gui/ColorSelectPaneWithOutTransparent.java
  51. 32
      designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveCustomAction.java
  52. 66
      designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java
  53. 65
      designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java
  54. 64
      designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java
  55. 64
      designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java
  56. 8
      designer_form/src/com/fr/design/designer/creator/cardlayout/XCardAddButton.java
  57. 116
      designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java
  58. 29
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java
  59. 14
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java
  60. 39
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java
  61. 37
      designer_form/src/com/fr/design/mainframe/EditingMouseListener.java
  62. 2
      designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleImgBackgroundEditor.java
  63. 26
      designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java
  64. 4
      designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

48
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);
if (FRContext.getLocale().equals(Locale.US)) {
// 英文显示不全,故每行一个按钮
autoshrik.setFourLine();
autoshrik.setLayout(new GridLayout(4, 1, 1, 1));
} else {
autoshrik.setTwoLine(); autoshrik.setTwoLine();
autoshrik.setLayout(new GridLayout(2, 2, 1, 1)); 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);

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"}));

121
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 dictTabPane;
private JPanel dictCardPane;
private CardLayout dictCardLayout;
private JPanel cardPaneForTreeSetting; //构建树属性容器
private JPanel treeTabPane;
private JPanel formPane; //事件属性容器
private WidgetEventPane eventTabPane; 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(); }

34
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_Blank") + 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_Blank"));
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();
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());
} }
});
protected void initErrorMsgPane() {
// 错误信息 // 错误信息
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;
} }
} }
} }

10
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,7 +33,12 @@ 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 (FRContext.getLocale().equals(Locale.US)) {
url = SiteCenter.getInstance().acquireUrlByKind("bbs.video.en");
} else {
url = SiteCenter.getInstance().acquireUrlByKind("bbs.video");
}
if (StringUtils.isEmpty(url)) { if (StringUtils.isEmpty(url)) {
FRContext.getLogger().info("The URL is empty!"); FRContext.getLogger().info("The URL is empty!");
return; return;
@ -40,7 +46,7 @@ public class VideoAction extends UpdateAction
try { try {
Desktop.getDesktop().browse(new URI(url)); Desktop.getDesktop().browse(new URI(url));
} catch (IOException exp) { } catch (IOException exp) {
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer_Set_default_browser"));
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (URISyntaxException exp) { } catch (URISyntaxException exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);

19
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")
})); }));
// 英文去掉服务电话和 QQ
if (FRContext.getLocale().equals(Locale.US)){
// do nothing
} else {
if(ComparatorUtils.equals(ProductConstants.APP_NAME,FINEREPORT)){ if(ComparatorUtils.equals(ProductConstants.APP_NAME,FINEREPORT)){
boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("Service_Phone") + ProductConstants.COMPARE_TELEPHONE); boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("FR-Designer_Service_Phone") + ProductConstants.COMPARE_TELEPHONE);
contentPane.add(boxCenterAlignmentPane); contentPane.add(boxCenterAlignmentPane);
} }
boxCenterAlignmentPane = new BoxCenterAligmentPane("QQ:" + SiteCenter.getInstance().acquireUrlByKind("help.qq")); boxCenterAlignmentPane = new BoxCenterAligmentPane("QQ:" + SiteCenter.getInstance().acquireUrlByKind("help.qq"));
contentPane.add(boxCenterAlignmentPane); 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");
} }

54
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());
dbTableDataMenuHandler = ExtraDesignClassManager.getInstance().getSingle(DBTableDataMenuHandler.MARK_STRING);
if (dbTableDataMenuHandler != null) {
toolBarDef.addShortCut(SeparatorDef.DEFAULT); toolBarDef.addShortCut(SeparatorDef.DEFAULT);
toolBarDef.addShortCut(new EditCustomCountQueryAction()); 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;

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() {

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

@ -159,10 +159,7 @@ 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", descriptionArea.setText(Inter.getLocText("FR-Designer_Function_Description_Area_Text", File.separator, File.separator, FRContext.getCurrentEnv().getPath() + File.separator));
"Function-J2EE_server", "Directory", "Function-Source_Code", "Example"},
new String[]{" \"com.fr.script.AbstractFunction\".", "\n", " \"" + File.separator + "WEB-INF" + File.separator + "classes\"",
",", ".\n", ":" + FRContext.getCurrentEnv().getPath() + File.separator + "classes"}));
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));

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();
}

2
designer_base/src/com/fr/design/fun/HyperlinkProvider.java

@ -10,7 +10,7 @@ import com.fr.stable.fun.mark.Mutable;
public interface HyperlinkProvider extends Mutable { public interface HyperlinkProvider extends Mutable {
String XML_TAG = "HyperlinkProvider"; String XML_TAG = "HyperlinkProvider";
int CURRENT_LEVEL = 1; int CURRENT_LEVEL = 2;
/** /**

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;
}
}

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!");

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());

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

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

@ -505,11 +505,18 @@ FR-Designer_JavaScript_Set=
FR-Designer_Attribute= FR-Designer_Attribute=
FR-Designer_Form_Editing_Listeners= FR-Designer_Form_Editing_Listeners=
FR-Designer_Form_Basic_Properties= FR-Designer_Form_Basic_Properties=
FR-Designer_DS_Dictionary= FR-Designer_DS_Dictionary=Data Dictionary
FR-Designer_Create_Tree= FR-Designer_Create_Tree=Build Tree
FR-Designer_Set_Callback_Function= FR-Designer_Set_Callback_Function=
FR-Designer_ConfirmDialog_Content= FR-Designer_ConfirmDialog_Content=
FR-Designer_ConfirmDialog_Title= FR-Designer_ConfirmDialog_Title=
FR-Designer_LayoutTable_Column_Width=160
FR-Designer_Set_BG_Of_Current_Row=Set BG of the row being edited
FR-Designer_Unload_Check=Prompt users when leave without submitting
FR-Designer_ReportColumns_Columns_Optional=
FR-Designer_Row_Icon_File_Name=row.png
FR-Designer_Center_Display=Center
FR-Designer_Left_Display=Left
FR-Designer_Background_Null= FR-Designer_Background_Null=
FR-Designer_Background_Color= FR-Designer_Background_Color=
FR-Designer_Background_Texture= FR-Designer_Background_Texture=
@ -521,4 +528,37 @@ FR-Designer_Background_Image_Select=
FR-Designer_Tab_carousel= FR-Designer_Tab_carousel=
FR-Designer_setCarousel= FR-Designer_setCarousel=
FR-Designer_carouselInterval= FR-Designer_carouselInterval=
FR-Designer_WidgetOrder= FR-Designer_Initial_Background_Tips=
FR-Designer_Mouse_Move_Tips=
FR-Designer_Mouse_Click_Tips=
FR-Designer_About_Version=Version
FR-Designer_About_CopyRight=Copy Right
FR-Designer_Service_Phone=Service Phone
FR-Designer_Allow_Blank=Allow Blank
FR-Designer_PageSetup_Page=Page
FR-Designer_Custom_Job_Description=Description
FR-Designer_Property=Property
FR-Designer_ClassName=Class Name
FR-Designer_Polyblock_Edit=Polyblock Edit
FR-Designer_Function_Description_Area_Text=The class must inherit 'com.fr.script.AbstractFunction'. The compiled class should be copied to\nJ2EE server '{R1}WEB-INF{R2}classes' directory.\nAdd the source code(.java file) into the same folder if need.\nExample: {R3}classes}
FR-Designer_PageSetup_Horizontal=Horizontal
FR-Designer_PageSetup_Vertical=Vertical
FR-Designer_Gradient_Direction=Gradient Direction
FR-Designer_Drag_To_Select_Gradient=\\ Drag the button below to choose gradient area, click it to choose color
FR-Designer_Display_Value=Display Value
FR-Designer_Actual_Value=Actual Value
FR-Designer_CellWrite_ToolTip=Tool Tip of Cell
FR-Designer_Show_Content=Show content
FR-Designer_Auto_Adjust_Size=Auto adjust
FR-Designer_Show_As_Download=Display the binary content using download link
FR-Designer_File_Name_For_Download=File Name For Download
FR-Designer_No=No
FR-Designer_Pagination=Page Break
FR-Designer_Role=Role
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
FR-Designer_DS_TableData=Data Set
FR-Designer_Parameter-Formula=Formula
FR-Designer_Plugin_Should_Update_Please_Contact_Developer=Plugin version is too low, and is not compatible with current API. Please contact the developer to update.

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

@ -181,7 +181,7 @@ FR-Designer_Support_QQ=Support online
FR-Designer_Swatch=Swatch FR-Designer_Swatch=Swatch
FR-Designer_Tab_title=Tab title FR-Designer_Tab_title=Tab title
FR-Designer_TableData=Data set FR-Designer_TableData=Data set
FR-Designer_Thank_guest=Special Thanks FR-Designer_Thank_guest=Special thanks to
FR-Designer_Thanks-To=Thanks FR-Designer_Thanks-To=Thanks
FR-Designer_Title=Title FR-Designer_Title=Title
FR-Designer_Total=Total FR-Designer_Total=Total
@ -510,6 +510,13 @@ FR-Designer_Create_Tree=Build Tree
FR-Designer_Set_Callback_Function=Set Callback Function FR-Designer_Set_Callback_Function=Set Callback Function
FR-Designer_ConfirmDialog_Content= FR-Designer_ConfirmDialog_Content=
FR-Designer_ConfirmDialog_Title= FR-Designer_ConfirmDialog_Title=
FR-Designer_LayoutTable_Column_Width=250
FR-Designer_Set_BG_Of_Current_Row=Set BG of the row being edited
FR-Designer_Unload_Check=Prompt users when leave without submitting
FR-Designer_ReportColumns_Columns_Optional=\u3000
FR-Designer_Row_Icon_File_Name=row_en.png
FR-Designer_Center_Display=Center
FR-Designer_Left_Display=Left
FR-Designer_Background_Null=No Background FR-Designer_Background_Null=No Background
FR-Designer_Background_Color=Color FR-Designer_Background_Color=Color
FR-Designer_Background_Texture=Texture FR-Designer_Background_Texture=Texture
@ -521,4 +528,37 @@ FR-Designer_Background_Image_Select=Select Picture
FR-Designer_Tab_carousel= FR-Designer_Tab_carousel=
FR-Designer_setCarousel= FR-Designer_setCarousel=
FR-Designer_carouselInterval= FR-Designer_carouselInterval=
FR-Designer_WidgetOrder=Widget Order 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_About_Version=Version
FR-Designer_About_CopyRight=Copy Right
FR-Designer_Service_Phone=Service Phone
FR-Designer_Allow_Blank=Allow Null
FR-Designer_PageSetup_Page=Page
FR-Designer_Custom_Job_Description=Description
FR-Designer_Property=Property
FR-Designer_ClassName=Class Name
FR-Designer_Polyblock_Edit=Aggregation block edition
FR-Designer_Function_Description_Area_Text=The class must inherit 'com.fr.script.AbstractFunction'. The compiled class files should be copied to\nJ2EE server '{R1}WEB-INF{R2}classes' directory.\nAdd the source code(.java file) into the same folder if need.\nExample: {R3}classes
FR-Designer_PageSetup_Horizontal=Horizontal
FR-Designer_PageSetup_Vertical=Vertical
FR-Designer_Gradient_Direction=Gradient Direction
FR-Designer_Drag_To_Select_Gradient=\\ Drag the button below to choose gradient area, click it to choose color
FR-Designer_Display_Value=Display Value
FR-Designer_Actual_Value=Actual Value
FR-Designer_CellWrite_ToolTip=Tool Tip of Cell
FR-Designer_Show_Content=Show content
FR-Designer_Auto_Adjust_Size=Auto adjust
FR-Designer_Show_As_Download=Display the binary content using download link
FR-Designer_File_Name_For_Download=File Name For Download
FR-Designer_No=No
FR-Designer_Pagination=Page Break
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
FR-Designer_Role=Role
FR-Designer_DS_TableData=Data Set
FR-Designer_Parameter-Formula=Formula
FR-Designer_Plugin_Should_Update_Please_Contact_Developer=Plugin version is too low, and is not compatible with current API. Please contact the developer to update.

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

@ -489,6 +489,13 @@ FR-Designer_Create_Tree=
FR-Designer_Set_Callback_Function= FR-Designer_Set_Callback_Function=
FR-Designer_ConfirmDialog_Content= FR-Designer_ConfirmDialog_Content=
FR-Designer_ConfirmDialog_Title= FR-Designer_ConfirmDialog_Title=
FR-Designer_LayoutTable_Column_Width=160
FR-Designer_Set_BG_Of_Current_Row=\u5831\u544A\u30AB\u30EC\u30F3\u30C8\u7DE8\u96C6\u884C\u80CC\u666F\u8A2D\u5B9A
FR-Designer_Unload_Check=\u63D0\u51FA\u305B\u305A\u306B\u30D2\u30F3\u30C8
FR-Designer_ReportColumns_Columns_Optional=\u6BB5\u7D44\u307F
FR-Designer_Row_Icon_File_Name=row.png
FR-Designer_Center_Display=\u4E2D\u592E\u63C3\u3048\u8868\u793A
FR-Designer_Left_Display=\u5DE6\u8868\u793A
FR-Designer_Background_Null= FR-Designer_Background_Null=
FR-Designer_Background_Color= FR-Designer_Background_Color=
FR-Designer_Background_Texture= FR-Designer_Background_Texture=
@ -500,3 +507,37 @@ FR-Designer_Background_Image_Select=
FR-Designer_Tab_carousel= FR-Designer_Tab_carousel=
FR-Designer_setCarousel= FR-Designer_setCarousel=
FR-Designer_carouselInterval= FR-Designer_carouselInterval=
FR-Designer_Initial_Background_Tips=
FR-Designer_Mouse_Move_Tips=
FR-Designer_Mouse_Click_Tips=
FR-Designer_About_Version=\u30D0\u30FC\u30B8\u30E7\u30F3
FR-Designer_About_CopyRight=\u8457\u4F5C\u6A29\u6240\u6709
FR-Designer_Service_Phone=\u30B5\u30FC\u30D3\u30B9\u96FB\u8A71\uFF1A
FR-Designer_Allow_Blank=\u7A7A\u6B04\u3042\u308A
FR-Designer_PageSetup_Page=\u30DA\u30FC\u30B8
FR-Designer_Custom_Job_Description=\u8A18\u8FF0
FR-Designer_Property=\u5C5E\u6027
FR-Designer_ClassName=\u985E\u540D
FR-Designer_Polyblock_Edit=\u30A2\u30B0\u30EA\u30B2\u30FC\u30B7\u30E7\u30F3\u30D6\u30ED\u30C3\u30AF\u7DE8\u96C6
FR-Designer_Function_Description_Area_Text=\u3053\u306E\u30AF\u30E9\u30B9\u306F\u7D99\u627F\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"com.fr.script.AbstractFunction"\u3002\u3092\u7D99\u627F\u3059\u3079\u304D\u3067\u3059\u3002\u30B3\u30F3\u30D1\u30A4\u30EB\u5F8C\u306E\u985E\u30D5\u30A1\u30A4\u30EB\u3092\nJ2EE\u30B5\u30FC\u30D0\u30FC "{R1}WEB-INF{R2}classes" \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3002\u306B\u30B3\u30D4\u30FC\u3057\u3066\u3001class\u306B\u5BFE\u5FDC\u3059\u308Bjava\u30D5\u30A1\u30A4\u30EB\u3082\u5F53\u76EE\u6B21\u306B\u7F6E\u3044\u3066\u304F\u3060\u3055\u3044\u3002\n\u4F8B\u3048\u3070\uFF1A{R3}classes
FR-Designer_PageSetup_Horizontal=\u6A2A\u65B9\u5411
FR-Designer_PageSetup_Vertical=\u7E26\u65B9\u5411
FR-Designer_Gradient_Direction=\u65B9\u5411\u3092\u5F90\u3005\u306B\u5909\u5316
FR-Designer_Drag_To_Select_Gradient=\\ \u4E0B\u65B9\u306E\u30DC\u30BF\u30F3\u3092\u30D7\u30EB\u30C0\u30A6\u30F3\u3057\u3066\u6F38\u6B21\u5909\u5316\u30A8\u30EA\u30A2\u3092\u9078\u629E\u3057\u3001\u30AF\u30EA\u30C3\u30AF\u3057
FR-Designer_Display_Value=\u8868\u793A\u5024
FR-Designer_Actual_Value=\u5B9F\u969B\u5024
FR-Designer_CellWrite_ToolTip=\u30BB\u30EB\u30D2\u30F3\u30C8
FR-Designer_Show_Content=\u5185\u5BB9\u8868\u793A
FR-Designer_Auto_Adjust_Size=\u81EA\u52D5\u8ABF\u6574
FR-Designer_Show_As_Download=\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u30EA\u30F3\u30AF\u3067\uFF12\u9032\u6CD5\u306E\u5185\u5BB9\u3092\u8868\u793A
FR-Designer_File_Name_For_Download=\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u30D5\u30A1\u30A4\u30EB\u540D
FR-Designer_No=\u3044\u3044\u3048
FR-Designer_Pagination=\u30DA\u30FC\u30B8\u30F3\u30B0
FR-Designer-Move_Tab_First=
FR-Designer-Move_Tab_End=
FR-Designer-Move_Tab_Next=
FR-Designer-Move_Tab_Prev=
FR-Designer_Role=
FR-Designer_DS_TableData=\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9
FR-Designer_Parameter-Formula=\u6570\u5F0F
FR-Designer_Plugin_Should_Update_Please_Contact_Developer=

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

@ -459,14 +459,14 @@ FR-Designer-DS-Database_Query=\uB370\uC774\uD130\uBCA0\uC774\uC2A4\uCC3E\uC544\u
FR-Designer_Is_Share_DBTableData=\uB370\uC774\uD130\uC138\uD2B8\uACF5\uC720 FR-Designer_Is_Share_DBTableData=\uB370\uC774\uD130\uC138\uD2B8\uACF5\uC720
FR-Designer-LayerPageReport_PageQuery=\uD398\uC774\uC9C0\uB098\uB204\uAE30\uCC3E\uC544\uBCF4\uAE30 FR-Designer-LayerPageReport_PageQuery=\uD398\uC774\uC9C0\uB098\uB204\uAE30\uCC3E\uC544\uBCF4\uAE30
FR-Designer-LayerPageReport_Define_PageQuerySQL=\uC815\uC758\uD398\uC774\uC9C0\uB098\uB204\uAE30\uCC3E\uC544\uBCF4\uAE30sql FR-Designer-LayerPageReport_Define_PageQuerySQL=\uC815\uC758\uD398\uC774\uC9C0\uB098\uB204\uAE30\uCC3E\uC544\uBCF4\uAE30sql
FR-Designer_Event=\ FR-Designer_Event=
FR-Designer_Properties=\uFFFD FR-Designer_Properties=\uFFFD
FR-Designer_Export_failed=\uB0B4\uBCF4\uB0B4\uAE30\uC2E4\uD328 FR-Designer_Export_failed=\uB0B4\uBCF4\uB0B4\uAE30\uC2E4\uD328
FR-Designer_Exported_successfully=\uB0B4\uBCF4\uB0B4\uAE30\uC131\uACF5 FR-Designer_Exported_successfully=\uB0B4\uBCF4\uB0B4\uAE30\uC131\uACF5
FR-Designer_Exporting=\uB0B4\uBCF4\uB0B4\uAE30\uC911 FR-Designer_Exporting=\uB0B4\uBCF4\uB0B4\uAE30\uC911
FR-Designer_Export-PDF=PDF\uC11C\uC2DDFR-Designer_Properties=\uFFFD FR-Designer_Export-PDF=PDF\uC11C\uC2DD
FR-Designer_Button_OK=\uD655\uC778FR-Designer_Button_Cancel=\uCDE8\uC18C FR-Designer_Button_OK=\uD655\uC778
\uFFFD FR-Designer_Button_Cancel=\uCDE8\uC18C
FR-Designer_JavaScript= FR-Designer_JavaScript=
FR-Designer_JavaScript_Form_Submit= FR-Designer_JavaScript_Form_Submit=
FR-Designer_JavaScript_Commit_to_Database= FR-Designer_JavaScript_Commit_to_Database=
@ -484,6 +484,13 @@ FR-Designer_Create_Tree=
FR-Designer_Set_Callback_Function= FR-Designer_Set_Callback_Function=
FR-Designer_ConfirmDialog_Content= FR-Designer_ConfirmDialog_Content=
FR-Designer_ConfirmDialog_Title= FR-Designer_ConfirmDialog_Title=
FR-Designer_LayoutTable_Column_Width=160
FR-Designer_Set_BG_Of_Current_Row=\uAE30\uC785\uD604\uC7AC\uD3B8\uC9D1\uD589\uBC30\uACBD\uC124\uC815
FR-Designer_Unload_Check=\uBBF8\uC81C\uCD9C\uB098\uAC14\uC74C\uC54C\uB9BC
FR-Designer_ReportColumns_Columns_Optional=\uC140\uB098\uB204\uAE30
FR-Designer_Row_Icon_File_Name=row.png
FR-Designer_Center_Display=\uAC00\uC6B4\uB370\uC815\uB82C\uBCF4\uC774\uAE30
FR-Designer_Left_Display=\uC67C\uCABD\uBCF4\uC774\uAE30
FR-Designer_Background_Null= FR-Designer_Background_Null=
FR-Designer_Background_Color= FR-Designer_Background_Color=
FR-Designer_Background_Texture= FR-Designer_Background_Texture=
@ -495,3 +502,38 @@ FR-Designer_Background_Image_Select=
FR-Designer_Tab_carousel= FR-Designer_Tab_carousel=
FR-Designer_setCarousel= FR-Designer_setCarousel=
FR-Designer_carouselInterval= FR-Designer_carouselInterval=
FR-Designer_Initial_Background_Tips=
FR-Designer_Mouse_Move_Tips=
FR-Designer_Mouse_Click_Tips=
FR-Designer_About_Version=\uBC84\uC804
FR-Designer_About_CopyRight=\uD310\uAD8C\uC18C\uC720
FR-Designer_Service_Phone=\uC11C\uBE44\uC2A4\uC804\uD654\uFF1A
FR-Designer_Allow_Blank=\uBE48\uCE78\uD5C8\uC6A9
FR-Designer_PageSetup_Page=\uC6F9\uD398\uC774\uC9C0
FR-Designer_Custom_Job_Description=\uC124\uBA85
FR-Designer_Property=\uC18D\uC131
FR-Designer_ClassName=\uD074\uB798\uC2A4\uB124\uC784
FR-Designer_Polyblock_Edit=\uCDE8\uD569\uBE14\uB7ED\uD3B8\uC9D1
FR-Designer_Function_Description_Area_Text=\uD574\uB2F9\uD074\uB798\uC2A4\uB294\uACC4\uC2B9\uD574\uC57C\uD55C\uB2E4."com.fr.script.AbstractFunction".\uCEF4\uD30C\uC77C\uD6C4\uC758\uD074\uB798\uC2A4\uD30C\uC77C\uC744~\uB85C\uBCF5\uC0AC\nJ2EE\uC11C\uBC84 "{R1}WEB-INF{R2}classes" \uB514\uB809\uD130\uB9AC, \uD544\uC694\uC2DC class \uC0C1\uC751\uD558\uB294 java\uC18C\uC2A4\uD30C\uC77C\uB3C4\uD574\uB2F9\uB514\uB809\uD130\uB9AC\uD558\uB2E8\uC5D0\uB450\uC5B4\uD3B8\uC9D1\uBC0F\uCC3E\uC544\uBCF4\uAE30\uB97C\uD560\uC218\uC788\uC2B5\uB2C8\uB2E4.\n\uC608: {R3}classes
FR-Designer_PageSetup_Horizontal=\uAC00\uB85C
FR-Designer_PageSetup_Vertical=\uC138\uB85C
FR-Designer_Gradient_Direction=\uADF8\uB77C\uB370\uC774\uC158 \uBC29\uD5A5
FR-Designer_Drag_To_Select_Gradient=\\\uD558\uB2E8\uD0A4\uB97C\uB4DC\uB798\uADF8\uD558\uC5EC\uADF8\uB77C\uB370\uC774\uC158\uC601\uC5ED\uC744\uC120\uD0DD\uD558\uACE0\uD0A4\uB97C\uD074\uB9AD\uD558\uC5EC\uD574\uB2F9\uC0C9\uC120\uD0DD
FR-Designer_Display_Value=\uAC12\uBCF4\uC774\uAE30
FR-Designer_Actual_Value=\uC2E4\uC81C\uAC12
FR-Designer_CellWrite_ToolTip=\uB0B4\uC6A9\uC54C\uB9BC
FR-Designer_Show_Content=\uB0B4\uC6A9\uBCF4\uC774\uAE30
FR-Designer_Auto_Adjust_Size=\uC790\uB3D9\uC870\uC815
FR-Designer_Show_As_Download=\uB2E4\uC6B4\uB85C\uB4DC\uB9C1\uD06C\uB85C2\uC9C4\uBC95\uB0B4\uC6A9\uBCF4\uC774\uAE30
FR-Designer_File_Name_For_Download=\uB2E4\uC6B4\uB85C\uB4DC\uD30C\uC77C\uBA85
FR-Designer_No=\uC544\uB2C8\uC624
FR-Designer_Pagination=\uD398\uC774\uC9C0\uB098\uB204\uAE30
FR-Designer-Move_Tab_First=
FR-Designer-Move_Tab_End=
FR-Designer-Move_Tab_Next=
FR-Designer-Move_Tab_Prev=
FR-Designer_Role=
FR-Designer_DS_TableData=\uB370\uC774\uD130\uC138\uD2B8
FR-Designer_Parameter-Formula=\uC218\uC2DD
FR-Designer_Plugin_Should_Update_Please_Contact_Developer=

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

@ -514,6 +514,13 @@ FR-Designer_Create_Tree=\u6784\u5EFA\u6811
FR-Designer_Set_Callback_Function=\u8BBE\u7F6E\u56DE\u8C03\u51FD\u6570 FR-Designer_Set_Callback_Function=\u8BBE\u7F6E\u56DE\u8C03\u51FD\u6570
FR-Designer_ConfirmDialog_Content=\u662F\u5426\u786E\u5B9A\u5220\u9664tab\u63A7\u4EF6 FR-Designer_ConfirmDialog_Content=\u662F\u5426\u786E\u5B9A\u5220\u9664tab\u63A7\u4EF6
FR-Designer_ConfirmDialog_Title=FineReport 8.0 FR-Designer_ConfirmDialog_Title=FineReport 8.0
FR-Designer_LayoutTable_Column_Width=160
FR-Designer_Set_BG_Of_Current_Row=\u586B\u62A5\u5F53\u524D\u7F16\u8F91\u884C\u80CC\u666F\u8BBE\u7F6E
FR-Designer_Unload_Check=\u672A\u63D0\u4EA4\u79BB\u5F00\u63D0\u793A
FR-Designer_ReportColumns_Columns_Optional=\u5206\u680F
FR-Designer_Row_Icon_File_Name=row.png
FR-Designer_Center_Display=\u5C45\u4E2D\u5C55\u793A
FR-Designer_Left_Display=\u5DE6\u5C55\u793A
FR-Designer_Background_Null=\u6CA1\u6709\u80CC\u666F FR-Designer_Background_Null=\u6CA1\u6709\u80CC\u666F
FR-Designer_Background_Color=\u989C\u8272 FR-Designer_Background_Color=\u989C\u8272
FR-Designer_Background_Texture=\u7EB9\u7406 FR-Designer_Background_Texture=\u7EB9\u7406
@ -525,4 +532,37 @@ FR-Designer_Background_Image_Select=\u9009\u62E9\u56FE\u7247
FR-Designer_Tab_carousel=tab\u8F6E\u64AD FR-Designer_Tab_carousel=tab\u8F6E\u64AD
FR-Designer_setCarousel=\u5F00\u542F\u8F6E\u64AD FR-Designer_setCarousel=\u5F00\u542F\u8F6E\u64AD
FR-Designer_carouselInterval=\u8F6E\u64AD\u95F4\u9694 FR-Designer_carouselInterval=\u8F6E\u64AD\u95F4\u9694
FR-Designer_WidgetOrder=\u63A7\u4EF6\u987A\u5E8F 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
FR-Designer_About_Version=\u7248\u672C
FR-Designer_About_CopyRight=\u7248\u6743\u6240\u6709
FR-Designer_Service_Phone=\u670D\u52A1\u7535\u8BDD\uFF1A
FR-Designer_Allow_Blank=\u5141\u8BB8\u4E3A\u7A7A
FR-Designer_PageSetup_Page=\u9875\u9762
FR-Designer_Custom_Job_Description=\u63CF\u8FF0
FR-Designer_Property=\u5C5E\u6027
FR-Designer_ClassName=\u7C7B\u540D
FR-Designer_Polyblock_Edit=\u805A\u5408\u5757\u7F16\u8F91
FR-Designer_Function_Description_Area_Text=\u8BE5\u7C7B\u5FC5\u987B\u7EE7\u627F"com.fr.script.AbstractFunction"\u3002\u5E94\u5C06\u7F16\u8BD1\u540E\u7684\u7C7B\u6587\u4EF6\u62F7\u8D1D\u5230\nJ2EE\u670D\u52A1\u5668 "{R1}WEB-INF{R2}classes" \u76EE\u5F55\uFF0C\u5982\u679C\u5FC5\u8981\u7684\u8BDD\u5C06class\u5BF9\u5E94\u7684java\u6E90\u6587\u4EF6\u4E5F\u653E\u7F6E\u5230\u8BE5\u76EE\u5F55\u4E0B\u65B9\u4FBF\u7F16\u8F91\u548C\u67E5\u770B\u3002\n\u4F8B\u5982\uFF1A{R3}classes
FR-Designer_PageSetup_Horizontal=\u6A2A\u5411
FR-Designer_PageSetup_Vertical=\u7EB5\u5411
FR-Designer_Gradient_Direction=\u6E10\u53D8\u65B9\u5411
FR-Designer_Drag_To_Select_Gradient=\\ \u62D6\u52A8\u4E0B\u65B9\u6309\u94AE\u9009\u62E9\u6E10\u53D8\u533A\u57DF\uFF0C\u5355\u51FB\u6309\u94AE\u9009\u62E9\u5BF9\u5E94\u989C\u8272
FR-Designer_Display_Value=\u663E\u793A\u503C
FR-Designer_Actual_Value=\u5B9E\u9645\u503C
FR-Designer_CellWrite_ToolTip=\u5185\u5BB9\u63D0\u793A
FR-Designer_Show_Content=\u663E\u793A\u5185\u5BB9
FR-Designer_Auto_Adjust_Size=\u81EA\u52A8\u8C03\u6574
FR-Designer_Show_As_Download=\u7528\u4E0B\u8F7D\u94FE\u63A5\u663E\u793A\u4E8C\u8FDB\u5236\u5185\u5BB9
FR-Designer_File_Name_For_Download=\u4E0B\u8F7D\u6587\u4EF6\u540D
FR-Designer_No=\u5426
FR-Designer_Pagination=\u5206\u9875
FR-Designer-Move_Tab_First=\u79FB\u52A8\u5230\u9996\u4F4D
FR-Designer-Move_Tab_End=\u79FB\u52A8\u5230\u672B\u5C3E
FR-Designer-Move_Tab_Next=\u5F80\u540E\u79FB\u52A8
FR-Designer-Move_Tab_Prev=\u5F80\u524D\u79FB\u52A8
FR-Designer_Role=\u89D2\u8272
FR-Designer_DS_TableData=\u6570\u636E\u96C6
FR-Designer_Parameter-Formula=\u516C\u5F0F
FR-Designer_Plugin_Should_Update_Please_Contact_Developer=\u63D2\u4EF6\u7248\u672C\u8FC7\u4F4E, \u5B58\u5728API\u4E0D\u517C\u5BB9, \u8BF7\u8054\u7CFB\u5F00\u53D1\u8005\u5347\u7EA7\u63D2\u4EF6

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

@ -502,6 +502,13 @@ FR-Designer_Create_Tree=
FR-Designer_Set_Callback_Function= FR-Designer_Set_Callback_Function=
FR-Designer_ConfirmDialog_Content= FR-Designer_ConfirmDialog_Content=
FR-Designer_ConfirmDialog_Title= FR-Designer_ConfirmDialog_Title=
FR-Designer_LayoutTable_Column_Width=160
FR-Designer_Set_BG_Of_Current_Row=\u586B\u5831\u7576\u524D\u7DE8\u8F2F\u5217\u80CC\u666F\u8A2D\u5B9A
FR-Designer_Unload_Check=\u672A\u63D0\u4EA4\u96E2\u958B\u63D0\u793A
FR-Designer_ReportColumns_Columns_Optional=\u5831\u8868\u6B04\u4F4D
FR-Designer_Row_Icon_File_Name=row.png
FR-Designer_Center_Display=\u7F6E\u4E2D\u986F\u793A
FR-Designer_Left_Display=\u5DE6\u986F\u793A
FR-Designer_Background_Null= FR-Designer_Background_Null=
FR-Designer_Background_Color= FR-Designer_Background_Color=
FR-Designer_Background_Texture= FR-Designer_Background_Texture=
@ -513,4 +520,37 @@ FR-Designer_Background_Image_Select=
FR-Designer_Tab_carousel= FR-Designer_Tab_carousel=
FR-Designer_setCarousel= FR-Designer_setCarousel=
FR-Designer_carouselInterval= FR-Designer_carouselInterval=
FR-Designer_WidgetOrder=\u63A7\u4EF6\u9806\u5E8F FR-Designer_Initial_Background_Tips=
FR-Designer_Mouse_Move_Tips=
FR-Designer_Mouse_Click_Tips=
FR-Designer_About_Version=\u7248\u672C
FR-Designer_About_CopyRight=\u7248\u6B0A\u6240\u6709
FR-Designer_Service_Phone=\u670D\u52D9\u96FB\u8A71\uFF1A
FR-Designer_Allow_Blank=\u5141\u8A31\u70BA\u7A7A\u767D
FR-Designer_PageSetup_Page=\u9801\u9762
FR-Designer_Custom_Job_Description=\u63CF\u8FF0
FR-Designer_Property=\u5C6C\u6027
FR-Designer_ClassName=\u985E\u540D
FR-Designer_Polyblock_Edit=\u805A\u5408\u584A\u7DE8\u8F2F
FR-Designer_Function_Description_Area_Text=\u8A72\u985E\u5FC5\u9808\u7E7C\u627F"com.fr.script.AbstractFunction"\u3002\u61C9\u5C07\u7DE8\u8B6F\u5F8C\u7684\u985E\u6A94\u6848\u62F7\u8C9D\u5230\nJ2EE\u4F3A\u670D\u5668 "{R1}WEB-INF{R2}classes" \u76EE\u9304\uFF0C\u5982\u679C\u5FC5\u8981\u7684\u8A71\u5C07class\u5C0D\u61C9\u7684java\u539F\u59CB\u6A94\u6848\u4E5F\u653E\u7F6E\u5230\u8A72\u76EE\u9304\u4E0B\u65B9\u4FBF\u7DE8\u8F2F\u548C\u67E5\u770B\u3002\n\u4F8B\u5982\uFF1A{R3}classes
FR-Designer_PageSetup_Horizontal=\u6A2A\u5411
FR-Designer_PageSetup_Vertical=\u7E31\u5411
FR-Designer_Gradient_Direction=\u6F38\u8B8A\u65B9\u5411
FR-Designer_Drag_To_Select_Gradient=\\ \u62D6\u52D5\u4E0B\u767C\u90A3\u500B\u6309\u9215\u61F8\u8457\u5340\u57DF\uFF0C\u55AE\u64CA\u6309\u9215\u9078\u64C7\u984F\u8272
FR-Designer_Display_Value=\u986F\u793A\u503C
FR-Designer_Actual_Value=\u5BE6\u969B\u503C
FR-Designer_CellWrite_ToolTip=\u5167\u5BB9\u63D0\u793A
FR-Designer_Show_Content=\u986F\u793A\u5167\u5BB9
FR-Designer_Auto_Adjust_Size=\u81EA\u52D5\u8ABF\u6574
FR-Designer_Show_As_Download=\u7528\u4E0B\u8F09\u93C8\u63A5\u986F\u793A\u4E8C\u9032\u5236\u5167\u5BB9
FR-Designer_File_Name_For_Download=\u4E0B\u8F09\u6A94\u6848\u540D
FR-Designer_No=\u5426
FR-Designer_Pagination=\u5206\u9801
FR-Designer-Move_Tab_First=\u79FB\u52D5\u5230\u9996\u4F4D
FR-Designer-Move_Tab_End=\u79FB\u52D5\u5230\u672B\u5C3E
FR-Designer-Move_Tab_Next=\u5F80\u5F8C\u79FB\u52D5
FR-Designer-Move_Tab_Prev=\u5F80\u524D\u79FB\u52D5
FR-Designer_Role=
FR-Designer_DS_TableData=\u8CC7\u6599\u96C6
FR-Designer_Parameter-Formula=\u516C\u5F0F
FR-Designer_Plugin_Should_Update_Please_Contact_Developer=\u633F\u4EF6\u7248\u672C\u904E\u4F4E\uFF0C\u5B58\u5728API\u4E0D\u76F8\u5BB9\uFF0C\u8ACB\u806F\u7CFB\u958B\u767C\u8005\u965E\u7D1A\u633F\u4EF6

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

@ -160,9 +160,7 @@ public abstract class ToolBarMenuDock {
public Locale[] supportCommunityLocales() { public Locale[] supportCommunityLocales() {
return new Locale[]{ return new Locale[]{
Locale.CHINA, Locale.CHINA,
Locale.JAPAN,
Locale.TAIWAN, Locale.TAIWAN,
Locale.US,
}; };
} }
@ -314,6 +312,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);
@ -398,7 +401,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

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);

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

@ -1,25 +1,63 @@
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;
// 最近使用颜色
private List<Color> colors = new ArrayList<Color>();
private static final String RECENT_COLOR_TAG = "RecentColors";
private static final String COLOR_TAG = "Color";
static {
GeneralContext.addEnvChangedListener(new EnvChangedListener() {
public void envChanged() {
ColorSelectConfigManager.envChanged();
}
});
}
private static void envChanged() {
configManager = null;
}
public Color[] getColors() { public Color[] getColors() {
if(colors == null){
//初次打开软件时从xml文件中获取历史颜色信息
if (init) {
ColorSelectConfigManagerProvider manager = ColorSelectConfigManager.getProviderInstance();
this.colors = manager.getColorsFromFile();
init = false;
}
if (colors == null) {
colors = new ArrayList<Color>(); colors = new ArrayList<Color>();
} }
return colors.toArray(new Color[colors.size()]); return colors.toArray(new Color[colors.size()]);
@ -28,6 +66,7 @@ public class ColorSelectConfigManager{
public int getColorNum() { public int getColorNum() {
return colorNums; return colorNums;
} }
public void setColorNum(int colorNums) { public void setColorNum(int colorNums) {
this.colorNums = colorNums; this.colorNums = colorNums;
} }
@ -43,14 +82,111 @@ public class ColorSelectConfigManager{
* 添加颜色到最近使用队列中 * 添加颜色到最近使用队列中
* *
* @param color 颜色 * @param color 颜色
*
*/ */
public void addToColorQueue(Color color){ public void addToColorQueue(Color color) {
// 过滤重复的最近使用颜色 // 过滤重复的最近使用颜色
// 因为有个后进先出的问题,最近使用的颜色需要放到最前面所以没用set // 因为有个后进先出的问题,最近使用的颜色需要放到最前面所以没用set
if(colors.contains(color)){ if (colors.contains(color)) {
colors.remove(color); colors.remove(color);
} }
colors.add(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,16 +47,26 @@ 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;
JPanel panel = new JPanel(); JPanel panel = new JPanel();
@ -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; data.AbstractClassJob; import com.fr.design.dialog.DialogActionAdapter; data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.stable.StringUtils; data.AbstractClassJob; import com.fr.design.formula.JavaEditorPane; data.AbstractClassJob; import com.fr.design.gui.ibutton.UIButton; import java.awt.*; data.AbstractClassJob; import com.fr.design.gui.itextfield.UITextField; import java.awt.event.ActionListener; 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("Select")); 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("Edit")); editButton.setPreferredSize(new Dimension( browserButton.getPreferredSize().width, classNameTextField.getPreferredSize().height)); data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; import com.fr.design.formula.JavaEditorPane; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; 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 public void actionPerformed(ActionEvent e) { dlg.doOK(); } }); dlg.setVisible(true); } }); data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; reportletNamePane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("ClassName"), null)); this.add(reportletNamePane, BorderLayout.NORTH); data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; objectProperiesPane = new ObjectProperiesPane(); objectProperiesPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Property"), null)); this.add(objectProperiesPane, BorderLayout.CENTER); data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; UITextArea area = new UITextArea(2, 1); area.setText(Inter.getLocText(new String[]{"Come_True", "Interface"}) + ":com.fr.data.SubmitJob"); JPanel dsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); dsPane.add(area); dsPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Description"), null)); this.add(dsPane, BorderLayout.SOUTH); checkAddButtonEnable(); } data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; public int getLengthOfTextField() { import com.fr.design.layout.FRGUIPaneFactory; data.AbstractClassJob; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; protected String title4PopupWindow() { return "CustomJob"; } data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; protected Component getWindowAncestor() { return this; } data.AbstractClassJob; import com.fr.design.gui.frpane.ObjectProperiesPane; @Override public void populateBean(Object ob) { if (ob instanceof AbstractClassJob) { AbstractClassJob cj = (AbstractClassJob) ob; data.AbstractClassJob; 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.gui.frpane.ObjectProperiesPane; 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; import com.fr.design.dialog.BasicDialog; import com.fr.design.gui.itextfield.UITextField; Empty(classNameTextField.getText())); } /** * 重置 */ public void reset() { this.classNameTextField.setText(null); this.checkAddButtonEnable(); } } package com.fr.design.write.submit; import com.fr.data.AbstractClassJob; import com.fr.design.layout.FRGUIPaneFactory; data.AbstractClassJob; data.AbstractClassJob; data.AbstractClassJob; import com.fr.design.dialog.DialogActionAdapter; data.AbstractClassJob; data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; data.AbstractClassJob; import com.fr.stable.StringUtils; data.AbstractClassJob; data.AbstractClassJob; import com.fr.design.formula.JavaEditorPane; data.AbstractClassJob; data.AbstractClassJob; data.AbstractClassJob; import com.fr.design.gui.ibutton.UIButton; data.AbstractClassJob; import java.awt.*; data.AbstractClassJob; data.AbstractClassJob; import com.fr.design.gui.itextfield.UITextField; data.AbstractClassJob; import java.awt.event.ActionListener; 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; */ 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("Select")); data.AbstractClassJob; browserButton.setPreferredSize(new Dimension( data.AbstractClassJob; browserButton.getPreferredSize().width, data.AbstractClassJob; classNameTextField.getPreferredSize().height)); data.AbstractClassJob; */ data.AbstractClassJob; UIButton editButton = new UIButton(Inter.getLocText("Edit")); data.AbstractClassJob; editButton.setPreferredSize(new Dimension( data.AbstractClassJob; browserButton.getPreferredSize().width, data.AbstractClassJob; classNameTextField.getPreferredSize().height)); data.AbstractClassJob; reportletNamePane.add(browserButton); data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.formula.JavaEditorPane; 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()); 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; @Override data.AbstractClassJob; public void actionPerformed(ActionEvent e) { data.AbstractClassJob; dlg.doOK(); data.AbstractClassJob; } data.AbstractClassJob; }); data.AbstractClassJob; dlg.setVisible(true); checkAddButtonEnable(); data.AbstractClassJob; } data.AbstractClassJob; }); data.AbstractClassJob; reportletNamePane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("ClassName"), null)); data.AbstractClassJob; this.add(reportletNamePane, BorderLayout.NORTH); data.AbstractClassJob; objectProperiesPane = new ObjectProperiesPane(); data.AbstractClassJob; objectProperiesPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Property"), null)); data.AbstractClassJob; this.add(objectProperiesPane, BorderLayout.CENTER); data.AbstractClassJob; UITextArea area = new UITextArea(2, 1); data.AbstractClassJob; area.setText(Inter.getLocText(new String[]{"Come_True", "Interface"}) + ":com.fr.data.SubmitJob"); data.AbstractClassJob; JPanel dsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); data.AbstractClassJob; dsPane.add(area); data.AbstractClassJob; dsPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Description"), null)); data.AbstractClassJob; this.add(dsPane, BorderLayout.SOUTH); data.AbstractClassJob; checkAddButtonEnable(); data.AbstractClassJob; } data.AbstractClassJob; public int getLengthOfTextField() { data.AbstractClassJob; */ data.AbstractClassJob; import com.fr.design.layout.FRGUIPaneFactory; data.AbstractClassJob; data.AbstractClassJob; protected String title4PopupWindow() { data.AbstractClassJob; return "CustomJob"; data.AbstractClassJob; protected Component getWindowAncestor() { data.AbstractClassJob; return this; data.AbstractClassJob; @Override data.AbstractClassJob; public void populateBean(Object ob) { data.AbstractClassJob; if (ob instanceof AbstractClassJob) { data.AbstractClassJob; AbstractClassJob cj = (AbstractClassJob) ob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; data.AbstractClassJob; if (ob instanceof AbstractClassJob) { import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; data.AbstractClassJob; if (ob instanceof AbstractClassJob) { import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.beans.BasicBeanPane; return this; data.AbstractClassJob; if (ob instanceof AbstractClassJob) { data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.formula.JavaEditorPane; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.gui.frpane.ObjectProperiesPane; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.gui.itextarea.UITextArea; AbstractClassJob cj = (AbstractClassJob) ob; this.classNameTextField.setText(cj.getClassName()); import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.dialog.BasicDialog; checkAddButtonEnable(); } import java.awt.event.ActionListener; import com.fr.design.gui.itextfield.UITextField; /** * 添加按钮可用 */ public void checkAddButtonEnable() { objectProperiesPane.enableAddButton(StringUtils.isNotEmpty(classNameTextField.getText())); } /** * 重置 */ public void reset() { this.classNameTextField.setText(null); this.checkAddButtonEnable(); } }

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

@ -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");

14
designer_base/src/com/fr/start/BaseDesigner.java

@ -11,6 +11,7 @@ import com.fr.design.extra.WebDialog;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.MutilTempalteTabPane; import com.fr.design.file.MutilTempalteTabPane;
import com.fr.design.file.TemplateTreePane; import com.fr.design.file.TemplateTreePane;
import com.fr.design.fun.DesignerStartOpenFileProcessor;
import com.fr.design.fun.GlobalListenerProvider; import com.fr.design.fun.GlobalListenerProvider;
import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.mainframe.TemplatePane; import com.fr.design.mainframe.TemplatePane;
@ -123,7 +124,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
String[] plugins = PluginCollector.getCollector().getErrorPlugins(); String[] plugins = PluginCollector.getCollector().getErrorPlugins();
if (ArrayUtils.isNotEmpty(plugins)) { if (ArrayUtils.isNotEmpty(plugins)) {
String text = StableUtils.join(plugins, ",") + Inter.getLocText("FR-Designer_Plugin_Should_Update"); String text = StableUtils.join(plugins, ",") + ": " + Inter.getLocText("FR-Designer_Plugin_Should_Update_Please_Contact_Developer");
int r = JOptionPane.showConfirmDialog(null, text, Inter.getLocText("FR-Designer_Plugin_Should_Update_Title"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); int r = JOptionPane.showConfirmDialog(null, text, Inter.getLocText("FR-Designer_Plugin_Should_Update_Title"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
if (r == JOptionPane.OK_OPTION) { if (r == JOptionPane.OK_OPTION) {
WebDialog.createPluginDialog(); WebDialog.createPluginDialog();
@ -224,6 +225,17 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
file = FILEFactory.createFILE(FILEFactory.ENV_PREFIX file = FILEFactory.createFILE(FILEFactory.ENV_PREFIX
+ DesignerEnvManager.getEnvManager().getLastOpenFile()); + DesignerEnvManager.getEnvManager().getLastOpenFile());
} }
//启动时打开指定文件的接口
DesignerStartOpenFileProcessor processor = ExtraDesignClassManager.getInstance().getSingle(DesignerStartOpenFileProcessor.XML_TAG);
if (processor != null) {
FILE f = processor.fileToShow();
if (f != null) {
file = f;//避免null
} else {
isException = true;//此时有文件nullpointer异常,执行打开空文件
}
}
if (file.exists() && !isException) { if (file.exists() && !isException) {
df.openTemplate(file); df.openTemplate(file);
} else { } else {

12
designer_chart/src/com/fr/design/mainframe/chart/gui/ColorSelectPaneWithOutTransparent.java

@ -19,7 +19,7 @@ public class ColorSelectPaneWithOutTransparent extends ColorSelectPane {
public void initCenterPaneChildren(JPanel centerPane) { public void initCenterPaneChildren(JPanel centerPane) {
JPanel menuColorPane1 = new JPanel(); JPanel menuColorPane1 = new JPanel();
centerPane.add(menuColorPane1); centerPane.add(menuColorPane1);
menuColorPane1.setLayout(new GridLayout(5, 8, 5, 5)); menuColorPane1.setLayout(new GridLayout(3, 8, 5, 5));
for (int i = 0; i < ChartConstants.MAP_COLOR_ARRAY.length; i++) { for (int i = 0; i < ChartConstants.MAP_COLOR_ARRAY.length; i++) {
menuColorPane1.add(new ColorCell(ChartConstants.MAP_COLOR_ARRAY[i], this)); menuColorPane1.add(new ColorCell(ChartConstants.MAP_COLOR_ARRAY[i], this));
} }
@ -30,4 +30,14 @@ public class ColorSelectPaneWithOutTransparent extends ColorSelectPane {
protected Color[] getColorArray(){ protected Color[] getColorArray(){
return ChartConstants.MAP_COLOR_ARRAY; return ChartConstants.MAP_COLOR_ARRAY;
} }
protected JPanel getMenuColorPane() {
JPanel menuColorPane = new JPanel();
menuColorPane.setLayout(new GridLayout(0, 8, 1, 1));
menuColorPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8));
menuColorPane.setPreferredSize(new Dimension(205, 62));
return menuColorPane;
}
} }

32
designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveCustomAction.java

@ -0,0 +1,32 @@
package com.fr.design.designer.creator.cardlayout;
import com.fr.base.BaseUtils;
import com.fr.design.designer.beans.actions.FormUndoableAction;
import com.fr.design.mainframe.FormDesigner;
/**
* Created by zhouping on 2017/2/9.
*/
public class TabMoveCustomAction extends FormUndoableAction {
private XCardSwitchButton xCardSwitchButton;
public TabMoveCustomAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) {
super(t);
this.setName("");
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png"));
this.xCardSwitchButton = xCardSwitchButton;
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
return false;
}
public XCardSwitchButton getxCardSwitchButton() {
return xCardSwitchButton;
}
public void setxCardSwitchButton(XCardSwitchButton xCardSwitchButton) {
this.xCardSwitchButton = xCardSwitchButton;
}
}

66
designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java

@ -0,0 +1,66 @@
package com.fr.design.designer.creator.cardlayout;
import com.fr.base.BaseUtils;
import com.fr.design.designer.beans.actions.FormUndoableAction;
import com.fr.design.mainframe.FormDesigner;
import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
/**
* Created by zhouping on 2017/2/9.
*/
public class TabMoveEndAction extends FormUndoableAction {
private XCardSwitchButton xCardSwitchButton;
public TabMoveEndAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) {
super(t);
this.setName(Inter.getLocText("FR-Designer-Move_Tab_End"));
this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/control/rightright.png"));
this.xCardSwitchButton = xCardSwitchButton;
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
XWCardTagLayout xwCardTagLayout = xCardSwitchButton.getTagLayout();
XWCardLayout xwCardLayout = xCardSwitchButton.getCardLayout();
CardSwitchButton currentButton = (CardSwitchButton) xCardSwitchButton.toData();
try {
int currentIndex = currentButton.getIndex();
int maxIndex = xwCardTagLayout.getComponentCount();
XWTabFitLayout xCurrentTab = (XWTabFitLayout) xwCardLayout.getXCreator(currentIndex);
WTabFitLayout currentTab = (WTabFitLayout) xCurrentTab.toData();
xwCardTagLayout.setSwitchingTab(true);
//修改当前tab往后所有tab的索引号
for (int i = currentIndex + 1; i < maxIndex; i++) {
CardSwitchButton tempBtn = (CardSwitchButton) xwCardTagLayout.getXCreator(i).toData();
tempBtn.setIndex(i - 1);
WTabFitLayout tempTab = (WTabFitLayout) xwCardLayout.getXCreator(i).toData();
tempTab.setIndex(i - 1);
tempTab.setTabNameIndex(i - 1);
}
xwCardTagLayout.remove(xCardSwitchButton);
xwCardTagLayout.add(xCardSwitchButton);
xwCardLayout.remove(xCurrentTab);
xwCardLayout.add(xCurrentTab);
currentButton.setIndex(maxIndex - 1);
currentTab.setIndex(maxIndex - 1);
currentTab.setTabNameIndex(maxIndex - 1);
xwCardTagLayout.setSwitchingTab(false);
}catch (Exception e){
xwCardTagLayout.setSwitchingTab(false);
FRLogger.getLogger().error(e.getMessage());
return false;
}
return true;
}
public XCardSwitchButton getxCardSwitchButton() {
return xCardSwitchButton;
}
public void setxCardSwitchButton(XCardSwitchButton xCardSwitchButton) {
this.xCardSwitchButton = xCardSwitchButton;
}
}

65
designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java

@ -0,0 +1,65 @@
package com.fr.design.designer.creator.cardlayout;
import com.fr.base.BaseUtils;
import com.fr.design.designer.beans.actions.FormUndoableAction;
import com.fr.design.mainframe.FormDesigner;
import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
/**
* Created by zhouping on 2017/2/9.
*/
public class TabMoveFirstAction extends FormUndoableAction {
private XCardSwitchButton xCardSwitchButton;
public TabMoveFirstAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) {
super(t);
this.setName(Inter.getLocText("FR-Designer-Move_Tab_First"));
this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/control/leftleft.png"));
this.xCardSwitchButton = xCardSwitchButton;
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
XWCardTagLayout xwCardTagLayout = xCardSwitchButton.getTagLayout();
XWCardLayout xwCardLayout = xCardSwitchButton.getCardLayout();
CardSwitchButton currentButton = (CardSwitchButton) xCardSwitchButton.toData();
try {
int currentIndex = currentButton.getIndex();
XWTabFitLayout xCurrentTab = (XWTabFitLayout) xwCardLayout.getXCreator(currentIndex);
WTabFitLayout currentTab = (WTabFitLayout) xCurrentTab.toData();
xwCardTagLayout.setSwitchingTab(true);
//修改当前tab往前所有tab的索引号
for (int i = currentIndex - 1; i >= 0; i--) {
CardSwitchButton tempBtn = (CardSwitchButton) xwCardTagLayout.getXCreator(i).toData();
tempBtn.setIndex(i + 1);
WTabFitLayout tempTab = (WTabFitLayout) xwCardLayout.getXCreator(i).toData();
tempTab.setIndex(i + 1);
tempTab.setTabNameIndex(i + 1);
}
xwCardTagLayout.remove(xCardSwitchButton);
xwCardTagLayout.add(xCardSwitchButton, 0);
xwCardLayout.remove(xCurrentTab);
xwCardLayout.add(xCurrentTab, 0);
currentButton.setIndex(0);
currentTab.setIndex(0);
currentTab.setTabNameIndex(0);
xwCardTagLayout.setSwitchingTab(false);
}catch (Exception e){
xwCardTagLayout.setSwitchingTab(false);
FRLogger.getLogger().error(e.getMessage());
return false;
}
return true;
}
public XCardSwitchButton getxCardSwitchButton() {
return xCardSwitchButton;
}
public void setxCardSwitchButton(XCardSwitchButton xCardSwitchButton) {
this.xCardSwitchButton = xCardSwitchButton;
}
}

64
designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java

@ -0,0 +1,64 @@
package com.fr.design.designer.creator.cardlayout;
import com.fr.base.BaseUtils;
import com.fr.design.designer.beans.actions.FormUndoableAction;
import com.fr.design.mainframe.FormDesigner;
import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
/**
* Created by zhouping on 2017/2/9.
*/
public class TabMoveNextAction extends FormUndoableAction {
private XCardSwitchButton xCardSwitchButton;
public TabMoveNextAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) {
super(t);
this.setName(Inter.getLocText("FR-Designer-Move_Tab_Next"));
this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/control/right.png"));
this.xCardSwitchButton = xCardSwitchButton;
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
XWCardTagLayout xwCardTagLayout = xCardSwitchButton.getTagLayout();
XWCardLayout xwCardLayout = xCardSwitchButton.getCardLayout();
CardSwitchButton currentButton = (CardSwitchButton) xCardSwitchButton.toData();
try {
int currentIndex = currentButton.getIndex();
XWTabFitLayout xCurrentTab = (XWTabFitLayout) xwCardLayout.getXCreator(currentIndex);
WTabFitLayout currentTab = (WTabFitLayout) xCurrentTab.toData();
xwCardTagLayout.setSwitchingTab(true);
//修改下一个tab的索引号
CardSwitchButton nextBtn = (CardSwitchButton) xwCardTagLayout.getXCreator(currentIndex + 1).toData();
nextBtn.setIndex(currentIndex);
WTabFitLayout nextTab = (WTabFitLayout) xwCardLayout.getXCreator(currentIndex + 1).toData();
nextTab.setIndex(currentIndex);
nextTab.setTabNameIndex(currentIndex);
xwCardTagLayout.remove(xCardSwitchButton);
xwCardTagLayout.add(xCardSwitchButton, currentIndex + 1);
xwCardLayout.remove(xCurrentTab);
xwCardLayout.add(xCurrentTab, currentIndex + 1);
currentButton.setIndex(currentIndex + 1);
currentTab.setIndex(currentIndex + 1);
currentTab.setTabNameIndex(currentIndex + 1);
xwCardTagLayout.setSwitchingTab(false);
}catch (Exception e){
xwCardTagLayout.setSwitchingTab(false);
FRLogger.getLogger().error(e.getMessage());
return false;
}
return true;
}
public XCardSwitchButton getxCardSwitchButton() {
return xCardSwitchButton;
}
public void setxCardSwitchButton(XCardSwitchButton xCardSwitchButton) {
this.xCardSwitchButton = xCardSwitchButton;
}
}

64
designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java

@ -0,0 +1,64 @@
package com.fr.design.designer.creator.cardlayout;
import com.fr.base.BaseUtils;
import com.fr.design.designer.beans.actions.FormUndoableAction;
import com.fr.design.mainframe.FormDesigner;
import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
/**
* Created by zhouping on 2017/2/9.
*/
public class TabMovePrevAction extends FormUndoableAction {
private XCardSwitchButton xCardSwitchButton;
public TabMovePrevAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) {
super(t);
this.setName(Inter.getLocText("FR-Designer-Move_Tab_Prev"));
this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/control/left.png"));
this.xCardSwitchButton = xCardSwitchButton;
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
XWCardTagLayout xwCardTagLayout = xCardSwitchButton.getTagLayout();
XWCardLayout xwCardLayout = xCardSwitchButton.getCardLayout();
CardSwitchButton currentButton = (CardSwitchButton) xCardSwitchButton.toData();
try {
int currentIndex = currentButton.getIndex();
XWTabFitLayout xCurrentTab = (XWTabFitLayout) xwCardLayout.getXCreator(currentIndex);
WTabFitLayout currentTab = (WTabFitLayout) xCurrentTab.toData();
xwCardTagLayout.setSwitchingTab(true);
//修改上一个tab的索引号
CardSwitchButton prevBtn = (CardSwitchButton) xwCardTagLayout.getXCreator(currentIndex - 1).toData();
prevBtn.setIndex(currentIndex);
WTabFitLayout prevTab = (WTabFitLayout) xwCardLayout.getXCreator(currentIndex - 1).toData();
prevTab.setIndex(currentIndex);
prevTab.setTabNameIndex(currentIndex);
xwCardTagLayout.remove(xCardSwitchButton);
xwCardTagLayout.add(xCardSwitchButton, currentIndex - 1);
xwCardLayout.remove(xCurrentTab);
xwCardLayout.add(xCurrentTab, currentIndex - 1);
currentButton.setIndex(currentIndex - 1);
currentTab.setIndex(currentIndex - 1);
currentTab.setTabNameIndex(currentIndex - 1);
xwCardTagLayout.setSwitchingTab(false);
}catch (Exception e){
xwCardTagLayout.setSwitchingTab(false);
FRLogger.getLogger().error(e.getMessage());
return false;
}
return true;
}
public XCardSwitchButton getxCardSwitchButton() {
return xCardSwitchButton;
}
public void setxCardSwitchButton(XCardSwitchButton xCardSwitchButton) {
this.xCardSwitchButton = xCardSwitchButton;
}
}

8
designer_form/src/com/fr/design/designer/creator/cardlayout/XCardAddButton.java

@ -89,12 +89,12 @@ public class XCardAddButton extends XButton{
// addbutton对应的XWCardLayout和XWCardTagLayout暂未存入到xml中,重新打开之后先根据父子层获取 // addbutton对应的XWCardLayout和XWCardTagLayout暂未存入到xml中,重新打开之后先根据父子层获取
if(cardLayout == null && tagLayout ==null ){ if(cardLayout == null && tagLayout ==null ){
initRalateLayout(); initRelateLayout();
} }
int index = cardLayout.toData().getWidgetCount(); int index = cardLayout.toData().getWidgetCount();
//添加新的tab,并将原来的设为未选中状态 //添加新的tab,并将原来的设为未选中状态
setTabUnselectd(); setTabUnselected();
addTab(index); addTab(index);
this.tagLayout.adjustComponentWidth(); this.tagLayout.adjustComponentWidth();
@ -110,7 +110,7 @@ public class XCardAddButton extends XButton{
LayoutUtils.layoutRootContainer(designer.getRootComponent()); LayoutUtils.layoutRootContainer(designer.getRootComponent());
} }
private void initRalateLayout(){ private void initRelateLayout(){
XWCardTitleLayout titleLayout = (XWCardTitleLayout)this.getBackupParent(); XWCardTitleLayout titleLayout = (XWCardTitleLayout)this.getBackupParent();
this.tagLayout = titleLayout.getTagPart(); this.tagLayout = titleLayout.getTagPart();
@ -129,7 +129,7 @@ public class XCardAddButton extends XButton{
} }
//将原来的tab页设置为未选中状态 //将原来的tab页设置为未选中状态
private void setTabUnselectd(){ private void setTabUnselected(){
for(int i=0;i<this.tagLayout.getComponentCount();i++){ for(int i=0;i<this.tagLayout.getComponentCount();i++){
WCardTagLayout layout = (WCardTagLayout) this.tagLayout.toData(); WCardTagLayout layout = (WCardTagLayout) this.tagLayout.toData();
CardSwitchButton button = layout.getSwitchButton(i); CardSwitchButton button = layout.getSwitchButton(i);

116
designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java

@ -3,15 +3,9 @@
*/ */
package com.fr.design.designer.creator.cardlayout; package com.fr.design.designer.creator.cardlayout;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.geom.Rectangle2D;
import java.util.*;
import javax.swing.*;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution;
import com.fr.base.background.ColorBackground; import com.fr.base.background.ColorBackground;
import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.ComponentAdapter; import com.fr.design.designer.beans.ComponentAdapter;
@ -24,6 +18,7 @@ import com.fr.design.mainframe.EditingMouseListener;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormHierarchyTreePane; import com.fr.design.mainframe.FormHierarchyTreePane;
import com.fr.design.mainframe.JForm; import com.fr.design.mainframe.JForm;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.LayoutBorderStyle;
@ -33,6 +28,13 @@ import com.fr.general.Background;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.geom.Rectangle2D;
import java.util.HashMap;
import java.util.Map;
/** /**
* *
* *
@ -41,11 +43,12 @@ import com.fr.general.Inter;
public class XCardSwitchButton extends XButton { public class XCardSwitchButton extends XButton {
private static final int LEFT_GAP = 16; private static final int LEFT_GAP = 16;
private static Icon MOUSE_COLSE = BaseUtils.readIcon("/com/fr/design/images/buttonicon/close_icon.png"); private static Icon MOUSE_CLOSE = BaseUtils.readIcon("/com/fr/design/images/buttonicon/close_icon.png");
//设置的图片类型 //设置的图片类型
private static final String COLORBACKGROUNDTYPE = "ColorBackground"; private static final String COLOR_BACKGROUND_TYPE = "ColorBackground";
private static final String DEFAULTTYPE = "default"; private static final String DEFAULT_TYPE = "default";
private static final String DEFAULT_FONT_NAME = "SimSun";
//默认颜色 //默认颜色
public static final Color NORMAL_GRAL = new Color(236,236,236); public static final Color NORMAL_GRAL = new Color(236,236,236);
@ -64,15 +67,16 @@ public class XCardSwitchButton extends XButton {
private static final int FONT_SIZE_ADJUST = 2; private static final int FONT_SIZE_ADJUST = 2;
private static final int SIDE_OFFSET = 57; private static final int SIDE_OFFSET = 57;
private static final int HEIGHT_OFFSET = 25; private static final int FONT_SIZE = 9;
private XWCardLayout cardLayout; private XWCardLayout cardLayout;
private XWCardTagLayout tagLayout; private XWCardTagLayout tagLayout;
private Background selectBackground; private Background selectBackground;
private boolean isCustomStyle; private boolean isCustomStyle;
private UILabel label;
private Icon closeIcon = MOUSE_COLSE; private Icon closeIcon = MOUSE_CLOSE;
public XWCardTagLayout getTagLayout() { public XWCardTagLayout getTagLayout() {
return tagLayout; return tagLayout;
@ -106,6 +110,14 @@ public class XCardSwitchButton extends XButton {
this.selectBackground = selectBackground; this.selectBackground = selectBackground;
} }
public UILabel getLabel() {
return label;
}
public void setLabel(UILabel label) {
this.label = label;
}
public XCardSwitchButton(CardSwitchButton widget, Dimension initSize) { public XCardSwitchButton(CardSwitchButton widget, Dimension initSize) {
super(widget, initSize); super(widget, initSize);
} }
@ -133,16 +145,17 @@ public class XCardSwitchButton extends XButton {
//关闭重新打开,相关的layout未存到xml中,初始化 //关闭重新打开,相关的layout未存到xml中,初始化
if(cardLayout == null){ if(cardLayout == null){
initRalateLayout(this); initRelateLayout(this);
} }
//获取当前tab的index //获取当前tab的index
XCardSwitchButton button = this; XCardSwitchButton button = this;
CardSwitchButton currentButton = (CardSwitchButton) button.toData(); CardSwitchButton currentButton = (CardSwitchButton) button.toData();
int index = currentButton.getIndex(); int index = currentButton.getIndex();
int maxIndex = cardLayout.getComponentCount() - 1;
//点击删除图标时 //点击删除图标时
if (isSeletectedClose(e,designer)) { if (isSelectedClose(e, designer)) {
//当删除到最后一个tab时,删除整个tab布局 //当删除到最后一个tab时,删除整个tab布局
if(tagLayout.getComponentCount() <= MIN_SIZE){ if(tagLayout.getComponentCount() <= MIN_SIZE){
deleteTabLayout(selectionModel, designer); deleteTabLayout(selectionModel, designer);
@ -161,16 +174,39 @@ public class XCardSwitchButton extends XButton {
// 切换到当前tab按钮对应的tabFitLayout // 切换到当前tab按钮对应的tabFitLayout
XWTabFitLayout tabFitLayout = (XWTabFitLayout) cardLayout.getComponent(index); XWTabFitLayout tabFitLayout = (XWTabFitLayout) cardLayout.getComponent(index);
tabFitLayout.setxCardSwitchButton(this); XCardSwitchButton xCardSwitchButton = (XCardSwitchButton) this.tagLayout.getComponent(index);
tabFitLayout.setxCardSwitchButton(xCardSwitchButton);
selectionModel.setSelectedCreator(tabFitLayout); selectionModel.setSelectedCreator(tabFitLayout);
if (editingMouseListener.stopEditing()) { if (editingMouseListener.stopEditing()) {
ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this);
this); editingMouseListener.startEditing(this, adapter.getDesignerEditor(), adapter);
editingMouseListener.startEditing(this,
adapter.getDesignerEditor(), adapter);
} }
setTabsAndAdjust(); setTabsAndAdjust();
if(SwingUtilities.isRightMouseButton(e)){
showPopupMenu(editingMouseListener, e, index, maxIndex);
}
}
private void showPopupMenu(EditingMouseListener editingMouseListener, MouseEvent e, int index, int maxIndex) {
JPopupMenu jPopupMenu = new JPopupMenu();
Action first = new TabMoveFirstAction(editingMouseListener.getDesigner(), this);
Action prev = new TabMovePrevAction(editingMouseListener.getDesigner(), this);
Action next = new TabMoveNextAction(editingMouseListener.getDesigner(), this);
Action end = new TabMoveEndAction(editingMouseListener.getDesigner(), this);
if (index == 0){
first.setEnabled(false);
prev.setEnabled(false);
}
if (index == maxIndex){
next.setEnabled(false);
end.setEnabled(false);
}
jPopupMenu.add(first);
jPopupMenu.add(prev);
jPopupMenu.add(next);
jPopupMenu.add(end);
GUICoreUtils.showPopupMenu(jPopupMenu, editingMouseListener.getDesigner(), e.getX(), e.getY());
} }
//删除card,同时修改其他switchbutton和tabfit的index //删除card,同时修改其他switchbutton和tabfit的index
@ -204,7 +240,7 @@ public class XCardSwitchButton extends XButton {
//SwitchButton对应的XWCardLayout和XWCardTagLayout暂未存到xml中,重新打开时根据父子层关系获取 //SwitchButton对应的XWCardLayout和XWCardTagLayout暂未存到xml中,重新打开时根据父子层关系获取
private void initRalateLayout(XCardSwitchButton button){ private void initRelateLayout(XCardSwitchButton button){
this.tagLayout = (XWCardTagLayout)this.getBackupParent(); this.tagLayout = (XWCardTagLayout)this.getBackupParent();
XWCardTitleLayout titleLayout = (XWCardTitleLayout) this.tagLayout.getBackupParent(); XWCardTitleLayout titleLayout = (XWCardTitleLayout) this.tagLayout.getBackupParent();
XWCardMainBorderLayout borderLayout = (XWCardMainBorderLayout)titleLayout.getBackupParent(); XWCardMainBorderLayout borderLayout = (XWCardMainBorderLayout)titleLayout.getBackupParent();
@ -212,7 +248,7 @@ public class XCardSwitchButton extends XButton {
} }
//是否进入点击关闭按钮区域 //是否进入点击关闭按钮区域
private boolean isSeletectedClose(MouseEvent e,FormDesigner designer){ private boolean isSelectedClose(MouseEvent e, FormDesigner designer){
int diff = designer.getArea().getHorScrollBar().getValue(); int diff = designer.getArea().getHorScrollBar().getValue();
@ -242,6 +278,8 @@ public class XCardSwitchButton extends XButton {
int width = button.getWidth(); int width = button.getWidth();
int height = button.getHeight(); int height = button.getHeight();
ey = ey % DEFAULT_BUTTON_HEIGHT;
// 鼠标进入按钮右侧删除图标区域 // 鼠标进入按钮右侧删除图标区域
double recX = position.getX() + (width - RIGHT_OFFSET); double recX = position.getX() + (width - RIGHT_OFFSET);
double recY = position.getY() + (height - TOP_OFFSET); double recY = position.getY() + (height - TOP_OFFSET);
@ -262,7 +300,7 @@ public class XCardSwitchButton extends XButton {
super.paintComponent(g); super.paintComponent(g);
setTabsAndAdjust(); setTabsAndAdjust();
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
drawBackgorund(); drawBackground();
drawTitle(); drawTitle();
Dimension panelSize = this.getContentLabel().getSize(); Dimension panelSize = this.getContentLabel().getSize();
this.getContentBackground().paint(g, new Rectangle2D.Double(0, 0, panelSize.getWidth(), panelSize.getHeight())); this.getContentBackground().paint(g, new Rectangle2D.Double(0, 0, panelSize.getWidth(), panelSize.getHeight()));
@ -275,13 +313,13 @@ public class XCardSwitchButton extends XButton {
} }
//画背景 //画背景
private void drawBackgorund(){ private void drawBackground(){
CardSwitchButton button = (CardSwitchButton)this.toData(); CardSwitchButton button = (CardSwitchButton)this.toData();
Background currentBackground; Background currentBackground;
currentBackground = this.getSelectBackground(); currentBackground = this.getSelectBackground();
//这边就是button的背景图片,图片的是image,默认的是color,所以不应该是针对null的判断 //这边就是button的背景图片,图片的是image,默认的是color,所以不应该是针对null的判断
String type = currentBackground != null? currentBackground.getBackgroundType() : DEFAULTTYPE; String type = currentBackground != null? currentBackground.getBackgroundType() : DEFAULT_TYPE;
if (type.equals(COLORBACKGROUNDTYPE) || type.equals(DEFAULTTYPE)) { if (type.equals(COLOR_BACKGROUND_TYPE) || type.equals(DEFAULT_TYPE)) {
ColorBackground background; ColorBackground background;
if(button.isShowButton()){ if(button.isShowButton()){
this.rebuid(); this.rebuid();
@ -300,14 +338,17 @@ public class XCardSwitchButton extends XButton {
CardSwitchButton button = (CardSwitchButton) this.toData(); CardSwitchButton button = (CardSwitchButton) this.toData();
this.setButtonText(button.getText()); this.setButtonText(button.getText());
if (this.cardLayout == null) { if (this.cardLayout == null) {
initRalateLayout(this); initRelateLayout(this);
} }
LayoutBorderStyle style = this.cardLayout.toData().getBorderStyle(); LayoutBorderStyle style = this.cardLayout.toData().getBorderStyle();
// 标题部分 // 标题部分
WidgetTitle title = style.getTitle(); WidgetTitle title = style.getTitle();
FRFont font = title.getFrFont(); FRFont font = button.getFont();
if (font == null) {
font = FRFont.getInstance(DEFAULT_FONT_NAME, 0, FONT_SIZE);
}
FRFont newFont = FRFont.getInstance(font.getName(),font.getStyle(),font.getSize() + FONT_SIZE_ADJUST); FRFont newFont = FRFont.getInstance(font.getName(),font.getStyle(),font.getSize() + FONT_SIZE_ADJUST);
UILabel label = this.getContentLabel(); UILabel label = this.getContentLabel();
label.setFont(newFont); label.setFont(newFont);
@ -327,6 +368,12 @@ public class XCardSwitchButton extends XButton {
//删除tab布局 //删除tab布局
private void deleteTabLayout(SelectionModel selectionModel,FormDesigner designer){ private void deleteTabLayout(SelectionModel selectionModel,FormDesigner designer){
String titleName = this.getContentLabel().getText();
int value = JOptionPane.showConfirmDialog(null, Inter.getLocText("FR-Designer_ConfirmDialog_Content") + "“" + titleName + "”",
Inter.getLocText("FR-Designer_ConfirmDialog_Title"),JOptionPane.YES_NO_OPTION);
if (value != JOptionPane.OK_OPTION) {
return;
}
XLayoutContainer mainLayout = this.cardLayout.getBackupParent(); XLayoutContainer mainLayout = this.cardLayout.getBackupParent();
if(mainLayout != null){ if(mainLayout != null){
selectionModel.setSelectedCreator(mainLayout); selectionModel.setSelectedCreator(mainLayout);
@ -353,7 +400,7 @@ public class XCardSwitchButton extends XButton {
XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i); XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i);
CardSwitchButton tempCard = (CardSwitchButton) temp.toData(); CardSwitchButton tempCard = (CardSwitchButton) temp.toData();
String tempText = tempCard.getText(); String tempText = tempCard.getText();
Font f = ((CardSwitchButton)this.toData()).getFont(); Font f = tempCard.getFont();
FontMetrics fm = GraphHelper.getFontMetrics(f); FontMetrics fm = GraphHelper.getFontMetrics(f);
cardWidth.put(i,fm.stringWidth(tempText)); cardWidth.put(i,fm.stringWidth(tempText));
cardHeight.put(i,fm.getHeight()); cardHeight.put(i,fm.getHeight());
@ -378,8 +425,15 @@ public class XCardSwitchButton extends XButton {
Dimension dimension = new Dimension(); Dimension dimension = new Dimension();
dimension.setSize(cardWidth, cardHeight); dimension.setSize(cardWidth, cardHeight);
XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i); XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i);
CardSwitchButton cardSwitchButton = (CardSwitchButton) temp.toData();
FRFont frFont = cardSwitchButton.getFont();
if (frFont == null) {
frFont = FRFont.getInstance(DEFAULT_FONT_NAME, 0, FONT_SIZE);
}
UILabel label = temp.getContentLabel(); UILabel label = temp.getContentLabel();
label.setSize(dimension); label.setSize(dimension);
label.setFont(frFont.applyResolutionNP(ScreenResolution.getScreenResolution()));
label.setForeground(frFont.getForeground());
temp.setContentLabel(label); temp.setContentLabel(label);
temp.setSize(dimension); temp.setSize(dimension);
temp.setPreferredSize(new Dimension(cardWidth, cardHeight)); temp.setPreferredSize(new Dimension(cardWidth, cardHeight));
@ -391,4 +445,10 @@ public class XCardSwitchButton extends XButton {
super.doLayout(); super.doLayout();
setTabsAndAdjust(); setTabsAndAdjust();
} }
@Override
protected void initXCreatorProperties() {
super.initXCreatorProperties();
label = this.getContentLabel();
}
} }

29
designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java

@ -255,7 +255,12 @@ public class XWCardLayout extends XLayoutContainer {
creator.setDirections(null); creator.setDirections(null);
WCardLayout layout = this.toData(); WCardLayout layout = this.toData();
Widget w = creator.toData(); Widget w = creator.toData();
layout.addWidget(w);
for (int i = 0, count = this.getComponentCount(); i < count; i++) {
if (creator == this.getComponent(i)) {
layout.addWidget(w, i);
}
}
} }
@Override @Override
@ -271,15 +276,28 @@ public class XWCardLayout extends XLayoutContainer {
return true; return true;
} }
/** /**
* 得到属性名 * 得到属性名
* @return 属性名 * @return 属性名
* @throws IntrospectionException * @throws IntrospectionException
*/ */
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
//嵌套的tab组件,内层的不支持轮播属性,屏蔽属性表
if(!isNested()) {
CRPropertyDescriptor[] crp = ((WCardLayout) data).isCarousel() ? getisCarousel() : getisnotCarousel(); CRPropertyDescriptor[] crp = ((WCardLayout) data).isCarousel() ? getisCarousel() : getisnotCarousel();
return ArrayUtils.addAll(getDefaultDescriptor(), crp); return ArrayUtils.addAll(getDefaultDescriptor(), crp);
}else{
return getDefaultDescriptor();
}
}
/**
* 判断当前tab组件是不是嵌套的
* @return 嵌套与否
*/
private boolean isNested(){
XLayoutContainer xLayoutContainer = this.getBackupParent().getBackupParent();
return xLayoutContainer != null && xLayoutContainer.acceptType(XWTabFitLayout.class);
} }
public CRPropertyDescriptor[] getisCarousel() throws IntrospectionException { public CRPropertyDescriptor[] getisCarousel() throws IntrospectionException {
@ -326,7 +344,7 @@ public class XWCardLayout extends XLayoutContainer {
@Override @Override
public void propertyChange(){ public void propertyChange(){
WCardLayout cardLayout = toData(); WCardLayout cardLayout = toData();
changeRalateSwitchCardname(cardLayout.getWidgetName()); changeRelateSwitchCardName(cardLayout.getWidgetName());
} }
}), }),
new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass(
@ -376,8 +394,8 @@ public class XWCardLayout extends XLayoutContainer {
} }
} }
//修改相关SwtchButton所绑定的cardLayout控件名 //修改相关SwitchButton所绑定的cardLayout控件名
private void changeRalateSwitchCardname(String cardLayoutName) { private void changeRelateSwitchCardName(String cardLayoutName) {
XWCardMainBorderLayout borderLayout = (XWCardMainBorderLayout) this.getBackupParent(); XWCardMainBorderLayout borderLayout = (XWCardMainBorderLayout) this.getBackupParent();
WCardMainBorderLayout border = borderLayout.toData(); WCardMainBorderLayout border = borderLayout.toData();
WCardTitleLayout titleLayout = border.getTitlePart(); WCardTitleLayout titleLayout = border.getTitlePart();
@ -400,7 +418,6 @@ public class XWCardLayout extends XLayoutContainer {
SelectionModel selectionModel = designer.getSelectionModel(); SelectionModel selectionModel = designer.getSelectionModel();
selectionModel.setSelectedCreator(mainLayout); selectionModel.setSelectedCreator(mainLayout);
selectionModel.deleteSelection(); selectionModel.deleteSelection();
return;
} }
@Override @Override
public void setBorder(Border border) { public void setBorder(Border border) {

14
designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java

@ -35,6 +35,8 @@ public class XWCardTagLayout extends XWHorizontalBoxLayout {
private String tagName = "Tab"; private String tagName = "Tab";
private boolean switchingTab = false;
//增加一个tabNameIndex防止tabFitLayout重名 //增加一个tabNameIndex防止tabFitLayout重名
private int tabFitIndex = 0; private int tabFitIndex = 0;
private CardSwitchButton currentCard; private CardSwitchButton currentCard;
@ -63,6 +65,14 @@ public class XWCardTagLayout extends XWHorizontalBoxLayout {
this.tagName = tagName; this.tagName = tagName;
} }
public boolean isSwitchingTab() {
return switchingTab;
}
public void setSwitchingTab(boolean switchingTab) {
this.switchingTab = switchingTab;
}
private XWCardLayout cardLayout; private XWCardLayout cardLayout;
public XWCardTagLayout(WCardTagLayout widget, Dimension initSize){ public XWCardTagLayout(WCardTagLayout widget, Dimension initSize){
@ -90,6 +100,10 @@ public class XWCardTagLayout extends XWHorizontalBoxLayout {
public void componentAdded(ContainerEvent e) { public void componentAdded(ContainerEvent e) {
super.componentAdded(e); super.componentAdded(e);
if (isSwitchingTab()){
return;
}
if(this.cardLayout == null){ if(this.cardLayout == null){
initCardLayout(); initCardLayout();
} }

39
designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java

@ -5,6 +5,7 @@ import java.beans.IntrospectionException;
import javax.swing.border.Border; import javax.swing.border.Border;
import com.fr.base.ScreenResolution;
import com.fr.base.background.ColorBackground; import com.fr.base.background.ColorBackground;
import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRTabFitLayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRTabFitLayoutAdapter;
@ -15,6 +16,7 @@ import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormHierarchyTreePane; import com.fr.design.mainframe.FormHierarchyTreePane;
import com.fr.design.mainframe.widget.editors.ButtonTypeEditor; import com.fr.design.mainframe.widget.editors.ButtonTypeEditor;
@ -28,6 +30,7 @@ import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.form.ui.widget.BoundsWidget; import com.fr.form.ui.widget.BoundsWidget;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
@ -43,6 +46,9 @@ public class XWTabFitLayout extends XWFitLayout {
// tab布局在拖拽导致的缩放里(含间隔时),如果拖拽宽高大于组件宽高,会导致调整的时候找不到原来的组件 // tab布局在拖拽导致的缩放里(含间隔时),如果拖拽宽高大于组件宽高,会导致调整的时候找不到原来的组件
// 这里先将拖拽之前的宽高先做备份 // 这里先将拖拽之前的宽高先做备份
private static final Color NORMAL_GRAL = new Color(236,236,236); private static final Color NORMAL_GRAL = new Color(236,236,236);
private static final String DEFAULT_FONT_NAME = "SimSun";
public final static Font DEFAULTFT = new Font("Song_TypeFace",0,12);
public final static FRFont DEFAULT_FRFT = FRFont.getInstance(DEFAULT_FONT_NAME, 0, 9);
private Dimension referDim; private Dimension referDim;
private Background initialBackground; private Background initialBackground;
private Background overBackground; private Background overBackground;
@ -164,6 +170,13 @@ public class XWTabFitLayout extends XWFitLayout {
new PropertyChangeAdapter() { new PropertyChangeAdapter() {
@Override @Override
public void propertyChange() { public void propertyChange() {
font = ((WTabFitLayout) data).getFont();
CardSwitchButton cardSwitchButton = (CardSwitchButton) xCardSwitchButton.toData();
cardSwitchButton.setFont(font);
UILabel uiLabel = xCardSwitchButton.getLabel();
uiLabel.setFont(font.applyResolutionNP(ScreenResolution.getScreenResolution()));
uiLabel.setForeground(font.getForeground());
xCardSwitchButton.setLabel(uiLabel);
} }
}), }),
}; };
@ -215,21 +228,45 @@ public class XWTabFitLayout extends XWFitLayout {
private void checkButonType() { private void checkButonType() {
if (this.xCardSwitchButton == null) { if (this.xCardSwitchButton == null) {
//假如为空,默认获取第一个tab的cardBtn属性
try {
xCardSwitchButton = (XCardSwitchButton) ((XWCardMainBorderLayout) this.getTopLayout()).getTitlePart().getTagPart().getComponent(0);
}catch (Exception e){
FRLogger.getLogger().error(e.getMessage());
}
return; return;
} }
boolean isStyle = ((WTabFitLayout) data).isCustomStyle(); boolean isStyle = ((WTabFitLayout) data).isCustomStyle();
Background bg; Background bg;
bg = ColorBackground.getInstance(NORMAL_GRAL); bg = ColorBackground.getInstance(NORMAL_GRAL);
CardSwitchButton cardSwitchButton = (CardSwitchButton) this.xCardSwitchButton.toData();
if (!isStyle) { if (!isStyle) {
this.xCardSwitchButton.setCustomStyle(false); this.xCardSwitchButton.setCustomStyle(false);
this.xCardSwitchButton.setSelectBackground(bg); this.xCardSwitchButton.setSelectBackground(bg);
this.xCardSwitchButton.getLabel().setFont(DEFAULTFT);
cardSwitchButton.setInitialBackground(null);
cardSwitchButton.setClickBackground(null);
cardSwitchButton.setOverBackground(null);
cardSwitchButton.setFont(DEFAULT_FRFT);
} else { } else {
CardSwitchButton cardSwitchButton = (CardSwitchButton) this.xCardSwitchButton.toData();
Background initialBackground = cardSwitchButton.getInitialBackground(); Background initialBackground = cardSwitchButton.getInitialBackground();
bg = initialBackground == null ? bg : initialBackground; bg = initialBackground == null ? bg : initialBackground;
this.xCardSwitchButton.setSelectBackground(bg); this.xCardSwitchButton.setSelectBackground(bg);
this.xCardSwitchButton.setCustomStyle(true); this.xCardSwitchButton.setCustomStyle(true);
cardSwitchButton.setCustomStyle(true); cardSwitchButton.setCustomStyle(true);
if (font != null) {
cardSwitchButton.setFont(font);
}
if (this.initialBackground != null){
this.xCardSwitchButton.setSelectBackground(this.initialBackground);
cardSwitchButton.setInitialBackground(this.initialBackground);
}
if (this.overBackground != null){
cardSwitchButton.setOverBackground(this.overBackground);
}
if (this.clickBackground != null) {
cardSwitchButton.setClickBackground(this.clickBackground);
}
} }
} }

37
designer_form/src/com/fr/design/mainframe/EditingMouseListener.java

@ -187,6 +187,14 @@ public class EditingMouseListener extends MouseInputAdapter {
designer.selectComponents(e); designer.selectComponents(e);
} }
if (stateModel.isDragging()) { if (stateModel.isDragging()) {
mouseDraggingRelease(e);
}
}
lastPressEvent = null;
last_creator = null;
}
private void mouseDraggingRelease(MouseEvent e) {
// 当前鼠标所在的组件 // 当前鼠标所在的组件
XCreator hoveredComponent = designer.getComponentAt(e.getX(), e.getY()); XCreator hoveredComponent = designer.getComponentAt(e.getX(), e.getY());
if(designer.isWidgetsIntersect() && dragBackupBounds != null && hoveredComponent != null){ if(designer.isWidgetsIntersect() && dragBackupBounds != null && hoveredComponent != null){
@ -218,13 +226,8 @@ public class EditingMouseListener extends MouseInputAdapter {
designer.setPainter(null); designer.setPainter(null);
} }
cancelPromptWidgetForbidEnter(); cancelPromptWidgetForbidEnter();
}
} }
} }
lastPressEvent = null;
last_creator = null;
}
/** /**
* 激活上下文菜单待完善 * 激活上下文菜单待完善
@ -286,9 +289,20 @@ public class EditingMouseListener extends MouseInputAdapter {
} }
if (component.isReport()) { if (component.isReport()) {
elementCaseMouseMoved(e, component);
designer.repaint();
return;
}
processChartEditorMouseMove(component, e);
designer.repaint();
}
private void elementCaseMouseMoved(MouseEvent e, XCreator component) {
xElementCase = (XElementCase)component; xElementCase = (XElementCase)component;
UIButton button = (UIButton)xElementCase.getCoverPane().getComponent(0); UIButton button = (UIButton)xElementCase.getCoverPane().getComponent(0);
if(designer.getCursor().getType() ==Cursor.HAND_CURSOR) { if(designer.getCursor().getType() == Cursor.HAND_CURSOR) {
designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
} // component.getParent() 是报表块所在的XWTitleLayout } // component.getParent() 是报表块所在的XWTitleLayout
int minX = button.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue(); int minX = button.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue();
@ -312,14 +326,6 @@ public class EditingMouseListener extends MouseInputAdapter {
} }
xElementCase.displayCoverPane(true); xElementCase.displayCoverPane(true);
xElementCase.setDirections(Direction.TOP_BOTTOM_LEFT_RIGHT); xElementCase.setDirections(Direction.TOP_BOTTOM_LEFT_RIGHT);
designer.repaint();
return;
}
processChartEditorMouseMove(component, e);
designer.repaint();
} }
private void setCoverPaneNotDisplay(MouseEvent e, boolean isLinkedHelpDialog) { private void setCoverPaneNotDisplay(MouseEvent e, boolean isLinkedHelpDialog) {
@ -511,9 +517,6 @@ public class EditingMouseListener extends MouseInputAdapter {
* @param e 鼠标事件 * @param e 鼠标事件
*/ */
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (e.getButton() != MouseEvent.BUTTON1) {
return;
}
XCreator creator = designer.getComponentAt(e); XCreator creator = designer.getComponentAt(e);
creator = processTopLayoutMouseClick(creator); creator = processTopLayoutMouseClick(creator);

2
designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleImgBackgroundEditor.java

@ -18,10 +18,8 @@ public class AccessibleImgBackgroundEditor extends UneditableAccessibleEditor {
@Override @Override
protected void showEditorPane() { protected void showEditorPane() {
if (choosePane == null) {
choosePane = new BackgroundButtonPane(); choosePane = new BackgroundButtonPane();
choosePane.setPreferredSize(new Dimension(600, 400)); choosePane.setPreferredSize(new Dimension(600, 400));
}
BasicDialog dlg = choosePane.showWindow(SwingUtilities.getWindowAncestor(this)); BasicDialog dlg = choosePane.showWindow(SwingUtilities.getWindowAncestor(this));
dlg.addDialogActionListener(new DialogActionAdapter() { dlg.addDialogActionListener(new DialogActionAdapter() {

26
designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java

@ -1,5 +1,6 @@
package com.fr.design.parameter; package com.fr.design.parameter;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormHierarchyTreePane; import com.fr.design.mainframe.FormHierarchyTreePane;
@ -13,8 +14,7 @@ import java.awt.event.MouseEvent;
public class ParameterPropertyPane extends JPanel{ public class ParameterPropertyPane extends JPanel{
private ParameterToolBarPane toolbarPane; private ParameterToolBarPane toolbarPane;
private BasicScrollPane basicScrollPane;
// private JWorkBook workbook;
private ParaDefinitePane paraPane; private ParaDefinitePane paraPane;
public static ParameterPropertyPane THIS; public static ParameterPropertyPane THIS;
@ -43,12 +43,26 @@ public class ParameterPropertyPane extends JPanel{
public ParameterPropertyPane() { public ParameterPropertyPane() {
toolbarPane = new ParameterToolBarPane(); toolbarPane = new ParameterToolBarPane();
basicScrollPane = new BasicScrollPane() {
@Override
protected JPanel createContentPane() {
return toolbarPane;
}
initParameterListener(); @Override
public void populateBean(Object ob) {
}
@Override
protected String title4PopupWindow() {
return null;
}
};
initParameterListener();
this.setLayout(new BorderLayout(0, 6)); this.setLayout(new BorderLayout(0, 6));
this.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); this.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
this.add(toolbarPane, BorderLayout.CENTER); this.add(basicScrollPane, BorderLayout.CENTER);
} }
private void setEditor(FormDesigner editor) { private void setEditor(FormDesigner editor) {
@ -68,9 +82,9 @@ public class ParameterPropertyPane extends JPanel{
SwingUtilities.invokeLater(new Runnable() { SwingUtilities.invokeLater(new Runnable() {
@Override @Override
public void run() { public void run() {
if (paraPane.isWithQueryButton()) if (paraPane.isWithQueryButton()) {
paraPane.addingParameter2Editor(toolbarPane.getTargetParameter(parameterSelectedLabel)); paraPane.addingParameter2Editor(toolbarPane.getTargetParameter(parameterSelectedLabel));
else { } else {
paraPane.addingParameter2EditorWithQueryButton(toolbarPane.getTargetParameter(parameterSelectedLabel)); paraPane.addingParameter2EditorWithQueryButton(toolbarPane.getTargetParameter(parameterSelectedLabel));
} }
} }

4
designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

@ -11,7 +11,6 @@ import java.util.ArrayList;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.event.ChangeListener;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
@ -35,7 +34,6 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
private static final int GAP_BV = 4; private static final int GAP_BV = 4;
private static final int BUTTON_HEIGHT = 20; private static final int BUTTON_HEIGHT = 20;
private static final int WIDTH = 225; private static final int WIDTH = 225;
private static final int L_H = 18; private static final int L_H = 18;
public ParameterToolBarPane() { public ParameterToolBarPane() {
@ -133,7 +131,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
layoutContainer(parent); layoutContainer(parent);
int h= ((parameterSelectedLabellist.size() == 0) ? L_H : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height); int h= ((parameterSelectedLabellist.size() == 0) ? 0 : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height);
return new Dimension(w, h); return new Dimension(w, h);
} }

Loading…
Cancel
Save