Browse Source

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

master
fanglei 7 years ago
parent
commit
65d206d47e
  1. 2
      designer/src/com/fr/design/actions/ButtonGroupAction.java
  2. 1
      designer/src/com/fr/design/actions/cell/CellWidgetAttrAction.java
  3. 1
      designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java
  4. 207
      designer/src/com/fr/design/actions/cell/style/AlignmentAction.java
  5. 140
      designer/src/com/fr/design/actions/cell/style/ReportFontBoldAction.java
  6. 14
      designer/src/com/fr/design/actions/cell/style/ReportFontItalicAction.java
  7. 13
      designer/src/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java
  8. 1
      designer/src/com/fr/design/actions/edit/HyperlinkAction.java
  9. 1099
      designer/src/com/fr/design/dscolumn/DSColumnAdvancedPane.java
  10. 48
      designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java
  11. 10
      designer/src/com/fr/design/expand/SortExpandAttrPane.java
  12. 100
      designer/src/com/fr/design/mainframe/ElementCasePane.java
  13. 15
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  14. 9
      designer/src/com/fr/design/mainframe/JWorkBook.java
  15. 24
      designer/src/com/fr/design/mainframe/ReportFloatPane.java
  16. 4
      designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java
  17. 13
      designer/src/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java
  18. 5
      designer/src/com/fr/design/mainframe/alphafine/cell/model/AlphaCellModel.java
  19. 3
      designer/src/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java
  20. 1
      designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java
  21. 76
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  22. 7
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java
  23. BIN
      designer/src/com/fr/design/mainframe/alphafine/images/bigsearch.png
  24. BIN
      designer/src/com/fr/design/mainframe/alphafine/images/bigsearch@2x.png
  25. BIN
      designer/src/com/fr/design/mainframe/alphafine/images/smallsearch.png
  26. BIN
      designer/src/com/fr/design/mainframe/alphafine/images/smallsearch@2x.png
  27. 2
      designer/src/com/fr/design/mainframe/alphafine/preview/FilePreviewPane.java
  28. 2
      designer/src/com/fr/design/mainframe/alphafine/preview/NoResultPane.java
  29. 7
      designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java
  30. 1
      designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java
  31. 29
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java
  32. 8
      designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java
  33. 12
      designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java
  34. 36
      designer/src/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java
  35. 2
      designer/src/com/fr/design/report/UnitFieldPane.java
  36. 4
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  37. 12
      designer/src/com/fr/design/widget/ui/AbstractDataModify.java
  38. 16
      designer/src/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java
  39. 4
      designer/src/com/fr/design/widget/ui/ButtonGroupDictPane.java
  40. 15
      designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java
  41. 6
      designer/src/com/fr/design/widget/ui/ComboBoxDefinePane.java
  42. 3
      designer/src/com/fr/design/widget/ui/ComboCheckBoxDefinePane.java
  43. 30
      designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java
  44. 5
      designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java
  45. 6
      designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java
  46. 10
      designer/src/com/fr/design/widget/ui/ListEditorDefinePane.java
  47. 5
      designer/src/com/fr/design/widget/ui/MultiFileEditorPane.java
  48. 1
      designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java
  49. 2
      designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java
  50. 6
      designer/src/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java
  51. 6
      designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java
  52. 5
      designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java
  53. 4
      designer/src/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java
  54. 4
      designer/src/com/fr/design/widget/ui/btn/DefineAppendColumnRowPane.java
  55. 3
      designer/src/com/fr/design/widget/ui/btn/DefineDeleteColumnRowPane.java
  56. 325
      designer/src/com/fr/grid/Grid.java
  57. 4
      designer/src/com/fr/grid/GridHeader.java
  58. 3
      designer/src/com/fr/poly/creator/ECBlockEditor.java
  59. 201
      designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java
  60. 197
      designer/src/com/fr/start/Designer.java
  61. 172
      designer_base/src/com/fr/design/DesignerEnvManager.java
  62. 2
      designer_base/src/com/fr/design/actions/TemplateComponentAction.java
  63. 44
      designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
  64. 2
      designer_base/src/com/fr/design/actions/server/PlatformManagerAction.java
  65. 11
      designer_base/src/com/fr/design/condition/LiteConditionPane.java
  66. 9
      designer_base/src/com/fr/design/constants/UIConstants.java
  67. 55
      designer_base/src/com/fr/design/data/DesignTableDataManager.java
  68. 3
      designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java
  69. 13
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java
  70. 5
      designer_base/src/com/fr/design/data/datapane/preview/PreviewTablePane.java
  71. 13
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  72. 2
      designer_base/src/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java
  73. 10
      designer_base/src/com/fr/design/designer/IntervalConstants.java
  74. 10
      designer_base/src/com/fr/design/designer/TargetComponent.java
  75. 38
      designer_base/src/com/fr/design/designer/creator/CRPropertyDescriptor.java
  76. 6
      designer_base/src/com/fr/design/editor/DoubleDeckValueEditorPane.java
  77. 24
      designer_base/src/com/fr/design/editor/ValueEditorPane.java
  78. 4
      designer_base/src/com/fr/design/editor/editor/FormulaEditor.java
  79. 2
      designer_base/src/com/fr/design/file/MutilTempalteTabPane.java
  80. 3
      designer_base/src/com/fr/design/file/NewTemplatePane.java
  81. 29
      designer_base/src/com/fr/design/file/TemplateTreePane.java
  82. 2
      designer_base/src/com/fr/design/formula/FormulaPane.java
  83. 59
      designer_base/src/com/fr/design/gui/HyperlinkFilterHelper.java
  84. 23
      designer_base/src/com/fr/design/gui/controlpane/JListControlPane.java
  85. 19
      designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java
  86. 29
      designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java
  87. 17
      designer_base/src/com/fr/design/gui/controlpane/UINameableListCellRenderer.java
  88. 30
      designer_base/src/com/fr/design/gui/core/WidgetOption.java
  89. 29
      designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java
  90. 3
      designer_base/src/com/fr/design/gui/frpane/RegPane.java
  91. 61
      designer_base/src/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java
  92. 2
      designer_base/src/com/fr/design/gui/ibutton/UIButton.java
  93. 61
      designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java
  94. 6
      designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java
  95. 4
      designer_base/src/com/fr/design/gui/ibutton/UIHeadGroup.java
  96. 26
      designer_base/src/com/fr/design/gui/ibutton/UIToggleButton.java
  97. 2
      designer_base/src/com/fr/design/gui/icombobox/LazyComboBox.java
  98. 13
      designer_base/src/com/fr/design/gui/icombobox/UIComboBoxRenderer.java
  99. 42
      designer_base/src/com/fr/design/gui/ispinner/UISpinner.java
  100. 13
      designer_base/src/com/fr/design/gui/itextfield/UITextField.java
  101. Some files were not shown because too many files have changed in this diff Show More

2
designer/src/com/fr/design/actions/ButtonGroupAction.java

@ -36,7 +36,7 @@ public abstract class ButtonGroupAction extends ElementCaseAction{
break; break;
} }
} }
if(value == -1 && createToolBarComponent().hasClick()) { if(createToolBarComponent().hasClick()) {
index = getSelectedIndex(); index = getSelectedIndex();
createToolBarComponent().setClickState(false); createToolBarComponent().setClickState(false);
} }

1
designer/src/com/fr/design/actions/cell/CellWidgetAttrAction.java

@ -22,5 +22,6 @@ public class CellWidgetAttrAction extends UpdateAction {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS); EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);
EastRegionContainerPane.getInstance().setWindow2PreferWidth();
} }
} }

1
designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java

@ -24,5 +24,6 @@ public class ConditionAttributesAction extends UpdateAction {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CONDITION_ATTR); EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CONDITION_ATTR);
EastRegionContainerPane.getInstance().setWindow2PreferWidth();
} }
} }

207
designer/src/com/fr/design/actions/cell/style/AlignmentAction.java

@ -1,111 +1,134 @@
package com.fr.design.actions.cell.style; package com.fr.design.actions.cell.style;
import javax.swing.Icon;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.chart.BaseChartCollection; import com.fr.base.chart.BaseChartCollection;
import com.fr.design.constants.UIConstants;
import com.fr.design.actions.ButtonGroupAction; import com.fr.design.actions.ButtonGroupAction;
import com.fr.design.actions.utils.ReportActionUtils; import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.general.Inter; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.Inter;
import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection; import com.fr.grid.selection.Selection;
import com.fr.report.cell.FloatElement; import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.Constants;
import javax.swing.*;
public class AlignmentAction extends ButtonGroupAction implements StyleActionInterface { public class AlignmentAction extends ButtonGroupAction implements StyleActionInterface {
public AlignmentAction(ElementCasePane t, Icon[] iconArray, private static final Icon[] normalBlackIcon = new Icon[]{
Integer[] valueArray) { BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
super(t, iconArray, valueArray); BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
} BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png")};
private static final Icon[] toggleWhiteIcon = new Icon[]{
/** BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal_white.png"),
* executeStyle BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal_white.png"),
* BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal_white.png")};
* @param style
* @param selectedStyle private static final Integer[] valueArray = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
* @return style
*/ public AlignmentAction(ElementCasePane t) {
public Style executeStyle(Style style, Style selectedStyle) { super(t, normalBlackIcon, valueArray);
return style.deriveHorizontalAlignment(getSelectedValue()); }
}
/** /**
* 更新Style * executeStyle
* *
* @param style style * @param style
*/ * @param selectedStyle
public void updateStyle(Style style) { * @return style
setSelectedIndex(BaseUtils.getAlignment4Horizontal(style)); */
} public Style executeStyle(Style style, Style selectedStyle) {
return style.deriveHorizontalAlignment(getSelectedValue());
/** }
* executeActionReturnUndoRecordNeeded
* /**
* @return * 更新Style
*/ *
public boolean executeActionReturnUndoRecordNeeded() { * @param style style
ElementCasePane reportPane = this.getEditingComponent(); */
if (reportPane == null) { public void updateStyle(Style style) {
return false; UIButtonGroup<Integer> buttonGroup = createToolBarComponent();
} int selected = BaseUtils.getAlignment4Horizontal(style);
for (int i = 0; i < normalBlackIcon.length; i++) {
return ReportActionUtils.executeAction(this, reportPane); UIToggleButton button = buttonGroup.getButton(i);
} Icon currentIcon = button.getIcon();
Icon newIcon = selected == valueArray[i] ? toggleWhiteIcon[i] : normalBlackIcon[i];
/** if (newIcon != currentIcon) {
* update button.setIcon(newIcon);
*/ }
public void update() { }
super.update(); setSelectedIndex(selected);
}
//peter:如果当前没有ReportFrame,不需要继续.
if (!this.isEnabled()) { /**
return; * executeActionReturnUndoRecordNeeded
} *
* @return
//got simple cell element from row and column */
ElementCasePane reportPane = this.getEditingComponent(); public boolean executeActionReturnUndoRecordNeeded() {
if (reportPane == null) { ElementCasePane reportPane = this.getEditingComponent();
this.setEnabled(false); if (reportPane == null) {
return; return false;
} }
Selection cs = reportPane.getSelection();
TemplateElementCase tplEC = reportPane.getEditingElementCase(); return ReportActionUtils.executeAction(this, reportPane);
}
if (tplEC != null && cs instanceof FloatSelection) {
FloatElement selectedFloat = tplEC.getFloatElement(((FloatSelection) cs).getSelectedFloatName()); /**
Object value = selectedFloat.getValue(); * update
if (value instanceof BaseChartCollection) { */
this.setEnabled(false); public void update() {
return; super.update();
}
} //peter:如果当前没有ReportFrame,不需要继续.
this.updateStyle(ReportActionUtils.getCurrentStyle(reportPane)); if (!this.isEnabled()) {
} return;
}
/**
* 创建工具条且有提示 //got simple cell element from row and column
* ElementCasePane reportPane = this.getEditingComponent();
* @return if (reportPane == null) {
*/ this.setEnabled(false);
public UIButtonGroup<Integer> createToolBarComponent() { return;
UIButtonGroup<Integer> group = super.createToolBarComponent(); }
if (group != null) { Selection cs = reportPane.getSelection();
group.setForToolBarButtonGroup(true); TemplateElementCase tplEC = reportPane.getEditingElementCase();
group.setAllToolTips(new String[]{Inter.getLocText("StyleAlignment-Left"), Inter.getLocText("Center"), Inter.getLocText("StyleAlignment-Right")});
} if (tplEC != null && cs instanceof FloatSelection) {
for (int i = 0; i < 3; i++) { FloatElement selectedFloat = tplEC.getFloatElement(((FloatSelection) cs).getSelectedFloatName());
group.getButton(i).setRoundBorder(true, UIConstants.ARC); Object value = selectedFloat.getValue();
group.getButton(i).setBorderPainted(true); if (value instanceof BaseChartCollection) {
} this.setEnabled(false);
return group; return;
} }
}
this.updateStyle(ReportActionUtils.getCurrentStyle(reportPane));
}
/**
* 创建工具条且有提示
*
* @return
*/
public UIButtonGroup<Integer> createToolBarComponent() {
UIButtonGroup<Integer> group = super.createToolBarComponent();
if (group != null) {
group.setForToolBarButtonGroup(true);
group.setAllToolTips(new String[]{Inter.getLocText("StyleAlignment-Left"), Inter.getLocText("Center"), Inter.getLocText("StyleAlignment-Right")});
}
for (int i = 0; i < 3; i++) {
group.getButton(i).setRoundBorder(true, UIConstants.ARC);
group.getButton(i).setBorderPainted(true);
}
return group;
}
} }

140
designer/src/com/fr/design/actions/cell/style/ReportFontBoldAction.java

@ -8,84 +8,96 @@ import com.fr.base.Style;
import com.fr.base.core.StyleUtils; import com.fr.base.core.StyleUtils;
import com.fr.design.actions.ToggleButtonUpdateAction; import com.fr.design.actions.ToggleButtonUpdateAction;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import javax.swing.*;
/** /**
* Bold. * Bold.
*/ */
public class ReportFontBoldAction extends AbstractStyleAction implements ToggleButtonUpdateAction { public class ReportFontBoldAction extends AbstractStyleAction implements ToggleButtonUpdateAction {
private UIToggleButton button; private UIToggleButton button;
protected Style style; protected Style style;
private final static Icon blackIcon = BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png");
private final static Icon whiteIcon = BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold_white.png");
public ReportFontBoldAction(ElementCasePane t) {
super(t);
public ReportFontBoldAction(ElementCasePane t) { this.setName(Inter.getLocText("FRFont-bold"));
super(t); this.setSmallIcon(blackIcon);
}
this.setName(Inter.getLocText("FRFont-bold")); /**
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); * 根据按钮状态获取格式
} *
* @param style
* @param defStyle
* @return
*/
@Override
public Style executeStyle(Style style, Style defStyle) {
button = createToolBarComponent();
button.setIcon(getToggleButtonIcon(button.isSelected()));
button.setSelected(!button.isSelected());
if (button.isSelected()) {
setSelectedFont(style);
button.setSelected(false);
} else {
setUnselectedFont(style);
button.setSelected(true);
}
/** return this.style;
* 根据按钮状态获取格式 }
*
* @param style
* @param defStyle
* @return
*/
@Override
public Style executeStyle(Style style, Style defStyle) {
createToolBarComponent().setSelected(!createToolBarComponent().isSelected());
if (createToolBarComponent().isSelected()) {
setSelectedFont(style);
createToolBarComponent().setSelected(false);
} else {
setUnselectedFont(style);
createToolBarComponent().setSelected(true);
}
return this.style; protected Icon getToggleButtonIcon(boolean isSelected) {
} return isSelected ? blackIcon : whiteIcon;
}
protected void setSelectedFont(Style style) { protected void setSelectedFont(Style style) {
this.style = StyleUtils.boldReportFont(style); this.style = StyleUtils.boldReportFont(style);
} }
protected void setUnselectedFont(Style style) { protected void setUnselectedFont(Style style) {
this.style = StyleUtils.unBoldReportFont(style); this.style = StyleUtils.unBoldReportFont(style);
} }
/** /**
* Update Style. * Update Style.
*/ */
@Override @Override
public void updateStyle(Style style) { public void updateStyle(Style style) {
if (style == null) { if (style == null) {
return; return;
} }
FRFont frFont = style.getFRFont(); FRFont frFont = style.getFRFont();
if (frFont == null) { if (frFont == null) {
return; return;
} }
createToolBarComponent().setSelected(isStyle(frFont)); button = createToolBarComponent();
} button.setSelected(isStyle(frFont));
button.setIcon(getToggleButtonIcon(!button.isSelected()));
}
protected boolean isStyle(FRFont frFont) { protected boolean isStyle(FRFont frFont) {
return frFont.isBold(); return frFont.isBold();
} }
/** /**
* Gets component on toolbar. * Gets component on toolbar.
* *
* @return the created components on toolbar. * @return the created components on toolbar.
*/ */
@Override @Override
public UIToggleButton createToolBarComponent() { public UIToggleButton createToolBarComponent() {
if (button == null) { if (button == null) {
button = GUICoreUtils.createToolBarComponent(this); button = GUICoreUtils.createToolBarComponent(this);
button.setEventBannded(true); button.setEventBannded(true);
} }
return button; return button;
} }
} }

14
designer/src/com/fr/design/actions/cell/style/ReportFontItalicAction.java

@ -10,16 +10,21 @@ import com.fr.general.FRFont;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import javax.swing.*;
/** /**
* Bold. * Bold.
*/ */
public class ReportFontItalicAction extends ReportFontBoldAction { public class ReportFontItalicAction extends ReportFontBoldAction {
public ReportFontItalicAction(ElementCasePane t) { private final static Icon blackIcon = BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png");
private final static Icon whiteIcon = BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic_white.png");
public ReportFontItalicAction(ElementCasePane t) {
super(t); super(t);
this.setName(Inter.getLocText("FRFont-italic")); this.setName(Inter.getLocText("FRFont-italic"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); this.setSmallIcon(blackIcon);
} }
@ -31,6 +36,9 @@ public class ReportFontItalicAction extends ReportFontBoldAction {
this.style = StyleUtils.unItalicReportFont(style); this.style = StyleUtils.unItalicReportFont(style);
} }
protected Icon getToggleButtonIcon(boolean isSelected) {
return isSelected ? blackIcon : whiteIcon;
}
protected boolean isStyle(FRFont frFont) { protected boolean isStyle(FRFont frFont) {
return frFont.isItalic(); return frFont.isItalic();

13
designer/src/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java

@ -11,15 +11,21 @@ import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.*;
/** /**
* Bold. * Bold.
*/ */
public class ReportFontUnderlineAction extends ReportFontBoldAction { public class ReportFontUnderlineAction extends ReportFontBoldAction {
public ReportFontUnderlineAction(ElementCasePane t) {
private final static Icon blackIcon = BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png");
private final static Icon whiteIcon = BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline_white.png");
public ReportFontUnderlineAction(ElementCasePane t) {
super(t); super(t);
this.setName(Inter.getLocText("FRFont-Underline")); this.setName(Inter.getLocText("FRFont-Underline"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png")); this.setSmallIcon(blackIcon);
} }
protected void setSelectedFont (Style style) { protected void setSelectedFont (Style style) {
@ -30,6 +36,9 @@ public class ReportFontUnderlineAction extends ReportFontBoldAction {
this.style = StyleUtils.setReportFontUnderline(style, false); this.style = StyleUtils.setReportFontUnderline(style, false);
} }
protected Icon getToggleButtonIcon(boolean isSelected) {
return isSelected ? blackIcon : whiteIcon;
}
protected boolean isStyle(FRFont frFont) { protected boolean isStyle(FRFont frFont) {
return frFont.getUnderline() != Constants.LINE_NONE; return frFont.getUnderline() != Constants.LINE_NONE;

1
designer/src/com/fr/design/actions/edit/HyperlinkAction.java

@ -25,5 +25,6 @@ public class HyperlinkAction extends UpdateAction {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_HYPERLINK); EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_HYPERLINK);
EastRegionContainerPane.getInstance().setWindow2PreferWidth();
} }
} }

1099
designer/src/com/fr/design/dscolumn/DSColumnAdvancedPane.java

File diff suppressed because it is too large Load Diff

48
designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java

@ -23,7 +23,7 @@ import java.awt.event.ItemListener;
* 这个pane是选中数据列后在上方QuickRegion处显示的pane * 这个pane是选中数据列后在上方QuickRegion处显示的pane
* *
* @author zhou, yaoh.wu * @author zhou, yaoh.wu
* @version 2017年8月2日14点55 * @version 2017年9月26日17点22
* @since 8.0 * @since 8.0
*/ */
public class ResultSetGroupDockingPane extends ResultSetGroupPane { public class ResultSetGroupDockingPane extends ResultSetGroupPane {
@ -70,7 +70,6 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
cardLayout.show(cardPane, "groupPane"); cardLayout.show(cardPane, "groupPane");
cardPane.setPreferredSize(new Dimension(158, 20)); cardPane.setPreferredSize(new Dimension(158, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 10); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 10);
checkButtonEnabled();
} else if (i == BIND_SELECTED) { } else if (i == BIND_SELECTED) {
cardLayout.show(cardPane, "listPane"); cardLayout.show(cardPane, "listPane");
cardPane.setPreferredSize(new Dimension(0, 0)); cardPane.setPreferredSize(new Dimension(0, 0));
@ -81,8 +80,8 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 10); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 10);
CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr(); CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
cellExpandAttr.setDirection(Constants.NONE); cellExpandAttr.setDirection(Constants.NONE);
checkButtonEnabled();
} }
checkButtonEnabled();
} }
}); });
@ -116,13 +115,13 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
@Override @Override
public void populate(TemplateCellElement cellElement) { public void populate(TemplateCellElement cellElement) {
//更新面板信息时可能会触发绑定在组件上的事件,先移除这些事件
this.removeListener();
this.cellElement = cellElement; this.cellElement = cellElement;
if (isNPE(cellElement)) {
if (isNPE(cellElement)) return; return;
}
DSColumn dSColumn = (DSColumn) cellElement.getValue(); DSColumn dSColumn = (DSColumn) cellElement.getValue();
// populate groupPane
// RecordGrouper
recordGrouper = dSColumn.getGrouper(); recordGrouper = dSColumn.getGrouper();
if (recordGrouper instanceof FunctionGrouper && !((FunctionGrouper) recordGrouper).isCustom()) { if (recordGrouper instanceof FunctionGrouper && !((FunctionGrouper) recordGrouper).isCustom()) {
int mode = recordGrouper.getDivideMode(); int mode = recordGrouper.getDivideMode();
@ -154,13 +153,16 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
this.groupComboBox.setSelectedIndex(ADVANCED); this.groupComboBox.setSelectedIndex(ADVANCED);
} }
checkButtonEnabled(); checkButtonEnabled();
//加上面板组件的交互事件监听
this.addListener();
} }
@Override @Override
public void update() { public void update() {
if (isNPE(cellElement)) return; if (isNPE(cellElement)) {
return;
}
DSColumn dSColumn = (DSColumn) cellElement.getValue(); DSColumn dSColumn = (DSColumn) cellElement.getValue();
if (this.goBox.getSelectedIndex() == BIND_GROUP) { if (this.goBox.getSelectedIndex() == BIND_GROUP) {
recordGrouper = updateGroupCombox(); recordGrouper = updateGroupCombox();
} else if (this.goBox.getSelectedIndex() == BIND_SELECTED) { } else if (this.goBox.getSelectedIndex() == BIND_SELECTED) {
@ -194,17 +196,21 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
cardPane.setPreferredSize(new Dimension(158, 50)); cardPane.setPreferredSize(new Dimension(158, 50));
cardPane.revalidate(); cardPane.revalidate();
cardPane.repaint(); cardPane.repaint();
} else { return;
}
if (groupComboBox.isEnabled() || functionComboBox.isEnabled()) {
cardPane.setPreferredSize(new Dimension(158, 20)); cardPane.setPreferredSize(new Dimension(158, 20));
cardPane.revalidate(); cardPane.revalidate();
cardPane.repaint(); cardPane.repaint();
return;
} }
cardPane.setPreferredSize(new Dimension(158, 0));
cardPane.revalidate();
cardPane.repaint();
} }
public void addListener(ItemListener listener) {
goBox.addItemListener(listener); public void setListener(ItemListener listener) {
groupComboBox.addItemListener(listener);
functionComboBox.addItemListener(listener);
this.listener = listener; this.listener = listener;
} }
@ -216,4 +222,16 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
public void setRecordGrouper(RecordGrouper recordGrouper) { public void setRecordGrouper(RecordGrouper recordGrouper) {
this.recordGrouper = recordGrouper; this.recordGrouper = recordGrouper;
} }
private void addListener() {
goBox.addItemListener(this.listener);
groupComboBox.addItemListener(this.listener);
functionComboBox.addItemListener(this.listener);
}
private void removeListener() {
goBox.removeItemListener(this.listener);
groupComboBox.removeItemListener(this.listener);
functionComboBox.removeItemListener(this.listener);
}
} }

10
designer/src/com/fr/design/expand/SortExpandAttrPane.java

@ -24,11 +24,11 @@ public class SortExpandAttrPane extends JPanel {
public SortExpandAttrPane() { public SortExpandAttrPane() {
this.setLayout(new BorderLayout(0, 4)); this.setLayout(new BorderLayout(0, 4));
Icon[] iconArray = { Icon[][] iconArray = {
BaseUtils.readIcon("/com/fr/design/images/expand/none16x16.png"), {BaseUtils.readIcon("/com/fr/design/images/expand/none16x16.png"), BaseUtils.readIcon("/com/fr/design/images/expand/none16x16_selected@1x.png")},
BaseUtils.readIcon("/com/fr/design/images/expand/asc.png"), {BaseUtils.readIcon("/com/fr/design/images/expand/asc.png"), BaseUtils.readIcon("/com/fr/design/images/expand/asc_selected.png")},
BaseUtils.readIcon("/com/fr/design/images/expand/des.png") {BaseUtils.readIcon("/com/fr/design/images/expand/des.png"), BaseUtils.readIcon("/com/fr/design/images/expand/des_selected.png")}
}; };
String[] nameArray = { Inter.getLocText("Sort-Original"), Inter.getLocText("Sort-Ascending"), Inter.getLocText("Sort-Descending") }; String[] nameArray = { Inter.getLocText("Sort-Original"), Inter.getLocText("Sort-Ascending"), Inter.getLocText("Sort-Descending") };
sort_type_pane = new UIButtonGroup(iconArray); sort_type_pane = new UIButtonGroup(iconArray);
sort_type_pane.setAllToolTips(nameArray); sort_type_pane.setAllToolTips(nameArray);

100
designer/src/com/fr/design/mainframe/ElementCasePane.java

@ -3,34 +3,7 @@
*/ */
package com.fr.design.mainframe; package com.fr.design.mainframe;
import java.awt.AWTEvent; import com.fr.base.*;
import java.awt.Adjustable;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.event.*;
import java.lang.reflect.Constructor;
import java.util.Set;
import javax.swing.AbstractAction;
import javax.swing.ActionMap;
import javax.swing.Icon;
import javax.swing.InputMap;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollBar;
import javax.swing.KeyStroke;
import com.fr.base.BaseUtils;
import com.fr.base.DynamicUnitList;
import com.fr.base.FRContext;
import com.fr.base.Formula;
import com.fr.base.ScreenResolution;
import com.fr.base.Style;
import com.fr.design.DesignState; import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
@ -39,30 +12,8 @@ import com.fr.design.actions.ExitAuthorityEditAction;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.cell.BorderAction; import com.fr.design.actions.cell.BorderAction;
import com.fr.design.actions.cell.CleanAuthorityAction; import com.fr.design.actions.cell.CleanAuthorityAction;
import com.fr.design.actions.cell.style.AlignmentAction; import com.fr.design.actions.cell.style.*;
import com.fr.design.actions.cell.style.ReportFontBoldAction; import com.fr.design.actions.columnrow.*;
import com.fr.design.actions.cell.style.ReportFontForegroundAction;
import com.fr.design.actions.cell.style.ReportFontItalicAction;
import com.fr.design.actions.cell.style.ReportFontNameAction;
import com.fr.design.actions.cell.style.ReportFontSizeAction;
import com.fr.design.actions.cell.style.ReportFontUnderlineAction;
import com.fr.design.actions.cell.style.StyleBackgroundAction;
import com.fr.design.actions.columnrow.CancelColumnAction;
import com.fr.design.actions.columnrow.CancelRowAction;
import com.fr.design.actions.columnrow.ColumnHideAction;
import com.fr.design.actions.columnrow.ColumnWidthAction;
import com.fr.design.actions.columnrow.DeleteColumnAction;
import com.fr.design.actions.columnrow.DeleteRowAction;
import com.fr.design.actions.columnrow.FootColumnAction;
import com.fr.design.actions.columnrow.FootRowAction;
import com.fr.design.actions.columnrow.HeadColumnAction;
import com.fr.design.actions.columnrow.HeadRowAction;
import com.fr.design.actions.columnrow.InsertColumnAction;
import com.fr.design.actions.columnrow.InsertRowAction;
import com.fr.design.actions.columnrow.ResetColumnHideAction;
import com.fr.design.actions.columnrow.ResetRowHideAction;
import com.fr.design.actions.columnrow.RowHeightAction;
import com.fr.design.actions.columnrow.RowHideAction;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.edit.CopyAction; import com.fr.design.actions.edit.CopyAction;
import com.fr.design.actions.edit.CutAction; import com.fr.design.actions.edit.CutAction;
@ -74,6 +25,7 @@ import com.fr.design.cell.clipboard.CellElementsClip;
import com.fr.design.cell.clipboard.ElementsTransferable; import com.fr.design.cell.clipboard.ElementsTransferable;
import com.fr.design.cell.clipboard.FloatElementsClip; import com.fr.design.cell.clipboard.FloatElementsClip;
import com.fr.design.cell.editor.*; import com.fr.design.cell.editor.*;
import com.fr.design.cell.editor.CellEditor;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.designer.EditingState; import com.fr.design.designer.EditingState;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
@ -83,11 +35,7 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.mainframe.cell.QuickEditorRegion; import com.fr.design.mainframe.cell.QuickEditorRegion;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.*;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.NameSeparator;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.selection.QuickEditor; import com.fr.design.selection.QuickEditor;
import com.fr.design.selection.Selectedable; import com.fr.design.selection.Selectedable;
import com.fr.design.selection.SelectionEvent; import com.fr.design.selection.SelectionEvent;
@ -95,11 +43,7 @@ import com.fr.design.selection.SelectionListener;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.grid.Grid; import com.fr.grid.*;
import com.fr.grid.GridColumn;
import com.fr.grid.GridCorner;
import com.fr.grid.GridRow;
import com.fr.grid.GridUtils;
import com.fr.grid.dnd.ElementCasePaneDropTarget; import com.fr.grid.dnd.ElementCasePaneDropTarget;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection; import com.fr.grid.selection.Selection;
@ -119,9 +63,17 @@ import com.fr.report.elementcase.ElementCase;
import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.ColumnRow; import com.fr.stable.ColumnRow;
import com.fr.stable.Constants;
import com.fr.stable.unit.FU; import com.fr.stable.unit.FU;
import javax.swing.*;
import java.awt.*;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.event.*;
import java.lang.reflect.Constructor;
import java.util.Set;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/** /**
@ -186,7 +138,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
/** /**
* Constructor. * Constructor.
*/ */
public ElementCasePane(T t) { public ElementCasePane(T t) {
super(t); super(t);
// marks:能触发processEvent,不管是否给component增加listener。这里是使在reportPane中的任意位置滑动鼠标轮都能 // marks:能触发processEvent,不管是否给component增加listener。这里是使在reportPane中的任意位置滑动鼠标轮都能
// 下拉grid。 // 下拉grid。
@ -209,7 +161,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
this.setLayout(new RGridLayout()); this.setLayout(new RGridLayout());
//todo 直接修改分辨率 //todo 直接修改分辨率
if (this.resolution == 0){ if (this.resolution == 0) {
this.resolution = ScreenResolution.getScreenResolution(); this.resolution = ScreenResolution.getScreenResolution();
} }
@ -243,7 +195,6 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
} }
public int getMenuState() { public int getMenuState() {
return DesignState.WORK_SHEET; return DesignState.WORK_SHEET;
} }
@ -294,8 +245,8 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
setFormatState(DesignerContext.FORMAT_STATE_NULL); setFormatState(DesignerContext.FORMAT_STATE_NULL);
formatBrush.setSelected(false); formatBrush.setSelected(false);
grid.setCursor(UIConstants.CELL_DEFAULT_CURSOR); grid.setCursor(UIConstants.CELL_DEFAULT_CURSOR);
if(DesignerContext.getReferencedElementCasePane() == null){ if (DesignerContext.getReferencedElementCasePane() == null) {
return; return;
} }
((ElementCasePane) DesignerContext.getReferencedElementCasePane()).getGrid().setNotShowingTableSelectPane(true); ((ElementCasePane) DesignerContext.getReferencedElementCasePane()).getGrid().setNotShowingTableSelectPane(true);
@ -348,11 +299,11 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
} }
public void setResolution(int resolution){ public void setResolution(int resolution) {
this.resolution = resolution; this.resolution = resolution;
} }
public int getResolution(){ public int getResolution() {
return this.resolution; return this.resolution;
} }
@ -390,7 +341,6 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
grid.setDefaultFloatEditor(Image.class, new ImageFloatEditor()); grid.setDefaultFloatEditor(Image.class, new ImageFloatEditor());
DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager(); DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager();
grid.setGridLineColor(designerEnvManager.getGridLineColor());
grid.setPaginationLineColor(designerEnvManager.getPaginationLineColor()); grid.setPaginationLineColor(designerEnvManager.getPaginationLineColor());
} }
@ -1150,7 +1100,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
HeadColumnAction headcolumnAction = new HeadColumnAction(this); HeadColumnAction headcolumnAction = new HeadColumnAction(this);
FootColumnAction footcolumnAction = new FootColumnAction(this); FootColumnAction footcolumnAction = new FootColumnAction(this);
ColumnRow selectedCellPoint = GridUtils.getAdjustEventColumnRow_withresolution(this, evt.getX(), evt.getY(),this.resolution); ColumnRow selectedCellPoint = GridUtils.getAdjustEventColumnRow_withresolution(this, evt.getX(), evt.getY(), this.resolution);
ElementCase elementCase = this.getEditingElementCase(); ElementCase elementCase = this.getEditingElementCase();
boolean cancel = false; boolean cancel = false;
ReportPageAttrProvider reportPageAttr = elementCase.getReportPageAttr(); ReportPageAttrProvider reportPageAttr = elementCase.getReportPageAttr();
@ -1268,11 +1218,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
protected ToolBarDef createAlignmentToolBar() { protected ToolBarDef createAlignmentToolBar() {
return ShortCut.asToolBarDef(new ShortCut[]{ return ShortCut.asToolBarDef(new ShortCut[]{
new AlignmentAction(this, new Icon[]{ new AlignmentAction(this)}
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png")},
new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT})}
); );
} }

15
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -50,18 +50,22 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
if (!isEditable() && !BaseUtils.isAuthorityEditing()) { if (!isEditable() && !BaseUtils.isAuthorityEditing()) {
return; return;
} }
doOnSelectionChanged(e); refreshPropertyPanes();
} }
}); });
this.addTargetModifiedListener(new TargetModifiedListener() { this.addTargetModifiedListener(new TargetModifiedListener() {
@Override @Override
public void targetModified(TargetModifiedEvent e) { public void targetModified(TargetModifiedEvent e) {
CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this); if (DesignerContext.isRefreshOnTargetModifiedEnabled()) {
refreshPropertyPanes();
} else {
CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
}
} }
}); });
} }
private void doOnSelectionChanged(SelectionEvent e) { private void refreshPropertyPanes() {
//在编辑权限,所以要更新权限编辑面板 //在编辑权限,所以要更新权限编辑面板
if (BaseUtils.isAuthorityEditing()) { if (BaseUtils.isAuthorityEditing()) {
AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(ElementCasePaneDelegate.this); AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(ElementCasePaneDelegate.this);
@ -76,7 +80,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
QuickEditorRegion.getInstance().populate(getCurrentEditor()); QuickEditorRegion.getInstance().populate(getCurrentEditor());
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (editingTemplate != null && !editingTemplate.isUpMode()) { if (editingTemplate != null && !editingTemplate.isUpMode()) {
Selection editingSelection = ((ElementCasePaneDelegate)e.getSource()).getSelection(); Selection editingSelection = getSelection();
// 模板初始化完成后,才能初始化超级链接面板 // 模板初始化完成后,才能初始化超级链接面板
HyperlinkGroupPane hyperlinkGroupPane = editingTemplate.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance()); HyperlinkGroupPane hyperlinkGroupPane = editingTemplate.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
hyperlinkGroupPane.populate(ElementCasePaneDelegate.this); hyperlinkGroupPane.populate(ElementCasePaneDelegate.this);
@ -172,6 +176,9 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
for (int i = 0; i < actions.length; i++) { for (int i = 0; i < actions.length; i++) {
subMenuDef.addShortCut(actions[i]); subMenuDef.addShortCut(actions[i]);
} }
// 顺便更新右侧属性面板悬浮元素tab中的菜单项
ReportFloatPane.getInstance().refreshInsertFloatMenu(this);
} }
// 格式菜单 // 格式菜单

9
designer/src/com/fr/design/mainframe/JWorkBook.java

@ -114,10 +114,13 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
if (isEditingPolySheet()) { if (isEditingPolySheet()) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY);
} else { } else {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT); if (isUpMode()) {
EastRegionContainerPane.getInstance().replaceCellElementPane(getEastUpPane()); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_PARA);
EastRegionContainerPane.getInstance().replaceCellAttrPane(getEastDownPane()); } else {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
}
} }
refreshToolArea();
} }
private boolean isEditingPolySheet() { private boolean isEditingPolySheet() {

24
designer/src/com/fr/design/mainframe/ReportFloatPane.java

@ -23,7 +23,6 @@ import java.awt.*;
public class ReportFloatPane extends JPanel { public class ReportFloatPane extends JPanel {
private static ReportFloatPane THIS; private static ReportFloatPane THIS;
private ElementCasePaneDelegate elementCasePaneDelegate;
private MenuDef insertFloatMenu; private MenuDef insertFloatMenu;
private ReportFloatPane() { private ReportFloatPane() {
@ -37,12 +36,20 @@ public class ReportFloatPane extends JPanel {
return THIS; return THIS;
} }
public void refreshInsertFloatMenu(ElementCasePaneDelegate elementCasePaneDelegate) {
insertFloatMenu.clearShortCuts();
UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, elementCasePaneDelegate);
for (int i = 0; i < actions.length; i++) {
insertFloatMenu.addShortCut(actions[i]);
}
}
private void initComponent() { private void initComponent() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
UIToolbar topToolBar = new UIToolbar(); UIToolbar topToolBar = new UIToolbar();
topToolBar.setLayout(new BorderLayout()); topToolBar.setLayout(new BorderLayout());
insertFloatMenu = createInsertToolBar(); initInsertToolBar();
topToolBar.setPreferredSize(new Dimension(155,20)); topToolBar.setPreferredSize(new Dimension(155,20));
topToolBar.add(createButtonUI(), BorderLayout.CENTER); topToolBar.add(createButtonUI(), BorderLayout.CENTER);
topToolBar.setBorder(BorderFactory.createEmptyBorder(-1, -1, -1, -1)); topToolBar.setBorder(BorderFactory.createEmptyBorder(-1, -1, -1, -1));
@ -66,19 +73,14 @@ public class ReportFloatPane extends JPanel {
this.add(leftTopPane, BorderLayout.NORTH); this.add(leftTopPane, BorderLayout.NORTH);
} }
private MenuDef createInsertToolBar() { private void initInsertToolBar() {
MenuDef insertFloatMenu = new MenuDef(true); insertFloatMenu = new MenuDef(true);
insertFloatMenu.setName(KeySetUtils.INSERT_FLOAT.getMenuKeySetName()); insertFloatMenu.setName(KeySetUtils.INSERT_FLOAT.getMenuKeySetName());
insertFloatMenu.setTooltip(Inter.getLocText("FR-Designer_T_Insert_Float")); insertFloatMenu.setTooltip(Inter.getLocText("FR-Designer_T_Insert_Float"));
insertFloatMenu.setIconPath("com/fr/design/images/control/addPopup.png"); insertFloatMenu.setIconPath("com/fr/design/images/control/addPopup.png");
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
elementCasePaneDelegate = (ElementCasePaneDelegate) editingTemplate.getCurrentElementCasePane(); ElementCasePaneDelegate elementCasePaneDelegate = (ElementCasePaneDelegate) editingTemplate.getCurrentElementCasePane();
UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, elementCasePaneDelegate); refreshInsertFloatMenu(elementCasePaneDelegate);
for (int i = 0; i < actions.length; i++) {
insertFloatMenu.addShortCut(actions[i]);
}
return insertFloatMenu;
} }
private UIButton createButtonUI() { private UIButton createButtonUI() {

4
designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java

@ -19,7 +19,6 @@ import java.util.List;
* Created by XiaXiang on 2017/5/8. * Created by XiaXiang on 2017/5/8.
*/ */
public class AlphaFineHelper { public class AlphaFineHelper {
public static final NoResultModel NO_RESULT_MODEL = new NoResultModel(Inter.getLocText("FR-Designer_AlphaFine_NoResult"));
public static final NoResultModel NO_CONNECTION_MODEL = new NoResultModel(Inter.getLocText("FR-Designer_ConnectionFailed")); public static final NoResultModel NO_CONNECTION_MODEL = new NoResultModel(Inter.getLocText("FR-Designer_ConnectionFailed"));
private static AlphaFineDialog alphaFineDialog; private static AlphaFineDialog alphaFineDialog;
@ -27,6 +26,9 @@ public class AlphaFineHelper {
* 弹出alphafine搜索面板 * 弹出alphafine搜索面板
*/ */
public static void showAlphaFineDialog(boolean forceOpen) { public static void showAlphaFineDialog(boolean forceOpen) {
if (!AlphaFineConfigManager.isALPHALicAvailable()) {
return;
}
if (alphaFineDialog == null) { if (alphaFineDialog == null) {
alphaFineDialog = new AlphaFineDialog(DesignerContext.getDesignerFrame(), forceOpen); alphaFineDialog = new AlphaFineDialog(DesignerContext.getDesignerFrame(), forceOpen);
alphaFineDialog.setVisible(true); alphaFineDialog.setVisible(true);

13
designer/src/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java

@ -1,25 +1,24 @@
package com.fr.design.mainframe.alphafine.cell.model; package com.fr.design.mainframe.alphafine.cell.model;
import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.CellType;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.json.JSONException; import com.fr.json.JSONException;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import javax.swing.*;
/** /**
* Created by XiaXiang on 2017/4/20. * Created by XiaXiang on 2017/4/20.
*/ */
public class ActionModel extends AlphaCellModel { public class ActionModel extends AlphaCellModel {
private Action action; private UpdateAction action;
public ActionModel(String name, String description, Action action, int searchCount) { public ActionModel(String name, String description, UpdateAction action, int searchCount) {
this(name, description, action); this(name, description, action);
setSearchCount(searchCount); setSearchCount(searchCount);
} }
public ActionModel(String name, String description, Action action) { public ActionModel(String name, String description, UpdateAction action) {
super(name, null, CellType.ACTION); super(name, null, CellType.ACTION);
this.action = action; this.action = action;
this.setDescription(description); this.setDescription(description);
@ -43,11 +42,11 @@ public class ActionModel extends AlphaCellModel {
return action != null ? action.hashCode() : 0; return action != null ? action.hashCode() : 0;
} }
public Action getAction() { public UpdateAction getAction() {
return action; return action;
} }
public void setAction(Action action) { public void setAction(UpdateAction action) {
this.action = action; this.action = action;
} }

5
designer/src/com/fr/design/mainframe/alphafine/cell/model/AlphaCellModel.java

@ -27,7 +27,7 @@ public abstract class AlphaCellModel implements Comparable {
this.content = content; this.content = content;
} }
public CellType getType() { public CellType getType() {
return type; return type;
} }
@ -68,6 +68,7 @@ public abstract class AlphaCellModel implements Comparable {
public boolean isNeedToSendToServer() { public boolean isNeedToSendToServer() {
return true; return true;
} }
/** /**
* model转json * model转json
* *
@ -102,7 +103,7 @@ public abstract class AlphaCellModel implements Comparable {
@Override @Override
public int compareTo(Object o) { public int compareTo(Object o) {
AlphaCellModel cellModel = (AlphaCellModel)o; AlphaCellModel cellModel = (AlphaCellModel) o;
int difference = cellModel.getSearchCount() - this.getSearchCount(); int difference = cellModel.getSearchCount() - this.getSearchCount();
if (difference != 0) { if (difference != 0) {
return difference; return difference;

3
designer/src/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java

@ -5,7 +5,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.general.IOUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
@ -55,7 +54,7 @@ public class ContentCellRender implements ListCellRenderer<Object> {
detailLabel.setForeground(AlphaFineConstants.LIGHT_GRAY); detailLabel.setForeground(AlphaFineConstants.LIGHT_GRAY);
panel.add(detailLabel, BorderLayout.CENTER); panel.add(detailLabel, BorderLayout.CENTER);
int width = (int) (titleLabel.getPreferredSize().getWidth() + detailLabel.getPreferredSize().getWidth()); int width = (int) (titleLabel.getPreferredSize().getWidth() + detailLabel.getPreferredSize().getWidth());
if ( width > AlphaFineConstants.LEFT_WIDTH - OFFSET) { if (width > AlphaFineConstants.LEFT_WIDTH - OFFSET) {
int nameWidth = (int) (AlphaFineConstants.LEFT_WIDTH - detailLabel.getPreferredSize().getWidth() - OFFSET); int nameWidth = (int) (AlphaFineConstants.LEFT_WIDTH - detailLabel.getPreferredSize().getWidth() - OFFSET);
titleLabel.setPreferredSize(new Dimension(nameWidth, AlphaFineConstants.CELL_HEIGHT)); titleLabel.setPreferredSize(new Dimension(nameWidth, AlphaFineConstants.CELL_HEIGHT));
} }

1
designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java

@ -3,7 +3,6 @@ package com.fr.design.mainframe.alphafine.cell.render;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.general.IOUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;

76
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -367,7 +367,6 @@ public class AlphaFineDialog extends UIDialog {
* 停止加载状态 * 停止加载状态
*/ */
private void fireStopLoading() { private void fireStopLoading() {
searchListModel.resetState();
if (searchResultPane != null) { if (searchResultPane != null) {
removeLeftPane(); removeLeftPane();
} }
@ -665,25 +664,18 @@ public class AlphaFineDialog extends UIDialog {
searchTextField.addKeyListener(new KeyAdapter() { searchTextField.addKeyListener(new KeyAdapter() {
@Override @Override
public void keyPressed(KeyEvent e) { public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_DOWN) { if (e.getKeyCode() == KeyEvent.VK_ENTER) {
searchResultList.requestFocus(); if (searchResultList.getModel().getSize() > 1) {
searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() + 1); dealWithSearchResult(searchResultList.getSelectedValue());
}
}
@Override
public void keyReleased(KeyEvent e) {
int keyCode = e.getKeyCode();
if (keyCode == KeyEvent.VK_ESCAPE) {
if (StringUtils.isBlank(searchTextField.getText()) || ComparatorUtils.equals(searchTextField.getText(), searchTextField.getPlaceHolder())) {
AlphaFineDialog.this.setVisible(false);
} else {
searchTextField.setText(null);
removeSearchResult();
} }
} else if (e.getKeyCode() == KeyEvent.VK_ENTER) { } else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
dealWithSearchResult(searchResultList.getSelectedValue()); if (searchResultList.getSelectedIndex() == searchResultList.getModel().getSize() - 1) {
} searchResultList.setSelectedIndex(0);
}
searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() + 1);
} else if (e.getKeyCode() == KeyEvent.VK_UP) {
searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() - 1);
} else escAlphaFine(e);
} }
}); });
@ -754,7 +746,9 @@ public class AlphaFineDialog extends UIDialog {
private void doNavigate() { private void doNavigate() {
AlphaFineDialog.this.dispose(); AlphaFineDialog.this.dispose();
final AlphaCellModel model = searchResultList.getSelectedValue(); final AlphaCellModel model = searchResultList.getSelectedValue();
model.doAction(); if (model != null) {
model.doAction();
}
} }
/** /**
@ -888,6 +882,21 @@ public class AlphaFineDialog extends UIDialog {
this.splitLabel = splitLabel; this.splitLabel = splitLabel;
} }
/**
* 键盘退出AlphaFine
*
* @param e
*/
private void escAlphaFine(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
if (StringUtils.isBlank(searchTextField.getText()) || ComparatorUtils.equals(searchTextField.getText(), searchTextField.getPlaceHolder())) {
AlphaFineDialog.this.setVisible(false);
} else {
searchTextField.setText(null);
removeSearchResult();
}
}
}
/** /**
* +-------------------------------------+ * +-------------------------------------+
@ -907,7 +916,9 @@ public class AlphaFineDialog extends UIDialog {
*/ */
@Override @Override
public void setSelectedIndex(int index) { public void setSelectedIndex(int index) {
if (index > 0 && checkSelectedIndex(index)) { if (index == 0 && getModel().getSize() > 1) {
super.setSelectedIndex(1);
} else if (index > 0 && checkSelectedIndex(index)) {
int previousIndex = getSelectedIndex(); int previousIndex = getSelectedIndex();
super.setSelectedIndex(index); super.setSelectedIndex(index);
AlphaCellModel cellModel = getSelectedValue(); AlphaCellModel cellModel = getSelectedValue();
@ -930,21 +941,6 @@ public class AlphaFineDialog extends UIDialog {
} }
private void initListListener() { private void initListListener() {
addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
dealWithSearchResult(getSelectedValue());
} else if (e.getKeyCode() == KeyEvent.VK_UP) {
if (getSelectedIndex() == 1) {
searchTextField.requestFocus();
}
} else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
searchTextField.requestFocus();
}
}
});
addMouseListener(new MouseAdapter() { addMouseListener(new MouseAdapter() {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
@ -968,6 +964,14 @@ public class AlphaFineDialog extends UIDialog {
} }
} }
}); });
addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
escAlphaFine(e);
}
});
} }
} }

7
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.alphafine.component; package com.fr.design.mainframe.alphafine.component;
import com.bulenkov.iconloader.IconLoader;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.help.alphafine.AlphaFineContext; import com.fr.design.actions.help.alphafine.AlphaFineContext;
import com.fr.design.actions.help.alphafine.AlphaFineListener; import com.fr.design.actions.help.alphafine.AlphaFineListener;
@ -7,10 +8,8 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.utils.ThemeUtils; import com.fr.design.utils.ThemeUtils;
import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -22,12 +21,12 @@ public class AlphaFinePane extends BasicPane {
private static AlphaFinePane alphaFinePane; private static AlphaFinePane alphaFinePane;
public AlphaFinePane() { public AlphaFinePane() {
setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 14)); setLayout(new BorderLayout());
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) {
Toolkit.getDefaultToolkit().addAWTEventListener(AlphaFineDialog.listener(), AWTEvent.KEY_EVENT_MASK); Toolkit.getDefaultToolkit().addAWTEventListener(AlphaFineDialog.listener(), AWTEvent.KEY_EVENT_MASK);
} }
UIButton refreshButton = new UIButton(); UIButton refreshButton = new UIButton();
refreshButton.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/smallsearch.png")); refreshButton.setIcon(IconLoader.getIcon("/com/fr/design/mainframe/alphafine/images/smallsearch.png"));
refreshButton.setToolTipText(Inter.getLocText("FR-Designer_AlphaFine")); refreshButton.setToolTipText(Inter.getLocText("FR-Designer_AlphaFine"));
refreshButton.set4ToolbarButton(); refreshButton.set4ToolbarButton();
refreshButton.setRolloverEnabled(false); refreshButton.setRolloverEnabled(false);

BIN
designer/src/com/fr/design/mainframe/alphafine/images/bigsearch.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 503 B

After

Width:  |  Height:  |  Size: 461 B

BIN
designer/src/com/fr/design/mainframe/alphafine/images/bigsearch@2x.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 871 B

After

Width:  |  Height:  |  Size: 761 B

BIN
designer/src/com/fr/design/mainframe/alphafine/images/smallsearch.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 299 B

BIN
designer/src/com/fr/design/mainframe/alphafine/images/smallsearch@2x.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 539 B

2
designer/src/com/fr/design/mainframe/alphafine/preview/FilePreviewPane.java

@ -18,7 +18,7 @@ public class FilePreviewPane extends JPanel {
float widthScale = (AlphaFineConstants.RIGHT_WIDTH) / (float) image.getWidth(); float widthScale = (AlphaFineConstants.RIGHT_WIDTH) / (float) image.getWidth();
float heightScale = (AlphaFineConstants.CONTENT_HEIGHT) / (float) image.getHeight(); float heightScale = (AlphaFineConstants.CONTENT_HEIGHT) / (float) image.getHeight();
Image showImage; Image showImage;
showImage = widthScale > heightScale? image.getScaledInstance((int) (image.getWidth() * heightScale), AlphaFineConstants.CONTENT_HEIGHT, Image.SCALE_SMOOTH) : image.getScaledInstance(AlphaFineConstants.RIGHT_WIDTH, (int) (image.getWidth() * widthScale), Image.SCALE_SMOOTH); showImage = widthScale > heightScale ? image.getScaledInstance((int) (image.getWidth() * heightScale), AlphaFineConstants.CONTENT_HEIGHT, Image.SCALE_SMOOTH) : image.getScaledInstance(AlphaFineConstants.RIGHT_WIDTH, (int) (image.getWidth() * widthScale), Image.SCALE_SMOOTH);
label.setIcon(new ImageIcon(showImage)); label.setIcon(new ImageIcon(showImage));
add(label); add(label);
} }

2
designer/src/com/fr/design/mainframe/alphafine/preview/NoResultPane.java

@ -20,7 +20,7 @@ public class NoResultPane extends JPanel {
image.setPreferredSize(new Dimension(150, 111)); image.setPreferredSize(new Dimension(150, 111));
image.setHorizontalAlignment(SwingConstants.CENTER); image.setHorizontalAlignment(SwingConstants.CENTER);
image.setIcon(IconLoader.getIcon(iconUrl)); image.setIcon(IconLoader.getIcon(iconUrl));
image.setBorder(BorderFactory.createEmptyBorder(100,0,0,0)); image.setBorder(BorderFactory.createEmptyBorder(100, 0, 0, 0));
UILabel description = new UILabel(title); UILabel description = new UILabel(title);
description.setForeground(AlphaFineConstants.MEDIUM_GRAY); description.setForeground(AlphaFineConstants.MEDIUM_GRAY);
description.setFont(FRFont.getInstance("SimSun", Font.PLAIN, 14)); description.setFont(FRFont.getInstance("SimSun", Font.PLAIN, 14));

7
designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java

@ -19,7 +19,12 @@ import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import java.io.*; import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

1
designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java

@ -103,6 +103,7 @@ public class PluginSearchManager implements AlphaFineSearchProcessor {
if (jsonArray != null) { if (jsonArray != null) {
SearchResult searchResult = new SearchResult(); SearchResult searchResult = new SearchResult();
for (int i = 0; i < jsonArray.length(); i++) { for (int i = 0; i < jsonArray.length(); i++) {
AlphaFineHelper.checkCancel();
PluginModel cellModel = getPluginModel(jsonArray.optJSONObject(i), false); PluginModel cellModel = getPluginModel(jsonArray.optJSONObject(i), false);
if (!AlphaFineHelper.getFilterResult().contains(cellModel)) { if (!AlphaFineHelper.getFilterResult().contains(cellModel)) {
searchResult.add(cellModel); searchResult.add(cellModel);

29
designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java

@ -10,6 +10,7 @@ import com.fr.design.mainframe.alphafine.cell.model.ActionModel;
import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.model.SearchResult;
import com.fr.design.mainframe.toolbar.UpdateActionManager;
import com.fr.file.XMLFileManager; import com.fr.file.XMLFileManager;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
@ -26,8 +27,17 @@ import com.fr.stable.xml.XMLReadable;
import com.fr.stable.xml.XMLTools; import com.fr.stable.xml.XMLTools;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
import java.io.*; import java.io.File;
import java.util.*; import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.StringReader;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/** /**
* Created by XiaXiang on 2017/5/15. * Created by XiaXiang on 2017/5/15.
@ -220,21 +230,24 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear
recentModelList = recentKVModelMap.get(searchText); recentModelList = recentKVModelMap.get(searchText);
SearchResult resultModelList = recentModelList; SearchResult resultModelList = recentModelList;
Iterator<AlphaCellModel> modelIterator = resultModelList.iterator(); Iterator<AlphaCellModel> modelIterator = resultModelList.iterator();
SearchResult searchResult = new SearchResult();
while (modelIterator.hasNext()) { while (modelIterator.hasNext()) {
AlphaCellModel model = modelIterator.next(); AlphaCellModel model = modelIterator.next();
if (model.getType() == CellType.ACTION && !((ActionModel) model).getAction().isEnabled()) { if (model.getType() == CellType.ACTION && !UpdateActionManager.getUpdateActionManager().isEnable(((ActionModel) model).getAction())) {
modelIterator.remove(); continue;
} else {
searchResult.add(model);
} }
} }
Collections.sort(resultModelList); Collections.sort(searchResult);
int size = resultModelList.size(); int size = searchResult.size();
if (size > MAX_SIZE) { if (size > MAX_SIZE) {
SearchResult result = new SearchResult(); SearchResult result = new SearchResult();
result.addAll(resultModelList.subList(0, MAX_SIZE)); result.addAll(searchResult.subList(0, MAX_SIZE));
return result; return result;
} }
return resultModelList; return searchResult;
} }
} }
return recentModelList; return recentModelList;

8
designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java

@ -45,10 +45,10 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
*/ */
public JPanel createContentPane() { public JPanel createContentPane() {
String[] nameArray = {Inter.getLocText("ExpandD-Not_Expand"), Inter.getLocText("Utils-Top_to_Bottom"), Inter.getLocText("Utils-Left_to_Right")}; String[] nameArray = {Inter.getLocText("ExpandD-Not_Expand"), Inter.getLocText("Utils-Top_to_Bottom"), Inter.getLocText("Utils-Left_to_Right")};
Icon[] iconArray = { Icon[][] iconArray = {
BaseUtils.readIcon("/com/fr/design/images/expand/none16x16.png"), {BaseUtils.readIcon("/com/fr/design/images/expand/none16x16.png"), BaseUtils.readIcon("/com/fr/design/images/expand/none16x16_selected@1x.png")},
BaseUtils.readIcon("/com/fr/design/images/expand/vertical.png"), {BaseUtils.readIcon("/com/fr/design/images/expand/vertical.png"), BaseUtils.readIcon("/com/fr/design/images/expand/vertical_selected@1x.png")},
BaseUtils.readIcon("/com/fr/design/images/expand/landspace.png") {BaseUtils.readIcon("/com/fr/design/images/expand/landspace.png"), BaseUtils.readIcon("/com/fr/design/images/expand/landspace_selected@1x.png")}
}; };
Byte[] valueArray = {Constants.NONE, Constants.TOP_TO_BOTTOM, Constants.LEFT_TO_RIGHT}; Byte[] valueArray = {Constants.NONE, Constants.TOP_TO_BOTTOM, Constants.LEFT_TO_RIGHT};
expandDirectionButton = new UIButtonGroup<Byte>(iconArray, valueArray); expandDirectionButton = new UIButtonGroup<Byte>(iconArray, valueArray);

12
designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java

@ -29,6 +29,8 @@ public class ErrorInfoUploader {
private static ErrorInfoUploader collector; private static ErrorInfoUploader collector;
private static boolean licSupport = true; private static boolean licSupport = true;
// 在一台不能上网的电脑里发现了10w个errorinfo...
private static final int MAX_ERROR_SIZE = 2000;
static { static {
GeneralContext.addEnvChangedListener(new EnvChangedListener() { GeneralContext.addEnvChangedListener(new EnvChangedListener() {
@ -123,6 +125,11 @@ public class ErrorInfoUploader {
} }
File[] files = folder.listFiles(); File[] files = folder.listFiles();
if (files.length > MAX_ERROR_SIZE) {
StableUtils.deleteFile(folder);
return;
}
try { try {
for (File file : files) { for (File file : files) {
String filePath = file.getPath(); String filePath = file.getPath();
@ -131,6 +138,11 @@ public class ErrorInfoUploader {
if (suffix.endsWith(SUFFIX)) { if (suffix.endsWith(SUFFIX)) {
Thread.sleep(1000L); Thread.sleep(1000L);
String content = IOUtils.inputStream2String(new FileInputStream(file)); String content = IOUtils.inputStream2String(new FileInputStream(file));
if (content.length() > MAX_ERROR_SIZE) {
file.delete();
continue;
}
String url = SiteCenter.getInstance().acquireUrlByKind("design.error"); String url = SiteCenter.getInstance().acquireUrlByKind("design.error");
if (sendErroInfo(url, content)) { if (sendErroInfo(url, content)) {
file.delete(); file.delete();

36
designer/src/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java

@ -36,32 +36,34 @@ public class FormElementCasePaneDelegate extends ElementCasePane<FormElementCase
this.addSelectionChangeListener(new SelectionListener() { this.addSelectionChangeListener(new SelectionListener() {
@Override @Override
public void selectionChanged(SelectionEvent e) { public void selectionChanged(SelectionEvent e) {
CellElementPropertyPane.getInstance().populate(FormElementCasePaneDelegate.this); refreshPropertyPanes();
QuickEditorRegion.getInstance().populate(getCurrentEditor());
// 超级链接
HyperlinkGroupPane hyperlinkGroupPane = DesignerContext.getDesignerFrame().getSelectedJTemplate().
getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
hyperlinkGroupPane.populate(FormElementCasePaneDelegate.this);
// 条件属性
ConditionAttributesGroupPane conditionAttributesGroupPane = ConditionAttributesGroupPane.getInstance();
conditionAttributesGroupPane.populate(FormElementCasePaneDelegate.this);
EastRegionContainerPane.getInstance().updateCellElementState(isSelectedOneCell());
} }
}); });
this.addTargetModifiedListener(new TargetModifiedListener() { this.addTargetModifiedListener(new TargetModifiedListener() {
@Override @Override
public void targetModified(TargetModifiedEvent e) { public void targetModified(TargetModifiedEvent e) {
CellElementPropertyPane.getInstance().populate(FormElementCasePaneDelegate.this); if (DesignerContext.isRefreshOnTargetModifiedEnabled()) {
refreshPropertyPanes();
} else {
CellElementPropertyPane.getInstance().populate(FormElementCasePaneDelegate.this);
}
} }
}); });
} }
// private void populateHyperLinkGroupPane() { private void refreshPropertyPanes() {
// final TemplateElementCase report = this.getEditingElementCase(); CellElementPropertyPane.getInstance().populate(FormElementCasePaneDelegate.this);
// NameJavaScriptGroup nameHyperlinks = ReportHyperlinkGroupPane.getNameJSGroup(this, report); QuickEditorRegion.getInstance().populate(getCurrentEditor());
// HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getHyperLinkPane().populate(nameHyperlinks); // 超级链接
// } HyperlinkGroupPane hyperlinkGroupPane = DesignerContext.getDesignerFrame().getSelectedJTemplate().
getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
hyperlinkGroupPane.populate(FormElementCasePaneDelegate.this);
// 条件属性
ConditionAttributesGroupPane conditionAttributesGroupPane = ConditionAttributesGroupPane.getInstance();
conditionAttributesGroupPane.populate(FormElementCasePaneDelegate.this);
EastRegionContainerPane.getInstance().updateCellElementState(isSelectedOneCell());
}
@Override @Override
protected boolean supportRepeatedHeaderFooter() { protected boolean supportRepeatedHeaderFooter() {

2
designer/src/com/fr/design/report/UnitFieldPane.java

@ -48,7 +48,7 @@ public class UnitFieldPane extends JPanel {
} else if (unitType == Constants.UNIT_INCH) { } else if (unitType == Constants.UNIT_INCH) {
this.setText(Inter.getLocText("FR-Designer_Unit_INCH")); this.setText(Inter.getLocText("FR-Designer_Unit_INCH"));
} else { } else {
this.setText(Inter.getLocText("FR-Designer_Unit_MM-mm")); this.setText(Inter.getLocText("FR-Designer_Unit_MM"));
} }
//ajust the heigt of unitLabel. //ajust the heigt of unitLabel.

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

@ -1,5 +1,6 @@
package com.fr.design.widget; package com.fr.design.widget;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
@ -91,7 +92,8 @@ public class CellWidgetCardPane extends BasicPane {
tabbedPane.show(center, tabTitles[index]); tabbedPane.show(center, tabTitles[index]);
} }
}; };
tabsHeaderIconPane.setNeedLeftRightOutLine(false); tabsHeaderIconPane.setNeedLeftRightOutLine(true);
tabsHeaderIconPane.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, UIConstants.SHADOW_GREY));
this.add(tabsHeaderIconPane, BorderLayout.NORTH); this.add(tabsHeaderIconPane, BorderLayout.NORTH);
widgetPropertyPane = new BasicWidgetPropertySettingPane(); widgetPropertyPane = new BasicWidgetPropertySettingPane();

12
designer/src/com/fr/design/widget/ui/AbstractDataModify.java

@ -4,12 +4,14 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.widget.DataModify; import com.fr.design.widget.DataModify;
import javax.swing.*; import javax.swing.JComponent;
/** /**
* Created by richie on 15/11/16. * Created by richie on 15/11/16.
*/ */
public abstract class AbstractDataModify<T> extends BasicBeanPane<T> implements DataModify<T> { public abstract class AbstractDataModify<T> extends BasicBeanPane<T> implements DataModify<T> {
protected String globalName;
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
@ -20,4 +22,12 @@ public abstract class AbstractDataModify<T> extends BasicBeanPane<T> implements
public JComponent toSwingComponent() { public JComponent toSwingComponent() {
return this; return this;
} }
public void setGlobalName(String globalName){
this.globalName = globalName;
}
public String getGlobalName(){
return globalName;
}
} }

16
designer/src/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java

@ -1,6 +1,6 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants;
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.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
@ -11,8 +11,11 @@ import com.fr.form.ui.Widget;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*; import javax.swing.BorderFactory;
import java.awt.*; import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
public class BasicWidgetPropertySettingPane extends BasicPane { public class BasicWidgetPropertySettingPane extends BasicPane {
private ParameterTreeComboBox widgetNameComboBox; private ParameterTreeComboBox widgetNameComboBox;
@ -28,20 +31,17 @@ public class BasicWidgetPropertySettingPane extends BasicPane {
visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(0,0,0,0)); visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
widgetNameComboBox = new ParameterTreeComboBox(); widgetNameComboBox = new ParameterTreeComboBox();
widgetNameComboBox.refreshTree(); widgetNameComboBox.refreshTree();
JPanel widgetNamePane = new JPanel(new BorderLayout());
widgetNamePane.add(widgetNameComboBox, BorderLayout.CENTER);
widgetNamePane.setBorder(BorderFactory.createEmptyBorder(0,20,0,0));
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Form-Widget_Name")), widgetNamePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Form-Widget_Name")), widgetNameComboBox},
new Component[]{enableCheckBox, null}, new Component[]{enableCheckBox, null},
new Component[]{visibleCheckBox, null}, new Component[]{visibleCheckBox, null},
}; };
double[] rowSize = {p, p, p}; double[] rowSize = {p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1}}; int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE); JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1);
pane.setBorder(BorderFactory.createEmptyBorder(10,0,10,0)); pane.setBorder(BorderFactory.createEmptyBorder(10,0,10,0));
this.add(pane, BorderLayout.CENTER); this.add(pane, BorderLayout.CENTER);

4
designer/src/com/fr/design/widget/ui/ButtonGroupDictPane.java

@ -5,6 +5,7 @@ import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import com.fr.data.Dictionary; import com.fr.data.Dictionary;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -57,8 +58,7 @@ public class ButtonGroupDictPane extends JPanel {
{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictPane, null}, {new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictPane, null},
{adaptiveCheckbox, columnLabel, columnSpinner} {adaptiveCheckbox, columnLabel, columnSpinner}
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, 16, 8); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
this.add(panel); this.add(panel);

15
designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java

@ -1,6 +1,7 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
@ -17,28 +18,24 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private UITextField text; private UITextField text;
public CheckBoxDefinePane() { public CheckBoxDefinePane() {
this.iniComoponents(); this.iniComponents();
} }
private void iniComoponents() { private void iniComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
text = new UITextField(); text = new UITextField();
JPanel panel = new JPanel(new BorderLayout());
panel.add(text, BorderLayout.CENTER);
panel.setBorder(BorderFactory.createEmptyBorder(0, 35, 0, 0));
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Text")), panel}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Text")), text},
}; };
double[] rowSize = {p}; double[] rowSize = {p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}}; int[][] rowCount = {{1, 1}};
JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE); JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W3, IntervalConstants.INTERVAL_L1);
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 24, pane); UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 24, pane);
pane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15)); pane.setBorder(BorderFactory.createEmptyBorder(10, 5, 10, 0));
this.add(uiExpandablePane); this.add(uiExpandablePane);
} }

6
designer/src/com/fr/design/widget/ui/ComboBoxDefinePane.java

@ -4,6 +4,7 @@ import javax.swing.*;
import com.fr.data.Dictionary; import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
@ -26,8 +27,9 @@ public class ComboBoxDefinePane extends CustomWritableRepeatEditorPane<ComboBox>
protected JPanel setForthContentPane () { protected JPanel setForthContentPane () {
dictPane = new AccessibleDictionaryEditor(); dictPane = new AccessibleDictionaryEditor();
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictPane}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(
jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictPane}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
return jPanel; return jPanel;
} }

3
designer/src/com/fr/design/widget/ui/ComboCheckBoxDefinePane.java

@ -2,6 +2,7 @@ package com.fr.design.widget.ui;
import com.fr.data.Dictionary; import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
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.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -42,7 +43,7 @@ public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<Comb
double[] rowSize = {p, p, p, p}; double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1},{1,1},{1,1}}; int[][] rowCount = {{1, 1},{1, 1},{1,1},{1,1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
advancePane.add(panel); advancePane.add(panel);
return advancePane; return advancePane;

30
designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java

@ -3,6 +3,7 @@ package com.fr.design.widget.ui;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.data.core.FormatField; import com.fr.data.core.FormatField;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -36,7 +37,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private UIComboBox currentFormatComboBox; private UIComboBox currentFormatComboBox;
private UILabel currentSamplelabel; private UILabel currentSamplelabel;
private UIButtonGroup fomatHeadGroup; private UIButtonGroup fomatHeadGroup;
private static final int SAMPLE_LABEL_PADDING = 4;
public DateEditorDefinePane() { public DateEditorDefinePane() {
@ -58,17 +59,16 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), formatHead}, new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format")), formatHead},
new Component[]{new UILabel(Inter.getLocText("FS_Start_Date") + ":"), startDv}, new Component[]{new UILabel(Inter.getLocText("FS_Start_Date")), startDv},
new Component[]{new UILabel(Inter.getLocText("FS_End_Date") + ":"), endDv}, new Component[]{new UILabel(Inter.getLocText("FS_End_Date")), endDv},
new Component[]{waterMarkDictPane, null}, new Component[]{waterMarkDictPane, null},
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypeComboBox } new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type")), returnTypeComboBox }
}; };
double[] rowSize = {p, p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1, 1},{1, 1}}; int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
return panel; return panel;
@ -76,7 +76,13 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private JPanel createFormatPane(UIComboBox formatComboBox, UILabel sampleLabel){ private JPanel createFormatPane(UIComboBox formatComboBox, UILabel sampleLabel){
JPanel previewPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Base_StyleFormat_Sample")); JPanel previewPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Base_StyleFormat_Sample"));
previewPane.add(sampleLabel); previewPane.setLayout(new BorderLayout());
JPanel sampleLabelWrapper = new JPanel(new BorderLayout());
sampleLabelWrapper.setBorder(BorderFactory.createEmptyBorder(0, SAMPLE_LABEL_PADDING, SAMPLE_LABEL_PADDING, SAMPLE_LABEL_PADDING));
sampleLabelWrapper.add(sampleLabel, BorderLayout.CENTER);
previewPane.add(sampleLabelWrapper, BorderLayout.CENTER);
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.add(previewPane, BorderLayout.NORTH); jPanel.add(previewPane, BorderLayout.NORTH);
jPanel.add(formatComboBox, BorderLayout.CENTER); jPanel.add(formatComboBox, BorderLayout.CENTER);
@ -84,7 +90,13 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
} }
private UILabel createSamplePane(){ private UILabel createSamplePane(){
UILabel sampleLabel = new UILabel(""); UILabel sampleLabel = new UILabel("") {
@Override
public void setText(String text) {
// 加上<html>可以自动换行
super.setText("<html>" + text + "</html>");
}
};
sampleLabel.setHorizontalAlignment(SwingConstants.CENTER); sampleLabel.setHorizontalAlignment(SwingConstants.CENTER);
sampleLabel.setFont(FRContext.getDefaultValues().getFRFont()); sampleLabel.setFont(FRContext.getDefaultValues().getFRFont());
return sampleLabel; return sampleLabel;

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

@ -32,8 +32,11 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel contentPane = this.setFirstContentPane(); JPanel contentPane = this.setFirstContentPane();
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.add(contentPane, BorderLayout.CENTER);
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
if (contentPane != null) { if (contentPane != null) {
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 24, contentPane); UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 24, jPanel);
this.add(uiExpandablePane, BorderLayout.NORTH); this.add(uiExpandablePane, BorderLayout.NORTH);
} }
this.addValidatePane(); this.addValidatePane();

6
designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java

@ -2,6 +2,7 @@ package com.fr.design.widget.ui;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.DialogActionListener; import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
@ -57,14 +58,15 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
parameterViewPaneButton = new UIButton(Inter.getLocText("FR-Designer_Edit")); parameterViewPaneButton = new UIButton(Inter.getLocText("FR-Designer_Edit"));
parameterViewPaneButton.addActionListener(parameterListener); parameterViewPaneButton.addActionListener(parameterListener);
parameterViewPane = new ReportletParameterViewPane(); parameterViewPane = new ReportletParameterViewPane();
horizontalCheck.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
verticalCheck.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
java.awt.Component[][] coms = { java.awt.Component[][] coms = {
{horizontalCheck, null}, {horizontalCheck, null},
{verticalCheck, null}, {verticalCheck, null},
{new UILabel(Inter.getLocText("Form-Url")), srcTextField = new UITextField()}, {new UILabel(Inter.getLocText("Form-Url")), srcTextField = new UITextField()},
{new UILabel(Inter.getLocText("FR-Designer_Parameters")), parameterViewPaneButton}}; {new UILabel(Inter.getLocText("FR-Designer_Parameters")), parameterViewPaneButton}};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, 45, LayoutConstants.VGAP_LARGE); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W3, IntervalConstants.INTERVAL_L1);
contentPane.add(panel); contentPane.add(panel);

10
designer/src/com/fr/design/widget/ui/ListEditorDefinePane.java

@ -34,12 +34,12 @@ public class ListEditorDefinePane extends WriteUnableRepeatEditorPane<ListEditor
@Override @Override
protected JPanel setThirdContentPane() { protected JPanel setThirdContentPane() {
JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel centerPane = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0(); needHeadCheckBox = new UICheckBox(Inter.getLocText("List-Need_Head"));
centerPane.add(needHeadCheckBox = new UICheckBox(Inter.getLocText("List-Need_Head")));
needHeadCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); needHeadCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
contenter.add(centerPane); jPanel.add(needHeadCheckBox, BorderLayout.CENTER);
return contenter; jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
return jPanel;
} }
@Override @Override

5
designer/src/com/fr/design/widget/ui/MultiFileEditorPane.java

@ -1,5 +1,6 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.DictionaryComboBox; import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.icombobox.DictionaryConstants; import com.fr.design.gui.icombobox.DictionaryConstants;
@ -55,9 +56,7 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
double[] rowSize = {p, p, p}; double[] rowSize = {p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 22, 10); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 00));
contenter.add(panel, BorderLayout.CENTER); contenter.add(panel, BorderLayout.CENTER);
return contenter; return contenter;

1
designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java

@ -29,7 +29,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel content = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel content = FRGUIPaneFactory.createBorderLayout_S_Pane();
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
waterMarkDictPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
content.add(waterMarkDictPane, BorderLayout.CENTER); content.add(waterMarkDictPane, BorderLayout.CENTER);
return content; return content;
} }

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

@ -51,9 +51,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
} }
}); });
JPanel content = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel content = FRGUIPaneFactory.createBorderLayout_S_Pane();
waterMarkDictPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
content.add(waterMarkDictPane, BorderLayout.CENTER); content.add(waterMarkDictPane, BorderLayout.CENTER);
return content; return content;
} }

6
designer/src/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java

@ -7,6 +7,7 @@ import javax.swing.JPanel;
import com.fr.data.Dictionary; import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itree.refreshabletree.TreeRootPane; import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -38,8 +39,9 @@ public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
treeSettingPane = new AccessibleTreeModelEditor(); treeSettingPane = new AccessibleTreeModelEditor();
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel north = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Create_Tree")), treeSettingPane}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); JPanel north = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
north.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); new Component[]{new UILabel(Inter.getLocText("FR-Designer_Create_Tree")), treeSettingPane}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1);
north.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
JPanel center = super.setFirstContentPane(); JPanel center = super.setFirstContentPane();
jPanel.add(north, BorderLayout.NORTH); jPanel.add(north, BorderLayout.NORTH);
jPanel.add(center, BorderLayout.CENTER); jPanel.add(center, BorderLayout.CENTER);

6
designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java

@ -2,6 +2,7 @@ package com.fr.design.widget.ui;
import com.fr.data.Dictionary; import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
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.itree.refreshabletree.TreeRootPane; import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
@ -55,8 +56,9 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
protected JPanel setSecondContentPane() { protected JPanel setSecondContentPane() {
accessibleTreeModelEditor = new AccessibleTreeModelEditor(); accessibleTreeModelEditor = new AccessibleTreeModelEditor();
JPanel createTree = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Create_Tree")), accessibleTreeModelEditor}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); JPanel createTree = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
createTree.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); new Component[]{new UILabel(Inter.getLocText("FR-Designer_Create_Tree")), accessibleTreeModelEditor}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1);
createTree.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
JPanel contenter = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel contenter = FRGUIPaneFactory.createBorderLayout_S_Pane();

5
designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java

@ -1,5 +1,6 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
@ -28,8 +29,8 @@ public class WaterMarkDictPane extends JPanel {
double[] rowSize = {p}; double[] rowSize = {p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}}; int[][] rowCount = {{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 18, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W3, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); // panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
} }

4
designer/src/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java

@ -5,6 +5,7 @@ import java.awt.*;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
@ -36,8 +37,7 @@ public abstract class WriteUnableRepeatEditorPane<E extends WriteUnableRepeatEdi
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1,1},{1,1}}; int[][] rowCount = {{1,1},{1,1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
contentPane.add(panel); contentPane.add(panel);
JPanel otherContentPane = this.setThirdContentPane(); JPanel otherContentPane = this.setThirdContentPane();
if (otherContentPane != null) if (otherContentPane != null)

4
designer/src/com/fr/design/widget/ui/btn/DefineAppendColumnRowPane.java

@ -3,6 +3,8 @@ package com.fr.design.widget.ui.btn;
import java.awt.Component; import java.awt.Component;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -43,7 +45,7 @@ public class DefineAppendColumnRowPane extends BasicPane {
lpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); lpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
lpane.add(new UILabel(Inter.getLocText("Append_Delete_Row_Message"))); lpane.add(new UILabel(Inter.getLocText("Append_Delete_Row_Message")));
Component[][] components = { { new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"})), crEditor }, { rowCountLable, jNumberEditor } ,{lpane,null}}; Component[][] components = { { new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"})), crEditor }, { rowCountLable, jNumberEditor } ,{lpane,null}};
JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());

3
designer/src/com/fr/design/widget/ui/btn/DefineDeleteColumnRowPane.java

@ -2,6 +2,7 @@ package com.fr.design.widget.ui.btn;
import javax.swing.*; import javax.swing.*;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -38,7 +39,7 @@ public class DefineDeleteColumnRowPane extends BasicPane {
Component[][] components = { Component[][] components = {
{ new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"})), crEditor }, { new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"})), crEditor },
{ messageLabel, null}}; { messageLabel, null}};
JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());

325
designer/src/com/fr/grid/Grid.java

@ -10,7 +10,6 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.fun.GridUIProcessor; import com.fr.design.fun.GridUIProcessor;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.templateinfo.TemplateInfoCollector;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.grid.event.CellEditorEvent; import com.fr.grid.event.CellEditorEvent;
@ -36,7 +35,6 @@ import javax.swing.plaf.ComponentUI;
import java.awt.*; import java.awt.*;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.Date;
import java.util.Hashtable; import java.util.Hashtable;
import java.util.Iterator; import java.util.Iterator;
@ -57,7 +55,7 @@ public class Grid extends BaseGridComponent {
transient private TemplateCellElement editingCellElement; transient private TemplateCellElement editingCellElement;
private boolean showGridLine = true; private boolean showGridLine = true;
private Color gridLineColor = new Color(0xf0f0f3); // line color. private Color gridLineColor = UIConstants.RULER_LINE_COLOR; // line color.
private boolean isShowPaginateLine = true; private boolean isShowPaginateLine = true;
private Color paginationLineColor = Color.RED; // line color of paper private Color paginationLineColor = Color.RED; // line color of paper
@ -146,12 +144,10 @@ public class Grid extends BaseGridComponent {
} }
/** /**
* 应用界面设置 * 应用界面设置
* *
* * @date 2014-12-21-下午6:32:43
* @date 2014-12-21-下午6:32:43 */
*
*/
public void updateUI() { public void updateUI() {
GridUIProcessor localGridUIProcessor = ExtraDesignClassManager.getInstance().getSingle(GridUIProcessor.MARK_STRING, new DefaultGridUIProcessor()); GridUIProcessor localGridUIProcessor = ExtraDesignClassManager.getInstance().getSingle(GridUIProcessor.MARK_STRING, new DefaultGridUIProcessor());
ComponentUI localComponentUI = localGridUIProcessor.appearanceForGrid(this.resolution); ComponentUI localComponentUI = localGridUIProcessor.appearanceForGrid(this.resolution);
@ -160,14 +156,11 @@ public class Grid extends BaseGridComponent {
/** /**
* 是否显示格子线 * 是否显示格子线
* *
* @return 是否显示格子线 * @return 是否显示格子线
* * @date 2014-12-21-下午6:32:13
* */
* @date 2014-12-21-下午6:32:13
*
*/
public boolean isShowGridLine() { public boolean isShowGridLine() {
return showGridLine; return showGridLine;
} }
@ -183,7 +176,7 @@ public class Grid extends BaseGridComponent {
this.getElementCasePane().repaint(); this.getElementCasePane().repaint();
} }
public GridMouseAdapter getGridMouseAdapter(){ public GridMouseAdapter getGridMouseAdapter() {
return this.gridMouseAdapter; return this.gridMouseAdapter;
} }
@ -210,14 +203,11 @@ public class Grid extends BaseGridComponent {
} }
/** /**
* 是否显示分页线 * 是否显示分页线
* *
* @return 是否显示分页线 * @return 是否显示分页线
* * @date 2014-12-21-下午6:31:45
* */
* @date 2014-12-21-下午6:31:45
*
*/
public boolean isShowPaginateLine() { public boolean isShowPaginateLine() {
return isShowPaginateLine; return isShowPaginateLine;
} }
@ -253,14 +243,11 @@ public class Grid extends BaseGridComponent {
/** /**
* 是否显示垂直冻结线 * 是否显示垂直冻结线
* *
* @return 是否显示垂直冻结线 * @return 是否显示垂直冻结线
* * @date 2014-12-21-下午6:29:35
* */
* @date 2014-12-21-下午6:29:35
*
*/
public boolean isShowVerticalFrozenLine() { public boolean isShowVerticalFrozenLine() {
return isShowVerticalFrozenLine; return isShowVerticalFrozenLine;
} }
@ -295,14 +282,11 @@ public class Grid extends BaseGridComponent {
} }
/** /**
* 是否显示水平冻结线 * 是否显示水平冻结线
* *
* @return 是否显示水平冻结线 * @return 是否显示水平冻结线
* * @date 2014-12-21-下午6:29:35
* */
* @date 2014-12-21-下午6:29:35
*
*/
public boolean isShowHorizontalFrozenLine() { public boolean isShowHorizontalFrozenLine() {
return isShowHorizontalFrozenLine; return isShowHorizontalFrozenLine;
} }
@ -377,14 +361,11 @@ public class Grid extends BaseGridComponent {
} }
/** /**
* 组件是否可以被编辑 * 组件是否可以被编辑
* *
* @return 组件是否可以被编辑 * @return 组件是否可以被编辑
* * @date 2014-12-21-下午6:29:09
* */
* @date 2014-12-21-下午6:29:09
*
*/
public boolean isEditable() { public boolean isEditable() {
return editable; return editable;
} }
@ -501,27 +482,21 @@ public class Grid extends BaseGridComponent {
// /////////////editor begin // /////////////editor begin
/** /**
* 是否处于编辑状态 * 是否处于编辑状态
* *
* @return 是否处于编辑状态 * @return 是否处于编辑状态
* * @date 2014-12-21-下午6:28:45
* */
* @date 2014-12-21-下午6:28:45
*
*/
public boolean isEditing() { public boolean isEditing() {
return this.editorComponent != null; return this.editorComponent != null;
} }
/** /**
* 当前编辑对象是否为单元格 * 当前编辑对象是否为单元格
* *
* @return 当前编辑对象是否为单元格 * @return 当前编辑对象是否为单元格
* * @date 2014-12-21-下午6:28:18
* */
* @date 2014-12-21-下午6:28:18
*
*/
public boolean isCellEditing() { public boolean isCellEditing() {
return this.isEditing() && cellEditor != null && notShowingTableSelectPane; return this.isEditing() && cellEditor != null && notShowingTableSelectPane;
} }
@ -534,27 +509,21 @@ public class Grid extends BaseGridComponent {
} }
/** /**
* 是否处于智能选择单元格阶段 * 是否处于智能选择单元格阶段
* *
* @return 是否处于智能选择单元格阶段 * @return 是否处于智能选择单元格阶段
* * @date 2014-12-21-下午6:27:36
* */
* @date 2014-12-21-下午6:27:36
*
*/
public boolean IsNotShowingTableSelectPane() { public boolean IsNotShowingTableSelectPane() {
return this.notShowingTableSelectPane; return this.notShowingTableSelectPane;
} }
/** /**
* 当前是否在编辑悬浮元素 * 当前是否在编辑悬浮元素
* *
* @return 是否在编辑悬浮元素 * @return 是否在编辑悬浮元素
* * @date 2014-12-21-下午6:26:46
* */
* @date 2014-12-21-下午6:26:46
*
*/
public boolean isFloatEditing() { public boolean isFloatEditing() {
return this.isEditing() && floatEditor != null; return this.isEditing() && floatEditor != null;
} }
@ -566,7 +535,7 @@ public class Grid extends BaseGridComponent {
* @param column the column of the cell to edit, where 0 is the first column; * @param column the column of the cell to edit, where 0 is the first column;
* @param row the row of the cell to edit, where 0 is the first row * @param row the row of the cell to edit, where 0 is the first row
* @return the editor for this cell; if <code>null</code> return the default * @return the editor for this cell; if <code>null</code> return the default
* editor for this type of cell * editor for this type of cell
* @see com.fr.design.cell.editor.CellEditor * @see com.fr.design.cell.editor.CellEditor
*/ */
public CellEditor getCellEditor(int column, int row) { public CellEditor getCellEditor(int column, int row) {
@ -598,7 +567,7 @@ public class Grid extends BaseGridComponent {
* edited. If nothing is being edited, returns -1. * edited. If nothing is being edited, returns -1.
* *
* @return the index of the column that contains the cell currently being * @return the index of the column that contains the cell currently being
* edited; returns -1 if nothing being edited * edited; returns -1 if nothing being edited
*/ */
public int getEditingColumn() { public int getEditingColumn() {
return editingColumn; return editingColumn;
@ -618,7 +587,7 @@ public class Grid extends BaseGridComponent {
* If nothing is being edited, returns -1. * If nothing is being edited, returns -1.
* *
* @return the index of the row that contains the cell currently being * @return the index of the row that contains the cell currently being
* edited; returns -1 if nothing being edited * edited; returns -1 if nothing being edited
*/ */
public int getEditingRow() { public int getEditingRow() {
return editingRow; return editingRow;
@ -800,25 +769,20 @@ public class Grid extends BaseGridComponent {
} }
/** /**
* 开始单元格编辑 * 开始单元格编辑
* *
* * @date 2014-12-21-下午6:25:17
* @date 2014-12-21-下午6:25:17 */
*
*/
public void startEditing() { public void startEditing() {
this.startEditing(false); this.startEditing(false);
} }
/** /**
* 开始单元格编辑 * 开始单元格编辑
* *
* @param byKeyEvent 是否为键盘触发 * @param byKeyEvent 是否为键盘触发
* * @date 2014-12-21-下午6:25:17
* */
* @date 2014-12-21-下午6:25:17
*
*/
protected void startEditing(boolean byKeyEvent) { protected void startEditing(boolean byKeyEvent) {
ElementCasePane reportPane = this.getElementCasePane(); ElementCasePane reportPane = this.getElementCasePane();
ElementCase report = reportPane.getEditingElementCase(); ElementCase report = reportPane.getEditingElementCase();
@ -867,19 +831,15 @@ public class Grid extends BaseGridComponent {
} }
/** /**
* 开始单元格编辑 * 开始单元格编辑
* *
* @param column * @param column
* @param row * @param row
* @param cellTypeClass 单元格类型 * @param cellTypeClass 单元格类型
* @param byKeyEvent 是否为键盘触发 * @param byKeyEvent 是否为键盘触发
* * @return 编辑是否成功
* @return 编辑是否成功 * @date 2014-12-21-下午6:25:17
* */
*
* @date 2014-12-21-下午6:25:17
*
*/
public boolean startCellEditingAt_DEC(int column, int row, Class cellTypeClass, boolean byKeyEvent) { public boolean startCellEditingAt_DEC(int column, int row, Class cellTypeClass, boolean byKeyEvent) {
if (this.isEditing()) { if (this.isEditing()) {
this.stopEditing();// 需要先停止正在进行的编辑. this.stopEditing();// 需要先停止正在进行的编辑.
@ -954,12 +914,10 @@ public class Grid extends BaseGridComponent {
} }
/** /**
* 停止编辑状态 * 停止编辑状态
* *
* * @date 2014-12-21-下午6:24:54
* @date 2014-12-21-下午6:24:54 */
*
*/
public void stopEditing() { public void stopEditing() {
// 首先判断是哪种类型的编辑. // 首先判断是哪种类型的编辑.
if (this.isCellEditing()) { if (this.isCellEditing()) {
@ -1117,11 +1075,11 @@ public class Grid extends BaseGridComponent {
if (styleChange || imageChange) { if (styleChange || imageChange) {
return true; return true;
} }
} else { } else {
if(newValue instanceof RichText){ if (newValue instanceof RichText) {
setShowAsHtml(this.editingCellElement); setShowAsHtml(this.editingCellElement);
} }
Object oldValue = this.editingCellElement.getValue(); Object oldValue = this.editingCellElement.getValue();
if (!ComparatorUtils.equals_exactly(oldValue, newValue)) { if (!ComparatorUtils.equals_exactly(oldValue, newValue)) {
editingCellElement.setValue(newValue); editingCellElement.setValue(newValue);
@ -1130,16 +1088,16 @@ public class Grid extends BaseGridComponent {
} }
return false; return false;
} }
private void setShowAsHtml(CellElement cellElement){ private void setShowAsHtml(CellElement cellElement) {
CellGUIAttr guiAttr = cellElement.getCellGUIAttr(); CellGUIAttr guiAttr = cellElement.getCellGUIAttr();
if(guiAttr == null){ if (guiAttr == null) {
guiAttr = new CellGUIAttr(); guiAttr = new CellGUIAttr();
cellElement.setCellGUIAttr(guiAttr); cellElement.setCellGUIAttr(guiAttr);
} }
guiAttr.setShowAsHTML(true); guiAttr.setShowAsHTML(true);
} }
/** /**
* 当单元格里的内容过长时自动调整单元格 * 当单元格里的内容过长时自动调整单元格
@ -1148,34 +1106,32 @@ public class Grid extends BaseGridComponent {
*/ */
private void shrinkToFit(TemplateElementCase tplEC) { private void shrinkToFit(TemplateElementCase tplEC) {
if (editingCellElement == null) { if (editingCellElement == null) {
return; return;
} }
Object editElementValue = editingCellElement.getValue(); Object editElementValue = editingCellElement.getValue();
if (valueNeedFit(editElementValue)) { if (valueNeedFit(editElementValue)) {
int mode = this.getElementCasePane().getReportSettings().getShrinkToFitMode(); int mode = this.getElementCasePane().getReportSettings().getShrinkToFitMode();
GridUtils.shrinkToFit(mode, tplEC, editingCellElement); GridUtils.shrinkToFit(mode, tplEC, editingCellElement);
} }
} }
//是否需要根据内容自动调整, 目前只有字符串, 数字, 富文本需要 //是否需要根据内容自动调整, 目前只有字符串, 数字, 富文本需要
private boolean valueNeedFit(Object value){ private boolean valueNeedFit(Object value) {
if(value == null){ if (value == null) {
return false; return false;
} }
return value instanceof String || return value instanceof String ||
value instanceof Number || value instanceof Number ||
value instanceof RichText; value instanceof RichText;
} }
/** /**
* 取消编辑状态 * 取消编辑状态
* *
* * @date 2014-12-21-下午6:24:34
* @date 2014-12-21-下午6:24:34 */
*
*/
public void cancelEditing() { public void cancelEditing() {
if (this.isEditing()) { if (this.isEditing()) {
removeEditor(); removeEditor();
@ -1184,12 +1140,10 @@ public class Grid extends BaseGridComponent {
} }
/** /**
* 移除选中组件 * 移除选中组件
* *
* * @date 2014-12-21-下午6:24:16
* @date 2014-12-21-下午6:24:16 */
*
*/
public void removeEditor() { public void removeEditor() {
if (this.isCellEditing()) { if (this.isCellEditing()) {
this.removeCellEditor(); this.removeCellEditor();
@ -1199,12 +1153,10 @@ public class Grid extends BaseGridComponent {
} }
/** /**
* 移除单元格组件 * 移除单元格组件
* *
* * @date 2014-12-21-下午6:24:00
* @date 2014-12-21-下午6:24:00 */
*
*/
public void removeCellEditor() { public void removeCellEditor() {
CellEditor cellEditor = getCellEditor(); CellEditor cellEditor = getCellEditor();
if (cellEditor == null) { if (cellEditor == null) {
@ -1233,12 +1185,10 @@ public class Grid extends BaseGridComponent {
} }
/** /**
* 移除悬浮元素组件 * 移除悬浮元素组件
* *
* * @date 2014-12-21-下午6:23:38
* @date 2014-12-21-下午6:23:38 */
*
*/
public void removeFloatEditor() { public void removeFloatEditor() {
FloatEditor floatEditor = getFloatEditor(); FloatEditor floatEditor = getFloatEditor();
if (floatEditor != null) { if (floatEditor != null) {
@ -1290,31 +1240,24 @@ public class Grid extends BaseGridComponent {
// /////////////editor end // /////////////editor end
/** /**
* 鼠标点击事件 * 鼠标点击事件
* *
* @param evtX x坐标 * @param evtX x坐标
* @param evtY y坐标 * @param evtY y坐标
* * @date 2014-12-21-下午6:22:56
* */
* @date 2014-12-21-下午6:22:56
*
*/
public void doMousePress(double evtX, double evtY) { public void doMousePress(double evtX, double evtY) {
dispatchEvent(new MouseEvent(this, MouseEvent.MOUSE_PRESSED, System.currentTimeMillis(), 0, (int) evtX, (int) evtY, 1, false)); dispatchEvent(new MouseEvent(this, MouseEvent.MOUSE_PRESSED, System.currentTimeMillis(), 0, (int) evtX, (int) evtY, 1, false));
} }
/** /**
* 计算oldRectangle,因为CellElement的合并会变成多大的区域. * 计算oldRectangle,因为CellElement的合并会变成多大的区域.
* *
* @param report 当前格子报表 * @param report 当前格子报表
* @param oldRectangle 之前的选中区域 * @param oldRectangle 之前的选中区域
* * @return 插入的区域
* @return 插入的区域 * @date 2014-12-21-下午6:22:21
* */
*
* @date 2014-12-21-下午6:22:21
*
*/
public Rectangle caculateIntersectsUnion(ElementCase report, Rectangle oldRectangle) { public Rectangle caculateIntersectsUnion(ElementCase report, Rectangle oldRectangle) {
Rectangle newRectangle = new Rectangle(oldRectangle); Rectangle newRectangle = new Rectangle(oldRectangle);

4
designer/src/com/fr/grid/GridHeader.java

@ -1,5 +1,7 @@
package com.fr.grid; package com.fr.grid;
import com.fr.design.constants.UIConstants;
import java.awt.*; import java.awt.*;
@ -7,7 +9,7 @@ public abstract class GridHeader<T> extends BaseGridComponent {
public final static int SIZE_ADJUST = 4; public final static int SIZE_ADJUST = 4;
//属性 //属性
private Color separatorLineColor = new Color(172, 168, 153); //separator lines private Color separatorLineColor = UIConstants.RULER_LINE_COLOR; //separator lines
private Color selectedForeground = Color.black; private Color selectedForeground = Color.black;
private Color selectedBackground = new Color(208, 240, 252); private Color selectedBackground = new Color(208, 240, 252);

3
designer/src/com/fr/poly/creator/ECBlockEditor.java

@ -47,6 +47,9 @@ public class ECBlockEditor extends BlockEditor<ECBlockPane, PolyECBlock> {
@Override @Override
public void targetModified(TargetModifiedEvent e) { public void targetModified(TargetModifiedEvent e) {
designer.fireTargetModified(); designer.fireTargetModified();
if (DesignerContext.isRefreshOnTargetModifiedEnabled()) {
resetSelectionAndChooseState();
}
} }
}); });
} }

201
designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -34,6 +34,7 @@ import com.fr.report.cell.CellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellExpandAttr; import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.cell.cellattr.core.group.FilterTypeEnum;
import com.fr.report.cell.cellattr.core.group.SelectCount; import com.fr.report.cell.cellattr.core.group.SelectCount;
import javax.swing.*; import javax.swing.*;
@ -46,6 +47,9 @@ import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.ArrayList; import java.util.ArrayList;
import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.*;
/** /**
* 单元格元素 数据列编辑器 * 单元格元素 数据列编辑器
* *
@ -58,10 +62,6 @@ public class CellDSColumnEditor extends CellQuickEditor {
private static final double P = TableLayout.PREFERRED, F = TableLayout.FILL; private static final double P = TableLayout.PREFERRED, F = TableLayout.FILL;
private static final Color TIP_FONT_COLOR = new Color(0x7F333334, true); private static final Color TIP_FONT_COLOR = new Color(0x7F333334, true);
private enum FilterType {
//前N个 后N个 奇数 偶数 自定义 未定义
TOP, BOTTOM, ODD, EVEN, SPECIFY, UNDEFINE
}
private JPanel dsColumnRegion; private JPanel dsColumnRegion;
private JPanel centerPane; private JPanel centerPane;
@ -219,7 +219,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
dataPane = new SelectedDataColumnPane(true, true, tc, cellElement); dataPane = new SelectedDataColumnPane(true, true, tc, cellElement);
groupPane = new ResultSetGroupDockingPane(); groupPane = new ResultSetGroupDockingPane();
dataPane.addListener(dataListener); dataPane.addListener(dataListener);
groupPane.addListener(groupListener); groupPane.setListener(groupListener);
double[] rowSize = {P}, columnSize = {P, F}; double[] rowSize = {P}, columnSize = {P, F};
UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Filter_Conditions")); UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Filter_Conditions"));
@ -669,6 +669,69 @@ public class CellDSColumnEditor extends CellQuickEditor {
private JFormulaField topFormulaPane; private JFormulaField topFormulaPane;
private JFormulaField bottomFormulaPane; private JFormulaField bottomFormulaPane;
private ActionListener actionListener = new ActionListener() {
public void actionPerformed(ActionEvent evt) {
int selectIndex = rsComboBox.getSelectedIndex();
CardLayout setCardPaneLayout = (CardLayout) setCardPane.getLayout();
CardLayout tipCardPaneLayout = (CardLayout) tipCardPane.getLayout();
if (selectIndex == TOP.getValue()) {
//前N个
setCardPaneLayout.show(setCardPane, TOP.name());
tipCardPaneLayout.show(tipCardPane, TOP.name());
//隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
} else if (selectIndex == BOTTOM.getValue()) {
//后N个
setCardPaneLayout.show(setCardPane, BOTTOM.name());
tipCardPaneLayout.show(tipCardPane, BOTTOM.name());
//隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
} else if (selectIndex == ODD.getValue()) {
//奇数
setCardPaneLayout.show(setCardPane, ODD.name());
tipCardPaneLayout.show(tipCardPane, ODD.name());
//隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
} else if (selectIndex == EVEN.getValue()) {
//偶数
setCardPaneLayout.show(setCardPane, EVEN.name());
tipCardPaneLayout.show(tipCardPane, EVEN.name());
//隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
} else if (selectIndex == SPECIFY.getValue()) {
//指定
setCardPaneLayout.show(setCardPane, SPECIFY.name());
tipCardPaneLayout.show(tipCardPane, SPECIFY.name());
//显示set和tip
setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
} else {
//未定义
setCardPaneLayout.show(setCardPane, UNDEFINE.name());
tipCardPaneLayout.show(tipCardPane, UNDEFINE.name());
//隐藏set和tip
setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
}
}
};
public ResultSetFilterConfigPane() { public ResultSetFilterConfigPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
UILabel filterLabel = new UILabel(Inter.getLocText("BindColumn-Results_Filter")); UILabel filterLabel = new UILabel(Inter.getLocText("BindColumn-Results_Filter"));
@ -681,65 +744,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
Inter.getLocText("Even"), Inter.getLocText("Even"),
Inter.getLocText("Specify") Inter.getLocText("Specify")
}); });
rsComboBox.addActionListener(new ActionListener() { rsComboBox.addActionListener(actionListener);
public void actionPerformed(ActionEvent evt) {
int selectIndex = rsComboBox.getSelectedIndex();
CardLayout setCardPaneLayout = (CardLayout) setCardPane.getLayout();
CardLayout tipCardPaneLayout = (CardLayout) tipCardPane.getLayout();
if (selectIndex == 1) {
//前N个
setCardPaneLayout.show(setCardPane, FilterType.TOP.name());
tipCardPaneLayout.show(tipCardPane, FilterType.TOP.name());
//隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
} else if (selectIndex == 2) {
//后N个
setCardPaneLayout.show(setCardPane, FilterType.BOTTOM.name());
tipCardPaneLayout.show(tipCardPane, FilterType.BOTTOM.name());
//隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
} else if (selectIndex == 3) {
//奇数
setCardPaneLayout.show(setCardPane, FilterType.ODD.name());
tipCardPaneLayout.show(tipCardPane, FilterType.ODD.name());
//隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
} else if (selectIndex == 4) {
setCardPaneLayout.show(setCardPane, FilterType.EVEN.name());
tipCardPaneLayout.show(tipCardPane, FilterType.EVEN.name());
//隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
} else if (selectIndex == 5) {
setCardPaneLayout.show(setCardPane, FilterType.SPECIFY.name());
tipCardPaneLayout.show(tipCardPane, FilterType.SPECIFY.name());
//显示set和tip
setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
} else {
setCardPaneLayout.show(setCardPane, FilterType.UNDEFINE.name());
tipCardPaneLayout.show(tipCardPane, FilterType.UNDEFINE.name());
//隐藏set和tip
setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
}
}
});
//配置展示CardLayout //配置展示CardLayout
setCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); setCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
//提示信息展示CardLayout //提示信息展示CardLayout
@ -747,36 +752,36 @@ public class CellDSColumnEditor extends CellQuickEditor {
//前N个 //前N个
topFormulaPane = new JFormulaField(DEFAULT_VALUE); topFormulaPane = new JFormulaField(DEFAULT_VALUE);
setCardPane.add(topFormulaPane, FilterType.TOP.name()); setCardPane.add(topFormulaPane, TOP.name());
tipCardPane.add(new JPanel(), FilterType.TOP.name()); tipCardPane.add(new JPanel(), TOP.name());
//后N个 //后N个
bottomFormulaPane = new JFormulaField(DEFAULT_VALUE); bottomFormulaPane = new JFormulaField(DEFAULT_VALUE);
setCardPane.add(bottomFormulaPane, FilterType.BOTTOM.name()); setCardPane.add(bottomFormulaPane, BOTTOM.name());
tipCardPane.add(new JPanel(), FilterType.BOTTOM.name()); tipCardPane.add(new JPanel(), BOTTOM.name());
//自定义值下方没有提示信息,也没有输入框 //自定义值下方没有提示信息,也没有输入框
setCardPane.add(new JPanel(), FilterType.UNDEFINE.name()); setCardPane.add(new JPanel(), UNDEFINE.name());
tipCardPane.add(new JPanel(), FilterType.UNDEFINE.name()); tipCardPane.add(new JPanel(), UNDEFINE.name());
//奇数 UILabel 占一行作为提示信息 //奇数 UILabel 占一行作为提示信息
setCardPane.add(new JPanel(), FilterType.ODD.name()); setCardPane.add(new JPanel(), ODD.name());
MultilineLabel oddTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Odd_Tip")); MultilineLabel oddTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Odd_Tip"));
oddTip.setForeground(TIP_FONT_COLOR); oddTip.setForeground(TIP_FONT_COLOR);
tipCardPane.add(oddTip, FilterType.ODD.name()); tipCardPane.add(oddTip, ODD.name());
//偶数 UILabel 占一行作为提示信息 //偶数 UILabel 占一行作为提示信息
setCardPane.add(new JPanel(), FilterType.EVEN.name()); setCardPane.add(new JPanel(), EVEN.name());
MultilineLabel evenTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Even_Tip")); MultilineLabel evenTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Even_Tip"));
evenTip.setForeground(TIP_FONT_COLOR); evenTip.setForeground(TIP_FONT_COLOR);
tipCardPane.add(evenTip, FilterType.EVEN.name()); tipCardPane.add(evenTip, EVEN.name());
//输入框占用右半边,提示信息占一行 //输入框占用右半边,提示信息占一行
serialTextField = new UITextField(16); serialTextField = new UITextField(16);
setCardPane.add(serialTextField, FilterType.SPECIFY.name()); setCardPane.add(serialTextField, SPECIFY.name());
MultilineLabel specifyTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Specify_Tip")); MultilineLabel specifyTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Specify_Tip"));
specifyTip.setForeground(TIP_FONT_COLOR); specifyTip.setForeground(TIP_FONT_COLOR);
tipCardPane.add(specifyTip, FilterType.SPECIFY.name()); tipCardPane.add(specifyTip, SPECIFY.name());
contentPane = TableLayoutHelper.createDiffVGapTableLayoutPane(new Component[][]{ contentPane = TableLayoutHelper.createDiffVGapTableLayoutPane(new Component[][]{
{filterLabel, rsComboBox}, {filterLabel, rsComboBox},
{null, setCardPane}, {null, setCardPane},
@ -787,6 +792,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
} }
public void populate(CellElement cellElement) { public void populate(CellElement cellElement) {
rsComboBox.removeActionListener(actionListener);
if (cellElement != null) { if (cellElement != null) {
Object value = cellElement.getValue(); Object value = cellElement.getValue();
if (value != null && value instanceof DSColumn) { if (value != null && value instanceof DSColumn) {
@ -794,42 +800,59 @@ public class CellDSColumnEditor extends CellQuickEditor {
SelectCount selectCount = dSColumn.getSelectCount(); SelectCount selectCount = dSColumn.getSelectCount();
this.topFormulaPane.populateElement(cellElement); this.topFormulaPane.populateElement(cellElement);
this.bottomFormulaPane.populateElement(cellElement); this.bottomFormulaPane.populateElement(cellElement);
CardLayout setCardPaneLayout = (CardLayout) setCardPane.getLayout();
CardLayout tipCardPaneLayout = (CardLayout) tipCardPane.getLayout();
if (selectCount != null) { if (selectCount != null) {
int selectCountType = selectCount.getType(); int selectCountType = selectCount.getType();
this.rsComboBox.setSelectedIndex(selectCountType); this.rsComboBox.setSelectedIndex(selectCountType);
switch (selectCountType) { switch (FilterTypeEnum.getFilterByValue(selectCountType)) {
case SelectCount.TOP: case TOP:
this.topFormulaPane.populate(selectCount.getFormulaCount()); this.topFormulaPane.populate(selectCount.getFormulaCount());
//前N个
setCardPaneLayout.show(setCardPane, TOP.name());
tipCardPaneLayout.show(tipCardPane, TOP.name());
//隐藏tip 显示set //隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(156, 20)); setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(0, 0)); tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
break; break;
case SelectCount.BOTTOM: case BOTTOM:
this.bottomFormulaPane.populate(selectCount.getFormulaCount()); this.bottomFormulaPane.populate(selectCount.getFormulaCount());
//后N个
setCardPaneLayout.show(setCardPane, BOTTOM.name());
tipCardPaneLayout.show(tipCardPane, BOTTOM.name());
//隐藏tip 显示set //隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(156, 20)); setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(0, 0)); tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
break; break;
case SelectCount.SPECIFY: case SPECIFY:
this.serialTextField.setText(selectCount.getSerial()); this.serialTextField.setText(selectCount.getSerial());
//指定
setCardPaneLayout.show(setCardPane, SPECIFY.name());
tipCardPaneLayout.show(tipCardPane, SPECIFY.name());
//显示set和tip //显示set和tip
setCardPane.setPreferredSize(new Dimension(156, 20)); setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(224, 40)); tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
break; break;
case SelectCount.EVEN: case EVEN:
//偶数
setCardPaneLayout.show(setCardPane, EVEN.name());
tipCardPaneLayout.show(tipCardPane, EVEN.name());
//隐藏set 显示tip //隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0)); setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
tipCardPane.setPreferredSize(new Dimension(224, 40)); tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
break; break;
case SelectCount.ODD: case ODD:
//奇数
setCardPaneLayout.show(setCardPane, ODD.name());
tipCardPaneLayout.show(tipCardPane, ODD.name());
//隐藏set 显示tip //隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0)); setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
@ -837,6 +860,9 @@ public class CellDSColumnEditor extends CellQuickEditor {
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
break; break;
default: default:
//未定义
setCardPaneLayout.show(setCardPane, UNDEFINE.name());
tipCardPaneLayout.show(tipCardPane, UNDEFINE.name());
//隐藏set和tip //隐藏set和tip
setCardPane.setPreferredSize(new Dimension(0, 0)); setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
@ -844,6 +870,9 @@ public class CellDSColumnEditor extends CellQuickEditor {
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
} }
} else { } else {
//未定义
setCardPaneLayout.show(setCardPane, UNDEFINE.name());
tipCardPaneLayout.show(tipCardPane, UNDEFINE.name());
//隐藏set和tip //隐藏set和tip
setCardPane.setPreferredSize(new Dimension(0, 0)); setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
@ -852,6 +881,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
} }
} }
} }
rsComboBox.addActionListener(actionListener);
} }
public void update(CellElement cellElement) { public void update(CellElement cellElement) {
@ -866,11 +896,11 @@ public class CellDSColumnEditor extends CellQuickEditor {
SelectCount selectCount = new SelectCount(); SelectCount selectCount = new SelectCount();
selectCount.setType(selectedFilterIndex); selectCount.setType(selectedFilterIndex);
dSColumn.setSelectCount(selectCount); dSColumn.setSelectCount(selectCount);
if (selectedFilterIndex == SelectCount.TOP) { if (selectedFilterIndex == TOP.getValue()) {
selectCount.setFormulaCount(this.topFormulaPane.getFormulaText()); selectCount.setFormulaCount(this.topFormulaPane.getFormulaText());
} else if (selectedFilterIndex == SelectCount.BOTTOM) { } else if (selectedFilterIndex == BOTTOM.getValue()) {
selectCount.setFormulaCount(this.bottomFormulaPane.getFormulaText()); selectCount.setFormulaCount(this.bottomFormulaPane.getFormulaText());
} else if (selectedFilterIndex == SelectCount.SPECIFY) { } else if (selectedFilterIndex == SPECIFY.getValue()) {
selectCount.setSerial(this.serialTextField.getText()); selectCount.setSerial(this.serialTextField.getText());
} }
} }
@ -887,6 +917,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
topFormulaPane.addListener(formulaListener); topFormulaPane.addListener(formulaListener);
bottomFormulaPane.addListener(formulaListener); bottomFormulaPane.addListener(formulaListener);
rsComboBox.registerChangeListener(formulaListener); rsComboBox.registerChangeListener(formulaListener);
serialTextField.registerChangeListener(formulaListener);
} }
} }

197
designer/src/com/fr/start/Designer.java

@ -51,17 +51,17 @@ public class Designer extends BaseDesigner {
private static final int TOOLBARPANEVGAP = -4; private static final int TOOLBARPANEVGAP = -4;
private static final int PREVIEW_DOWN_X_GAP = 92; private static final int PREVIEW_DOWN_X_GAP = 92;
private static final int GAP = 7; private static final int GAP = 7;
private static final String OLD_ENV_FOLDER_71 = ".FineReport71"; private static final String OLD_ENV_FOLDER_71 = ".FineReport71";
private static final String OLD_ENV_FOLDER_70 = ".FineReport70"; private static final String OLD_ENV_FOLDER_70 = ".FineReport70";
private UserInfoPane userInfoPane; private UserInfoPane userInfoPane;
private UIButton saveButton; private UIButton saveButton;
private UIButton undo; private UIButton undo;
private UIButton redo; private UIButton redo;
private UIPreviewButton run; private UIPreviewButton run;
/** /**
* 设计器启动的Main方法 * 设计器启动的Main方法
@ -135,32 +135,31 @@ public class Designer extends BaseDesigner {
public UILargeToolbar createLargeToolbar() { public UILargeToolbar createLargeToolbar() {
UILargeToolbar largeToolbar = super.createLargeToolbar(); UILargeToolbar largeToolbar = super.createLargeToolbar();
largeToolbar.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 4)); largeToolbar.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 4));
JPanel templeJpanel = new JPanel() { largeToolbar.add(generateEmptyGap(1));
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.width = 1;
return dim;
}
};
templeJpanel.setBackground(Color.WHITE);
largeToolbar.add(templeJpanel);
createRunButton(largeToolbar); createRunButton(largeToolbar);
largeToolbar.add(run); largeToolbar.add(run);
templeJpanel = new JPanel() { run.setBackground(Color.WHITE);
largeToolbar.add(generateEmptyGap(GAP));
largeToolbar.addSeparator(new Dimension(2, 42));
largeToolbar.setBorder(new MatteBorder(new Insets(0, 0, 1, 0), UIConstants.LINE_COLOR));
return largeToolbar;
}
private JPanel generateEmptyGap(final int width) {
JPanel panel = new JPanel() {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize(); Dimension dim = super.getPreferredSize();
dim.width = GAP; dim.width = width;
return dim; return dim;
} }
}; };
templeJpanel.setBackground(Color.WHITE); panel.setBackground(Color.WHITE);
largeToolbar.add(templeJpanel); return panel;
largeToolbar.setBorder(new MatteBorder(new Insets(0, 0, 1, 0), UIConstants.LINE_COLOR));
return largeToolbar;
} }
/** /**
* 创建上面一排的工具栏按钮 * 创建上面一排的工具栏按钮
*
* @return 按钮 * @return 按钮
*/ */
public UIButton[] createUp() { public UIButton[] createUp() {
@ -183,7 +182,7 @@ public class Designer extends BaseDesigner {
}); });
return saveButton; return saveButton;
} }
private UIButton createUndoButton() { private UIButton createUndoButton() {
undo = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/undo.png")); undo = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/undo.png"));
undo.setToolTipText(KeySetUtils.UNDO.getMenuKeySetName()); undo.setToolTipText(KeySetUtils.UNDO.getMenuKeySetName());
@ -292,9 +291,10 @@ public class Designer extends BaseDesigner {
/** /**
* 生成工具栏 * 生成工具栏
*
* @param toolbarComponent 工具栏 * @param toolbarComponent 工具栏
* @param plus 对象 * @param plus 对象
* @return 更新后的toolbar * @return 更新后的toolbar
*/ */
public JComponent resetToolBar(JComponent toolbarComponent, ToolBarMenuDockPlus plus) { public JComponent resetToolBar(JComponent toolbarComponent, ToolBarMenuDockPlus plus) {
//如果是处于权限编辑状态 //如果是处于权限编辑状态
@ -333,16 +333,15 @@ public class Designer extends BaseDesigner {
public JTemplate<?, ?> createNewTemplate() { public JTemplate<?, ?> createNewTemplate() {
return new JWorkBook(); return new JWorkBook();
} }
/** /**
* 创建论坛登录面板, chart那边不需要 * 创建论坛登录面板, chart那边不需要
* *
* @return 面板组件 * @return 面板组件
* */
*/ public Component createBBSLoginPane() {
public Component createBBSLoginPane(){ if (userInfoPane == null) {
if (userInfoPane == null){ userInfoPane = new UserInfoPane();
userInfoPane = new UserInfoPane();
} }
return userInfoPane; return userInfoPane;
} }
@ -352,7 +351,7 @@ public class Designer extends BaseDesigner {
* *
* @return 面板组件 * @return 面板组件
*/ */
public Component createAlphafinePane() { public Component createAlphaFinePane() {
return AlphaFinePane.getAlphaFinePane(); return AlphaFinePane.getAlphaFinePane();
} }
@ -360,68 +359,67 @@ public class Designer extends BaseDesigner {
protected SplashPane createSplashPane() { protected SplashPane createSplashPane() {
return new ReportSplashPane(); return new ReportSplashPane();
} }
/** /**
* 收集用户信息吗 * 收集用户信息吗
* */
*/
protected void collectUserInformation() { protected void collectUserInformation() {
//定制的就不弹出来了 //定制的就不弹出来了
if (!ComparatorUtils.equals(ProductConstants.APP_NAME, ProductConstants.DEFAULT_APPNAME)) { if (!ComparatorUtils.equals(ProductConstants.APP_NAME, ProductConstants.DEFAULT_APP_NAME)) {
return; return;
} }
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
final String key = envManager.getActivationKey(); final String key = envManager.getActivationKey();
//本地验证通过 //本地验证通过
if(ActiveKeyGenerator.localVerify(key)){ if (ActiveKeyGenerator.localVerify(key)) {
onLineVerify(envManager, key); onLineVerify(envManager, key);
UserInfoLabel.showBBSDialog(); UserInfoLabel.showBBSDialog();
return; return;
} }
if(StableUtils.checkDesignerActive(readOldKey())){ if (StableUtils.checkDesignerActive(readOldKey())) {
//只要有老的key, 就不弹窗, 下次启动的时候, 在线验证下就行. //只要有老的key, 就不弹窗, 下次启动的时候, 在线验证下就行.
String newKey = ActiveKeyGenerator.generateActiveKey(); String newKey = ActiveKeyGenerator.generateActiveKey();
envManager.setActivationKey(newKey); envManager.setActivationKey(newKey);
UserInfoLabel.showBBSDialog(); UserInfoLabel.showBBSDialog();
return; return;
} }
CollectUserInformationDialog activeDialog = new CollectUserInformationDialog( CollectUserInformationDialog activeDialog = new CollectUserInformationDialog(
DesignerContext.getDesignerFrame()); DesignerContext.getDesignerFrame());
activeDialog.setVisible(true); activeDialog.setVisible(true);
} }
private void onLineVerify(DesignerEnvManager envManager, final String key){ private void onLineVerify(DesignerEnvManager envManager, final String key) {
int status = envManager.getActiveKeyStatus(); int status = envManager.getActiveKeyStatus();
//没有联网验证过 //没有联网验证过
if (status != 0) { if (status != 0) {
Thread authThread = new Thread(new Runnable() { Thread authThread = new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
ActiveKeyGenerator.onLineVerify(key); ActiveKeyGenerator.onLineVerify(key);
} }
}); });
authThread.start(); authThread.start();
} }
} }
private File getOldEnvFile(String folderName){ private File getOldEnvFile(String folderName) {
String userHome = System.getProperty("user.home"); String userHome = System.getProperty("user.home");
if (userHome == null) { if (userHome == null) {
userHome = System.getProperty("userHome"); userHome = System.getProperty("userHome");
} }
String filePath = StableUtils.pathJoin(userHome, folderName, ProductConstants.APP_NAME + "Env.xml"); String filePath = StableUtils.pathJoin(userHome, folderName, ProductConstants.APP_NAME + "Env.xml");
return new File(filePath); return new File(filePath);
} }
private String getOldActiveKeyFromFile(File envFile){ private String getOldActiveKeyFromFile(File envFile) {
if (!envFile.exists()) { if (!envFile.exists()) {
return StringUtils.EMPTY; return StringUtils.EMPTY;
} }
DesignerEnvManager temp = new DesignerEnvManager(); DesignerEnvManager temp = new DesignerEnvManager();
try { try {
XMLTools.readFileXML(temp, envFile); XMLTools.readFileXML(temp, envFile);
@ -430,26 +428,25 @@ public class Designer extends BaseDesigner {
} }
return temp.getActivationKey(); return temp.getActivationKey();
} }
//默认只从7.0和711的设计器里读取key //默认只从7.0和711的设计器里读取key
private String readOldKey(){ private String readOldKey() {
File file71 = getOldEnvFile(OLD_ENV_FOLDER_71); File file71 = getOldEnvFile(OLD_ENV_FOLDER_71);
if (!file71.exists()) { if (!file71.exists()) {
File file70 = getOldEnvFile(OLD_ENV_FOLDER_70); File file70 = getOldEnvFile(OLD_ENV_FOLDER_70);
return getOldActiveKeyFromFile(file70); return getOldActiveKeyFromFile(file70);
} }
return getOldActiveKeyFromFile(file71); return getOldActiveKeyFromFile(file71);
} }
/** /**
* 设计器退出时, 做的一些操作. * 设计器退出时, 做的一些操作.
* */
*/ public void shutDown() {
public void shutDown(){ InformationCollector collector = InformationCollector.getInstance();
InformationCollector collector = InformationCollector.getInstance(); collector.collectStopTime();
collector.collectStopTime(); collector.saveXMLFile();
collector.saveXMLFile();
ServletContext.fireServletStopListener(); ServletContext.fireServletStopListener();
} }

172
designer_base/src/com/fr/design/DesignerEnvManager.java

@ -13,22 +13,47 @@ import com.fr.design.constants.UIConstants;
import com.fr.env.RemoteEnv; import com.fr.env.RemoteEnv;
import com.fr.env.SignIn; import com.fr.env.SignIn;
import com.fr.file.FILEFactory; import com.fr.file.FILEFactory;
import com.fr.general.*; import com.fr.general.ComparatorUtils;
import com.fr.stable.*; import com.fr.general.FRLevel;
import com.fr.general.FRLogFormatter;
import com.fr.general.FRLogger;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.stable.Constants;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.ListMap;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.core.UUID; import com.fr.stable.core.UUID;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.stable.xml.*; import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLReadable;
import com.fr.stable.xml.XMLTools;
import com.fr.stable.xml.XMLWriter;
import com.fr.stable.xml.XMLableReader;
import org.apache.log4j.Level;
import javax.swing.*; import javax.swing.*;
import javax.swing.SwingWorker.StateValue; import javax.swing.SwingWorker.StateValue;
import java.awt.*; import java.awt.*;
import java.io.*; import java.io.File;
import java.util.*; import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.logging.FileHandler; import java.util.logging.FileHandler;
import java.util.logging.Handler; import java.util.logging.Handler;
import org.apache.log4j.Level;
/** /**
* The manager of Designer GUI. * The manager of Designer GUI.
@ -36,6 +61,7 @@ import org.apache.log4j.Level;
public class DesignerEnvManager implements XMLReadable, XMLWriter { public class DesignerEnvManager implements XMLReadable, XMLWriter {
private static final int MAX_SHOW_NUM = 10; private static final int MAX_SHOW_NUM = 10;
private static final String VERSION_80 = "80";
private static DesignerEnvManager designerEnvManager; // gui. private static DesignerEnvManager designerEnvManager; // gui.
private String activationKey = null; private String activationKey = null;
@ -145,19 +171,19 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
designerEnvManager.setCurEnvName(name); designerEnvManager.setCurEnvName(name);
} }
} }
GeneralContext.addEnvChangedListener(new EnvChangedListener() { GeneralContext.addEnvChangedListener(new EnvChangedListener() {
@Override @Override
public void envChanged() { public void envChanged() {
designerEnvManager.setCurrentDirectoryPrefix(FILEFactory.ENV_PREFIX); designerEnvManager.setCurrentDirectoryPrefix(FILEFactory.ENV_PREFIX);
designerEnvManager.setDialogCurrentDirectory(ProjectConstants.REPORTLETS_NAME); designerEnvManager.setDialogCurrentDirectory(ProjectConstants.REPORTLETS_NAME);
} }
}); });
} }
return designerEnvManager; return designerEnvManager;
} }
@ -219,9 +245,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
calender.setTimeInMillis(System.currentTimeMillis()); calender.setTimeInMillis(System.currentTimeMillis());
String today = calender.get(Calendar.YEAR) + "-" + (calender.get(Calendar.MONTH) + 1) + "-" + calender.get(Calendar.DAY_OF_MONTH); String today = calender.get(Calendar.YEAR) + "-" + (calender.get(Calendar.MONTH) + 1) + "-" + calender.get(Calendar.DAY_OF_MONTH);
String fileName = StableUtils.pathJoin(new String[]{ String fileName = StableUtils.pathJoin(logLocation, "fr_" + today + "_%g.log");
logLocation, "fr_" + today + "_%g.log"
});
if (!new java.io.File(fileName).exists()) { if (!new java.io.File(fileName).exists()) {
StableUtils.makesureFileExist(new java.io.File(fileName)); StableUtils.makesureFileExist(new java.io.File(fileName));
} }
@ -253,11 +277,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
try { try {
FileWriter fileWriter = new FileWriter(envFile); FileWriter fileWriter = new FileWriter(envFile);
File oldEnvFile = new File(ProductConstants.getEnvHome() + File.separator + ProductConstants.APP_NAME + "6-1" + "Env.xml"); File oldEnvFile = new File(ProductConstants.getEnvHome() + File.separator + ProductConstants.APP_NAME + "6-1" + "Env.xml");
File envFile80 = new File(getEnvHome(VERSION_80) + File.separator + getEnvFile().getName());
if (oldEnvFile.exists()) { if (oldEnvFile.exists()) {
// marks:兼容DesignerEnv6-1.xml // marks:兼容DesignerEnv6-1.xml
FileReader fileReader = new FileReader(oldEnvFile); FileReader fileReader = new FileReader(oldEnvFile);
Utils.copyCharTo(fileReader, fileWriter); Utils.copyCharTo(fileReader, fileWriter);
fileReader.close(); fileReader.close();
} else if (envFile80.exists()) {
compatibilityPrevVersion(envFile80);
} else { } else {
// marks:生成一个新的xml文件 // marks:生成一个新的xml文件
StringReader stringReader = new StringReader("<?xml version=\"1.0\" encoding=\"UTF-8\" ?><Env></Env>"); StringReader stringReader = new StringReader("<?xml version=\"1.0\" encoding=\"UTF-8\" ?><Env></Env>");
@ -270,6 +297,33 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} }
} }
private static String getEnvHome(String version) {
String userHome = System.getProperty("user.home");
if (userHome == null) {
userHome = System.getProperty("userHome");
}
File envHome = new File(userHome + File.separator + "." + ProductConstants.APP_NAME + version);
if (!envHome.exists()) {
StableUtils.mkdirs(envHome);
}
return envHome.getAbsolutePath();
}
private void compatibilityPrevVersion(File prevEnvFile) {
try {
XMLTools.readFileXML(designerEnvManager, prevEnvFile);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
// 清空前一个版本中的工作目录和最近打开
nameEnvMap = new ListMap<String, Env>();
recentOpenedFilePathList = new ArrayList<String>();
curEnvName = null;
designerEnvManager.saveXMLFile();
}
public static void setEnvFile(File envFile) { public static void setEnvFile(File envFile) {
DesignerEnvManager.envFile = envFile; DesignerEnvManager.envFile = envFile;
} }
@ -285,6 +339,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
/** /**
* 是否启用了https * 是否启用了https
*
* @return 同上 * @return 同上
*/ */
public boolean isHttps() { public boolean isHttps() {
@ -311,7 +366,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
return certificatePass; return certificatePass;
} }
public void setCertificatePass(String certificatePass){ public void setCertificatePass(String certificatePass) {
this.certificatePass = certificatePass; this.certificatePass = certificatePass;
} }
@ -531,13 +586,13 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.reportLengthUnit = reportLengthUnit; this.reportLengthUnit = reportLengthUnit;
} }
private void writeTempFile(File tempFile){ private void writeTempFile(File tempFile) {
try{ try {
OutputStream fout = new FileOutputStream(tempFile); OutputStream fout = new FileOutputStream(tempFile);
XMLTools.writeOutputStreamXML(this, fout); XMLTools.writeOutputStreamXML(this, fout);
fout.flush(); fout.flush();
fout.close(); fout.close();
}catch (Exception e) { } catch (Exception e) {
FRContext.getLogger().error(e.getMessage()); FRContext.getLogger().error(e.getMessage());
} }
} }
@ -546,9 +601,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
* 保存设计器的配置文件, 该文件不在env的resource目录下 * 保存设计器的配置文件, 该文件不在env的resource目录下
* 而是在Consts.getEnvHome() + File.separator + Consts.APP_NAME * 而是在Consts.getEnvHome() + File.separator + Consts.APP_NAME
* *
*
* @date 2014-9-29-上午11:04:23 * @date 2014-9-29-上午11:04:23
*
*/ */
public void saveXMLFile() { public void saveXMLFile() {
File xmlFile = this.getDesignerEnvFile(); File xmlFile = this.getDesignerEnvFile();
@ -577,7 +630,6 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
* 是否加入产品改良 * 是否加入产品改良
* *
* @return 是否加入产品改良 * @return 是否加入产品改良
*
*/ */
public boolean isJoinProductImprove() { public boolean isJoinProductImprove() {
return joinProductImprove; return joinProductImprove;
@ -585,7 +637,6 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
/** /**
* 设置加入产品改良 * 设置加入产品改良
*
*/ */
public void setJoinProductImprove(boolean joinProductImprove) { public void setJoinProductImprove(boolean joinProductImprove) {
this.joinProductImprove = joinProductImprove; this.joinProductImprove = joinProductImprove;
@ -1155,63 +1206,63 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.lastShowBBSNewsTime = lastShowBBSNewsTime; this.lastShowBBSNewsTime = lastShowBBSNewsTime;
} }
private void readXMLVersion(XMLableReader reader){ private void readXMLVersion(XMLableReader reader) {
String tmpVal; String tmpVal;
if ((tmpVal = reader.getElementValue()) != null) { if ((tmpVal = reader.getElementValue()) != null) {
reader.setXmlVersionByString(tmpVal); reader.setXmlVersionByString(tmpVal);
} }
} }
private void readActiveKey(XMLableReader reader){ private void readActiveKey(XMLableReader reader) {
String tmpVal; String tmpVal;
if ((tmpVal = reader.getElementValue()) != null) { if ((tmpVal = reader.getElementValue()) != null) {
this.setActivationKey(tmpVal); this.setActivationKey(tmpVal);
} }
} }
private void readLogLocation(XMLableReader reader){ private void readLogLocation(XMLableReader reader) {
String tmpVal; String tmpVal;
if ((tmpVal = reader.getElementValue()) != null) { if ((tmpVal = reader.getElementValue()) != null) {
this.setLogLocation(tmpVal); this.setLogLocation(tmpVal);
} }
} }
private void readLanguage(XMLableReader reader){ private void readLanguage(XMLableReader reader) {
String tmpVal; String tmpVal;
if ((tmpVal = reader.getElementValue()) != null) { if ((tmpVal = reader.getElementValue()) != null) {
this.setLanguage(Integer.parseInt(tmpVal)); this.setLanguage(Integer.parseInt(tmpVal));
} }
} }
private void readJettyPort(XMLableReader reader){ private void readJettyPort(XMLableReader reader) {
String tmpVal; String tmpVal;
if ((tmpVal = reader.getElementValue()) != null) { if ((tmpVal = reader.getElementValue()) != null) {
this.setJettyServerPort(Integer.parseInt(tmpVal)); this.setJettyServerPort(Integer.parseInt(tmpVal));
} }
} }
private void readPageLengthUnit(XMLableReader reader){ private void readPageLengthUnit(XMLableReader reader) {
String tmpVal; String tmpVal;
if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) { if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) {
this.pageLengthUnit = Short.parseShort(tmpVal); this.pageLengthUnit = Short.parseShort(tmpVal);
} }
} }
private void readReportLengthUnit(XMLableReader reader){ private void readReportLengthUnit(XMLableReader reader) {
String tmpVal; String tmpVal;
if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) { if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) {
this.reportLengthUnit = Short.parseShort(tmpVal); this.reportLengthUnit = Short.parseShort(tmpVal);
} }
} }
private void readLastOpenFile(XMLableReader reader){ private void readLastOpenFile(XMLableReader reader) {
String tmpVal; String tmpVal;
if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) { if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) {
this.lastOpenFilePath = tmpVal; this.lastOpenFilePath = tmpVal;
} }
} }
private void readEncrytionKey(XMLableReader reader){ private void readEncrytionKey(XMLableReader reader) {
String tmpVal; String tmpVal;
if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) { if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) {
this.encryptionKey = tmpVal; this.encryptionKey = tmpVal;
@ -1219,15 +1270,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} }
private void readLastBBSTime(XMLableReader reader) {
private void readLastBBSTime(XMLableReader reader){
String tmpVal; String tmpVal;
if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) { if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) {
this.lastShowBBSTime = tmpVal; this.lastShowBBSTime = tmpVal;
} }
} }
private void readLastBBSNewsTime(XMLableReader reader){ private void readLastBBSNewsTime(XMLableReader reader) {
String tmpVal; String tmpVal;
if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) { if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) {
this.lastShowBBSNewsTime = tmpVal; this.lastShowBBSNewsTime = tmpVal;
@ -1275,15 +1325,15 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
readEncrytionKey(reader); readEncrytionKey(reader);
} else if ("jdkHome".equals(name)) { } else if ("jdkHome".equals(name)) {
this.jdkHome = reader.getElementValue(); this.jdkHome = reader.getElementValue();
}else if ("lastBBSTime".equals(name)){ } else if ("lastBBSTime".equals(name)) {
readLastBBSTime(reader); readLastBBSTime(reader);
} else if ("lastBBSNewsTime".equals(name)){ } else if ("lastBBSNewsTime".equals(name)) {
readLastBBSNewsTime(reader); readLastBBSNewsTime(reader);
}else if ("uuid".equals(name)){ } else if ("uuid".equals(name)) {
readUUID(reader); readUUID(reader);
} else if ("status".equals(name)){ } else if ("status".equals(name)) {
readActiveStatus(reader); readActiveStatus(reader);
} else if (ComparatorUtils.equals(CAS_PARAS,name)){ } else if (ComparatorUtils.equals(CAS_PARAS, name)) {
readHttpsParas(reader); readHttpsParas(reader);
} else if (name.equals("AlphaFineConfigManager")) { } else if (name.equals("AlphaFineConfigManager")) {
readAlphaFineAttr(reader); readAlphaFineAttr(reader);
@ -1297,12 +1347,12 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
reader.readXMLObject(this.alphaFineConfigManager = new AlphaFineConfigManager()); reader.readXMLObject(this.alphaFineConfigManager = new AlphaFineConfigManager());
} }
private void readHttpsParas(XMLableReader reader){ private void readHttpsParas(XMLableReader reader) {
String tempVal; String tempVal;
if((tempVal = reader.getAttrAsString(CAS_CERTIFICATE_PATH, null)) != null){ if ((tempVal = reader.getAttrAsString(CAS_CERTIFICATE_PATH, null)) != null) {
this.setCertificatePath(tempVal); this.setCertificatePath(tempVal);
} }
if((tempVal = reader.getAttrAsString(CAS_CERTIFICATE_PASSWORD, null)) != null){ if ((tempVal = reader.getAttrAsString(CAS_CERTIFICATE_PASSWORD, null)) != null) {
this.setCertificatePass(tempVal); this.setCertificatePass(tempVal);
} }
@ -1429,18 +1479,6 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} }
} }
}); });
// xml读完之后,看一下nameEnvMap是不是长度为0
if (nameEnvMap.isEmpty() && StableUtils.getInstallHome() != null) {
String install_home = StableUtils.getInstallHome();
if (install_home != null && new java.io.File(install_home).exists()) {
nameEnvMap.put("Default", LocalEnv.createEnv(StableUtils.pathJoin(new String[]{
install_home, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME
})));
curEnvName = "Default";
}
}
} }
private void readRecentOpenFileList(XMLableReader reader) { private void readRecentOpenFileList(XMLableReader reader) {
@ -1519,14 +1557,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} }
//写入uuid //写入uuid
private void writeUUID(XMLPrintWriter writer){ private void writeUUID(XMLPrintWriter writer) {
writer.startTAG("uuid"); writer.startTAG("uuid");
writer.textNode(getUUID()); writer.textNode(getUUID());
writer.end(); writer.end();
} }
//读取uuid //读取uuid
private void readUUID(XMLableReader reader){ private void readUUID(XMLableReader reader) {
String tmpVal; String tmpVal;
if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) { if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) {
this.uuid = tmpVal; this.uuid = tmpVal;
@ -1534,8 +1572,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} }
//写入激活状态 //写入激活状态
private void writeActiveStatus(XMLPrintWriter writer){ private void writeActiveStatus(XMLPrintWriter writer) {
if (this.activeKeyStatus == 0){ if (this.activeKeyStatus == 0) {
writer.startTAG("status"); writer.startTAG("status");
writer.textNode(this.activeKeyStatus + ""); writer.textNode(this.activeKeyStatus + "");
writer.end(); writer.end();
@ -1543,7 +1581,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} }
//读取激活状态 //读取激活状态
private void readActiveStatus(XMLableReader reader){ private void readActiveStatus(XMLableReader reader) {
String tmpVal; String tmpVal;
if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) { if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) {
this.activeKeyStatus = Integer.parseInt(tmpVal); this.activeKeyStatus = Integer.parseInt(tmpVal);
@ -1596,7 +1634,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
if (!this.isOracleSystemSpace()) { if (!this.isOracleSystemSpace()) {
writer.attr("useOracleSystemSpace", this.isOracleSystemSpace()); writer.attr("useOracleSystemSpace", this.isOracleSystemSpace());
} }
if (!this.isJoinProductImprove()){ if (!this.isJoinProductImprove()) {
writer.attr("joinProductImprove", this.isJoinProductImprove()); writer.attr("joinProductImprove", this.isJoinProductImprove());
} }
if (!this.isAutoBackUp()) { if (!this.isAutoBackUp()) {
@ -1681,29 +1719,29 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} }
//写论坛相关的两个属性 //写论坛相关的两个属性
private void writeBBSRelated(XMLPrintWriter writer){ private void writeBBSRelated(XMLPrintWriter writer) {
if (StringUtils.isNotEmpty(this.lastShowBBSTime)){ if (StringUtils.isNotEmpty(this.lastShowBBSTime)) {
writer.startTAG("lastBBSTime"); writer.startTAG("lastBBSTime");
writer.textNode(lastShowBBSTime); writer.textNode(lastShowBBSTime);
writer.end(); writer.end();
} }
if (StringUtils.isNotEmpty(this.lastShowBBSNewsTime)){ if (StringUtils.isNotEmpty(this.lastShowBBSNewsTime)) {
writer.startTAG("lastBBSNewsTime"); writer.startTAG("lastBBSNewsTime");
writer.textNode(lastShowBBSNewsTime); writer.textNode(lastShowBBSNewsTime);
writer.end(); writer.end();
} }
} }
private void writeHttpsParas(XMLPrintWriter writer){ private void writeHttpsParas(XMLPrintWriter writer) {
writer.startTAG(CAS_PARAS); writer.startTAG(CAS_PARAS);
if(StringUtils.isNotBlank(certificatePath)){ if (StringUtils.isNotBlank(certificatePath)) {
writer.attr(CAS_CERTIFICATE_PATH, certificatePath); writer.attr(CAS_CERTIFICATE_PATH, certificatePath);
} }
if(StringUtils.isNotBlank(certificatePass)){ if (StringUtils.isNotBlank(certificatePass)) {
writer.attr(CAS_CERTIFICATE_PASSWORD, certificatePass); writer.attr(CAS_CERTIFICATE_PASSWORD, certificatePass);
} }
if(isHttps){ if (isHttps) {
writer.attr("enable", true); writer.attr("enable", true);
} }
writer.end(); writer.end();
@ -1736,7 +1774,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
if (env == null) { if (env == null) {
return; return;
} }
writer.startTAG("Env"); writer.startTAG("Env");
writer.classAttr(env.getClass()); writer.classAttr(env.getClass());
writer.attr("name", name); writer.attr("name", name);

2
designer_base/src/com/fr/design/actions/TemplateComponentAction.java

@ -2,6 +2,7 @@ package com.fr.design.actions;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
import com.fr.design.mainframe.DesignerContext;
public abstract class TemplateComponentAction<T extends TargetComponent> extends UndoableAction implements TemplateComponentActionInterface<T> { public abstract class TemplateComponentAction<T extends TargetComponent> extends UndoableAction implements TemplateComponentActionInterface<T> {
private T t; private T t;
@ -24,6 +25,7 @@ public abstract class TemplateComponentAction<T extends TargetComponent> extends
@Override @Override
public void prepare4Undo() { public void prepare4Undo() {
DesignerContext.enableRefreshOnTargetModified();
this.getEditingComponent().fireTargetModified(); this.getEditingComponent().fireTargetModified();
T component = getEditingComponent(); T component = getEditingComponent();
if (component == null) { if (component == null) {

44
designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java

@ -1,5 +1,6 @@
package com.fr.design.actions.help.alphafine; package com.fr.design.actions.help.alphafine;
import com.fr.base.FRContext;
import com.fr.base.FRCoreContext; import com.fr.base.FRCoreContext;
import com.fr.general.VT4FR; import com.fr.general.VT4FR;
import com.fr.stable.OperatingSystem; import com.fr.stable.OperatingSystem;
@ -15,79 +16,68 @@ import javax.swing.*;
*/ */
public class AlphaFineConfigManager implements XMLable { public class AlphaFineConfigManager implements XMLable {
private static AlphaFineConfigManager alphaFineConfigManager = new AlphaFineConfigManager();
/** /**
* 是否开启alphafine * 是否开启alphafine
*/ */
private boolean isEnabled = true; private boolean isEnabled = true;
/** /**
* 是否联网搜索 * 是否联网搜索
*/ */
private boolean isSearchOnLine = true; private boolean isSearchOnLine = true;
/** /**
* 快捷键设置 * 搜索范围
*/ */
private String shortcuts;
/** /**
* 搜索范围 * 快捷键设置
*/ */
private String shortcuts;
/** /**
* 猜您需要 * 猜您需要
*/ */
private boolean isContainRecommend = true; private boolean isContainRecommend = true;
/** /**
* 设置 * 设置
*/ */
private boolean isContainAction = true; private boolean isContainAction = true;
/** /**
* 帮助文档 * 帮助文档
*/ */
private boolean isContainDocument = true; private boolean isContainDocument = true;
/** /**
* 模板 * 模板
*/ */
private boolean isContainTemplate = true; private boolean isContainTemplate = true;
/** /**
* 模板内容 * 模板内容
*/ */
private boolean isContainFileContent; private boolean isContainFileContent;
/** /**
* 应用中心 * 应用中心
*/ */
private boolean isContainPlugin = true; private boolean isContainPlugin = true;
/** /**
* 快捷键 * 快捷键
*/ */
private KeyStroke shortCutKeyStore; private KeyStroke shortCutKeyStore;
/** /**
* 是否提醒 * 是否提醒
*/ */
private boolean isNeedRemind = true; private boolean isNeedRemind = true;
/** /**
* 直接操作菜单次数 * 直接操作菜单次数
*/ */
private int operateCount; private int operateCount;
private static AlphaFineConfigManager alphaFineConfigManager = new AlphaFineConfigManager();
public static AlphaFineConfigManager getInstance() { public static AlphaFineConfigManager getInstance() {
return alphaFineConfigManager; return alphaFineConfigManager;
} }
public static boolean isALPHALicAvailable() {
return FRContext.getCurrentEnv() != null && VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support();
}
@Override @Override
public Object clone() throws CloneNotSupportedException { public Object clone() throws CloneNotSupportedException {
AlphaFineConfigManager manager = (AlphaFineConfigManager) super.clone(); AlphaFineConfigManager manager = (AlphaFineConfigManager) super.clone();
@ -130,8 +120,6 @@ public class AlphaFineConfigManager implements XMLable {
writer.end(); writer.end();
} }
public boolean isSearchOnLine() { public boolean isSearchOnLine() {
return isSearchOnLine; return isSearchOnLine;
} }
@ -147,20 +135,20 @@ public class AlphaFineConfigManager implements XMLable {
return shortcuts; return shortcuts;
} }
public void setShortcuts(String shortcuts) {
this.shortcuts = shortcuts;
this.shortCutKeyStore = convert2KeyStroke(this.shortcuts);
}
/** /**
* 返回默认快捷键 * 返回默认快捷键
*
* @return * @return
*/ */
private String getDefaultShortCuts() { private String getDefaultShortCuts() {
return OperatingSystem.isMacOS()? "meta + D" : "ctrl + D"; return OperatingSystem.isMacOS() ? "meta + D" : "ctrl + D";
} }
public void setShortcuts(String shortcuts) {
this.shortcuts = shortcuts;
this.shortCutKeyStore = convert2KeyStroke(this.shortcuts);
}
public boolean isContainAction() { public boolean isContainAction() {
return isContainAction; return isContainAction;
} }

2
designer_base/src/com/fr/design/actions/server/PlatformManagerAction.java

@ -15,7 +15,7 @@ public class PlatformManagerAction extends UpdateAction {
this.setMenuKeySet(PLATEFORM_MANAGER); this.setMenuKeySet(PLATEFORM_MANAGER);
this.setName(getMenuKeySet().getMenuKeySetName()); this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic()); this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/web/images/platform/platform_16_16.png")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/server/platform_16_16.png"));
} }
/** /**

11
designer_base/src/com/fr/design/condition/LiteConditionPane.java

@ -69,6 +69,7 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
private static final int DOWN_PADDING = 4; private static final int DOWN_PADDING = 4;
private static final int STRUT_ONE = 35; private static final int STRUT_ONE = 35;
private static final int STRUT_TWO = 4; private static final int STRUT_TWO = 4;
private static final int ADD_CONTROL_PANE_PADDING_RIGHT = -5;
private ActionListener actionListener1 = new ActionListener() { private ActionListener actionListener1 = new ActionListener() {
@ -537,8 +538,14 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
private void initControlPane(JPanel controlPane) { private void initControlPane(JPanel controlPane) {
JPanel addControlPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); JPanel addControlPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
controlPane.add(addControlPane, BorderLayout.SOUTH); addControlPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, ADD_CONTROL_PANE_PADDING_RIGHT));
addControlPane.setBorder(new ModLineBorder(ModLineBorder.TOP)); JPanel splitPane = new JPanel();
splitPane.setBorder(new ModLineBorder(ModLineBorder.TOP));
JPanel addControlPaneWrapper = new JPanel(new BorderLayout());
addControlPaneWrapper.add(addControlPane, BorderLayout.CENTER);
addControlPaneWrapper.add(splitPane, BorderLayout.NORTH);
controlPane.add(addControlPaneWrapper, BorderLayout.SOUTH);
ButtonGroup bg = new ButtonGroup(); ButtonGroup bg = new ButtonGroup();
bg.add(andRadioButton); bg.add(andRadioButton);

9
designer_base/src/com/fr/design/constants/UIConstants.java

@ -64,6 +64,7 @@ public interface UIConstants {
Constants.LINE_MEDIUM_DASH_DOT_DOT, //medium dash-dot-dot border Constants.LINE_MEDIUM_DASH_DOT_DOT, //medium dash-dot-dot border
Constants.LINE_SLANTED_DASH_DOT, //slanted dash-dot border Constants.LINE_SLANTED_DASH_DOT, //slanted dash-dot border
}; };
public static final Color TOOLBAR_BORDER_COLOR = new Color(0xD9DADD);
public static final Color COMBOBOX_BTN_NORMAL = new Color(0xD9DADD); public static final Color COMBOBOX_BTN_NORMAL = new Color(0xD9DADD);
public static final Color COMBOBOX_BTN_ROLLOVER = new Color(0xC8C9CD); public static final Color COMBOBOX_BTN_ROLLOVER = new Color(0xC8C9CD);
public static final Color COMBOBOX_BTN_PRESS = new Color(0xD8F2FD); public static final Color COMBOBOX_BTN_PRESS = new Color(0xD8F2FD);
@ -74,7 +75,7 @@ public interface UIConstants {
public static final Color OCEAN_BLUE = new Color(141, 179, 217); public static final Color OCEAN_BLUE = new Color(141, 179, 217);
public static final Color DARK_BLUE = new Color(0, 88, 144); public static final Color DARK_BLUE = new Color(0, 88, 144);
public static final Color NORMAL_BACKGROUND = new Color(212, 212, 216); public static final Color NORMAL_BACKGROUND = new Color(212, 212, 216);
public static final Color TREE_BACKGROUND = new Color(240, 240, 243); public static final Color TREE_BACKGROUND = new Color(245, 245, 247);
public static final Color TOOL_PANE_BACKGROUND = new Color(232, 232, 223); public static final Color TOOL_PANE_BACKGROUND = new Color(232, 232, 223);
public static final Color SELECT_TAB = new Color(245, 245, 247); public static final Color SELECT_TAB = new Color(245, 245, 247);
public static final Color TOOLBARUI_BACKGROUND = new Color(255, 255, 255); public static final Color TOOLBARUI_BACKGROUND = new Color(255, 255, 255);
@ -102,11 +103,11 @@ public interface UIConstants {
public static final Color SELECTED_BACKGROUND = new Color(0xdeedfe); public static final Color SELECTED_BACKGROUND = new Color(0xdeedfe);
public static final Color SELECTED_BORDER_LINE_COLOR = new Color(0x3384f0); public static final Color SELECTED_BORDER_LINE_COLOR = new Color(0x3384f0);
public static final Color DEFAULT_BG_RULER = new Color(0xffffff); public static final Color DEFAULT_BG_RULER = new Color(0xffffff);
public static final Color RULER_LINE_COLOR = new Color(0xababab); public static final Color RULER_LINE_COLOR = new Color(0xD9DADD);
public static final Color RULER_SCALE_COLOR = new Color(0x4e504f); public static final Color RULER_SCALE_COLOR = new Color(0x4e504f);
public static final Color PROPERTY_PANE_BACKGROUND = new Color(0xdadadd); public static final Color PROPERTY_PANE_BACKGROUND = new Color(0xdadadd);
public static final Color SPLIT_LINE = new Color(201, 198, 184); public static final Color SPLIT_LINE = new Color(201, 198, 184);
public static final Color TITLED_BORDER_COLOR = new Color(0xededee); public static final Color TITLED_BORDER_COLOR = new Color(0xe8e8e9);
public static final Color POP_DIALOG_BORDER = new Color(218, 218, 221); public static final Color POP_DIALOG_BORDER = new Color(218, 218, 221);
public static final Color PROPERTY_DIALOG_BORDER = new Color(0xc9c9cd); public static final Color PROPERTY_DIALOG_BORDER = new Color(0xc9c9cd);
public static final Color TAB_BUTTON_HOVER = new Color(231, 230, 235); public static final Color TAB_BUTTON_HOVER = new Color(231, 230, 235);
@ -114,6 +115,7 @@ public interface UIConstants {
public static final Color TAB_BUTTON_PRESS = new Color(228, 227, 232); public static final Color TAB_BUTTON_PRESS = new Color(228, 227, 232);
public static final Color TAB_BUTTON_PRESS_SELECTED = new Color(236, 236, 238); public static final Color TAB_BUTTON_PRESS_SELECTED = new Color(236, 236, 238);
public static final Color POPUP_TITLE_BACKGROUND = new Color(0xd8f2fd); public static final Color POPUP_TITLE_BACKGROUND = new Color(0xd8f2fd);
public static final Color LIST_ITEM_SPLIT_LINE = new Color(0xf0f0f3);
@ -129,6 +131,7 @@ public interface UIConstants {
public static final BufferedImage DRAG_LEFT_NORMAL = BaseUtils.readImage("com/fr/design/images/control/leftnor.png"); public static final BufferedImage DRAG_LEFT_NORMAL = BaseUtils.readImage("com/fr/design/images/control/leftnor.png");
public static final BufferedImage DRAG_LEFT_PRESS = BaseUtils.readImage("com/fr/design/images/control/leftpre.png"); public static final BufferedImage DRAG_LEFT_PRESS = BaseUtils.readImage("com/fr/design/images/control/leftpre.png");
public static final BufferedImage DRAG_DOT = BaseUtils.readImage("com/fr/design/images/control/dot.png"); public static final BufferedImage DRAG_DOT = BaseUtils.readImage("com/fr/design/images/control/dot.png");
public static final BufferedImage ACCESSIBLE_EDITOR_DOT = BaseUtils.readImage("com/fr/design/images/control/dot.png");
public static final BufferedImage DRAG_DOT_VERTICAL = BaseUtils.readImage("com/fr/design/images/control/dotv.png"); public static final BufferedImage DRAG_DOT_VERTICAL = BaseUtils.readImage("com/fr/design/images/control/dotv.png");
public static final BufferedImage POP_BUTTON_DOWN = BaseUtils.readImage("com/fr/design/images/buttonicon/popdownarrow.png"); public static final BufferedImage POP_BUTTON_DOWN = BaseUtils.readImage("com/fr/design/images/buttonicon/popdownarrow.png");
public static final BufferedImage POP_BUTTON_UP = BaseUtils.readImage("com/fr/design/images/buttonicon/popuparrow.png"); public static final BufferedImage POP_BUTTON_UP = BaseUtils.readImage("com/fr/design/images/buttonicon/popuparrow.png");

55
designer_base/src/com/fr/design/data/DesignTableDataManager.java

@ -6,19 +6,24 @@ import com.fr.base.StoreProcedureParameter;
import com.fr.base.TableData; import com.fr.base.TableData;
import com.fr.data.TableDataSource; import com.fr.data.TableDataSource;
import com.fr.data.core.DataCoreXmlUtils; import com.fr.data.core.DataCoreXmlUtils;
import com.fr.design.data.datapane.preview.PreviewTablePane;
import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.EmbeddedTableData;
import com.fr.data.impl.storeproc.ProcedureDataModel; import com.fr.data.impl.storeproc.ProcedureDataModel;
import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.data.impl.storeproc.StoreProcedureConstants; import com.fr.data.impl.storeproc.StoreProcedureConstants;
import com.fr.design.data.tabledata.wrapper.*;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.data.datapane.preview.PreviewTablePane;
import com.fr.design.data.tabledata.wrapper.ServerTableDataWrapper;
import com.fr.design.data.tabledata.wrapper.StoreProcedureDataWrapper;
import com.fr.design.data.tabledata.wrapper.StoreProcedureNameWrapper;
import com.fr.design.data.tabledata.wrapper.TableDataFactory;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.iprogressbar.AutoProgressBar; import com.fr.design.gui.iprogressbar.AutoProgressBar;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.parameter.ParameterInputPane; import com.fr.design.parameter.ParameterInputPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.file.DatasourceManager; import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider; import com.fr.file.DatasourceManagerProvider;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -34,8 +39,16 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.text.Collator; import java.text.Collator;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Timer;
import java.util.TimerTask;
/** /**
* 设计器管理操作数据集的类: * 设计器管理操作数据集的类:
@ -351,7 +364,20 @@ public abstract class DesignTableDataManager {
* @throws Exception 异常 * @throws Exception 异常
*/ */
public static EmbeddedTableData previewTableDataNeedInputParameters(TableData tabledata, int rowCount, boolean needLoadingBar) throws Exception { public static EmbeddedTableData previewTableDataNeedInputParameters(TableData tabledata, int rowCount, boolean needLoadingBar) throws Exception {
return previewTableData(tabledata, rowCount, true, needLoadingBar); return previewTableData(null, tabledata, rowCount, true, needLoadingBar);
}
/**
* 预览需要参数的数据集
*
* @param tabledata 数据集
* @param rowCount 需要预览的行数
* @param needLoadingBar 是否需要加载进度条
* @return 数据集
* @throws Exception 异常
*/
public static EmbeddedTableData previewTableDataNeedInputParameters(TableDataSource tableDataSource, TableData tabledata, int rowCount, boolean needLoadingBar) throws Exception {
return previewTableData(tableDataSource, tabledata, rowCount, true, needLoadingBar);
} }
/** /**
@ -364,7 +390,20 @@ public abstract class DesignTableDataManager {
* @throws Exception 异常 * @throws Exception 异常
*/ */
public static EmbeddedTableData previewTableDataNotNeedInputParameters(TableData tabledata, int rowCount, boolean needLoadingBar) throws Exception { public static EmbeddedTableData previewTableDataNotNeedInputParameters(TableData tabledata, int rowCount, boolean needLoadingBar) throws Exception {
return previewTableData(tabledata, rowCount, false, needLoadingBar); return previewTableData(null, tabledata, rowCount, false, needLoadingBar);
}
/**
* 预览不需要参数的数据集
*
* @param tabledata 数据集
* @param rowCount 需要预览的行数
* @param needLoadingBar 是否需要加载进度条
* @return 数据集
* @throws Exception 异常
*/
public static EmbeddedTableData previewTableDataNotNeedInputParameters(TableDataSource tableDataSource, TableData tabledata, int rowCount, boolean needLoadingBar) throws Exception {
return previewTableData(tableDataSource, tabledata, rowCount, false, needLoadingBar);
} }
/** /**
@ -376,7 +415,7 @@ public abstract class DesignTableDataManager {
* 而获取数据集的字段名字时则没必要 * 而获取数据集的字段名字时则没必要
* @return * @return
*/ */
private static EmbeddedTableData previewTableData(TableData tabledata, int rowCount, boolean isMustInputParameters, boolean needLoadingBar) throws Exception { private static EmbeddedTableData previewTableData(TableDataSource tableDataSource, TableData tabledata, int rowCount, boolean isMustInputParameters, boolean needLoadingBar) throws Exception {
final AutoProgressBar loadingBar = PreviewTablePane.getInstance().getProgressBar(); final AutoProgressBar loadingBar = PreviewTablePane.getInstance().getProgressBar();
Env currentEnv = FRContext.getCurrentEnv(); Env currentEnv = FRContext.getCurrentEnv();
ParameterProvider[] parameters = currentEnv.getTableDataParameters(tabledata); ParameterProvider[] parameters = currentEnv.getTableDataParameters(tabledata);
@ -406,7 +445,7 @@ public abstract class DesignTableDataManager {
parameter.setValue(parameterMap.get(parameter.getName())); parameter.setValue(parameterMap.get(parameter.getName()));
} }
} }
return currentEnv.previewTableData(tabledata, parameterMap, rowCount); return currentEnv.previewTableData(tableDataSource, tabledata, parameterMap, rowCount);
} catch (TableDataException e) { } catch (TableDataException e) {
throw new TableDataException(e.getMessage(), e); throw new TableDataException(e.getMessage(), e);
} finally { } finally {

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

@ -6,6 +6,7 @@ import com.fr.data.TableDataSource;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.BasicTableDataTreePane; import com.fr.design.data.BasicTableDataTreePane;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.tabledata.StoreProcedureWorkerListener; import com.fr.design.data.tabledata.StoreProcedureWorkerListener;
@ -111,6 +112,8 @@ public class TableDataTreePane extends BasicTableDataTreePane {
ToolBarDef toolbarDef = new ToolBarDef(); ToolBarDef toolbarDef = new ToolBarDef();
toolbarDef.addShortCut(addMenuDef, SeparatorDef.DEFAULT, editAction, removeAction, SeparatorDef.DEFAULT, previewTableDataAction, connectionTableAction); toolbarDef.addShortCut(addMenuDef, SeparatorDef.DEFAULT, editAction, removeAction, SeparatorDef.DEFAULT, previewTableDataAction, connectionTableAction);
UIToolbar toolBar = ToolBarDef.createJToolBar(); UIToolbar toolBar = ToolBarDef.createJToolBar();
toolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR));
toolBar.setBorderPainted(true);
toolbarDef.updateToolBar(toolBar); toolbarDef.updateToolBar(toolBar);
JPanel toolbarPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel toolbarPane = FRGUIPaneFactory.createBorderLayout_S_Pane();

13
designer_base/src/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java

@ -1,6 +1,8 @@
package com.fr.design.data.datapane.connect; package com.fr.design.data.datapane.connect;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.data.core.db.TableProcedure; import com.fr.data.core.db.TableProcedure;
import com.fr.design.border.UIRoundedBorder; import com.fr.design.border.UIRoundedBorder;
@ -20,6 +22,7 @@ import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.util.List;
/** /**
* 数据集编辑面板左边的部分 * 数据集编辑面板左边的部分
@ -39,6 +42,12 @@ public class ConnectionTableProcedurePane extends BasicPane {
public ConnectionTableProcedurePane() { public ConnectionTableProcedurePane() {
this.setLayout(new BorderLayout(4, 4)); this.setLayout(new BorderLayout(4, 4));
connectionComboBox = new ConnectionComboBoxPanel(com.fr.data.impl.Connection.class) { connectionComboBox = new ConnectionComboBoxPanel(com.fr.data.impl.Connection.class) {
@Override
protected void filterConnection(Connection connection, String conName, List<String> nameList) {
filter(connection, conName, nameList);
}
protected void refreshItems() { protected void refreshItems() {
super.refreshItems(); super.refreshItems();
if (tableViewList != null) { if (tableViewList != null) {
@ -83,6 +92,10 @@ public class ConnectionTableProcedurePane extends BasicPane {
this.setPreferredSize(new Dimension(WIDTH, getPreferredSize().height)); this.setPreferredSize(new Dimension(WIDTH, getPreferredSize().height));
} }
protected void filter(Connection connection, String conName, List<String> nameList) {
connection.addConnection(nameList, conName, new Class[]{AbstractDatabaseConnection.class});
}
protected JPanel createCheckBoxgroupPane() { protected JPanel createCheckBoxgroupPane() {
JPanel checkBoxgroupPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2); JPanel checkBoxgroupPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2);
JPanel first = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel first = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();

5
designer_base/src/com/fr/design/data/datapane/preview/PreviewTablePane.java

@ -6,6 +6,7 @@ package com.fr.design.data.datapane.preview;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.TableData; import com.fr.base.TableData;
import com.fr.data.TableDataSource;
import com.fr.data.impl.DBTableData; import com.fr.data.impl.DBTableData;
import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.EmbeddedTableData;
import com.fr.data.impl.storeproc.ProcedureDataModel; import com.fr.data.impl.storeproc.ProcedureDataModel;
@ -13,6 +14,7 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
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.file.HistoryTemplateListPane;
import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.iprogressbar.AutoProgressBar; import com.fr.design.gui.iprogressbar.AutoProgressBar;
@ -362,7 +364,8 @@ public class PreviewTablePane extends BasicPane {
} }
} }
connectionBar.close(); connectionBar.close();
previewTableData = DesignTableDataManager.previewTableDataNeedInputParameters(tableData, (int) maxPreviewNumberField.getValue(), true); TableDataSource dataSource = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getTarget();
previewTableData = DesignTableDataManager.previewTableDataNeedInputParameters(dataSource, tableData, (int) maxPreviewNumberField.getValue(), true);
// parameterInputDialog // parameterInputDialog
// update之后的parameters,转成一个parameterMap,用于预览TableData // update之后的parameters,转成一个parameterMap,用于预览TableData
PreviewTableModel previewModel = new PreviewTableModel(previewTableData.createDataModel(null), (int) maxPreviewNumberField.getValue()); PreviewTableModel previewModel = new PreviewTableModel(previewTableData.createDataModel(null), (int) maxPreviewNumberField.getValue());

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

@ -5,7 +5,11 @@ import com.fr.base.FRContext;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.ParameterHelper; import com.fr.base.ParameterHelper;
import com.fr.data.core.db.TableProcedure; import com.fr.data.core.db.TableProcedure;
import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection;
import com.fr.data.impl.DBTableData; import com.fr.data.impl.DBTableData;
import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.data.impl.NameDatabaseConnection; import com.fr.data.impl.NameDatabaseConnection;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
@ -37,6 +41,7 @@ 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.StringUtils; import com.fr.stable.StringUtils;
import org.sqlite.JDBC;
import javax.swing.*; import javax.swing.*;
import javax.swing.text.BadLocationException; import javax.swing.text.BadLocationException;
@ -102,7 +107,12 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
sqlSplitPane.add(box, BorderLayout.CENTER); sqlSplitPane.add(box, BorderLayout.CENTER);
// 左边的Panel,上面是选择DatabaseConnection的ComboBox,下面DatabaseConnection对应的Table // 左边的Panel,上面是选择DatabaseConnection的ComboBox,下面DatabaseConnection对应的Table
connectionTableProcedurePane = new ConnectionTableProcedurePane(); connectionTableProcedurePane = new ConnectionTableProcedurePane() {
@Override
protected void filter(Connection connection, String conName, List<String> nameList) {
connection.addConnection(nameList, conName, new Class[]{JDBCDatabaseConnection.class, JNDIDatabaseConnection.class});
}
};
connectionTableProcedurePane.addDoubleClickListener(new DoubleClickSelectedNodeOnTreeListener() { connectionTableProcedurePane.addDoubleClickListener(new DoubleClickSelectedNodeOnTreeListener() {
@Override @Override
@ -138,6 +148,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
this.add(mainSplitPane, BorderLayout.CENTER); this.add(mainSplitPane, BorderLayout.CENTER);
} }
private boolean isPreviewOrRefreshButton (FocusEvent e) { private boolean isPreviewOrRefreshButton (FocusEvent e) {
if (e.getOppositeComponent() != null) { if (e.getOppositeComponent() != null) {
String name = e.getOppositeComponent().getName(); String name = e.getOppositeComponent().getName();

2
designer_base/src/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java

@ -58,7 +58,7 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper {
EmbeddedTableData embeddedTableData = null; EmbeddedTableData embeddedTableData = null;
try { try {
embeddedTableData = DesignTableDataManager.previewTableDataNotNeedInputParameters(tabledata, TableData.RESULT_NOT_NEED, false); embeddedTableData = DesignTableDataManager.previewTableDataNotNeedInputParameters(tds, tabledata, TableData.RESULT_NOT_NEED, false);
} catch (Exception e) { } catch (Exception e) {
if (e.getMessage()!=null) { if (e.getMessage()!=null) {
DesignUtils.errorMessage(e.getMessage()); DesignUtils.errorMessage(e.getMessage());

10
designer_base/src/com/fr/design/designer/IntervalConstants.java

@ -7,7 +7,7 @@ public class IntervalConstants {
public static final int INTERVAL_L1 = 10; public static final int INTERVAL_L1 = 10;
public static final int INTERVAL_L2 = 15; public static final int INTERVAL_L2 = 13;
public static final int INTERVAL_L3 = 155; public static final int INTERVAL_L3 = 155;
@ -19,4 +19,12 @@ public class IntervalConstants {
public static final int INTERVAL_L7 = 8; public static final int INTERVAL_L7 = 8;
public static final int INTERVAL_W0 = 3;
public static final int INTERVAL_W1 = 25;
public static final int INTERVAL_W2 = 37;
public static final int INTERVAL_W3 = 49;
} }

10
designer_base/src/com/fr/design/designer/TargetComponent.java

@ -1,16 +1,16 @@
package com.fr.design.designer; package com.fr.design.designer;
import javax.swing.*; import com.fr.design.DesignState;
import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener; import com.fr.design.event.TargetModifiedListener;
import com.fr.design.mainframe.AuthorityEditPane;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.DesignState;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.design.mainframe.*;
import javax.swing.*;
/** /**
* 模板设计界面 * 模板设计界面
@ -31,7 +31,7 @@ public abstract class TargetComponent<T> extends JComponent {
public abstract void stopEditing(); public abstract void stopEditing();
public final T getTarget() { public T getTarget() {
return target; return target;
} }

38
designer_base/src/com/fr/design/designer/creator/CRPropertyDescriptor.java

@ -15,14 +15,15 @@ import java.beans.PropertyDescriptor;
*/ */
public final class CRPropertyDescriptor extends PropertyDescriptor { public final class CRPropertyDescriptor extends PropertyDescriptor {
public static final String RENDERER = "renderer"; public static final String RENDERER = "renderer";
private boolean isSubProperty = false;
private PropertyChangeAdapter l;
private PropertyChangeAdapter l;
public CRPropertyDescriptor(String name, Class<?> beanClass) throws IntrospectionException { public CRPropertyDescriptor(String name, Class<?> beanClass) throws IntrospectionException {
super(name, beanClass); super(name, beanClass);
} }
public CRPropertyDescriptor(String name, Class<?> beanClass, String readMethod, String writeMethod) throws IntrospectionException{ public CRPropertyDescriptor(String name, Class<?> beanClass, String readMethod, String writeMethod) throws IntrospectionException {
super(name, beanClass, readMethod, writeMethod); super(name, beanClass, readMethod, writeMethod);
} }
@ -33,17 +34,17 @@ public final class CRPropertyDescriptor extends PropertyDescriptor {
} }
return this; return this;
} }
public CRPropertyDescriptor setPropertyChangeListener(PropertyChangeAdapter l) {
this.l = l;
return this;
}
public void firePropertyChanged() { public CRPropertyDescriptor setPropertyChangeListener(PropertyChangeAdapter l) {
if (l != null) { this.l = l;
l.propertyChange(); return this;
} }
}
public void firePropertyChanged() {
if (l != null) {
l.propertyChange();
}
}
public CRPropertyDescriptor setEditorClass(Class<?> clazz) { public CRPropertyDescriptor setEditorClass(Class<?> clazz) {
this.setPropertyEditorClass(clazz); this.setPropertyEditorClass(clazz);
@ -59,4 +60,13 @@ public final class CRPropertyDescriptor extends PropertyDescriptor {
this.setDisplayName(displayName); this.setDisplayName(displayName);
return this; return this;
} }
public CRPropertyDescriptor setSubLevel(boolean isSubProperty) {
this.isSubProperty = isSubProperty;
return this;
}
public boolean isSubLevel() {
return isSubProperty;
}
} }

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

@ -217,9 +217,9 @@ public class DoubleDeckValueEditorPane extends BasicPane implements UIObserver,
String name = currentEditor.getName(); String name = currentEditor.getName();
Object columnIndex = currentEditor.getValue(); Object columnIndex = currentEditor.getValue();
//bug86542,这边为啥要new一个公式出来,只保留content,其他属性全不要了? //bug86542,这边为啥要new一个公式出来,只保留content,其他属性全不要了?
// if (ComparatorUtils.equals(name, Inter.getLocText("Formula"))) { if (columnIndex == null && ComparatorUtils.equals(name, Inter.getLocText("Formula"))) {
// columnIndex = new Formula(columnIndex == null ? "" : columnIndex.toString()); columnIndex = ((FormulaEditor) currentEditor).getFormula();
// } }
return columnIndex; return columnIndex;
} }

24
designer_base/src/com/fr/design/editor/ValueEditorPane.java

@ -2,19 +2,17 @@ package com.fr.design.editor;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.dialog.BasicPane;
import com.fr.design.editor.editor.*;
import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver; import com.fr.design.event.GlobalNameObserver;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIMenuEastAttrItem;
import com.fr.design.gui.imenu.UIPopupEastAttrMenu;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.dialog.BasicPane;
import com.fr.design.editor.editor.ColumnNameEditor;
import com.fr.design.editor.editor.Editor;
import com.fr.design.editor.editor.TextEditor;
import com.fr.design.editor.editor.XMLANameEditor;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -139,14 +137,14 @@ public class ValueEditorPane extends BasicPane implements UIObserver, GlobalName
private JPopupMenu createPopMenu() { private JPopupMenu createPopMenu() {
JPopupMenu scate = new JPopupMenu(); JPopupMenu scate = new UIPopupEastAttrMenu();
if (this.cards == null) { if (this.cards == null) {
return scate; return scate;
} }
for (int i = 0; i < this.cards.length; i++) { for (int i = 0; i < this.cards.length; i++) {
UIMenuItem item = new UIMenuItem(cards[i].getName()); JMenuItem item = new UIMenuEastAttrItem(cards[i].getName());
final int j = i; final int j = i;
item.addActionListener(new ActionListener() { item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -165,9 +163,6 @@ public class ValueEditorPane extends BasicPane implements UIObserver, GlobalName
} }
}); });
scate.add(item); scate.add(item);
if (i < cards.length - 1) {
scate.addSeparator();
}
} }
return scate; return scate;
} }
@ -207,9 +202,10 @@ public class ValueEditorPane extends BasicPane implements UIObserver, GlobalName
String name = currentEditor.getName(); String name = currentEditor.getName();
Object columnIndex = currentEditor.getValue(); Object columnIndex = currentEditor.getValue();
//bug86542,这边为啥要new一个公式出来,只保留content,其他属性全不要了? //bug86542,这边为啥要new一个公式出来,只保留content,其他属性全不要了?
// if (ComparatorUtils.equals(name, Inter.getLocText("Formula"))) { //MoMeak:我也想注释了,但是有bug啊。。。
// columnIndex = new Formula(columnIndex == null ? "" : columnIndex.toString()); if (columnIndex == null && ComparatorUtils.equals(name, Inter.getLocText("Formula"))) {
// } columnIndex = ((FormulaEditor) currentEditor).getFormula();
}
return columnIndex; return columnIndex;
} }

4
designer_base/src/com/fr/design/editor/editor/FormulaEditor.java

@ -96,6 +96,10 @@ public class FormulaEditor extends Editor<Formula> {
}).setVisible(true); }).setVisible(true);
} }
public Formula getFormula(){
return formula;
}
/** /**
* Return the value of the CellEditor. * Return the value of the CellEditor.
*/ */

2
designer_base/src/com/fr/design/file/MutilTempalteTabPane.java

@ -373,7 +373,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
private void paintDefaultBackground(Graphics2D g2d) { private void paintDefaultBackground(Graphics2D g2d) {
//画默认背景 //画默认背景
g2d.setPaint(new GradientPaint(1, 1, new Color(217, 218, 221), 1, getHeight() - 1, new Color(217, 218, 221))); g2d.setPaint(new GradientPaint(1, 1, new Color(217, 218, 221), 1, getHeight() - 1, new Color(217, 218, 221)));
g2d.fillRect(getX(), getY(), getWidth(), getHeight()); g2d.fillRect(0, 0, getWidth(), getHeight());
} }

3
designer_base/src/com/fr/design/file/NewTemplatePane.java

@ -10,6 +10,7 @@ import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener; import java.awt.event.MouseMotionListener;
import java.awt.geom.Line2D; import java.awt.geom.Line2D;
import java.awt.geom.Rectangle2D;
/** /**
* Author : daisy * Author : daisy
@ -45,6 +46,8 @@ public abstract class NewTemplatePane extends JComponent implements MouseListene
public void paintComponent(Graphics g) { public void paintComponent(Graphics g) {
super.paintComponent(g); super.paintComponent(g);
g2d = (Graphics2D) g; g2d = (Graphics2D) g;
g2d.setColor(UIConstants.COMBOBOX_BTN_NORMAL);
g2d.fill(new Rectangle2D.Double(0, 0, getWidth(),getHeight()));
int sheetIconY = (getHeight() - newWorkBookIconMode.getIconHeight()) / 2; int sheetIconY = (getHeight() - newWorkBookIconMode.getIconHeight()) / 2;
newWorkBookIconMode.paintIcon(this, g2d, newIconStartX, sheetIconY); newWorkBookIconMode.paintIcon(this, g2d, newIconStartX, sheetIconY);
// paintUnderLine(g2d); // paintUnderLine(g2d);

29
designer_base/src/com/fr/design/file/TemplateTreePane.java

@ -5,8 +5,8 @@ package com.fr.design.file;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.dav.LocalEnv; import com.fr.dav.LocalEnv;
import com.fr.design.gui.itree.filetree.TemplateFileTree;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itree.filetree.TemplateFileTree;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
@ -17,16 +17,18 @@ import com.fr.file.filetree.IOFileNodeFilter;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ProductConstants;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.sun.jna.platform.FileUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.logging.Level; import java.util.logging.Level;
@ -177,7 +179,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
} }
if (nodeFile.exists()) { if (nodeFile.exists()) {
String path = StableUtils.pathJoin(new String[]{nodeFile.getEnvPath(), nodeFile.getPath()}); String path = StableUtils.pathJoin(new String[]{nodeFile.getEnvPath(), nodeFile.getPath()});
FRContext.getCurrentEnv().deleteFile(nodeFile.getPath()); moveToTrash(nodeFile);
deleteHistory(path.replaceAll("/", "\\\\")); deleteHistory(path.replaceAll("/", "\\\\"));
} else { } else {
JOptionPane.showMessageDialog(this, Inter.getLocText("Warning-Template_Do_Not_Exsit"), ProductConstants.PRODUCT_NAME, JOptionPane.showMessageDialog(this, Inter.getLocText("Warning-Template_Do_Not_Exsit"), ProductConstants.PRODUCT_NAME,
@ -187,7 +189,6 @@ public class TemplateTreePane extends JPanel implements FileOperations {
reportletsTree.refresh(); reportletsTree.refresh();
} }
private void deleteHistory(String fileName) { private void deleteHistory(String fileName) {
int index = HistoryTemplateListPane.getInstance().contains(fileName); int index = HistoryTemplateListPane.getInstance().contains(fileName);
int size = HistoryTemplateListPane.getInstance().getHistoryCount(); int size = HistoryTemplateListPane.getInstance().getHistoryCount();
@ -304,4 +305,24 @@ public class TemplateTreePane extends JPanel implements FileOperations {
} }
} }
/**
* 文件回收
*
* @param nodeFile 节点文件
*/
private void moveToTrash(FileNodeFILE nodeFile) {
FileUtils fileUtils = FileUtils.getInstance();
if (fileUtils.hasTrash()) {
try {
fileUtils.moveToTrash(new File[]{new File(StableUtils.pathJoin(nodeFile.getEnvPath(), nodeFile.getPath()))});
} catch (IOException e) {
FRLogger.getLogger().info(e.getMessage());
FRContext.getCurrentEnv().deleteFile(nodeFile.getPath());
}
} else {
FRLogger.getLogger().info("No Trash Available");
FRContext.getCurrentEnv().deleteFile(nodeFile.getPath());
}
}
} }

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

@ -703,7 +703,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
UIScrollPane desScrollPane = new UIScrollPane(descriptionTextArea); UIScrollPane desScrollPane = new UIScrollPane(descriptionTextArea);
desScrollPane.setBorder(null); desScrollPane.setBorder(null);
this.add(this.createNamePane(Inter.getLocText("FR-Designer_FormulaPane_Formula_Description") + ":", desScrollPane), BorderLayout.EAST); this.add(this.createNamePane(Inter.getLocText("FR-Designer_FormulaPane_Formula_Description") + ":", desScrollPane), BorderLayout.EAST);
descriptionTextArea.setBackground(new Color(255, 255, 225)); descriptionTextArea.setBackground(Color.white);
descriptionTextArea.setLineWrap(true); descriptionTextArea.setLineWrap(true);
descriptionTextArea.setWrapStyleWord(true); descriptionTextArea.setWrapStyleWord(true);
descriptionTextArea.setEditable(false); descriptionTextArea.setEditable(false);

59
designer_base/src/com/fr/design/gui/HyperlinkFilterHelper.java

@ -0,0 +1,59 @@
package com.fr.design.gui;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.BaseJForm;
import com.fr.design.mainframe.JTemplate;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
/**
* Created by mengao on 2017/9/22.
* 单元格超链图表超链在不同类型模版中下拉选项不同
*/
public class HyperlinkFilterHelper {
public static boolean whetherAddHyperlink4cell(String itemName) {
JTemplate jTemplate = getCurrentEditingTemplate();
if (jTemplate == null) {
return false;
}
//先屏蔽掉这个,之后还有别的
String[] names = {Inter.getLocText("FR-Hyperlink_Chart_Float")};
for (String name : names) {
if (!jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, name)) {
return false;
}
}
return whetherAddFormLink(jTemplate, itemName);
}
public static boolean whetherAddHyperlink4Chart(String itemName) {
JTemplate jTemplate = getCurrentEditingTemplate();
if (jTemplate == null) {
return false;
}
//先屏蔽掉这个,之后还有别的
String[] names = {Inter.getLocText("FR-Hyperlink_Chart_Float"), Inter.getLocText("FR-Hyperlink_Chart_Cell")};
for (String name : names) {
if (!jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, name)) {
if (jTemplate.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB && ComparatorUtils.equals(itemName, names[0])) {
//表单报表块中图表悬浮元素超链,只屏蔽联动悬浮元素
return false;
} else if (jTemplate.getEditingReportIndex() == BaseJForm.FORM_TAB) {
//表单图表超链屏蔽掉联动悬浮元素和联动单元格
return false;
}
}
}
return whetherAddFormLink(jTemplate, itemName);
}
private static JTemplate getCurrentEditingTemplate() {
return HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
}
private static boolean whetherAddFormLink(JTemplate jTemplate, String itemName) {
String formName = Inter.getLocText("Hyperlink-Form_link");
return !(jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, formName));
}
}

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

@ -8,13 +8,12 @@ import com.fr.design.data.tabledata.tabledatapane.GlobalMultiTDTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane; import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane; import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane; import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.HyperlinkFilterHelper;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilist.JNameEdList; import com.fr.design.gui.ilist.JNameEdList;
import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.gui.ilist.ModNameActionListener; import com.fr.design.gui.ilist.ModNameActionListener;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.LineSeparator; import com.fr.design.menu.LineSeparator;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
@ -384,7 +383,7 @@ public abstract class JListControlPane extends JControlPane {
private void wrapActionListener(NameableCreator[] creators) { private void wrapActionListener(NameableCreator[] creators) {
for (final NameableCreator creator : creators) { for (final NameableCreator creator : creators) {
if (!whetherAdd(creator.menuName())) { if (!HyperlinkFilterHelper.whetherAddHyperlink4cell(creator.menuName())) {
continue; continue;
} }
boolean isTrue = ComparatorUtils.equals(creator.menuName(), Inter.getLocText("Datasource-Stored_Procedure")) || boolean isTrue = ComparatorUtils.equals(creator.menuName(), Inter.getLocText("Datasource-Stored_Procedure")) ||
@ -414,22 +413,6 @@ public abstract class JListControlPane extends JControlPane {
}); });
} }
} }
private boolean whetherAdd(String itemName) {
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jTemplate == null) {
return false;
}
//先屏蔽掉这个,之后还有别的
String[] names = {Inter.getLocText("FR-Hyperlink_Chart_Float")};
for (String name : names) {
if (!jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, name)) {
return false;
}
}
String formName = Inter.getLocText("Hyperlink-Form_link");
return !(jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, formName));
}
} }
/* /*
@ -468,7 +451,7 @@ public abstract class JListControlPane extends JControlPane {
this.setName(Inter.getLocText("FR-Action_Copy")); this.setName(Inter.getLocText("FR-Action_Copy"));
this.setMnemonic('C'); this.setMnemonic('C');
this.setSmallIcon(BaseUtils this.setSmallIcon(BaseUtils
.readIcon("/com/fr/base/images/cell/control/copy.png")); .readIcon("/com/fr/design/images/m_edit/copy.png"));
} }
@Override @Override

19
designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java

@ -178,7 +178,8 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
// 封装一层,加边框 // 封装一层,加边框
JPanel toolBarPane = new JPanel(new BorderLayout()); JPanel toolBarPane = new JPanel(new BorderLayout());
toolBarPane.add(toolBar, BorderLayout.CENTER); toolBarPane.add(toolBar, BorderLayout.CENTER);
toolBarPane.setBorder(BorderFactory.createMatteBorder(1, 1, 0, 1, new Color(201, 198, 184))); toolBarPane.setBorder(BorderFactory.createMatteBorder(1, 1, 0, 1, UIConstants.RULER_LINE_COLOR));
leftContentPane.add(toolBarPane, BorderLayout.NORTH); leftContentPane.add(toolBarPane, BorderLayout.NORTH);
// 顶部标签及add按钮 // 顶部标签及add按钮
@ -193,6 +194,16 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
topToolBar.setLayout(new BorderLayout()); topToolBar.setLayout(new BorderLayout());
ShortCut addItem = addItemShortCut().getShortCut(); ShortCut addItem = addItemShortCut().getShortCut();
addItem.intoJToolBar(topToolBar); addItem.intoJToolBar(topToolBar);
JPanel leftTopPane = getLeftTopPane(topToolBar);
leftTopPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0));
leftPane.add(leftTopPane, BorderLayout.NORTH);
return leftPane;
}
protected JPanel getLeftTopPane (UIToolbar topToolBar) {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = { p, f}; double[] columnSize = { p, f};
@ -200,11 +211,7 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(getAddItemText()), topToolBar}, new Component[]{new UILabel(getAddItemText()), topToolBar},
}; };
JPanel leftTopPane = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
leftTopPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0));
leftPane.add(leftTopPane, BorderLayout.NORTH);
return leftPane;
} }
/** /**

29
designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java

@ -11,7 +11,7 @@ import com.fr.design.data.tabledata.tabledatapane.GlobalMultiTDTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane; import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane; import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane; import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.HyperlinkFilterHelper;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ListModelElement;
@ -19,7 +19,6 @@ import com.fr.design.gui.ilist.ModNameActionListener;
import com.fr.design.gui.ilist.UINameEdList; import com.fr.design.gui.ilist.UINameEdList;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.LineSeparator; import com.fr.design.menu.LineSeparator;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
@ -162,11 +161,15 @@ public abstract class UIListControlPane extends UIControlPane {
if (creators.length == 1) { if (creators.length == 1) {
addItemShortCut = new AddItemUpdateAction(creators); addItemShortCut = new AddItemUpdateAction(creators);
} else { } else {
addItemShortCut = new AddItemMenuDef(creators); addItemShortCut = getAddItemMenuDef(creators);
} }
return new AbsoluteEnableShortCut(addItemShortCut); return new AbsoluteEnableShortCut(addItemShortCut);
} }
protected AddItemMenuDef getAddItemMenuDef (NameableCreator[] creators) {
return new AddItemMenuDef(creators);
}
@Override @Override
protected ShortCut4JControlPane removeItemShortCut() { protected ShortCut4JControlPane removeItemShortCut() {
return new NormalEnableShortCut(new RemoveItemAction()); return new NormalEnableShortCut(new RemoveItemAction());
@ -211,6 +214,7 @@ public abstract class UIListControlPane extends UIControlPane {
@Override @Override
public void populate(Nameable[] nameableArray) { public void populate(Nameable[] nameableArray) {
isPopulating = true; // 加一个标识位,避免切换单元格时,触发 saveSettings isPopulating = true; // 加一个标识位,避免切换单元格时,触发 saveSettings
nameableList.getCellEditor().stopCellEditing();
DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel(); DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel();
listModel.removeAllElements(); listModel.removeAllElements();
if (ArrayUtils.isEmpty(nameableArray)) { if (ArrayUtils.isEmpty(nameableArray)) {
@ -557,20 +561,8 @@ public abstract class UIListControlPane extends UIControlPane {
} }
} }
private boolean whetherAdd(String itemName) { protected boolean whetherAdd(String itemName){
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); return HyperlinkFilterHelper.whetherAddHyperlink4cell(itemName);
if (jTemplate == null) {
return false;
}
//先屏蔽掉这个,之后还有别的
String[] names = {Inter.getLocText("FR-Hyperlink_Chart_Float")};
for (String name : names) {
if (!jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, name)) {
return false;
}
}
String formName = Inter.getLocText("Hyperlink-Form_link");
return !(jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, formName));
} }
} }
@ -591,6 +583,7 @@ public abstract class UIListControlPane extends UIControlPane {
UIListControlPane.this.nameableList.getCellEditor() UIListControlPane.this.nameableList.getCellEditor()
.stopCellEditing(); .stopCellEditing();
} catch (Exception ignored) { } catch (Exception ignored) {
// do nothing
} }
// bug:在选中一个NameObject并删除,会遗留下Name. // bug:在选中一个NameObject并删除,会遗留下Name.
doBeforeRemove(); doBeforeRemove();
@ -610,7 +603,7 @@ public abstract class UIListControlPane extends UIControlPane {
this.setName(Inter.getLocText("FR-Action_Copy")); this.setName(Inter.getLocText("FR-Action_Copy"));
this.setMnemonic('C'); this.setMnemonic('C');
this.setSmallIcon(BaseUtils this.setSmallIcon(BaseUtils
.readIcon("/com/fr/base/images/cell/control/copy.png")); .readIcon("/com/fr/design/images/m_edit/copy.png"));
} }
@Override @Override

17
designer_base/src/com/fr/design/gui/controlpane/UINameableListCellRenderer.java

@ -51,7 +51,7 @@ public class UINameableListCellRenderer extends
} }
}; };
editButton.setIcon(listControlPane.isNewStyle() ? UIConstants.LIST_EDIT_ICON : UIConstants.CPT_ICON); editButton.setIcon(listControlPane.isNewStyle() ? UIConstants.LIST_EDIT_ICON : UIConstants.CPT_ICON);
editButton.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, BORDER_COLOR)); editButton.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, UIConstants.LIST_ITEM_SPLIT_LINE));
editButton.setHorizontalAlignment(SwingConstants.CENTER); editButton.setHorizontalAlignment(SwingConstants.CENTER);
label = new UILabel(); label = new UILabel();
label.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); label.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
@ -62,7 +62,7 @@ public class UINameableListCellRenderer extends
} }
private Border getNoFocusBorder() { private Border getNoFocusBorder() {
return BorderFactory.createMatteBorder(0, 0, 1, 0, BORDER_COLOR); return BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LIST_ITEM_SPLIT_LINE);
} }
private void setText(String t) { private void setText(String t) {
@ -110,19 +110,6 @@ public class UINameableListCellRenderer extends
setEnabled(list.isEnabled()); setEnabled(list.isEnabled());
setFont(list.getFont()); setFont(list.getFont());
Border border = null;
if (cellHasFocus) {
if (isSelected) {
border = DefaultLookup.getBorder(this, ui, "List.focusSelectedCellHighlightBorder");
}
if (border == null) {
border = DefaultLookup.getBorder(this, ui, "List.focusCellHighlightBorder");
}
} else {
border = getNoFocusBorder();
}
setBorder(border);
if (value instanceof ListModelElement) { if (value instanceof ListModelElement) {
Nameable wrappee = ((ListModelElement) value).wrapper; Nameable wrappee = ((ListModelElement) value).wrapper;
this.setText(((ListModelElement) value).wrapper.getName()); this.setText(((ListModelElement) value).wrapper.getName());

30
designer_base/src/com/fr/design/gui/core/WidgetOption.java

@ -127,27 +127,27 @@ public abstract class WidgetOption implements Serializable {
} }
public static final WidgetOption DATEEDITOR = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"Date", "Widget"}), public static final WidgetOption DATEEDITOR = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"Date", "Widget"}),
BaseUtils.readIcon("/com/fr/web/images/form/resources/date_16.png"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/date_16.png"),
DateEditor.class); DateEditor.class);
public static final WidgetOption TREE = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("Form-View_Tree"), public static final WidgetOption TREE = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("Form-View_Tree"),
BaseUtils.readIcon("/com/fr/web/images/form/resources/tree_16.png"), TreeEditor.class); BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/tree_16.png"), TreeEditor.class);
public static final WidgetOption TREECOMBOBOX = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Designer_Tree-ComboBox"), BaseUtils.readIcon("/com/fr/web/images/form/resources/comboboxtree.png"), public static final WidgetOption TREECOMBOBOX = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Designer_Tree-ComboBox"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/comboboxtree.png"),
TreeComboBoxEditor.class); TreeComboBoxEditor.class);
public static final WidgetOption CHECKBOXGROUP = WidgetOptionFactory.createByWidgetClass( public static final WidgetOption CHECKBOXGROUP = WidgetOptionFactory.createByWidgetClass(
Inter.getLocText(new String[]{"Form-CheckBoxGroup", "Widget"}), BaseUtils.readIcon("/com/fr/web/images/form/resources/checkbox_group_16.png"), CheckBoxGroup.class); Inter.getLocText(new String[]{"Form-CheckBoxGroup", "Widget"}), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/checkbox_group_16.png"), CheckBoxGroup.class);
public static final WidgetOption RADIOGROUP = WidgetOptionFactory.createByWidgetClass( public static final WidgetOption RADIOGROUP = WidgetOptionFactory.createByWidgetClass(
Inter.getLocText(new String[]{"Form-RadioGroup", "Widget"}), BaseUtils.readIcon("/com/fr/web/images/form/resources/button_group_16.png"), Inter.getLocText(new String[]{"Form-RadioGroup", "Widget"}), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/button_group_16.png"),
RadioGroup.class); RadioGroup.class);
public static final WidgetOption NUMBEREDITOR = WidgetOptionFactory.createByWidgetClass( public static final WidgetOption NUMBEREDITOR = WidgetOptionFactory.createByWidgetClass(
Inter.getLocText(new String[]{"Number", "Widget"}), BaseUtils.readIcon("/com/fr/web/images/form/resources/number_field_16.png"), NumberEditor.class); Inter.getLocText(new String[]{"Number", "Widget"}), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/number_field_16.png"), NumberEditor.class);
public static final WidgetOption LABEL = WidgetOptionFactory.createByWidgetClass( public static final WidgetOption LABEL = WidgetOptionFactory.createByWidgetClass(
Inter.getLocText(new String[]{"Label", "Widget"}), BaseUtils.readIcon("/com/fr/web/images/form/resources/label_16.png"), Inter.getLocText(new String[]{"Label", "Widget"}), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/label_16.png"),
Label.class); Label.class);
public static final WidgetOption BUTTON = WidgetOptionFactory.createByWidgetClass( public static final WidgetOption BUTTON = WidgetOptionFactory.createByWidgetClass(
@ -155,23 +155,23 @@ public abstract class WidgetOption implements Serializable {
Button.class); Button.class);
public static final WidgetOption FREEBUTTON = WidgetOptionFactory.createByWidgetClass( public static final WidgetOption FREEBUTTON = WidgetOptionFactory.createByWidgetClass(
Inter.getLocText(new String[]{"Form-Button", "Widget"}), BaseUtils.readIcon("/com/fr/web/images/form/resources/button_16.png"), Inter.getLocText(new String[]{"Form-Button", "Widget"}), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/button_16.png"),
FreeButton.class); FreeButton.class);
public static final WidgetOption MULTI_FILEEDITOR = WidgetOptionFactory.createByWidgetClass( public static final WidgetOption MULTI_FILEEDITOR = WidgetOptionFactory.createByWidgetClass(
Inter.getLocText(new String[]{"File", "Widget"}), BaseUtils.readIcon("/com/fr/web/images/form/resources/files_up.png"), Inter.getLocText(new String[]{"File", "Widget"}), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/files_up.png"),
MultiFileEditor.class); MultiFileEditor.class);
public static final WidgetOption COMBOBOX = WidgetOptionFactory.createByWidgetClass( public static final WidgetOption COMBOBOX = WidgetOptionFactory.createByWidgetClass(
Inter.getLocText(new String[]{"Form-ComboBox", "Widget"}), BaseUtils.readIcon("/com/fr/web/images/form/resources/combo_box_16.png"), Inter.getLocText(new String[]{"Form-ComboBox", "Widget"}), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/combo_box_16.png"),
ComboBox.class); ComboBox.class);
public static final WidgetOption COMBOCHECKBOX = WidgetOptionFactory.createByWidgetClass( public static final WidgetOption COMBOCHECKBOX = WidgetOptionFactory.createByWidgetClass(
Inter.getLocText(new String[]{"Form-ComboCheckBox", "Widget"}), BaseUtils.readIcon("/com/fr/web/images/form/resources/combo_check_16.png"), Inter.getLocText(new String[]{"Form-ComboCheckBox", "Widget"}), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/combo_check_16.png"),
ComboCheckBox.class); ComboCheckBox.class);
public static final WidgetOption CHECKBOX = WidgetOptionFactory.createByWidgetClass( public static final WidgetOption CHECKBOX = WidgetOptionFactory.createByWidgetClass(
Inter.getLocText(new String[]{"Form-CheckBox", "Widget"}), BaseUtils.readIcon("/com/fr/web/images/form/resources/check_box_16.png"), Inter.getLocText(new String[]{"Form-CheckBox", "Widget"}), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/check_box_16.png"),
CheckBox.class); CheckBox.class);
public static final WidgetOption LIST = WidgetOptionFactory.createByWidgetClass( public static final WidgetOption LIST = WidgetOptionFactory.createByWidgetClass(
@ -183,16 +183,16 @@ public abstract class WidgetOption implements Serializable {
TableTree.class); TableTree.class);
public static final WidgetOption TEXTEDITOR = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"Text", "Widget"}) public static final WidgetOption TEXTEDITOR = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"Text", "Widget"})
, BaseUtils.readIcon("/com/fr/web/images/form/resources/text_field_16.png"), , BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/text_field_16.png"),
TextEditor.class); TextEditor.class);
public static final WidgetOption TEXTAREA = WidgetOptionFactory.createByWidgetClass( public static final WidgetOption TEXTAREA = WidgetOptionFactory.createByWidgetClass(
Inter.getLocText(new String[]{"Form-TextArea", "Widget"}), BaseUtils.readIcon("/com/fr/web/images/form/resources/text_area_16.png"), Inter.getLocText(new String[]{"Form-TextArea", "Widget"}), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/text_area_16.png"),
TextArea.class); TextArea.class);
public static final WidgetOption PASSWORD = WidgetOptionFactory.createByWidgetClass( public static final WidgetOption PASSWORD = WidgetOptionFactory.createByWidgetClass(
Inter.getLocText(new String[]{"Form-Password", "Widget"}), Inter.getLocText(new String[]{"Form-Password", "Widget"}),
BaseUtils.readIcon("/com/fr/web/images/form/resources/password_field_16.png"), Password.class); BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/password_field_16.png"), Password.class);
public static final WidgetOption IFRAMEDITOR = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Designer_Form-Iframe"), BaseUtils.readIcon("/com/fr/web/images/form/resources/iframe_16.png"), public static final WidgetOption IFRAMEDITOR = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Designer_Form-Iframe"), BaseUtils.readIcon("/com/fr/web/images/form/resources/iframe_16.png"),
IframeEditor.class); IframeEditor.class);

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

@ -3,16 +3,19 @@ package com.fr.design.gui.frpane;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
import com.fr.design.fun.HyperlinkProvider; import com.fr.design.fun.HyperlinkProvider;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
import com.fr.general.GeneralContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.js.JavaScript; import com.fr.js.JavaScript;
import com.fr.js.NameJavaScript; import com.fr.js.NameJavaScript;
import com.fr.js.NameJavaScriptGroup; import com.fr.js.NameJavaScriptGroup;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.stable.ListMap; import com.fr.stable.ListMap;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
@ -33,6 +36,28 @@ public abstract class HyperlinkGroupPane extends UIListControlPane {
super(); super();
this.hyperlinkGroupPaneActionProvider = hyperlinkGroupPaneActionProvider; this.hyperlinkGroupPaneActionProvider = hyperlinkGroupPaneActionProvider;
} }
@Override
protected void initComponentPane() {
super.initComponentPane();
GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@Override
public void on(PluginEvent event) {
refreshNameableCreator(createNameableCreators());
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(HyperlinkProvider.XML_TAG);
}
});
}
/** /**
* 生成添加按钮的NameableCreator * 生成添加按钮的NameableCreator
* *

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

@ -75,7 +75,8 @@ public class RegPane extends BasicPane {
regComboBox = new UIComboBox(regType); regComboBox = new UIComboBox(regType);
regComboBox.setRenderer(listCellRender); regComboBox.setRenderer(listCellRender);
JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Input_Rule")), regComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Input_Rule")), regComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.add(contentPane, BorderLayout.NORTH); jPanel.add(contentPane, BorderLayout.NORTH);

61
designer_base/src/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java

@ -1,28 +1,14 @@
package com.fr.design.gui.frpane; package com.fr.design.gui.frpane;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.LayoutManager;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.HyperlinkFilterHelper;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.design.gui.imenutable.UIMenuNameableCreator;
@ -30,11 +16,7 @@ import com.fr.design.gui.imenutable.UIMenuTable;
import com.fr.design.hyperlink.ReportletHyperlinkPane; import com.fr.design.hyperlink.ReportletHyperlinkPane;
import com.fr.design.hyperlink.WebHyperlinkPane; import com.fr.design.hyperlink.WebHyperlinkPane;
import com.fr.design.javascript.EmailPane; import com.fr.design.javascript.EmailPane;
import com.fr.design.mainframe.BaseJForm; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.js.AbstractJavaScript; import com.fr.js.AbstractJavaScript;
@ -43,7 +25,15 @@ import com.fr.js.ReportletHyperlink;
import com.fr.js.WebHyperlink; import com.fr.js.WebHyperlink;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
public class UICorrelationComboBoxPane extends JPanel implements UIObserver { public class UICorrelationComboBoxPane extends JPanel implements UIObserver {
private static final Dimension DIALOG_SIZE = new Dimension(500, 500); private static final Dimension DIALOG_SIZE = new Dimension(500, 500);
@ -98,7 +88,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver {
if (values.size() > 1) { if (values.size() > 1) {
for (UIMenuNameableCreator value : values) { for (UIMenuNameableCreator value : values) {
final String itemName = value.getName(); final String itemName = value.getName();
if(!whetherAdd(itemName)){ if(!HyperlinkFilterHelper.whetherAddHyperlink4Chart(itemName)){
continue; continue;
} }
UIMenuItem item = new UIMenuItem(itemName); UIMenuItem item = new UIMenuItem(itemName);
@ -135,25 +125,6 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver {
initAddButtonListener(); initAddButtonListener();
} }
private boolean whetherAdd(String itemName){
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
//先屏蔽掉这个,之后还有别的
String[] names = {Inter.getLocText("FR-Hyperlink_Chart_Float"), Inter.getLocText("FR-Hyperlink_Chart_Cell")};
for (String name : names){
if(!jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName,name)){
if(jTemplate.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB && ComparatorUtils.equals(itemName, names[0])){
//表单报表块中图表悬浮元素超链,只屏蔽联动悬浮元素
return false;
} else if(jTemplate.getEditingReportIndex() == BaseJForm.FORM_TAB) {
//表单图表超链屏蔽掉联动悬浮元素和联动单元格
return false;
}
}
}
String formName = Inter.getLocText("Hyperlink-Form_link");
return !(jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, formName));
}
private String createUnrepeatedName(String prefix) { private String createUnrepeatedName(String prefix) {
List<UIMenuNameableCreator> all = tablePane.updateBean(); List<UIMenuNameableCreator> all = tablePane.updateBean();
// richer:生成的名字从1开始. kunsnat: 添加属性从0开始. // richer:生成的名字从1开始. kunsnat: 添加属性从0开始.

2
designer_base/src/com/fr/design/gui/ibutton/UIButton.java

@ -36,7 +36,7 @@ public class UIButton extends JButton implements UIObserver {
private CellBorderStyle border = null; private CellBorderStyle border = null;
protected UIObserverListener uiObserverListener; protected UIObserverListener uiObserverListener;
private static final int TOOLTIP_INIT_DELAY = 1000; // 延迟 1s 显示提示文字 private static final int TOOLTIP_INIT_DELAY = 300; // 延迟 0.3s 显示提示文字
public UIButton() { public UIButton() {
this(StringUtils.EMPTY); this(StringUtils.EMPTY);

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

@ -8,11 +8,14 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import sun.swing.SwingUtilities2;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.Border; import javax.swing.border.Border;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.plaf.basic.BasicHTML;
import javax.swing.text.View;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
@ -41,6 +44,10 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
this(iconArray, null); this(iconArray, null);
} }
public UIButtonGroup(Icon[][] iconArray) {
this(iconArray, null);
}
public UIButtonGroup(Icon[] iconArray, T[] objects) { public UIButtonGroup(Icon[] iconArray, T[] objects) {
if (!ArrayUtils.isEmpty(objects) && iconArray.length == objects.length) { if (!ArrayUtils.isEmpty(objects) && iconArray.length == objects.length) {
this.objectList = Arrays.asList(objects); this.objectList = Arrays.asList(objects);
@ -77,6 +84,42 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
} }
} }
public UIButtonGroup(Icon[][] iconArray, T[] objects) {
if (!ArrayUtils.isEmpty(objects) && iconArray.length == objects.length) {
this.objectList = Arrays.asList(objects);
}
labelButtonList = new ArrayList<UIToggleButton>(iconArray.length);
this.setLayout(getGridLayout(iconArray.length));
this.setBorder(getGroupBorder());
for (int i = 0; i < iconArray.length; i++) {
final int index = i;
Icon[] icon = iconArray[i];
final UIToggleButton labelButton = new UIToggleButton(icon) {
@Override
protected MouseListener getMouseListener() {
return new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
isClick = true;
if (!isEnabled()) {
return;
}
if (globalNameListener != null) {
globalNameListener.setGlobalName(buttonGroupName);
}
setSelectedWithFireChanged(index);
}
};
}
public boolean shouldResponseNameListener() {
return false;
}
};
initButton(labelButton);
}
}
public boolean hasClick() { public boolean hasClick() {
return isClick; return isClick;
} }
@ -145,6 +188,24 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
} }
}; };
labelButton.setUI(new UIButtonUI() {
protected void paintText(Graphics g, AbstractButton b, String text, Rectangle textRec) {
View v = (View) b.getClientProperty(BasicHTML.propertyKey);
if (v != null) {
v.paint(g, textRec);
return;
}
FontMetrics fm = SwingUtilities2.getFontMetrics(b, g);
int mnemonicIndex = b.getDisplayedMnemonicIndex();
if (isPressed(b)) {
g.setColor(Color.white);
} else {
g.setColor(Color.black);
}
SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemonicIndex, textRec.x + getTextShiftOffset(), textRec.y + fm.getAscent() + getTextShiftOffset());
}
});
initButton(labelButton); initButton(labelButton);
} }
} }

6
designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java

@ -68,6 +68,10 @@ public class UIButtonUI extends BasicButtonUI {
} }
private void paintText(Graphics g, AbstractButton b, String text) { private void paintText(Graphics g, AbstractButton b, String text) {
paintText(g, b, text ,textRec);
}
protected void paintText(Graphics g, AbstractButton b, String text, Rectangle textRec) {
View v = (View) b.getClientProperty(BasicHTML.propertyKey); View v = (View) b.getClientProperty(BasicHTML.propertyKey);
if (v != null) { if (v != null) {
v.paint(g, textRec); v.paint(g, textRec);
@ -156,7 +160,7 @@ public class UIButtonUI extends BasicButtonUI {
paintModelIcon(model, icon, g, c); paintModelIcon(model, icon, g, c);
} }
private void paintModelIcon(ButtonModel model, Icon icon, Graphics g, JComponent c) { protected void paintModelIcon(ButtonModel model, Icon icon, Graphics g, JComponent c) {
if (model.isPressed() && model.isArmed()) { if (model.isPressed() && model.isArmed()) {
icon.paintIcon(c, g, iconRec.x + getTextShiftOffset(), icon.paintIcon(c, g, iconRec.x + getTextShiftOffset(),
iconRec.y + getTextShiftOffset()); iconRec.y + getTextShiftOffset());

4
designer_base/src/com/fr/design/gui/ibutton/UIHeadGroup.java

@ -23,8 +23,8 @@ public class UIHeadGroup extends JPanel {
public UIHeadGroup(String[] textArray) { public UIHeadGroup(String[] textArray) {
labelButtonList = new ArrayList<UIToggleButton>(textArray.length); labelButtonList = new ArrayList<UIToggleButton>(textArray.length);
this.setBackground(UIConstants.NORMAL_BACKGROUND); this.setBackground(UIConstants.TREE_BACKGROUND);
this.setLayout(new GridLayout(0, textArray.length, 1, 0)); this.setLayout(new GridLayout(0, textArray.length, 0, 0));
// this.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); // this.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
for (int i = 0; i < textArray.length; i++) { for (int i = 0; i < textArray.length; i++) {
final int index = i; final int index = i;

26
designer_base/src/com/fr/design/gui/ibutton/UIToggleButton.java

@ -3,12 +3,13 @@ package com.fr.design.gui.ibutton;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Shape; import java.awt.Shape;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import java.awt.geom.RoundRectangle2D; import java.awt.geom.RoundRectangle2D;
import javax.swing.Icon; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
@ -46,6 +47,26 @@ public class UIToggleButton extends UIButton implements GlobalNameObserver{
addMouseListener(getMouseListener()); addMouseListener(getMouseListener());
} }
/**
* 需要反白的按钮接口
* support icons[normalIcon, selectedIcon]
* @param icons
*/
public UIToggleButton(Icon[] icons) {
super(icons[0], null, icons[1]);
setSelectedIcon(icons[1]);
setExtraPainted(true);
addActionListener(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
if (!UIToggleButton.super.isSelected()) {
UIToggleButton.super.setSelected(!UIToggleButton.super.isSelected());
}
}
});
addMouseListener(getMouseListener());
}
public void setGlobalName(String name){ public void setGlobalName(String name){
toggleButtonName = name ; toggleButtonName = name ;
} }
@ -66,6 +87,7 @@ public class UIToggleButton extends UIButton implements GlobalNameObserver{
@Override @Override
public void setSelected(boolean isSelected) { public void setSelected(boolean isSelected) {
super.setSelected(isSelected);
if (this.isSelected != isSelected) { if (this.isSelected != isSelected) {
this.isSelected = isSelected; this.isSelected = isSelected;
repaint(); repaint();
@ -100,7 +122,7 @@ public class UIToggleButton extends UIButton implements GlobalNameObserver{
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (isEnabled() && !isEventBannded) { if (isEnabled() && !isEventBannded) {
setSelectedWithFireListener(!isSelected()); setSelectedWithFireListener(!isSelected());
} }
} }
}; };

2
designer_base/src/com/fr/design/gui/icombobox/LazyComboBox.java

@ -175,8 +175,10 @@ public abstract class LazyComboBox extends UIComboBox implements PopupMenuListen
this.item = item; this.item = item;
this.setting = true; this.setting = true;
textField.setSetting(true);
String newText = (item == null) ? "" : item.toString(); String newText = (item == null) ? "" : item.toString();
textField.setText(newText); textField.setText(newText);
textField.setSetting(false);
this.setting = false; this.setting = false;
} }

13
designer_base/src/com/fr/design/gui/icombobox/UIComboBoxRenderer.java

@ -26,9 +26,16 @@ public class UIComboBoxRenderer extends DefaultListCellRenderer {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
cellHasFocus = cellHasFocus && !this.isEnabled(); cellHasFocus = cellHasFocus && !this.isEnabled();
JLabel renderer =(JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); JLabel renderer =(JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
renderer.setForeground(Color.black); renderer.setOpaque(true);
list.setSelectionBackground(UIConstants.COMBOBOX_BTN_PRESS); list.setSelectionBackground(UIConstants.NORMAL_BLUE);
list.setSelectionForeground(Color.black); list.setSelectionForeground(Color.WHITE);
if (isSelected) {
renderer.setForeground(list.getSelectionForeground());
renderer.setBackground(list.getSelectionBackground());
} else {
renderer.setForeground(list.getForeground());
renderer.setBackground(list.getBackground());
}
renderer.setText(" " + renderer.getText()); renderer.setText(" " + renderer.getText());
return renderer; return renderer;
} }

42
designer_base/src/com/fr/design/gui/ispinner/UISpinner.java

@ -6,8 +6,9 @@ import com.fr.design.event.GlobalNameObserver;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -16,6 +17,7 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import javax.swing.plaf.ButtonUI;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
@ -164,6 +166,34 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
} }
} }
private class ButtionUI extends UIButtonUI {
private boolean isNormalPaint = true;
@Override
protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) {
if (isPressed(b) && b.isPressedPainted()) {
isNormalPaint = false;
Color pressColor = UIConstants.COMBOBOX_BTN_PRESS;
GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), pressColor);
} else if (isRollOver(b)) {
isNormalPaint = false;
Color hoverColor = UIConstants.COMBOBOX_BTN_ROLLOVER;
GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), hoverColor);
} else if (b.isNormalPainted()) {
isNormalPaint = true;
GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted());
}
}
@Override
protected void paintModelIcon(ButtonModel model, Icon icon, Graphics g, JComponent c) {
if (isNormalPaint) {
g.setColor(UIConstants.COMBOBOX_BTN_NORMAL);
g.fillRect(0, 0, c.getWidth(), c.getHeight());
}
super.paintModelIcon(model, icon, g, c);
}
}
private void initComponents() { private void initComponents() {
textField = initNumberField(); textField = initNumberField();
@ -174,12 +204,22 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
public boolean shouldResponseChangeListener() { public boolean shouldResponseChangeListener() {
return false; return false;
} }
@Override
public ButtonUI getUI() {
return new ButtionUI();
}
}; };
preButton.setRoundBorder(true, Constants.LEFT); preButton.setRoundBorder(true, Constants.LEFT);
nextButton = new UIButton(UIConstants.ARROW_DOWN_ICON) { nextButton = new UIButton(UIConstants.ARROW_DOWN_ICON) {
public boolean shouldResponseChangeListener() { public boolean shouldResponseChangeListener() {
return false; return false;
} }
@Override
public ButtonUI getUI() {
return new ButtionUI();
}
}; };
nextButton.setRoundBorder(true, Constants.LEFT); nextButton.setRoundBorder(true, Constants.LEFT);
setLayout(new BorderLayout()); setLayout(new BorderLayout());

13
designer_base/src/com/fr/design/gui/itextfield/UITextField.java

@ -26,6 +26,9 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
private GlobalNameListener globalNameListener = null; private GlobalNameListener globalNameListener = null;
private Dimension preferredSize = null; private Dimension preferredSize = null;
//有些情况下setText的时候不希望触发attributeChange,添加一个属性标识
private boolean isSetting = false;
public UITextField() { public UITextField() {
super(); super();
InputEventBaseOnOS.addBasicEditInputMap(this); InputEventBaseOnOS.addBasicEditInputMap(this);
@ -78,6 +81,13 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
} }
} }
public boolean isSetting() {
return isSetting;
}
public void setSetting(boolean setting) {
isSetting = setting;
}
public void setPreferredSize(Dimension preferredSize) { public void setPreferredSize(Dimension preferredSize) {
this.preferredSize = preferredSize; this.preferredSize = preferredSize;
@ -88,6 +98,9 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
} }
protected void attributeChange() { protected void attributeChange() {
if(isSetting){
return;
}
if (globalNameListener != null && shouldResponseNameListener()) { if (globalNameListener != null && shouldResponseNameListener()) {
globalNameListener.setGlobalName(textFeildName); globalNameListener.setGlobalName(textFeildName);
} }

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

Loading…
Cancel
Save