Browse Source

Merging in latest from upstream (BA/design:refs/heads/release/9.0)

* commit 'b2e1f08dc093b0ddb5e23960185cd615be17ba62': (54 commits)
  REPORT-4115 参数面板各控件属性面板添加标签属性
  NumberDragBar labelString
  9.0界面修改
  代码规范
  update
  拼错
  build failed
  REPORT-3457 有几个报错没截取到日志.
  REPORT-2354 不从后台自动登录,切换环境进行登录
  PMD
  处理超链和条件显示的todo,修改警戒线和间隔背景
  根据交互要求,增加缩放条输入框条件限制0-400的数字
  REPORT-3815 [9.0一轮回归]单元格属性样式缩进等输入数字每次只能输入一位 REPORT-4025 [9.0一轮回归]其他属性分页中默认勾选项无法取消勾线 REPORT-4022 [9.0一轮回归]选中一片单元格时对齐方式设置异常如附件图片 根据交互要求,增加缩放条输入框条件限制0-400的数字
  pmd
  pmd
  pmd
  rt
  tmp
  图标
  update
  ...
master
ju 7 years ago
parent
commit
dcfa8c292c
  1. 6
      designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java
  2. 4
      designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java
  3. 7
      designer/src/com/fr/design/mainframe/CellElementPropertyPane.java
  4. 8
      designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java
  5. 120
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  6. 1
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java
  7. BIN
      designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif
  8. 16
      designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java
  9. 2
      designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java
  10. 2
      designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java
  11. 16
      designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java
  12. 20
      designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java
  13. 3
      designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java
  14. 4
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  15. 3
      designer/src/com/fr/design/widget/WidgetEventPane.java
  16. 6
      designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java
  17. 6
      designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java
  18. 6
      designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java
  19. 273
      designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java
  20. 6
      designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java
  21. 24
      designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java
  22. 2
      designer/src/com/fr/quickeditor/cellquick/CellStringQuickEditor.java
  23. 18
      designer_base/src/com/fr/design/actions/file/PreferencePane.java
  24. 10
      designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
  25. 1
      designer_base/src/com/fr/design/constants/UIConstants.java
  26. 1
      designer_base/src/com/fr/design/file/HistoryTemplateListPane.java
  27. 47
      designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java
  28. 14
      designer_base/src/com/fr/design/gui/style/BorderPane.java
  29. 2
      designer_base/src/com/fr/design/gui/style/NumberDragBar.java
  30. BIN
      designer_base/src/com/fr/design/images/buttonicon/run24.png
  31. BIN
      designer_base/src/com/fr/design/images/buttonicon/runs.png
  32. BIN
      designer_base/src/com/fr/design/images/m_edit/paste.png
  33. 6
      designer_base/src/com/fr/design/layout/TableLayoutHelper.java
  34. 5
      designer_base/src/com/fr/design/locale/designer.properties
  35. 7
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  36. 5
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  37. 7
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  38. 7
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  39. 5
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  40. 81
      designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java
  41. 17
      designer_base/src/com/fr/design/mainframe/JFormSliderPane.java
  42. 17
      designer_base/src/com/fr/design/mainframe/JSliderPane.java
  43. 8
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  44. 11
      designer_base/src/com/fr/design/present/dict/FormulaDictPane.java
  45. 2
      designer_base/src/com/fr/design/style/color/ColorSelectDetailPane.java
  46. 3
      designer_base/src/com/fr/design/style/color/ColorSelectDialog.java
  47. 8
      designer_base/src/com/fr/file/FILEChooserPane.java
  48. 2
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  49. 6
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java
  50. 12
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java
  51. 12
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java
  52. 1
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/BubblePlotReportDataContentPane.java
  53. 3
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java
  54. 1
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java
  55. 9
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java
  56. 16
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/BubblePlotTableDataContentPane.java
  57. 25
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java
  58. 7
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/PiePlotTableDataContentPane.java
  59. 1
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java
  60. 231
      designer_chart/src/com/fr/plugin/chart/DownloadOnlineSourcesHelper.java
  61. BIN
      designer_chart/src/com/fr/plugin/chart/background.png
  62. 20
      designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java
  63. 5
      designer_chart/src/com/fr/plugin/chart/custom/CustomPlotDesignerPaneFactory.java
  64. 59
      designer_chart/src/com/fr/plugin/chart/custom/VanChartCustomPlotPane.java
  65. 4
      designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomPlotSelectPane.java
  66. 49
      designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java
  67. 2
      designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomAxisAreaPane.java
  68. 2
      designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomPlotLabelTabPane.java
  69. 84
      designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java
  70. 84
      designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java
  71. 12
      designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java
  72. 12
      designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java
  73. 116
      designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java
  74. 121
      designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java
  75. 48
      designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java
  76. 53
      designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java
  77. 11
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java
  78. 237
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java
  79. 17
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java
  80. 3
      designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java
  81. 18
      designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotTableDataContentPane.java
  82. 14
      designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java
  83. 25
      designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java
  84. 15
      designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java
  85. 23
      designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java
  86. 13
      designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java
  87. 6
      designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java
  88. 6
      designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java
  89. 7
      designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java
  90. 5
      designer_form/src/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java
  91. 13
      designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java
  92. 6
      designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java
  93. 90
      designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java
  94. 11
      designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java
  95. 6
      designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java
  96. 6
      designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java
  97. 5
      designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java

6
designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java

@ -89,14 +89,10 @@ public class ChartFloatAction extends ElementCaseAction {
Style style = newFloatElement.getStyle(); Style style = newFloatElement.getStyle();
if (style != null) { if (style != null) {
newFloatElement.setStyle(style.deriveBorder(Constants.LINE_NONE, Color.black, newFloatElement.setStyle(style.deriveBorder(Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black));
Constants.LINE_NONE, Color.black,
Constants.LINE_NONE, Color.black,
Constants.LINE_NONE, Color.black));
} }
reportPane.getEditingElementCase().addFloatElement(newFloatElement); reportPane.getEditingElementCase().addFloatElement(newFloatElement);
reportPane.setSelection(new FloatSelection(newFloatElement.getName())); reportPane.setSelection(new FloatSelection(newFloatElement.getName()));
reportPane.fireTargetModified();
reportPane.fireSelectionChangeListener(); reportPane.fireSelectionChangeListener();
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
FRLogger.getLogger().error("Error in Float"); FRLogger.getLogger().error("Error in Float");

4
designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java

@ -41,7 +41,7 @@ import java.util.regex.Pattern;
* *
* @author yaoh.wu * @author yaoh.wu
* @version 2017年8月3日 * @version 2017年8月3日
* 复用对话框代码保留对话框原始布局 * 复用对话框代码保留对话框原始布局
* @since 8.0 * @since 8.0
*/ */
public class SelectedDataColumnPane extends BasicPane { public class SelectedDataColumnPane extends BasicPane {
@ -282,7 +282,7 @@ public class SelectedDataColumnPane extends BasicPane {
private void initWithParameterButton(final ElementCasePane casePane, final TemplateCellElement cellElement) { private void initWithParameterButton(final ElementCasePane casePane, final TemplateCellElement cellElement) {
final SelectedDataColumnPane that = this; final SelectedDataColumnPane that = this;
editorPane = new UITableEditorPane<ParameterProvider>(new ParameterTableModel()); editorPane = new UITableEditorPane<ParameterProvider>(new ParameterTableModel());
paramButton = new UIButton(Inter.getLocText("TableData_Dynamic_Parameter_Setting")); paramButton = new UIButton(Inter.getLocText("FR-Designer-Basic_Dynamic_Parameter_Injection"));
paramButton.addActionListener(new ActionListener() { paramButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
BasicDialog paramDialog = editorPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { BasicDialog paramDialog = editorPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {

7
designer/src/com/fr/design/mainframe/CellElementPropertyPane.java

@ -79,7 +79,7 @@ public class CellElementPropertyPane extends DockingView {
@Override @Override
public void fireTitleChange(String addName) { public void fireTitleChange(String addName) {
title.setText(Inter.getLocText("CellElement-Property_Table") + '-' + addName); title.setText(Inter.getLocText("FR-Designer_CellElement_Property_Table") + '-' + addName);
} }
}; };
@ -134,8 +134,7 @@ public class CellElementPropertyPane extends DockingView {
} }
public void reInit(ElementCasePane ePane) { public void reInit(ElementCasePane ePane) {
if (titlePane.getParent() == null) { // 如果处于隐藏状态,则让其显示 if (cellElementEditPane.getParent() == null) { // 如果处于隐藏状态,则让其显示
// this.add(titlePane, BorderLayout.NORTH);
this.add(cellElementEditPane, BorderLayout.CENTER); this.add(cellElementEditPane, BorderLayout.CENTER);
} }
cellElementEditPane.populate(ePane); cellElementEditPane.populate(ePane);
@ -151,7 +150,7 @@ public class CellElementPropertyPane extends DockingView {
@Override @Override
public String getViewTitle() { public String getViewTitle() {
return Inter.getLocText("CellElement-Property_Table"); return Inter.getLocText("FR-Designer_CellElement_Property_Table");
} }
@Override @Override

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

@ -33,14 +33,6 @@ public class TitleCellRender implements ListCellRenderer<Object> {
showMoreLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); showMoreLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));
panel.add(showMoreLabel, BorderLayout.EAST); panel.add(showMoreLabel, BorderLayout.EAST);
} }
if (moreModel.isLoading()) {
ImageIcon imageIcon = new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/loading.gif"));
//设置cell的加载动画
imageIcon.setImageObserver(list);
UILabel loadingLabel = new UILabel(imageIcon);
loadingLabel.setBorder(BorderFactory.createEmptyBorder(LOAD_OFFSET,0,0,0));
panel.add(loadingLabel, 0);
}
panel.setPreferredSize(new Dimension(list.getFixedCellWidth(), AlphaFineConstants.CELL_TITLE_HEIGHT)); panel.setPreferredSize(new Dimension(list.getFixedCellWidth(), AlphaFineConstants.CELL_TITLE_HEIGHT));
return panel; return panel;
} }

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

@ -17,7 +17,10 @@ import com.fr.design.mainframe.alphafine.cell.model.PluginModel;
import com.fr.design.mainframe.alphafine.cell.render.ContentCellRender; import com.fr.design.mainframe.alphafine.cell.render.ContentCellRender;
import com.fr.design.mainframe.alphafine.listener.DocumentAdapter; import com.fr.design.mainframe.alphafine.listener.DocumentAdapter;
import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.model.SearchResult;
import com.fr.design.mainframe.alphafine.preview.*; import com.fr.design.mainframe.alphafine.preview.DocumentPreviewPane;
import com.fr.design.mainframe.alphafine.preview.FilePreviewPane;
import com.fr.design.mainframe.alphafine.preview.NoResultPane;
import com.fr.design.mainframe.alphafine.preview.PluginPreviewPane;
import com.fr.design.mainframe.alphafine.search.manager.*; import com.fr.design.mainframe.alphafine.search.manager.*;
import com.fr.form.main.Form; import com.fr.form.main.Form;
import com.fr.form.main.FormIO; import com.fr.form.main.FormIO;
@ -72,9 +75,11 @@ public class AlphaFineDialog extends UIDialog {
private AlphaFineTextField searchTextField; private AlphaFineTextField searchTextField;
private UIButton closeButton; private UIButton closeButton;
private JPanel searchResultPane; private JPanel searchResultPane;
private Point pressedPoint;
private UIScrollPane leftSearchResultPane; private UIScrollPane leftSearchResultPane;
private JPanel defaultPane; private JPanel defaultPane;
//分割线
private UILabel splitLabel;
private JPanel rightSearchResultPane; private JPanel rightSearchResultPane;
private AlphaFineList searchResultList; private AlphaFineList searchResultList;
private SearchListModel searchListModel; private SearchListModel searchListModel;
@ -302,7 +307,7 @@ public class AlphaFineDialog extends UIDialog {
rightSearchResultPane.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH - 1, AlphaFineConstants.CONTENT_HEIGHT)); rightSearchResultPane.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH - 1, AlphaFineConstants.CONTENT_HEIGHT));
searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); searchResultPane.add(leftSearchResultPane, BorderLayout.WEST);
searchResultPane.add(rightSearchResultPane, BorderLayout.EAST); searchResultPane.add(rightSearchResultPane, BorderLayout.EAST);
UILabel splitLabel = new UILabel(); splitLabel = new UILabel();
splitLabel.setPreferredSize(new Dimension(AlphaFineConstants.HEIGHT, 1)); splitLabel.setPreferredSize(new Dimension(AlphaFineConstants.HEIGHT, 1));
searchResultPane.add(splitLabel, BorderLayout.NORTH); searchResultPane.add(splitLabel, BorderLayout.NORTH);
add(searchResultPane, BorderLayout.SOUTH); add(searchResultPane, BorderLayout.SOUTH);
@ -320,6 +325,8 @@ public class AlphaFineDialog extends UIDialog {
this.searchWorker = new SwingWorker() { this.searchWorker = new SwingWorker() {
@Override @Override
protected Object doInBackground() throws Exception { protected Object doInBackground() throws Exception {
resumeLeftPane();
splitLabel.setIcon(new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/bigloading.gif")));
rebuildList(searchTextField.getText().toLowerCase()); rebuildList(searchTextField.getText().toLowerCase());
return null; return null;
} }
@ -327,6 +334,7 @@ public class AlphaFineDialog extends UIDialog {
@Override @Override
protected void done() { protected void done() {
if (!isCancelled()) { if (!isCancelled()) {
splitLabel.setIcon(null);
fireStopLoading(); fireStopLoading();
} }
} }
@ -334,12 +342,39 @@ public class AlphaFineDialog extends UIDialog {
this.searchWorker.execute(); this.searchWorker.execute();
} }
/**
* 恢复左侧列表面板
*/
private void resumeLeftPane() {
if (searchResultPane != null && defaultPane != null) {
rightSearchResultPane.removeAll();
searchResultPane.remove(defaultPane);
defaultPane = null;
searchResultPane.add(leftSearchResultPane, BorderLayout.WEST);
refreshContainer();
}
}
/**
* 移除左侧列表面板
*/
private void removeLeftPane() {
if (searchListModel.isEmpty() && defaultPane == null) {
defaultPane = new NoResultPane(Inter.getLocText("FR-Designer-AlphaFine_NO_Result"), IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/no_result.png"));
searchResultPane.remove(leftSearchResultPane);
searchResultPane.add(defaultPane, BorderLayout.WEST);
refreshContainer();
}
}
/** /**
* 停止加载状态 * 停止加载状态
*/ */
private void fireStopLoading() { private void fireStopLoading() {
searchListModel.resetState(); searchListModel.resetState();
replaceLeftPane(); if (searchResultPane != null) {
removeLeftPane();
}
} }
/** /**
@ -351,22 +386,6 @@ public class AlphaFineDialog extends UIDialog {
revalidate(); revalidate();
} }
/**
* 重置结果面板
*/
private void replaceLeftPane() {
if (searchListModel.getSize() == 0 && defaultPane == null) {
defaultPane = new NoResultPane(Inter.getLocText("FR-Designer-AlphaFine_NO_Result"), IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/no_result.png"));
searchResultPane.remove(leftSearchResultPane);
searchResultPane.add(defaultPane, BorderLayout.WEST);
} else if (searchListModel.getSize() > 0 && defaultPane != null) {
searchResultPane.remove(defaultPane);
defaultPane = null;
searchResultPane.add(leftSearchResultPane, BorderLayout.WEST);
}
refreshContainer();
}
/** /**
* 重新构建搜索结果列表 * 重新构建搜索结果列表
* 先根据输入判断是不是隐藏的搜索功能 * 先根据输入判断是不是隐藏的搜索功能
@ -409,8 +428,7 @@ public class AlphaFineDialog extends UIDialog {
searchListModel.removeAllElements(); searchListModel.removeAllElements();
searchListModel.resetSelectedState(); searchListModel.resetSelectedState();
rightSearchResultPane.removeAll(); rightSearchResultPane.removeAll();
validate(); refreshContainer();
repaint();
} }
/** /**
@ -605,7 +623,7 @@ public class AlphaFineDialog extends UIDialog {
this.showWorker.execute(); this.showWorker.execute();
break; break;
default: default:
return; rightSearchResultPane.removeAll();
} }
@ -680,45 +698,6 @@ public class AlphaFineDialog extends UIDialog {
} }
/**
* 窗口拖拽
*/
private void initMouseListener() {
addMouseMotionListener(new MouseMotionAdapter() {
@Override
public void mouseDragged(MouseEvent e) {
doMouseDragged(e);
}
});
addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
doMousePressed(e);
}
});
}
private void doMousePressed(MouseEvent e) {
pressedPoint = e.getPoint();
}
private void doMouseDragged(MouseEvent e) {
Point point = e.getPoint();// 获取当前坐标
Point locationPoint = getLocation();// 获取窗体坐标
int x = locationPoint.x + point.x - pressedPoint.x;// 计算移动后的新坐标
int y = locationPoint.y + point.y - pressedPoint.y;
setLocation(x, y);// 改变窗体位置
}
/** /**
* 当鼠标在搜索界面边界外点击时触发 * 当鼠标在搜索界面边界外点击时触发
*/ */
@ -792,7 +771,7 @@ public class AlphaFineDialog extends UIDialog {
} }
final HashMap<String, String> para = new HashMap<>(); final HashMap<String, String> para = new HashMap<>();
String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
para.put("token", CodeUtils.md5Encode(date, "", "MD5")); para.put("token", CodeUtils.md5Encode(date, StringUtils.EMPTY, "MD5"));
para.put("content", object.toString()); para.put("content", object.toString());
HttpClient httpClient = new HttpClient(AlphaFineConstants.CLOUD_SERVER_URL, para, true); HttpClient httpClient = new HttpClient(AlphaFineConstants.CLOUD_SERVER_URL, para, true);
httpClient.asGet(); httpClient.asGet();
@ -880,6 +859,14 @@ public class AlphaFineDialog extends UIDialog {
this.storeText = storeText; this.storeText = storeText;
} }
public UILabel getSplitLabel() {
return splitLabel;
}
public void setSplitLabel(UILabel splitLabel) {
this.splitLabel = splitLabel;
}
/** /**
* +-------------------------------------+ * +-------------------------------------+
@ -1047,8 +1034,13 @@ public class AlphaFineDialog extends UIDialog {
isValidSelected = selected; isValidSelected = selected;
} }
@Override
public boolean isEmpty() {
return myDelegate.isEmpty();
}
public void resetState() { public void resetState() {
for (int i = 0; i< getSize(); i++) { for (int i = 0; i < getSize(); i++) {
getElementAt(i).resetState(); getElementAt(i).resetState();
} }
} }

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

@ -30,6 +30,7 @@ public class AlphaFinePane extends BasicPane {
refreshButton.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/smallsearch.png")); refreshButton.setIcon(IOUtils.readIcon("/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);
this.add(refreshButton); this.add(refreshButton);
this.setBackground(ThemeUtils.WHITE_BORDER_COLOR); this.setBackground(ThemeUtils.WHITE_BORDER_COLOR);
refreshButton.addActionListener(new ActionListener() { refreshButton.addActionListener(new ActionListener() {

BIN
designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

16
designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java

@ -18,7 +18,9 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.general.DateUtils; import com.fr.general.DateUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.GeneralContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -45,6 +47,7 @@ public class UserInfoPane extends BasicPane{
private UserInfoLabel userInfoLabel; private UserInfoLabel userInfoLabel;
public UserInfoLabel getUserInfoLabel() { public UserInfoLabel getUserInfoLabel() {
return userInfoLabel; return userInfoLabel;
} }
@ -64,18 +67,15 @@ public class UserInfoPane extends BasicPane{
this.userInfoLabel = new UserInfoLabel(this); this.userInfoLabel = new UserInfoLabel(this);
this.markUnSignIn(); this.markUnSignIn();
autoLogin(); addEnvChangedListener();
autoPushLoginDialog(); autoPushLoginDialog();
this.add(userInfoLabel, BorderLayout.CENTER); this.add(userInfoLabel, BorderLayout.CENTER);
} }
// 后台自动登录
private void autoLogin(){
Thread bbsAutoLoginThread = new Thread(new Runnable() {
@Override private void addEnvChangedListener(){
public void run() { GeneralContext.addEnvChangedListener(new EnvChangedListener() {
public void envChanged() {
String username = ConfigManager.getProviderInstance().getBbsUsername(); String username = ConfigManager.getProviderInstance().getBbsUsername();
if (StringUtils.isEmpty(username)){ if (StringUtils.isEmpty(username)){
markUnSignIn(); markUnSignIn();
@ -84,8 +84,8 @@ public class UserInfoPane extends BasicPane{
} }
} }
}); });
bbsAutoLoginThread.start();
} }
// 计算xml保存的上次弹框时间和当前时间的时间差 // 计算xml保存的上次弹框时间和当前时间的时间差
private int getDiffFromLastLogin(){ private int getDiffFromLastLogin(){

2
designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java

@ -76,7 +76,7 @@ public class CellElementEditPane extends BasicPane {
downTitle = new JPanel(); downTitle = new JPanel();
downTitle.setLayout(new BorderLayout()); downTitle.setLayout(new BorderLayout());
downTitle.add(tabsHeaderIconPane, BorderLayout.NORTH); downTitle.add(tabsHeaderIconPane, BorderLayout.NORTH);
center.setBorder(BorderFactory.createEmptyBorder(0, LEFT_BORDER, 0, RIGHT_BORDER)); center.setBorder(BorderFactory.createEmptyBorder(0, LEFT_BORDER, 0, 0));
downTitle.add(center, BorderLayout.CENTER); downTitle.add(center, BorderLayout.CENTER);
this.add(downTitle, BorderLayout.CENTER); this.add(downTitle, BorderLayout.CENTER);

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

@ -188,7 +188,7 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
// extendable // extendable
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_ExpandD-Expandable"))) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_ExpandD_Expandable"))) {
if (horizontalExpandableCheckBox.isSelected()) { if (horizontalExpandableCheckBox.isSelected()) {
if (verticalExpandableCheckBox.isSelected()) { if (verticalExpandableCheckBox.isSelected()) {
cellExpandAttr.setExtendable(CellExpandAttr.Both_EXTENDABLE); cellExpandAttr.setExtendable(CellExpandAttr.Both_EXTENDABLE);

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

@ -10,7 +10,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
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;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
@ -22,6 +22,7 @@ import com.fr.report.cell.cellattr.CellGUIAttr;
import com.fr.report.cell.cellattr.CellInsertPolicyAttr; import com.fr.report.cell.cellattr.CellInsertPolicyAttr;
import com.fr.report.cell.cellattr.CellPageAttr; import com.fr.report.cell.cellattr.CellPageAttr;
import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -47,9 +48,9 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
private UIComboBox showContent; private UIComboBox showContent;
private UIPropertyTextField tooltipTextField; private UITextField tooltipTextField;
private UIPropertyTextField fileNameTextField; private UITextField fileNameTextField;
// 分页 // 分页
private UICheckBox pageBeforeRowCheckBox; private UICheckBox pageBeforeRowCheckBox;
@ -228,8 +229,8 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
final JPanel fileNamePane = new JPanel(fileNameLayout); final JPanel fileNamePane = new JPanel(fileNameLayout);
JPanel fileNameCCPane = new JPanel(new BorderLayout(4, 0)); JPanel fileNameCCPane = new JPanel(new BorderLayout(4, 0));
fileNameCCPane.add(new UILabel(Inter.getLocText("FR-Designer_File_Name_For_Download")), BorderLayout.WEST); fileNameCCPane.add(new UILabel(Inter.getLocText("FR-Designer_File_Name_For_Download")), BorderLayout.WEST);
fileNameTextField = new UIPropertyTextField(); fileNameTextField = new UITextField();
tooltipTextField = new UIPropertyTextField(); tooltipTextField = new UITextField();
tooltipTextField.getUI(); tooltipTextField.getUI();
fileNamePane.add(new JPanel(), "none"); fileNamePane.add(new JPanel(), "none");
fileNamePane.add(fileNameCCPane, "content"); fileNamePane.add(fileNameCCPane, "content");
@ -342,6 +343,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
this.valueEditor.populate(defaultValue); this.valueEditor.populate(defaultValue);
} else { } else {
insertRowPolicy.setSelectedIndex(0); insertRowPolicy.setSelectedIndex(0);
this.valueEditor.populate(StringUtils.EMPTY);
} }
if (insertRowPolicy.getSelectedIndex() == 1) { if (insertRowPolicy.getSelectedIndex() == 1) {
insertRowPane.setPreferredSize(new Dimension(100, 20)); insertRowPane.setPreferredSize(new Dimension(100, 20));
@ -450,10 +452,10 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellWrite_Page_After_Column"))) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellWrite_Page_After_Column"))) {
cellPageAttr.setPageAfterColumn(this.pageAfterColumnCheckBox.isSelected()); cellPageAttr.setPageAfterColumn(this.pageAfterColumnCheckBox.isSelected());
} }
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellWrite_Can_Break_On_Paginate"))) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellPage_Can_Break_On_Paginate"))) {
cellPageAttr.setCanBreakOnPaginate(canBreakOnPaginateCheckBox.isSelected()); cellPageAttr.setCanBreakOnPaginate(canBreakOnPaginateCheckBox.isSelected());
} }
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellWrite_Repeat_Content_When_Paging"))) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellPage_Repeat_Content_When_Paging"))) {
cellPageAttr.setRepeat(this.repeatCheckBox.isSelected()); cellPageAttr.setRepeat(this.repeatCheckBox.isSelected());
} }

20
designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java

@ -45,14 +45,14 @@ public class CustomStylePane extends MultiTabPane<Style> {
} }
public static void main(String[] args) { public static void main(String[] args) {
JFrame jf = new JFrame("test"); // JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane(); // JPanel content = (JPanel) jf.getContentPane();
content.setLayout(new BorderLayout()); // content.setLayout(new BorderLayout());
content.add(new CustomStylePane(), BorderLayout.CENTER); // content.add(new CustomStylePane(), BorderLayout.CENTER);
GUICoreUtils.centerWindow(jf); // GUICoreUtils.centerWindow(jf);
jf.setSize(250, 400); // jf.setSize(250, 400);
jf.setVisible(true); // jf.setVisible(true);
} }
/** /**
@ -111,7 +111,7 @@ public class CustomStylePane extends MultiTabPane<Style> {
public boolean isBorderPaneSelected() { public boolean isBorderPaneSelected() {
return tabPane.getSelectedIndex() == TWO_INDEX; return tabPane.getSelectedIndex() == ONE_INDEX;
} }
/** /**
@ -137,7 +137,7 @@ public class CustomStylePane extends MultiTabPane<Style> {
* *
*/ */
public void updateBorder() { public void updateBorder() {
BorderUtils.update(reportPane, ((BorderPane) paneList.get(TWO_INDEX)).update()); BorderUtils.update(reportPane, ((BorderPane) paneList.get(ONE_INDEX)).update());
} }
/** /**

3
designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java

@ -78,7 +78,8 @@ public class ErrorInfoLogAppender extends AppenderSkeleton {
private String readLogID(String log) { private String readLogID(String log) {
String errorCode = Inter.getLocText("FR-Engine_ErrorCode-Prefix"); String errorCode = Inter.getLocText("FR-Engine_ErrorCode-Prefix");
String[] matchs = log.split(errorCode + ".*?:"); // 报错信息国际化不规范, 有些是中文分号, 有些是英文
String[] matchs = log.split(errorCode + ".*?[:,:]");
if (matchs.length <= 1) { if (matchs.length <= 1) {
return StringUtils.EMPTY; return StringUtils.EMPTY;
} }

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

@ -81,8 +81,8 @@ public class CellWidgetCardPane extends BasicPane {
eventTabPane.add(eventPane, BorderLayout.CENTER); eventTabPane.add(eventPane, BorderLayout.CENTER);
//k //k
center.add(attriTabPane, Inter.getLocText("FR-Designer_Attribute")); center.add(attriTabPane, Inter.getLocText("FR-Designer_Attribute"));
center.add(eventTabPane, Inter.getLocText("FR-Designer_Form_Editing_Listeners")); center.add(eventTabPane, Inter.getLocText("FR-Designer_Event"));
final String[] tabTitles = new String[]{Inter.getLocText("FR-Designer_Attribute"), Inter.getLocText("FR-Designer_Form_Editing_Listeners")}; final String[] tabTitles = new String[]{Inter.getLocText("FR-Designer_Attribute"), Inter.getLocText("FR-Designer_Event")};
tabsHeaderIconPane = new UIHeadGroup(tabTitles) { tabsHeaderIconPane = new UIHeadGroup(tabTitles) {
@Override @Override

3
designer/src/com/fr/design/widget/WidgetEventPane.java

@ -30,11 +30,14 @@ import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.stable.ReportConstants; import com.fr.report.stable.ReportConstants;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import javax.swing.*;
public class WidgetEventPane extends ObjectUIControlPane { public class WidgetEventPane extends ObjectUIControlPane {
public WidgetEventPane(ElementCasePane pane) { public WidgetEventPane(ElementCasePane pane) {
super(pane); super(pane);
this.setNameListEditable(false); this.setNameListEditable(false);
setBorder(BorderFactory.createEmptyBorder(10, 0, 15, 0));
} }
@Override @Override

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

@ -3,7 +3,7 @@ package com.fr.design.widget.ui;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
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.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -14,7 +14,7 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> { public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private UIPropertyTextField text; private UITextField text;
public CheckBoxDefinePane() { public CheckBoxDefinePane() {
this.iniComoponents(); this.iniComoponents();
@ -22,7 +22,7 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private void iniComoponents() { private void iniComoponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
text = new UIPropertyTextField(); text = new UITextField();
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.add(text, BorderLayout.CENTER); panel.add(text, BorderLayout.CENTER);
panel.setBorder(BorderFactory.createEmptyBorder(0, 35, 0, 0)); panel.setBorder(BorderFactory.createEmptyBorder(0, 35, 0, 0));

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

@ -5,7 +5,7 @@ import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -24,7 +24,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30; private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30;
protected UICheckBox allowBlankCheckBox; protected UICheckBox allowBlankCheckBox;
// richer:错误信息,是所有控件共有的属性,所以放到这里来 // richer:错误信息,是所有控件共有的属性,所以放到这里来
protected UIPropertyTextField errorMsgTextField; protected UITextField errorMsgTextField;
protected JPanel validatePane; protected JPanel validatePane;
public FieldEditorDefinePane() { public FieldEditorDefinePane() {
@ -44,7 +44,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initErrorMsgPane() { protected void initErrorMsgPane() {
// 错误信息 // 错误信息
errorMsgTextField = new UIPropertyTextField(); errorMsgTextField = new UITextField();
// // richer:主要为了方便查看比较长的错误信息 // // richer:主要为了方便查看比较长的错误信息
errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {

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

@ -9,7 +9,7 @@ import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -28,7 +28,7 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
private static final int P_W = 610; private static final int P_W = 610;
private static final int P_H = 580; private static final int P_H = 580;
private UIPropertyTextField srcTextField; private UITextField srcTextField;
private ReportletParameterViewPane parameterViewPane; private ReportletParameterViewPane parameterViewPane;
private UICheckBox horizontalCheck; private UICheckBox horizontalCheck;
private UICheckBox verticalCheck; private UICheckBox verticalCheck;
@ -61,7 +61,7 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
java.awt.Component[][] coms = { java.awt.Component[][] coms = {
{horizontalCheck, null}, {horizontalCheck, null},
{verticalCheck, null}, {verticalCheck, null},
{new UILabel(Inter.getLocText("Form-Url")), srcTextField = new UIPropertyTextField()}, {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, 45, LayoutConstants.VGAP_LARGE);

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

@ -20,6 +20,7 @@ import javax.swing.text.DefaultFormatter;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -39,113 +40,23 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
private SpinnerNumberModel maxValueModel; private SpinnerNumberModel maxValueModel;
private UIBasicSpinner minValueSpinner; private UIBasicSpinner minValueSpinner;
private SpinnerNumberModel minValueModel; private SpinnerNumberModel minValueModel;
private UIBasicSpinner decimalLength; private UISpinner decimalLength;
private JPanel limitNumberPane; private JPanel limitNumberPane;
private WaterMarkDictPane waterMarkDictPane; private WaterMarkDictPane waterMarkDictPane;
private ActionListener actionListener1 = new ActionListener() { private ActionListener allowDecimalsListener;
public void actionPerformed(ActionEvent e) {
if (allowDecimalsCheckBox.isSelected()) {
limitNumberPane.setVisible(true);
} else {
limitNumberPane.setVisible(false);
}
}
};
private ActionListener actionListener2 = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (allowNegativeCheckBox.isSelected()) {
minValueModel.setMinimum(-Double.MAX_VALUE);
if (!setMinValueCheckBox.isSelected()) {
maxValueModel.setMinimum(-Double.MAX_VALUE);
}
} else {
minValueModel.setMinimum(0.0);
if (!setMinValueCheckBox.isSelected()) {
maxValueModel.setMinimum(0.0);
}
Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (minValue < 0.0) {
minValueSpinner.setValue(0.0);
}
if (maxValue < 0.0) {
maxValueSpinner.setValue(0.0);
}
}
}
};
public ActionListener actionListener3 = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (setMaxValueCheckBox.isSelected()) {
maxValueSpinner.setVisible(true);
Double value = new Double(0);
if (setMinValueCheckBox.isSelected()) {
Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
if (minValue > value) {
value = minValue;
}
}
maxValueSpinner.setValue(value);
} else {
maxValueSpinner.setVisible(false);
minValueModel.setMaximum(Double.MAX_VALUE);
}
}
};
private ActionListener allowNegativeListener ;
private ActionListener actionListener4 = new ActionListener() { public ActionListener setMaxListener;
public void actionPerformed(ActionEvent e) {
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setVisible(true);
Double value = new Double(0);
if (setMaxValueCheckBox.isSelected()) {
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (maxValue < value) {
value = maxValue;
}
}
minValueSpinner.setValue(value);
} else {
minValueSpinner.setVisible(false);
maxValueModel.setMinimum(allowNegativeCheckBox.isSelected() ? (-Double.MAX_VALUE) : new Double(0));
}
}
};
private ChangeListener changeListener1 = new ChangeListener() { private ActionListener setMinListener;
@Override private ChangeListener maxValueChangeListener;
public void stateChanged(ChangeEvent e) {
if (setMaxValueCheckBox.isSelected()) {
if (setMinValueCheckBox.isSelected()) {
minValueModel.setMaximum(Double.parseDouble("" + maxValueSpinner.getValue()));
}
}
}
};
private ChangeListener changeListener2 = new ChangeListener() { private ChangeListener minValueChangeListener;
@Override
public void stateChanged(ChangeEvent e) {
if (setMinValueCheckBox.isSelected()) {
if (setMaxValueCheckBox.isSelected()) {
maxValueModel.setMinimum(Double.parseDouble("" + minValueSpinner.getValue()));
}
}
}
};
public NumberEditorDefinePane() { public NumberEditorDefinePane() {
// super();
this.initComponents();
} }
@ -160,73 +71,53 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
waterMarkDictPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); waterMarkDictPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
content.add(waterMarkDictPane, BorderLayout.CENTER); content.add(waterMarkDictPane, BorderLayout.CENTER);
return content; return content;
} }
public JPanel setValidatePane() { public JPanel setValidatePane() {
initListeners();
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Decimals")); this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Decimals"));
allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.decimalLength = new UIBasicSpinner(new SpinnerNumberModel(16, 0, Integer.MAX_VALUE, 1)); this.decimalLength = new UISpinner(0, Integer.MAX_VALUE, 1, 16);
this.decimalLength.setPreferredSize(new Dimension(155, 20)); this.allowDecimalsCheckBox.addActionListener(allowDecimalsListener);
this.allowDecimalsCheckBox.addActionListener(actionListener1);
this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Negative")); this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Negative"));
this.allowNegativeCheckBox.addActionListener(actionListener2); this.allowNegativeCheckBox.addActionListener(allowNegativeListener);
allowNegativeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowNegativeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Max_Value"), false); this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Max_Value"), false);
setMaxValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); setMaxValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
maxValueSpinner.setPreferredSize(new Dimension(155, 20));
setNotAllowsInvalid(this.maxValueSpinner); setNotAllowsInvalid(this.maxValueSpinner);
this.maxValueSpinner.setVisible(false); this.setMaxValueCheckBox.addActionListener(setMaxListener);
this.setMaxValueCheckBox.addActionListener(actionListener3); this.maxValueSpinner.addChangeListener(maxValueChangeListener);
this.maxValueSpinner.addChangeListener(changeListener1);
this.setMinValueCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Min_Value"), false); this.setMinValueCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Min_Value"), false);
setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
minValueSpinner.setPreferredSize(new Dimension(155, 20));
setNotAllowsInvalid(this.minValueSpinner); setNotAllowsInvalid(this.minValueSpinner);
this.minValueSpinner.setVisible(false); this.setMinValueCheckBox.addActionListener(setMinListener);
this.setMinValueCheckBox.addActionListener(actionListener4); this.minValueSpinner.addChangeListener(minValueChangeListener);
this.minValueSpinner.addChangeListener(changeListener2);
UILabel numberLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Double", "Numbers"})); UILabel numberLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Double", "Numbers"}));
numberLabel.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); limitNumberPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{numberLabel, decimalLength}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
JPanel decimalPane = new JPanel(new BorderLayout());
decimalPane.add(decimalLength, BorderLayout.CENTER);
decimalPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel maxValueSpinnerPane = new JPanel(new BorderLayout());
maxValueSpinnerPane.add(maxValueSpinner, BorderLayout.CENTER);
maxValueSpinnerPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel minValueSpinnerPane = new JPanel(new BorderLayout());
minValueSpinnerPane.add(minValueSpinner, BorderLayout.CENTER);
minValueSpinnerPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 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[]{allowDecimalsCheckBox, null}, new Component[]{allowDecimalsCheckBox, null},
new Component[]{numberLabel, decimalPane}, new Component[]{limitNumberPane, null},
new Component[]{allowNegativeCheckBox, null}, new Component[]{allowNegativeCheckBox, null},
new Component[]{setMaxValueCheckBox, maxValueSpinnerPane}, new Component[]{setMaxValueCheckBox, maxValueSpinner},
new Component[]{setMinValueCheckBox, minValueSpinnerPane}, new Component[]{setMinValueCheckBox, minValueSpinner},
}; };
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
pane.setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 0)); pane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
return pane; return pane;
} }
@ -237,28 +128,28 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.decimalLength.setValue(e.getMaxDecimalLength()); this.decimalLength.setValue(e.getMaxDecimalLength());
} else { } else {
this.limitNumberPane.setVisible(false); this.limitNumberPane.setVisible(false);
this.limitNumberPane.setPreferredSize(new Dimension(0,0));
} }
allowNegativeCheckBox.setSelected(e.isAllowNegative()); allowNegativeCheckBox.setSelected(e.isAllowNegative());
if (e.getMaxValue() == Double.MAX_VALUE) { if (e.getMaxValue() == Double.MAX_VALUE) {
setMaxValueCheckBox.setSelected(false); setMaxValueCheckBox.setSelected(false);
maxValueSpinner.setValue(new Double(Double.MAX_VALUE)); maxValueSpinner.setValue(new Double(Double.MAX_VALUE));
maxValueSpinner.setVisible(false); maxValueSpinner.setEnabled(false);
} else { } else {
setMaxValueCheckBox.setSelected(true); setMaxValueCheckBox.setSelected(true);
maxValueSpinner.setVisible(true); maxValueSpinner.setEnabled(true);
maxValueSpinner.setValue(new Double(e.getMaxValue())); maxValueSpinner.setValue(new Double(e.getMaxValue()));
} }
if (e.getMinValue() == -Double.MAX_VALUE) { if (e.getMinValue() == -Double.MAX_VALUE) {
setMinValueCheckBox.setSelected(false); setMinValueCheckBox.setSelected(false);
minValueSpinner.setValue(new Double(-Double.MAX_VALUE)); minValueSpinner.setValue(new Double(-Double.MAX_VALUE));
minValueSpinner.setVisible(false); minValueSpinner.setEnabled(false);
} else { } else {
minValueSpinner.setEnabled(true);
setMinValueCheckBox.setSelected(true); setMinValueCheckBox.setSelected(true);
minValueSpinner.setVisible(true);
minValueSpinner.setValue(new Double(e.getMinValue())); minValueSpinner.setValue(new Double(e.getMinValue()));
} }
this.waterMarkDictPane.populate(e); this.waterMarkDictPane.populate(e);
@ -270,7 +161,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
NumberEditor ob = new NumberEditor(); NumberEditor ob = new NumberEditor();
ob.setAllowDecimals(allowDecimalsCheckBox.isSelected()); ob.setAllowDecimals(allowDecimalsCheckBox.isSelected());
if (allowDecimalsCheckBox.isSelected()) { if (allowDecimalsCheckBox.isSelected()) {
ob.setMaxDecimalLength((Integer) this.decimalLength.getValue()); ob.setMaxDecimalLength((int)this.decimalLength.getValue());
} }
ob.setAllowNegative(allowNegativeCheckBox.isSelected()); ob.setAllowNegative(allowNegativeCheckBox.isSelected());
@ -292,18 +183,108 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
return ob; return ob;
} }
private void checkVisible() {
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setVisible(true);
} else {
minValueSpinner.setVisible(false);
}
if (setMinValueCheckBox.isSelected()) { private void initListeners(){ allowDecimalsListener = new ActionListener() {
minValueSpinner.setVisible(true); public void actionPerformed(ActionEvent e) {
} else { if (allowDecimalsCheckBox.isSelected()) {
minValueSpinner.setVisible(false); limitNumberPane.setVisible(true);
limitNumberPane.setPreferredSize(new Dimension(215,20));
} else {
limitNumberPane.setVisible(false);
limitNumberPane.setPreferredSize(new Dimension(0,0));
}
} }
};
allowNegativeListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (allowNegativeCheckBox.isSelected()) {
minValueModel.setMinimum(-Double.MAX_VALUE);
if (!setMinValueCheckBox.isSelected()) {
maxValueModel.setMinimum(-Double.MAX_VALUE);
}
} else {
minValueModel.setMinimum(0.0);
if (!setMinValueCheckBox.isSelected()) {
maxValueModel.setMinimum(0.0);
}
Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (minValue < 0.0) {
minValueSpinner.setValue(0.0);
}
if (maxValue < 0.0) {
maxValueSpinner.setValue(0.0);
}
}
}
};
setMaxListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (setMaxValueCheckBox.isSelected()) {
maxValueSpinner.setEnabled(true);
Double value = new Double(0);
if (setMinValueCheckBox.isSelected()) {
Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
if (minValue > value) {
value = minValue;
}
}
maxValueSpinner.setValue(value);
} else {
maxValueSpinner.setEnabled(false);
minValueModel.setMaximum(Double.MAX_VALUE);
}
}
};
setMinListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setEnabled(true);
Double value = new Double(0);
if (setMaxValueCheckBox.isSelected()) {
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (maxValue < value) {
value = maxValue;
}
}
minValueSpinner.setValue(value);
} else {
minValueSpinner.setEnabled(false);
maxValueModel.setMinimum(allowNegativeCheckBox.isSelected() ? (-Double.MAX_VALUE) : new Double(0));
}
}
};
maxValueChangeListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (setMaxValueCheckBox.isSelected()) {
if (setMinValueCheckBox.isSelected()) {
minValueModel.setMaximum(Double.parseDouble("" + maxValueSpinner.getValue()));
}
}
}
};
minValueChangeListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (setMinValueCheckBox.isSelected()) {
if (setMaxValueCheckBox.isSelected()) {
maxValueModel.setMinimum(Double.parseDouble("" + minValueSpinner.getValue()));
}
}
}
};
} }
private void setNotAllowsInvalid(UIBasicSpinner jspinner) { private void setNotAllowsInvalid(UIBasicSpinner jspinner) {

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

@ -1,7 +1,7 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.WaterMark; import com.fr.form.ui.WaterMark;
@ -13,12 +13,12 @@ import java.awt.event.KeyListener;
public class WaterMarkDictPane extends JPanel { public class WaterMarkDictPane extends JPanel {
private UIPropertyTextField waterMarkTextField; private UITextField waterMarkTextField;
public WaterMarkDictPane() { public WaterMarkDictPane() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
waterMarkTextField = new UIPropertyTextField(); waterMarkTextField = new UITextField();
UILabel emptyLabel = new UILabel(); UILabel emptyLabel = new UILabel();
emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0));

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

@ -1,6 +1,7 @@
package com.fr.quickeditor.cellquick; package com.fr.quickeditor.cellquick;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.columnrow.DSColumnConditionAction; import com.fr.design.actions.columnrow.DSColumnConditionAction;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.DSColumnCellAction; import com.fr.design.actions.insert.cell.DSColumnCellAction;
@ -219,8 +220,12 @@ public class CellDSColumnEditor extends CellQuickEditor {
uiLabel.setPreferredSize(new Dimension(60, 20)); uiLabel.setPreferredSize(new Dimension(60, 20));
UIButton uiButton = new UIButton(); UIButton uiButton = new UIButton();
if (tc != null) { if (tc != null) {
//第一次初始化时tc为空,引发NullPointerException //第一次初始化时tc为空,会引发NullPointerException
uiButton = new UIButton(new DSColumnConditionAction(tc)); UpdateAction condition = new DSColumnConditionAction(tc);
//丢掉icon,修改按钮名称为编辑
condition.setSmallIcon(null);
condition.setName(Inter.getLocText("FR-Designer_Edit"));
uiButton = new UIButton(condition);
} }
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{uiLabel, uiButton} new Component[]{uiLabel, uiButton}
@ -531,6 +536,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
* @see DSColumnAdvancedPane.SortPane * @see DSColumnAdvancedPane.SortPane
*/ */
public class ResultSetSortConfigPane extends JPanel { public class ResultSetSortConfigPane extends JPanel {
private static final String DEFAULT_VALUE = "=";
private JPanel contentPane; private JPanel contentPane;
//面板 //面板
private UIButtonGroup sortTypePane; private UIButtonGroup sortTypePane;
@ -553,7 +559,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
cardLayout = new CardLayout(); cardLayout = new CardLayout();
centerPane = new JPanel(cardLayout); centerPane = new JPanel(cardLayout);
formulaField = new JFormulaField(""); formulaField = new JFormulaField(DEFAULT_VALUE);
centerPane.add(new JPanel(), "none"); centerPane.add(new JPanel(), "none");
centerPane.add(formulaField, "content"); centerPane.add(formulaField, "content");
UILabel sortLabel = new UILabel(Inter.getLocText("Sort-Sort_Order")); UILabel sortLabel = new UILabel(Inter.getLocText("Sort-Sort_Order"));
@ -648,6 +654,8 @@ public class CellDSColumnEditor extends CellQuickEditor {
* @see DSColumnAdvancedPane.SelectCountPane * @see DSColumnAdvancedPane.SelectCountPane
*/ */
public class ResultSetFilterConfigPane extends JPanel { public class ResultSetFilterConfigPane extends JPanel {
private static final String DEFAULT_VALUE = "=";
private JPanel contentPane; private JPanel contentPane;
private UIComboBox rsComboBox; private UIComboBox rsComboBox;
private JPanel setCardPane; private JPanel setCardPane;
@ -733,12 +741,12 @@ public class CellDSColumnEditor extends CellQuickEditor {
tipCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); tipCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
//前N个 //前N个
topFormulaPane = new JFormulaField("="); topFormulaPane = new JFormulaField(DEFAULT_VALUE);
setCardPane.add(topFormulaPane, FilterType.TOP.name()); setCardPane.add(topFormulaPane, FilterType.TOP.name());
tipCardPane.add(new JPanel(), FilterType.TOP.name()); tipCardPane.add(new JPanel(), FilterType.TOP.name());
//后N个 //后N个
bottomFormulaPane = new JFormulaField("="); bottomFormulaPane = new JFormulaField(DEFAULT_VALUE);
setCardPane.add(bottomFormulaPane, FilterType.BOTTOM.name()); setCardPane.add(bottomFormulaPane, FilterType.BOTTOM.name());
tipCardPane.add(new JPanel(), FilterType.BOTTOM.name()); tipCardPane.add(new JPanel(), FilterType.BOTTOM.name());
@ -967,13 +975,15 @@ public class CellDSColumnEditor extends CellQuickEditor {
* @see DSColumnAdvancedPane.ValuePane * @see DSColumnAdvancedPane.ValuePane
*/ */
public class CustomValuePane extends JPanel { public class CustomValuePane extends JPanel {
private static final String DEFAULT_VALUE = "=$$$";
private JFormulaField formulaField; private JFormulaField formulaField;
public CustomValuePane() { public CustomValuePane() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
UILabel customValueLabel = new UILabel(Inter.getLocText("FR-Designer_Display_Value")); UILabel customValueLabel = new UILabel(Inter.getLocText("FR-Designer_Display_Value"));
customValueLabel.setPreferredSize(new Dimension(60, 20)); customValueLabel.setPreferredSize(new Dimension(60, 20));
formulaField = new JFormulaField("$$$"); formulaField = new JFormulaField(DEFAULT_VALUE);
this.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ this.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{customValueLabel, formulaField}, new Component[]{customValueLabel, formulaField},
}, new double[]{P}, new double[]{P, F}, HGAP, VGAP), BorderLayout.CENTER); }, new double[]{P}, new double[]{P, F}, HGAP, VGAP), BorderLayout.CENTER);
@ -988,7 +998,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
//formula //formula
String valueFormula = dSColumn.getResult(); String valueFormula = dSColumn.getResult();
if (valueFormula == null) { if (valueFormula == null) {
valueFormula = "$$$"; valueFormula = DEFAULT_VALUE;
} }
formulaField.populateElement(cellElement); formulaField.populateElement(cellElement);
formulaField.populate(valueFormula); formulaField.populate(valueFormula);

2
designer/src/com/fr/quickeditor/cellquick/CellStringQuickEditor.java

@ -69,7 +69,7 @@ public class CellStringQuickEditor extends CellQuickEditor {
return; return;
} }
if (e.getKeyCode() == KeyEvent.VK_ENTER) { if (e.getKeyCode() == KeyEvent.VK_ENTER) {
//todo 按enter键换至下一个单元格 yaoh.wu虽然模仿选中单元格按enter这种场景可以做到,但是原理没有弄清楚。 //todo yaoh.wu:按enter键换至下一个单元格 虽然模仿选中单元格按enter这种场景可以做到,但是原理没有弄清楚。
GridKeyListener dispatchListener = new GridKeyListener(tc.getGrid()); GridKeyListener dispatchListener = new GridKeyListener(tc.getGrid());
dispatchListener.keyPressed(e); dispatchListener.keyPressed(e);
dispatchListener.keyTyped(e); dispatchListener.keyTyped(e);

18
designer_base/src/com/fr/design/actions/file/PreferencePane.java

@ -75,13 +75,6 @@ public class PreferencePane extends BasicPane {
private static final FRLevel[] LOG = {FRLevel.SEVERE, FRLevel.WARNING, FRLevel.INFO, FRLevel.DEBUG}; private static final FRLevel[] LOG = {FRLevel.SEVERE, FRLevel.WARNING, FRLevel.INFO, FRLevel.DEBUG};
private static java.util.List<String> LANGUAGE = new ArrayList<>(); private static java.util.List<String> LANGUAGE = new ArrayList<>();
static {
Map<Locale, String> map = Inter.getSupportLocaleMap();
LANGUAGE.add(Inter.getLocText("FR-Designer_Language_Default"));
for(Locale locale : map.keySet()){
LANGUAGE.add(getLocaledLanguage(map.get(locale), locale));
}
};
private static int designerEnvLanguageIndex; // 打开设置对话框时,设计器使用的语言 private static int designerEnvLanguageIndex; // 打开设置对话框时,设计器使用的语言
private boolean languageChanged; // 是否修改了设计器语言设置 private boolean languageChanged; // 是否修改了设计器语言设置
@ -116,6 +109,17 @@ public class PreferencePane extends BasicPane {
public PreferencePane() { public PreferencePane() {
this.initComponents(); this.initComponents();
this.initLanguageItems();
}
// 语言选项
private void initLanguageItems() {
LANGUAGE.clear();
Map<Locale, String> map = Inter.getSupportLocaleMap();
LANGUAGE.add(Inter.getLocText("FR-Designer_Language_Default"));
for(Locale locale : map.keySet()){
LANGUAGE.add(getLocaledLanguage(map.get(locale), locale));
}
} }
protected void initComponents() { protected void initComponents() {

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

@ -1,5 +1,7 @@
package com.fr.design.actions.help.alphafine; package com.fr.design.actions.help.alphafine;
import com.fr.base.FRCoreContext;
import com.fr.general.VT4FR;
import com.fr.stable.OperatingSystem; import com.fr.stable.OperatingSystem;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
@ -88,7 +90,8 @@ public class AlphaFineConfigManager implements XMLable {
@Override @Override
public Object clone() throws CloneNotSupportedException { public Object clone() throws CloneNotSupportedException {
return super.clone(); AlphaFineConfigManager manager = (AlphaFineConfigManager) super.clone();
return manager;
} }
@Override @Override
@ -199,7 +202,10 @@ public class AlphaFineConfigManager implements XMLable {
} }
public boolean isEnabled() { public boolean isEnabled() {
return isEnabled; if (VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support()) {
return isEnabled;
}
return false;
} }
public void setEnabled(boolean isEnabled) { public void setEnabled(boolean isEnabled) {

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

@ -104,6 +104,7 @@ public interface UIConstants {
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(0xededee);
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 BufferedImage DRAG_BAR = BaseUtils.readImage("com/fr/design/images/control/bar.png"); public static final BufferedImage DRAG_BAR = BaseUtils.readImage("com/fr/design/images/control/bar.png");

1
designer_base/src/com/fr/design/file/HistoryTemplateListPane.java

@ -232,7 +232,6 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C
getCurrentEditingTemplate().repaint(); getCurrentEditingTemplate().repaint();
} }
private class HistoryListCellRender extends DefaultListCellRenderer { private class HistoryListCellRender extends DefaultListCellRenderer {
@Override @Override

47
designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java

@ -1,47 +0,0 @@
package com.fr.design.gui.itextfield;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import javax.swing.text.Document;
/**
* Created by ibm on 2017/8/16.
*/
public class UIPropertyTextField extends UITextField{
public UIPropertyTextField() {
super();
}
public UIPropertyTextField(int columns) {
super(columns);
}
public UIPropertyTextField(String text, int columns) {
super(text, columns);
}
public UIPropertyTextField(String text) {
super(text);
}
public UIPropertyTextField(Document doc, String text, int columns) {
super(doc, text, columns);
}
protected void initListener() {
if (shouldResponseChangeListener()) {
addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
}
@Override
public void focusLost(FocusEvent e) {
attributeChange();
}
});
}
}
}

14
designer_base/src/com/fr/design/gui/style/BorderPane.java

@ -53,17 +53,6 @@ public class BorderPane extends AbstractBasicStylePane {
this.initComponents(); this.initComponents();
} }
public static void main(String[] args) {
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(new BorderLayout());
content.add(new BorderPane(), BorderLayout.CENTER);
GUICoreUtils.centerWindow(jf);
jf.setSize(290, 400);
jf.setVisible(true);
}
protected void initComponents() { protected void initComponents() {
initButtonsWithIcon(); initButtonsWithIcon();
this.setLayout(new BorderLayout(0, 6)); this.setLayout(new BorderLayout(0, 6));
@ -184,7 +173,7 @@ public class BorderPane extends AbstractBasicStylePane {
} }
public Style update(Style style) { public Style update(Style style) {
style = style.deriveBackground(backgroundPane.update());
if (style == null) { if (style == null) {
style = Style.DEFAULT_STYLE; style = Style.DEFAULT_STYLE;
} }
@ -193,6 +182,7 @@ public class BorderPane extends AbstractBasicStylePane {
style = style.deriveBorder(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor(), cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor(), style = style.deriveBorder(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor(), cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor(),
cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor(), cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor()); cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor(), cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor());
style = style.deriveBackground(backgroundPane.update());
return style; return style;
} }

2
designer_base/src/com/fr/design/gui/style/NumberDragBar.java

@ -74,7 +74,7 @@ public class NumberDragBar extends JComponent {
g2.setColor(isEnabled() ? UIConstants.FONT_COLOR : UIManager.getColor("Label.disabledForeground")); g2.setColor(isEnabled() ? UIConstants.FONT_COLOR : UIManager.getColor("Label.disabledForeground"));
g2.drawString(String.valueOf(minValue), 2, 10); g2.drawString(String.valueOf(minValue), 2, 10);
g2.drawString(String.valueOf(maxValue), width - 20, 10); g2.drawString(String.valueOf(maxValue), width - 10 * String.valueOf(maxValue).length(), 10);
if(minValue < 0) { if(minValue < 0) {
g2.drawString("0", width / 2 - 2, 10); g2.drawString("0", width / 2 - 2, 10);
} }

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 B

After

Width:  |  Height:  |  Size: 942 B

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

After

Width:  |  Height:  |  Size: 482 B

BIN
designer_base/src/com/fr/design/images/m_edit/paste.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 214 B

6
designer_base/src/com/fr/design/layout/TableLayoutHelper.java

@ -203,7 +203,7 @@ public class TableLayoutHelper {
* 修改TableLayout布局的容器指定位置垂直间距的大小 * 修改TableLayout布局的容器指定位置垂直间距的大小
* *
* @param container 容器 * @param container 容器
* @param index vgap的索引ContainervGapA[ComponentA]vGapB[ComponentB]vGapC,vGapB index=2, * @param index vgap的索引Container{vGapA[ComponentA]vGapB[ComponentB]vGapC},vGapB index=2,
* 详情见{@link TableLayout#setRow(int, double)} * 详情见{@link TableLayout#setRow(int, double)}
* @param vgap vgap的新值 * @param vgap vgap的新值
*/ */
@ -211,6 +211,7 @@ public class TableLayoutHelper {
TableLayout layout = (TableLayout) container.getLayout(); TableLayout layout = (TableLayout) container.getLayout();
layout.setRow(index, vgap); layout.setRow(index, vgap);
layout.layoutContainer(container); layout.layoutContainer(container);
container.revalidate();
container.repaint(); container.repaint();
} }
@ -218,7 +219,7 @@ public class TableLayoutHelper {
* 修改TableLayout布局的容器指定位置水平间距的大小 * 修改TableLayout布局的容器指定位置水平间距的大小
* *
* @param container 容器 * @param container 容器
* @param index hgap的索引ContainerhGapA[ComponentA]hGapB[ComponentB],hGapB index=2, * @param index hgap的索引Container{hGapA[ComponentA]hGapB[ComponentB]},hGapB index=2,
* 详情见{@link TableLayout#setColumn(int, double)} * 详情见{@link TableLayout#setColumn(int, double)}
* @param hgap hgap的新值 * @param hgap hgap的新值
*/ */
@ -226,6 +227,7 @@ public class TableLayoutHelper {
TableLayout layout = (TableLayout) container.getLayout(); TableLayout layout = (TableLayout) container.getLayout();
layout.setColumn(index, hgap); layout.setColumn(index, hgap);
layout.layoutContainer(container); layout.layoutContainer(container);
container.revalidate();
container.repaint(); container.repaint();
} }

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

@ -2126,4 +2126,7 @@ FS-Designer_DS_Filter_Even_Tip=Even_Tip
FS-Designer_DS_Filter_Specify_Tip=Specify_Tip FS-Designer_DS_Filter_Specify_Tip=Specify_Tip
FR-Designer_Mobile-Height-Percent=Max Percent FR-Designer_Mobile-Height-Percent=Max Percent
FR-Designer_Mobile-Height-Limit=Height Limit FR-Designer_Mobile-Height-Limit=Height Limit
FR-Designer-AlphaFine_NO_Result=no search result FR-Designer-AlphaFine_NO_Result=no search result
FR-Designer-Download_Online_Sources=
FR-Designer_Select_Color=Select Color
FR-Designer-Basic_Dynamic_Parameter_Injection=Injection

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

@ -859,7 +859,7 @@ RP_Authority_Edit=Permission
Warnning=Warning Warnning=Warning
RoleName_Can_Not_Be_Null=Role name can not be null or duplicate RoleName_Can_Not_Be_Null=Role name can not be null or duplicate
Application=Applications Application=Applications
Formula_Dictionary_Display_Examples_Html=<html>Real value range is \ Formula_Dictionary_Display_Examples_Html=<html>the real value is \=range(100), the real value($$$)'s display value is \=0 - $$$, <br>the result is 1, 2, ..., 100 and -1, -2, ..., -100.<br></html>
ECP-error_pwd=Password Error ECP-error_pwd=Password Error
FR-Hyperlink_ChartHyperlink=Chart Hyperlink FR-Hyperlink_ChartHyperlink=Chart Hyperlink
M_Edit-FormatBrush=Format Painter M_Edit-FormatBrush=Format Painter
@ -2122,4 +2122,7 @@ FR-Designer_Barcode_Size=Barcode_Size
FS-Designer_DS_Filter_Odd_Tip=Odd_Tip FS-Designer_DS_Filter_Odd_Tip=Odd_Tip
FS-Designer_DS_Filter_Even_Tip=Even_Tip FS-Designer_DS_Filter_Even_Tip=Even_Tip
FS-Designer_DS_Filter_Specify_Tip=Specify_Tip FS-Designer_DS_Filter_Specify_Tip=Specify_Tip
FR-Designer-AlphaFine_NO_Result=no search result FR-Designer-AlphaFine_NO_Result=no search result
FR-Designer-Download_Online_Sources=
FR-Designer_Select_Color=Select Color
FR-Designer-Basic_Dynamic_Parameter_Injection=Injection

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

@ -857,7 +857,7 @@ RP_Authority_Edit=\u6A29\u9650\u7DE8\u96C6
Warnning=\u30EA\u30DE\u30A4\u30F3\u30C9 Warnning=\u30EA\u30DE\u30A4\u30F3\u30C9
RoleName_Can_Not_Be_Null=\u5F79\u5272\u540D\u306F\u7A7A\u6B04\u306B\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u305A\u3001\u91CD\u8907\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u307E\u305B\u3093 RoleName_Can_Not_Be_Null=\u5F79\u5272\u540D\u306F\u7A7A\u6B04\u306B\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u305A\u3001\u91CD\u8907\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u307E\u305B\u3093
Application=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3 Application=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3
Formula_Dictionary_Display_Examples_Html=<html>\u5B9F\u969B\u5024\u7BC4\u56F2\u306F\ Formula_Dictionary_Display_Examples_Html=<html>\u5B9F\u969B\u306E\u5024\u304C \=range(100)\u306E\u3068\u304D\u3001\u5B9F\u969B\u306E\u5024($$$)\u306E\u8868\u793A\u3059\u308B\u5024\u306E\u6570\u5F0F\u304C \= 0 - $$$\u306E\u3068\u304D\u3001\n\u6700\u7D42\u7684\u306A\u5B9F\u969B\u306E\u5024\u306F\u30011, 2, ..., 100\u3067\u3042\u308A\u3001\n\u305D\u306E\u8868\u793A\u7D50\u679C\u306F-1, -2, ..., -100\u3068\u306A\u308B\u3002<br></html>
ECP-error_pwd=\u30D1\u30B9\u30EF\u30FC\u30C9\u30A8\u30E9\u30FC ECP-error_pwd=\u30D1\u30B9\u30EF\u30FC\u30C9\u30A8\u30E9\u30FC
FR-Hyperlink_ChartHyperlink=\u30B0\u30E9\u30D5\u30CF\u30A4\u30D1\u30FC\u30EA\u30F3\u30AF FR-Hyperlink_ChartHyperlink=\u30B0\u30E9\u30D5\u30CF\u30A4\u30D1\u30FC\u30EA\u30F3\u30AF
M_Edit-FormatBrush=\u66F8\u5F0F\u30D6\u30E9\u30B7(B) M_Edit-FormatBrush=\u66F8\u5F0F\u30D6\u30E9\u30B7(B)
@ -2121,3 +2121,6 @@ FS-Designer_DS_Filter_Even_Tip=
FS-Designer_DS_Filter_Specify_Tip= FS-Designer_DS_Filter_Specify_Tip=
FR-Designer_Mobile-Height-Percent= FR-Designer_Mobile-Height-Percent=
FR-Designer_Mobile-Height-Limit= FR-Designer_Mobile-Height-Limit=
FR-Designer-Download_Online_Sources=
FR-Designer_Select_Color=
FR-Designer-Basic_Dynamic_Parameter_Injection=\

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

@ -857,7 +857,7 @@ RP_Authority_Edit=\uAD8C\uD55C\uD3B8\uC9D1
Warnning=\uC54C\uB9BC Warnning=\uC54C\uB9BC
RoleName_Can_Not_Be_Null=\uC5ED\uD560\uC774\uB984\uC740\uBE44\uC5B4\uC788\uAC70\uB098\uC911\uBCF5\uB418\uC5B4\uC11C\uB294\uC548\uB429\uB2C8\uB2E4. RoleName_Can_Not_Be_Null=\uC5ED\uD560\uC774\uB984\uC740\uBE44\uC5B4\uC788\uAC70\uB098\uC911\uBCF5\uB418\uC5B4\uC11C\uB294\uC548\uB429\uB2C8\uB2E4.
Application=\uC560\uD50C\uB9AC\uCF00\uC774\uC158 Application=\uC560\uD50C\uB9AC\uCF00\uC774\uC158
Formula_Dictionary_Display_Examples_Html=<html>\uC2E4\uC81C\uAC12\uBC94\uC704:\ Formula_Dictionary_Display_Examples_Html=<html>\uC2E4\uC81C\uAC12\uBC94\uC704:\=0 - $$$\uFF0C<br>\uCD5C\uC885\uACB0\uACFC\uC758\uC2E4\uC81C\uAC12: 1, 2, ..., 100,\uD45C\uC2DC\uAC12: -1, -2, ... , -100. <br>&nbsp;</html>
ECP-error_pwd=\uBE44\uBC00\uBC88\uD638\uC785\uB825\uC624\uB958 ECP-error_pwd=\uBE44\uBC00\uBC88\uD638\uC785\uB825\uC624\uB958
FR-Hyperlink_ChartHyperlink=\uCC28\uD2B8\uD558\uC774\uD37C\uB9C1\uD06C FR-Hyperlink_ChartHyperlink=\uCC28\uD2B8\uD558\uC774\uD37C\uB9C1\uD06C
M_Edit-FormatBrush=\uC11C\uC2DD\uD504\uB9B0\uD2B8(B) M_Edit-FormatBrush=\uC11C\uC2DD\uD504\uB9B0\uD2B8(B)
@ -2121,4 +2121,7 @@ FS-Designer_DS_Filter_Odd_Tip=
FS-Designer_DS_Filter_Even_Tip= FS-Designer_DS_Filter_Even_Tip=
FS-Designer_DS_Filter_Specify_Tip= FS-Designer_DS_Filter_Specify_Tip=
FR-Designer_Mobile-Height-Percent= FR-Designer_Mobile-Height-Percent=
FR-Designer_Mobile-Height-Limit= FR-Designer_Mobile-Height-Limit=
FR-Designer-Download_Online_Sources=
FR-Designer_Select_Color=
FR-Designer-Basic_Dynamic_Parameter_Injection=

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

@ -859,7 +859,7 @@ RP_Authority_Edit=\u6743\u9650\u7F16\u8F91
Warnning=\u63D0\u9192 Warnning=\u63D0\u9192
RoleName_Can_Not_Be_Null=\u89D2\u8272\u540D\u4E0D\u5141\u8BB8\u4E3A\u7A7A\u4E14\u4E0D\u80FD\u91CD\u590D RoleName_Can_Not_Be_Null=\u89D2\u8272\u540D\u4E0D\u5141\u8BB8\u4E3A\u7A7A\u4E14\u4E0D\u80FD\u91CD\u590D
Application=\u5E94\u7528\u7A0B\u5E8F Application=\u5E94\u7528\u7A0B\u5E8F
Formula_Dictionary_Display_Examples_Html=<html>\u5B9E\u9645\u503C\u8303\u56F4\u4E3A \ Formula_Dictionary_Display_Examples_Html=<html>\u5B9E\u9645\u503C\u8303\u56F4\u4E3A \=range(100),\u5BF9\u5B9E\u9645\u503C\u8303\u56F4\u5185\u7684\u6BCF\u4E2A$$$\u7684\u663E\u793A\u516C\u5F0F\u4E3A \=0 - $$$\uFF0C<br>\u5219\u6700\u7EC8\u7684\u7ED3\u679C\u5B9E\u9645\u503C\u4E3A1, 2, ..., 100,\u663E\u793A\u503C\u4E3A-1, -2, ... , -100\u3002<br>&nbsp;</html>
ECP-error_pwd=\u5BC6\u7801\u9519\u8BEF ECP-error_pwd=\u5BC6\u7801\u9519\u8BEF
FR-Hyperlink_ChartHyperlink=\u56FE\u8868\u8D85\u94FE FR-Hyperlink_ChartHyperlink=\u56FE\u8868\u8D85\u94FE
M_Edit-FormatBrush=\u683C\u5F0F\u5237(B) M_Edit-FormatBrush=\u683C\u5F0F\u5237(B)
@ -2133,4 +2133,7 @@ FR-Designer_Barcode_Size=\u6761\u5F62\u7801\u5927\u5C0F
FS-Designer_DS_Filter_Odd_Tip=\u63D0\u793A\uFF1A\u5E8F\u53F7\u4ECE1\u5F00\u59CB\uFF0C\u9009\u62E9\u4E86\u5947\u6570\u96C6(1,3,5...) FS-Designer_DS_Filter_Odd_Tip=\u63D0\u793A\uFF1A\u5E8F\u53F7\u4ECE1\u5F00\u59CB\uFF0C\u9009\u62E9\u4E86\u5947\u6570\u96C6(1,3,5...)
FS-Designer_DS_Filter_Even_Tip=\u63D0\u793A\uFF1A\u5E8F\u53F7\u4ECE1\u5F00\u59CB\uFF0C\u9009\u62E9\u4E86\u5076\u6570\u96C6(2,4,6...) FS-Designer_DS_Filter_Even_Tip=\u63D0\u793A\uFF1A\u5E8F\u53F7\u4ECE1\u5F00\u59CB\uFF0C\u9009\u62E9\u4E86\u5076\u6570\u96C6(2,4,6...)
FS-Designer_DS_Filter_Specify_Tip=\u63D0\u793A\uFF1A\u683C\u5F0F\u4E3A1,2-3,5,8\uFF0C\u5E8F\u53F7\u4ECE1\u5F00\u59CB\uFF0C\u5185\u503C\u53C2\u6570$_count_\u8868\u793A\u603B\u4E2A\u6570 FS-Designer_DS_Filter_Specify_Tip=\u63D0\u793A\uFF1A\u683C\u5F0F\u4E3A1,2-3,5,8\uFF0C\u5E8F\u53F7\u4ECE1\u5F00\u59CB\uFF0C\u5185\u503C\u53C2\u6570$_count_\u8868\u793A\u603B\u4E2A\u6570
FR-Designer-AlphaFine_NO_Result=\u65E0\u641C\u7D22\u7ED3\u679C FR-Designer-AlphaFine_NO_Result=\u65E0\u641C\u7D22\u7ED3\u679C
FR-Designer-Download_Online_Sources=\u56FE\u8868\u9700\u8981\u4E0B\u8F7D\u6700\u65B0\u7684\u8D44\u6E90\u6587\u4EF6\uFF0C\u662F\u5426\u5B89\u88C5\uFF1F
FR-Designer_Select_Color=\u9009\u62E9\u989C\u8272
FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165

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

@ -859,7 +859,7 @@ RP_Authority_Edit=\u6B0A\u9650\u7DE8\u8F2F
Warnning=\u63D0\u9192 Warnning=\u63D0\u9192
RoleName_Can_Not_Be_Null=\u89D2\u8272\u540D\u4E0D\u5141\u8A31\u70BA\u7A7A\u4E14\u4E0D\u80FD\u91CD\u8907 RoleName_Can_Not_Be_Null=\u89D2\u8272\u540D\u4E0D\u5141\u8A31\u70BA\u7A7A\u4E14\u4E0D\u80FD\u91CD\u8907
Application=\u61C9\u7528\u7A0B\u5F0F Application=\u61C9\u7528\u7A0B\u5F0F
Formula_Dictionary_Display_Examples_Html= Formula_Dictionary_Display_Examples_Html=<html>\u5BE6\u969B\u503C\u7BC4\u570D\u70BA \=range(100),\u5C0D\u5BE6\u969B\u503C\u7BC4\u570D\u5167\u7684\u6BCF\u500B$$$\u7684\u986F\u793A\u516C\u5F0F\u70BA \=0 - $$$\uFF0C<br>\u5247\u6700\u7D42\u7684\u7D50\u679C\u5BE6\u969B\u503C\u70BA1, 2, ..., 100,\u986F\u793A\u503C\u70BA-1, -2, ... , -100\u3002<br>&nbsp;</html>
ECP-error_pwd=\u5BC6\u78BC\u932F\u8AA4 ECP-error_pwd=\u5BC6\u78BC\u932F\u8AA4
FR-Hyperlink_ChartHyperlink=\u5716\u8868\u8D85\u93C8 FR-Hyperlink_ChartHyperlink=\u5716\u8868\u8D85\u93C8
M_Edit-FormatBrush=\u8907\u88FD\u683C\u5F0F(B) M_Edit-FormatBrush=\u8907\u88FD\u683C\u5F0F(B)
@ -2126,3 +2126,6 @@ FS-Designer_DS_Filter_Even_Tip=\u63D0\u793A\uFF1A\u5E8F\u865F\u5F9E1\u958B\u59CB
FS-Designer_DS_Filter_Specify_Tip=\u63D0\u793A\uFF1A\u683C\u5F0F\u70BA1,2-3,5,8\uFF0C\u5E8F\u865F\u5F9E1\u958B\u59CB\uFF0C\u5185\u7F6E\u53C3\u6578$_count_\u8868\u793A\u7E02\u500B\u6578 FS-Designer_DS_Filter_Specify_Tip=\u63D0\u793A\uFF1A\u683C\u5F0F\u70BA1,2-3,5,8\uFF0C\u5E8F\u865F\u5F9E1\u958B\u59CB\uFF0C\u5185\u7F6E\u53C3\u6578$_count_\u8868\u793A\u7E02\u500B\u6578
M-New_FormBook=\u65B0\u589E\u6C7A\u7B56\u5831\u8868 M-New_FormBook=\u65B0\u589E\u6C7A\u7B56\u5831\u8868
FR-Designer-AlphaFine_NO_Result=\u7121\u641C\u7D22\u7D50\u679C FR-Designer-AlphaFine_NO_Result=\u7121\u641C\u7D22\u7D50\u679C
FR-Designer-Download_Online_Sources=
FR-Designer_Select_Color=
FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165

81
designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

@ -13,6 +13,7 @@ import com.fr.general.FRFont;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.fr.pdf.kernel.utils.CompareTool; import com.fr.third.fr.pdf.kernel.utils.CompareTool;
import com.sap.conn.jco.JCo;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
@ -38,7 +39,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
// 弹出对话框高度 // 弹出对话框高度
private static final int POPUP_MIN_HEIGHT = 145; private static final int POPUP_MIN_HEIGHT = 145;
private static final int POPUP_MAX_HEIGHT = 480; private static final int POPUP_MAX_HEIGHT = 480;
private static final int POPUP_DEFAULT_HEIGHT = 360; private static final int POPUP_DEFAULT_HEIGHT = 356;
public static final String KEY_CELL_ELEMENT = "cellElement"; public static final String KEY_CELL_ELEMENT = "cellElement";
public static final String KEY_CELL_ATTR = "cellAttr"; public static final String KEY_CELL_ATTR = "cellAttr";
public static final String KEY_FLOAT_ELEMENT = "floatElement"; public static final String KEY_FLOAT_ELEMENT = "floatElement";
@ -53,6 +54,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private JPanel defaultPane; // "无可用配置项"面板 private JPanel defaultPane; // "无可用配置项"面板
private JPanel defaultAuthorityPane; // "该元素不支持权限编辑" private JPanel defaultAuthorityPane; // "该元素不支持权限编辑"
private PropertyItem selectedItem; // 当前被选中的属性配置项
public enum PropertyMode { public enum PropertyMode {
REPORT, // 报表 REPORT, // 报表
@ -219,6 +221,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
@Override @Override
public void onResize() { public void onResize() {
if (!isRightPaneVisible()) {
resetPropertyIcons();
} else {
refreshRightPane();
}
for (PropertyItem item : propertyItemMap.values()) { for (PropertyItem item : propertyItemMap.values()) {
item.onResize(); item.onResize();
} }
@ -374,6 +381,14 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
* 刷新右面板 * 刷新右面板
*/ */
public void refreshRightPane() { public void refreshRightPane() {
// 可继承,就继承
if (selectedItem != null && selectedItem.isVisible() && selectedItem.isEnabled() && !selectedItem.isPoppedOut()) {
selectedItem.setTabButtonSelected();
propertyCard.show(rightPane, selectedItem.getName());
return;
}
// 不可继承时,选中第一个可用 tab
boolean hasAvailableTab = false; boolean hasAvailableTab = false;
boolean hasEnabledTab = false; boolean hasEnabledTab = false;
for (String name : propertyItemMap.keySet()) { for (String name : propertyItemMap.keySet()) {
@ -388,6 +403,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
} }
} }
} }
// 无可用 tab 时,显示提示文字
if (!hasAvailableTab) { if (!hasAvailableTab) {
resetPropertyIcons(); resetPropertyIcons();
if (!hasEnabledTab && BaseUtils.isAuthorityEditing()) { if (!hasEnabledTab && BaseUtils.isAuthorityEditing()) {
@ -417,6 +433,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
} }
} }
private void resetPropertyIcons() { private void resetPropertyIcons() {
for (PropertyItem item : propertyItemMap.values()) { for (PropertyItem item : propertyItemMap.values()) {
item.resetButtonIcon(); item.resetButtonIcon();
@ -477,6 +494,13 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
public void updateStatus() { public void updateStatus() {
setEnabled(enableModes.contains(currentMode)); setEnabled(enableModes.contains(currentMode));
setVisible(visibleModes.contains(currentMode)); setVisible(visibleModes.contains(currentMode));
if (isPoppedOut()) {
if (!isVisible()) {
popToFrame();
} else if (!isEnabled()) {
popupDialog.showDefaultPane();
}
}
} }
public boolean isVisible() { public boolean isVisible() {
@ -593,6 +617,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
button.setIcon(BaseUtils.readIcon(getBtnIconUrl())); button.setIcon(BaseUtils.readIcon(getBtnIconUrl()));
button.setBackground(selectedBtnBackground); button.setBackground(selectedBtnBackground);
button.setOpaque(true); button.setOpaque(true);
selectedItem = this;
} }
private void initButton() { private void initButton() {
@ -672,6 +697,10 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
popupDialog.setVisible(false); popupDialog.setVisible(false);
initContentPane(); initContentPane();
onResize(); onResize();
if (isEnabled()) {
propertyCard.show(rightPane, getName());
setTabButtonSelected();
}
refreshContainer(); refreshContainer();
} }
} }
@ -763,7 +792,6 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
} else if (isMovable) { } else if (isMovable) {
setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
setBackground(Color.pink);
} else { } else {
setCursor(Cursor.getDefaultCursor()); setCursor(Cursor.getDefaultCursor());
} }
@ -867,12 +895,14 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private class PopupDialog extends JDialog { private class PopupDialog extends JDialog {
private Container container; private Container container;
private static final int RESIZE_RANGE = 4; private static final int RESIZE_RANGE = 8;
private Cursor originCursor; private Cursor originCursor;
private Cursor southResizeCursor = Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR); private Cursor southResizeCursor = Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR);
private Point mouseDownCompCoords; private Point mouseDownCompCoords;
private JPanel contentWrapper;
private JComponent contentPane; private JComponent contentPane;
private JPanel defaultPane; // 无可用配置项
private PropertyItem propertyItem; private PropertyItem propertyItem;
public PopupDialog(PropertyItem propertyItem) { public PopupDialog(PropertyItem propertyItem) {
super(DesignerContext.getDesignerFrame()); super(DesignerContext.getDesignerFrame());
@ -882,29 +912,50 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
PopupToolPane popupToolPane = new PopupToolPane(propertyItem, PopupToolPane.UP_BUTTON); PopupToolPane popupToolPane = new PopupToolPane(propertyItem, PopupToolPane.UP_BUTTON);
popupToolPane.setParentDialog(this); popupToolPane.setParentDialog(this);
contentPane = propertyItem.getContentPane(); contentPane = propertyItem.getContentPane();
container.add(popupToolPane, BorderLayout.NORTH);
container.add(contentPane, BorderLayout.CENTER); contentWrapper = new JPanel(new BorderLayout());
setSize(CONTENT_WIDTH, POPUP_DEFAULT_HEIGHT); contentWrapper.add(popupToolPane, BorderLayout.NORTH);
contentWrapper.add(contentPane, BorderLayout.CENTER);
contentWrapper.setBorder(BorderFactory.createLineBorder(UIConstants.PROPERTY_DIALOG_BORDER));
JPanel horizontalToolPane = new JPanel() {
@Override
public void paint(Graphics g) {
g.drawImage(UIConstants.DRAG_BAR, 0, 0, getWidth(), getHeight(), null);
g.drawImage(UIConstants.DRAG_DOT, (getWidth() - RESIZE_RANGE) / 2, 3, RESIZE_RANGE, 5, null);
}
};
contentWrapper.add(horizontalToolPane, BorderLayout.SOUTH);
container.add(contentWrapper, BorderLayout.CENTER);
setSize(CONTENT_WIDTH, POPUP_DEFAULT_HEIGHT + RESIZE_RANGE);
adjustLocation(); adjustLocation();
initListener(); initListener();
this.setVisible(true); this.setVisible(true);
defaultPane = getDefaultPane(Inter.getLocText("FR-Designer_No_Settings_Available"));
}
public void showDefaultPane() {
replaceContentPane(defaultPane);
} }
public void adjustLocation() { public void adjustLocation() {
Point btnCoords = propertyItem.getButton().getLocationOnScreen(); this.setLocation(
this.setLocation(btnCoords.x - CONTENT_WIDTH, btnCoords.y); getLeftPane().getLocationOnScreen().x - CONTENT_WIDTH,
DesignerContext.getDesignerFrame().getLocationOnScreen().y + 228
);
} }
public void replaceContentPane(PropertyItem propertyItem) { public void replaceContentPane(PropertyItem propertyItem) {
this.propertyItem = propertyItem; this.propertyItem = propertyItem;
JComponent contentPane = propertyItem.getContentPane(); replaceContentPane(propertyItem.getContentPane());
container.remove(this.contentPane); }
container.add(this.contentPane = contentPane);
// pack(); public void replaceContentPane(JComponent contentPane) {
if (getSize().height < container.getPreferredSize().height) { contentWrapper.remove(this.contentPane);
setSize(CONTENT_WIDTH, container.getPreferredSize().height); contentWrapper.add(this.contentPane = contentPane, BorderLayout.CENTER);
}
refreshContainer(); refreshContainer();
} }

17
designer_base/src/com/fr/design/mainframe/JFormSliderPane.java

@ -16,6 +16,8 @@ import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.text.DefaultFormatterFactory;
import javax.swing.text.NumberFormatter;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -75,6 +77,15 @@ public class JFormSliderPane extends JPanel {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
initSlider(); initSlider();
initShowValSpinner(); initShowValSpinner();
//MoMeak:控制只能输入10-400
JSpinner.NumberEditor editor = new JSpinner.NumberEditor(showValSpinner, "0");
showValSpinner.setEditor(editor);
JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField();
textField.setEditable(true);
DefaultFormatterFactory factory = (DefaultFormatterFactory) textField .getFormatterFactory();
NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter();
formatter.setAllowsInvalid(false);
initDownUpButton(); initDownUpButton();
initShowValButton(); initShowValButton();
initUIRadioButton(); initUIRadioButton();
@ -111,7 +122,7 @@ public class JFormSliderPane extends JPanel {
} }
private void initShowValSpinner() { private void initShowValSpinner() {
showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1)){ showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, 0, FOUR_HUNDRED, 1)){
public Point getToolTipLocation(MouseEvent event){ public Point getToolTipLocation(MouseEvent event){
return new Point(event.getX(), event.getY() - TOOLTIP_Y); return new Point(event.getX(), event.getY() - TOOLTIP_Y);
} }
@ -325,7 +336,7 @@ public class JFormSliderPane extends JPanel {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
showValue = (int) showValSpinner.getValue(); showValue = (int) showValSpinner.getValue();
isButtonOrIsTxt = true; isButtonOrIsTxt = true;
if (e.getActionCommand().equals("less")) { if ("less".equals(e.getActionCommand())) {
int newDownVal = showValue - TEN; int newDownVal = showValue - TEN;
if (newDownVal >= TEN) { if (newDownVal >= TEN) {
showValue = newDownVal; showValue = newDownVal;
@ -335,7 +346,7 @@ public class JFormSliderPane extends JPanel {
showValSpinner.setValue(TEN); showValSpinner.setValue(TEN);
} }
} }
if (e.getActionCommand().equals("more")) { if ("more".equals(e.getActionCommand())) {
int newUpVal = showValue + TEN; int newUpVal = showValue + TEN;
if (newUpVal <= FOUR_HUNDRED) { if (newUpVal <= FOUR_HUNDRED) {
showValue = newUpVal; showValue = newUpVal;

17
designer_base/src/com/fr/design/mainframe/JSliderPane.java

@ -17,6 +17,8 @@ import javax.swing.*;
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.BasicSliderUI; import javax.swing.plaf.basic.BasicSliderUI;
import javax.swing.text.DefaultFormatterFactory;
import javax.swing.text.NumberFormatter;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -77,6 +79,15 @@ public class JSliderPane extends JPanel {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
initSlider(); initSlider();
initShowValSpinner(); initShowValSpinner();
//MoMeak:控制只能输入10-400
JSpinner.NumberEditor editor = new JSpinner.NumberEditor(showValSpinner, "0");
showValSpinner.setEditor(editor);
JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField();
textField.setEditable(true);
DefaultFormatterFactory factory = (DefaultFormatterFactory) textField .getFormatterFactory();
NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter();
formatter.setAllowsInvalid(false);
initDownUpButton(); initDownUpButton();
initShowValButton(); initShowValButton();
initUIRadioButton(); initUIRadioButton();
@ -114,7 +125,7 @@ public class JSliderPane extends JPanel {
} }
private void initShowValSpinner() { private void initShowValSpinner() {
showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1)) { showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, 0, FOUR_HUNDRED, 1)) {
public Point getToolTipLocation(MouseEvent event) { public Point getToolTipLocation(MouseEvent event) {
return new Point(event.getX(), event.getY() - TOOLTIP_Y); return new Point(event.getX(), event.getY() - TOOLTIP_Y);
} }
@ -331,7 +342,7 @@ public class JSliderPane extends JPanel {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
showValue = (int) showValSpinner.getValue(); showValue = (int) showValSpinner.getValue();
isButtonOrIsTxt = true; isButtonOrIsTxt = true;
if (e.getActionCommand().equals("less")) { if ("less".equals(e.getActionCommand())) {
int newDownVal = showValue - TEN; int newDownVal = showValue - TEN;
if (newDownVal >= TEN) { if (newDownVal >= TEN) {
showValue = newDownVal; showValue = newDownVal;
@ -341,7 +352,7 @@ public class JSliderPane extends JPanel {
showValSpinner.setValue(TEN); showValSpinner.setValue(TEN);
} }
} }
if (e.getActionCommand().equals("more")) { if ("more".equals(e.getActionCommand())) {
int newUpVal = showValue + TEN; int newUpVal = showValue + TEN;
if (newUpVal <= FOUR_HUNDRED) { if (newUpVal <= FOUR_HUNDRED) {
showValue = newUpVal; showValue = newUpVal;

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

@ -5,6 +5,7 @@ package com.fr.design.mainframe.toolbar;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.FRCoreContext;
import com.fr.design.DesignState; import com.fr.design.DesignState;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
@ -34,6 +35,7 @@ import com.fr.env.RemoteEnv;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.VT4FR;
import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginRuntime; import com.fr.plugin.context.PluginRuntime;
import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.manage.PluginFilter;
@ -379,8 +381,10 @@ public abstract class ToolBarMenuDock {
// shortCuts.add(new ForumAction()); // shortCuts.add(new ForumAction());
} }
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(new AlphaFineAction()); if (VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support()) {
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(new AlphaFineAction());
shortCuts.add(SeparatorDef.DEFAULT);
}
shortCuts.add(new AboutAction()); shortCuts.add(new AboutAction());
return shortCuts.toArray(new ShortCut[shortCuts.size()]); return shortCuts.toArray(new ShortCut[shortCuts.size()]);
} }

11
designer_base/src/com/fr/design/present/dict/FormulaDictPane.java

@ -20,6 +20,7 @@ import java.awt.*;
public class FormulaDictPane extends FurtherBasicBeanPane<FormulaDictionary> { public class FormulaDictPane extends FurtherBasicBeanPane<FormulaDictionary> {
private static final int EDITOR_COLUMN = 15; private static final int EDITOR_COLUMN = 15;
private static final int LEFT_BORDER = 5;
private FormulaEditor keyFormulaEditor; private FormulaEditor keyFormulaEditor;
private FormulaEditor valueFormulaEditor; private FormulaEditor valueFormulaEditor;
@ -41,8 +42,8 @@ public class FormulaDictPane extends FurtherBasicBeanPane<FormulaDictionary> {
private void initComponents() { private void initComponents() {
keyFormulaEditor = new FormulaEditor(); keyFormulaEditor = new FormulaEditor();
keyFormulaEditor.setColumns(EDITOR_COLUMN); keyFormulaEditor.setColumns(EDITOR_COLUMN);
JPanel keyFormulaContainer = new JPanel(new FlowLayout(FlowLayout.RIGHT, 5, 0)); JPanel keyFormulaContainer = new JPanel(new FlowLayout(FlowLayout.RIGHT, LEFT_BORDER, 0));
keyFormulaContainer.setBorder(BorderFactory.createEmptyBorder(0,-5,0,-5)); keyFormulaContainer.setBorder(BorderFactory.createEmptyBorder(0, -LEFT_BORDER, 0, -LEFT_BORDER));
keyFormulaEditor.setPreferredSize(new Dimension(144, 20)); keyFormulaEditor.setPreferredSize(new Dimension(144, 20));
Icon icon = BaseUtils.readIcon("/com/fr/design/images/m_insert/formula.png"); Icon icon = BaseUtils.readIcon("/com/fr/design/images/m_insert/formula.png");
keyFormulaContainer.add(new JLabel(icon)); keyFormulaContainer.add(new JLabel(icon));
@ -58,15 +59,15 @@ public class FormulaDictPane extends FurtherBasicBeanPane<FormulaDictionary> {
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
UILabel tag = new UILabel(Inter.getLocText("Formula_Dictionary_Display_Examples_Html")); UILabel tag = new UILabel(Inter.getLocText("Formula_Dictionary_Display_Examples_Html"));
tag.setPreferredSize(new Dimension(225,20)); tag.setPreferredSize(new Dimension(225, 40));
JPanel t = new JPanel(new BorderLayout()); JPanel t = new JPanel(new BorderLayout());
t.add(tag, BorderLayout.CENTER); t.add(tag, BorderLayout.CENTER);
Formula vf = new Formula("$$$"); Formula vf = new Formula("$$$");
valueFormulaEditor = new FormulaEditor("", vf); valueFormulaEditor = new FormulaEditor("", vf);
JPanel valueFormulaContainer = new JPanel(new FlowLayout(FlowLayout.RIGHT, 5, 0)); JPanel valueFormulaContainer = new JPanel(new FlowLayout(FlowLayout.RIGHT, LEFT_BORDER, 0));
valueFormulaContainer.setBorder(BorderFactory.createEmptyBorder(0,-5,0,-5)); valueFormulaContainer.setBorder(BorderFactory.createEmptyBorder(0, -LEFT_BORDER, 0, -LEFT_BORDER));
valueFormulaEditor.setPreferredSize(new Dimension(144, 20)); valueFormulaEditor.setPreferredSize(new Dimension(144, 20));
valueFormulaContainer.add(new JLabel(icon)); valueFormulaContainer.add(new JLabel(icon));
valueFormulaContainer.add(valueFormulaEditor); valueFormulaContainer.add(valueFormulaEditor);

2
designer_base/src/com/fr/design/style/color/ColorSelectDetailPane.java

@ -56,7 +56,7 @@ public class ColorSelectDetailPane extends BasicPane {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return null; return Inter.getLocText("FR-Designer_Select_Color");
} }
protected void initComponents() { protected void initComponents() {

3
designer_base/src/com/fr/design/style/color/ColorSelectDialog.java

@ -112,7 +112,8 @@ public class ColorSelectDialog extends MiddleChartDialog{
doCancel(); doCancel();
} }
}); });
this.setTitle(pane.title4PopupWindow());
GUICoreUtils.setWindowCenter(getOwner(), this); GUICoreUtils.setWindowCenter(getOwner(), this);
} }

8
designer_base/src/com/fr/file/FILEChooserPane.java

@ -1,10 +1,6 @@
package com.fr.file; package com.fr.file;
import java.awt.BorderLayout; import java.awt.*;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
@ -510,7 +506,7 @@ public class FILEChooserPane extends BasicPane {
this.suffix = suffix; this.suffix = suffix;
dialog = showWindow(SwingUtilities.getWindowAncestor(parent), false); dialog = showWindow((Window)parent, false);
JPanel contentPane = (JPanel) dialog.getContentPane(); JPanel contentPane = (JPanel) dialog.getContentPane();
contentPane.setLayout(FRGUIPaneFactory.createM_BorderLayout()); contentPane.setLayout(FRGUIPaneFactory.createM_BorderLayout());
contentPane.add(this, BorderLayout.CENTER); contentPane.add(this, BorderLayout.CENTER);

2
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -42,6 +42,7 @@ import com.fr.form.ui.ChartEditor;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.DownloadOnlineSourcesHelper;
import com.fr.plugin.chart.PiePlot4VanChart; import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.area.AreaIndependentVanChartInterface; import com.fr.plugin.chart.area.AreaIndependentVanChartInterface;
import com.fr.plugin.chart.area.VanChartAreaPlot; import com.fr.plugin.chart.area.VanChartAreaPlot;
@ -125,6 +126,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
//重新注册designModuleFactory //重新注册designModuleFactory
DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption()); DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption());
DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance()); DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance());
DesignImageEvent.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper());
} }
}); });
} }

6
designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java

@ -113,20 +113,20 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
} }
}; };
styleAttrPane.setPreferredSize(new Dimension(WIDTH, (int) styleAttrPane.getPreferredSize().getHeight())); styleAttrPane.setPreferredSize(new Dimension(WIDTH, (int) styleAttrPane.getPreferredSize().getHeight()));
return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-Chart_Character")+":", styleAttrPane); return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-Chart_Character"), styleAttrPane);
} }
private JPanel createButtonBackgroundColorPane(){ private JPanel createButtonBackgroundColorPane(){
colorSelectBox4button = new ColorSelectBoxWithOutTransparent(WIDTH); colorSelectBox4button = new ColorSelectBoxWithOutTransparent(WIDTH);
return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Background") + ":", colorSelectBox4button); return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Background"), colorSelectBox4button);
} }
private JPanel createButtonConfigPane() { private JPanel createButtonConfigPane() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p,p,p}; double[] rowSize = {p,p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createTitleStylePane(),null}, new Component[]{createTitleStylePane(),null},
new Component[]{createButtonBackgroundColorPane(),null}, new Component[]{createButtonBackgroundColorPane(),null},

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

@ -59,6 +59,18 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
} }
} }
protected void initLayout() {
this.setLayout(new BorderLayout());
if (!paneList.isEmpty()) {
JPanel pane = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0));
if (nameArray.length > 1) {
pane.add(tabPane);
this.add(pane, BorderLayout.NORTH);
}
}
this.add(centerPane, BorderLayout.CENTER);
}
protected List<NamePane> initPaneList(Plot plot, AbstractAttrNoScrollPane parent) { protected List<NamePane> initPaneList(Plot plot, AbstractAttrNoScrollPane parent) {
plot4Pane = plot; plot4Pane = plot;

12
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java

@ -44,8 +44,10 @@ public abstract class AbstractReportDataContentPane extends BasicBeanPane<ChartC
initSeriesPane(); initSeriesPane();
this.add(seriesPane, "0,2,2,2"); JPanel panel = new JPanel(new BorderLayout());
seriesPane.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15));
panel.add(seriesPane);
this.add(panel, "0,2,2,2");
} }
//kunsnat: 用于重载, 甘特图, 股价图 第一列 默认应该不可编辑. //kunsnat: 用于重载, 甘特图, 股价图 第一列 默认应该不可编辑.
@ -192,4 +194,10 @@ public abstract class AbstractReportDataContentPane extends BasicBeanPane<ChartC
} }
} }
protected JSeparator getJSeparator() {
JSeparator jSeparator = new JSeparator();
jSeparator.setPreferredSize(new Dimension(246, 2));
return jSeparator;
}
} }

1
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/BubblePlotReportDataContentPane.java

@ -27,6 +27,7 @@ public class BubblePlotReportDataContentPane extends AbstractReportDataContentPa
initEveryPane(); initEveryPane();
filterPane = new ChartDataFilterPane(new BubblePlot(), parent); filterPane = new ChartDataFilterPane(new BubblePlot(), parent);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane); JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
filterPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
this.add(panel, "0,6,2,4"); this.add(panel, "0,6,2,4");
} }

3
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java

@ -67,7 +67,8 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
this.add(catePane, "0,0,2,0"); this.add(catePane, "0,0,2,0");
filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent); filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane); JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
this.add(panel, "0,6,2,4"); filterPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
this.add(panel, "0,6,2,4");
addButton.addActionListener(new ActionListener() { addButton.addActionListener(new ActionListener() {
@Override @Override

1
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java

@ -38,6 +38,7 @@ public class CategoryPlotReportDataContentPane extends AbstractReportDataContent
this.add(categoryName, "0,0,2,0"); this.add(categoryName, "0,0,2,0");
filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent); filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane); JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
filterPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
this.add(panel, "0,6,2,4"); } this.add(panel, "0,6,2,4"); }
protected TinyFormulaPane initCategoryBox(final String leftLabel) { protected TinyFormulaPane initCategoryBox(final String leftLabel) {

9
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java

@ -57,14 +57,9 @@ public class MeterPlotReportDataContentPane extends AbstractReportDataContentPan
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.NORTH); this.add(panel, BorderLayout.NORTH);
filterPane = new ChartDataFilterPane(new MeterPlot(), parent); filterPane = new ChartDataFilterPane(new MeterPlot(), parent);
JPanel panel1 = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane); JPanel pane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
filterPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
double[] cs = {p};
components = new Component[][]{
new Component[]{panel1},
};
JPanel pane = TableLayoutHelper.createTableLayoutPane(components, rowSize, cs);
this.add(pane, BorderLayout.CENTER); this.add(pane, BorderLayout.CENTER);
} }

16
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/BubblePlotTableDataContentPane.java

@ -6,7 +6,6 @@ import com.fr.chart.chartattr.BubblePlot;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.BubbleTableDefinition; import com.fr.chart.chartdata.BubbleTableDefinition;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -14,6 +13,7 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -52,23 +52,23 @@ public class BubblePlotTableDataContentPane extends AbstractTableDataContentPane
double[] columnSize_north = {p, f}; double[] columnSize_north = {p, f};
double[] rowSize_north = {p, p, p, p}; double[] rowSize_north = {p, p, p, p};
Component[][] components_north = new Component[][]{ Component[][] components_north = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Chart-Series_Name")+":", SwingConstants.RIGHT), seriesName}, new Component[]{new UILabel(Inter.getLocText("Chart-Series_Name")), seriesName},
new Component[]{new UILabel("x :",SwingConstants.RIGHT), xCombox}, new Component[]{new UILabel("x"), xCombox},
new Component[]{new UILabel("y :",SwingConstants.RIGHT), yCombox}, new Component[]{new UILabel("y"), yCombox},
new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")+":", SwingConstants.RIGHT), bubbleSize} new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), bubbleSize}
}; };
JPanel north = TableLayoutHelper.createTableLayoutPane(components_north,rowSize_north,columnSize_north); JPanel north = TableLayoutHelper.createTableLayoutPane(components_north,rowSize_north,columnSize_north);
north.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1)); north.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1));
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{north}, new Component[]{north},
new Component[]{new JSeparator()}, new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),dataScreeningPane), null},
new Component[]{new BoldFontTextLabel(Inter.getLocText("Chart-Data_Filter"))},
new Component[]{dataScreeningPane}
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);

25
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java

@ -11,6 +11,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -35,31 +36,35 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
nameBox = new UIComboBox(); nameBox = new UIComboBox();
valueBox = new UIComboBox(); valueBox = new UIComboBox();
filterPane = new ChartDataFilterPane(new MeterPlot(), parent); filterPane = new ChartDataFilterPane(new MeterPlot(), parent);
nameBox.setPreferredSize(new Dimension(100, 20)); nameBox.setPreferredSize(new Dimension(100, 20));
valueBox.setPreferredSize(new Dimension(100, 20)); valueBox.setPreferredSize(new Dimension(100, 20));
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = { p,f}; double[] columnSize = { p,f};
double[] rowSize = { p, p,p,p,p,p,p,p, p}; double[] rowSize = {p, p};
Component[][] components = createComponents(); Component[][] components = createComponents();
JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
this.add(panel,BorderLayout.CENTER); JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
filterPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
panel.setBorder(BorderFactory.createEmptyBorder(10,24,10,15));
this.add(getJSeparator(),BorderLayout.NORTH);
this.add(panel,BorderLayout.CENTER);
this.add(jPanel,BorderLayout.SOUTH);
nameBox.addItemListener(tooltipListener); nameBox.addItemListener(tooltipListener);
valueBox.addItemListener(tooltipListener); valueBox.addItemListener(tooltipListener);
} }
private Component[][] createComponents() { private Component[][] createComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{new BoldFontTextLabel(METER_NAME, SwingConstants.RIGHT), getNameComponent()}, new Component[]{new BoldFontTextLabel(METER_NAME), getNameComponent()},
new Component[]{new BoldFontTextLabel(METER_VALUE, SwingConstants.RIGHT), valueBox}, new Component[]{new BoldFontTextLabel(METER_VALUE), valueBox},
new Component[]{new JSeparator(), null},
new Component[]{new BoldFontTextLabel(Inter.getLocText("Chart-Data_Filter"))},
new Component[]{filterPane, null}
}; };
} }

7
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/PiePlotTableDataContentPane.java

@ -1,18 +1,19 @@
package com.fr.design.mainframe.chart.gui.data.table; package com.fr.design.mainframe.chart.gui.data.table;
import java.awt.BorderLayout;
import java.util.List;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.PiePlot; import com.fr.chart.chartattr.PiePlot;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import java.awt.*;
import java.util.List;
public class PiePlotTableDataContentPane extends AbstractTableDataContentPane{ public class PiePlotTableDataContentPane extends AbstractTableDataContentPane{
private SeriesTypeUseComboxPane typeChoosePane; private SeriesTypeUseComboxPane typeChoosePane;
public PiePlotTableDataContentPane(ChartDataPane parent) { public PiePlotTableDataContentPane(ChartDataPane parent) {
typeChoosePane = new SeriesTypeUseComboxPane(parent, new PiePlot()); typeChoosePane = new SeriesTypeUseComboxPane(parent, new PiePlot());
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(getJSeparator(), BorderLayout.NORTH);
this.add(typeChoosePane, BorderLayout.CENTER); this.add(typeChoosePane, BorderLayout.CENTER);
} }

1
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java

@ -57,6 +57,7 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane<ChartCollection> {
this.add(cardPane, BorderLayout.CENTER); this.add(cardPane, BorderLayout.CENTER);
dataScreeningPane = new ChartDataFilterPane(this.initplot, parent); dataScreeningPane = new ChartDataFilterPane(this.initplot, parent);
JPanel panel = new UIExpandablePane(Inter.getLocText("FR-Chart-Data_Filter"), 290, 24, dataScreeningPane); JPanel panel = new UIExpandablePane(Inter.getLocText("FR-Chart-Data_Filter"), 290, 24, dataScreeningPane);
dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
this.add(panel, BorderLayout.SOUTH); this.add(panel, BorderLayout.SOUTH);
} }

231
designer_chart/src/com/fr/plugin/chart/DownloadOnlineSourcesHelper.java

@ -0,0 +1,231 @@
package com.fr.plugin.chart;
import com.fr.base.FRContext;
import com.fr.design.RestartHelper;
import com.fr.design.extra.PluginConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient;
import com.fr.stable.StableUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.util.ArrayList;
import java.util.List;
/**
* Created by shine on 2017/8/21.
*/
public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent{
// 定义加载窗口大小
private static final int LOAD_WIDTH = 455;
private static final int INCIDENT_HEIGHT = 15;
private static final int LOAD_HEIGHT = 295;
private static final int PERCENT = 100;
//进度显示界面
private JDialog dialog;
//进度条
private JProgressBar progressbar;
private List<SiteInfo> list = new ArrayList<>();
//安装结果
private boolean result = true;
//链接服务器的客户端
private HttpClient httpClient;
//总共字节数
private double totalBytes = 0;
private static final double PHANTOM_MB = 96.1 * 1024 * 1024;
public void addPhantomSiteInfo() {
this.addSiteInfo("plugin.phantomjs", "/assist/phantomjs", PHANTOM_MB);
}
private static final double MAP_JSON_MB = 3.8 * 1024 * 1024;
public void addMapJSONSiteInfo() {
this.addSiteInfo("map.json", "/assets/map", MAP_JSON_MB);
}
public void addSiteInfo(String siteKind, String localDir, double megaBits) {
if (new File(FRContext.getCurrentEnv().getPath() + localDir).exists()) {
//本地有这个资源,不下载
return;
}
httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind(siteKind));
if (httpClient.getResponseCode() != HttpURLConnection.HTTP_OK) {
//服务器连不上,不下载
return;
}
totalBytes += megaBits;
list.add(new SiteInfo(siteKind, localDir));
}
public void installOnline() {
int choose = JOptionPane.showConfirmDialog(null, Inter.getLocText("FR-Designer-Download_Online_Sources"), null, JOptionPane.YES_NO_OPTION);
if (choose == JOptionPane.OK_OPTION) {
initDialog();
dialog.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
//取消下载
result = false;
exitDialog();
}
public void windowOpened(WindowEvent e) {
downloadAndInstallPluginDependenceFile();
exitDialog();
}
});
dialog.setVisible(true);
}
}
/**
* 下载和安装不分开是因为本地如果只安装好了一个依赖下次就不需要重复下载了
* 如果下载依赖后不安装则后面的插件会把前面的插件覆盖故而下载好了一个安装一个
*
* @return
* @throws Exception
*/
private void downloadAndInstallPluginDependenceFile() {
try {
double currentBytesRead = 0;
for (int i = 0; i < list.size(); i++) {
SiteInfo siteInfo = list.get(i);
httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind(siteInfo.siteKind));
if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) {
InputStream reader = httpClient.getResponseStream();
String temp = StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE);
File file = new File(temp);
StableUtils.makesureFileExist(file);
FileOutputStream writer = new FileOutputStream(temp);
byte[] buffer = new byte[PluginConstants.BYTES_NUM];
int bytesRead;
while ((bytesRead = reader.read(buffer)) > 0 && result) {
writer.write(buffer, 0, bytesRead);
buffer = new byte[PluginConstants.BYTES_NUM];
currentBytesRead += bytesRead;
setProgress(currentBytesRead);
}
reader.close();
writer.flush();
writer.close();
if (result) {
//安装文件
IOUtils.unZipFilesGBK(temp, FRContext.getCurrentEnv().getPath() + siteInfo.localDir);
}
} else {
result = false;
}
}
} catch (Exception e) {
result = false;
}
}
private void initDialog() {
// 创建标签,并在标签上放置一张图片
BufferedImage image = IOUtils.readImage("/com/fr/plugin/chart/background.png");
ImageIcon imageIcon = new ImageIcon(image);
UILabel label = new UILabel(imageIcon);
label.setBounds(0, 0, LOAD_WIDTH, LOAD_HEIGHT);
progressbar = new JProgressBar();
// 显示当前进度值信息
progressbar.setStringPainted(true);
// 设置进度条边框不显示
progressbar.setBorderPainted(false);
// 设置进度条的前景色
progressbar.setForeground(new Color(0x38aef5));
// 设置进度条的背景色
progressbar.setBackground(new Color(188, 190, 194));
progressbar.setBounds(0, LOAD_HEIGHT, LOAD_WIDTH, INCIDENT_HEIGHT);
progressbar.setMinimum(0);
progressbar.setMaximum((int) totalBytes);
setProgress(0);
dialog = new JDialog();
dialog.setTitle(Inter.getLocText("FR-Designer-Dependence_Install_Online"));
JPanel contentPane = new JPanel(new BorderLayout());
contentPane.add(label, BorderLayout.CENTER);
contentPane.add(progressbar, BorderLayout.SOUTH);
dialog.getContentPane().add(contentPane);
dialog.setModal(true);
dialog.setResizable(true);
dialog.setSize(LOAD_WIDTH, LOAD_HEIGHT + INCIDENT_HEIGHT);
dialog.setResizable(false);
GUICoreUtils.centerWindow(dialog);
dialog.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
}
private void setProgress(double current) {
progressbar.setValue((int) current);
progressbar.setString(current / totalBytes * PERCENT + "%");
progressbar.paintImmediately(new Rectangle(0, 0, LOAD_WIDTH, INCIDENT_HEIGHT * 2));
}
private void exitDialog() {
dialog.dispose();
if (result) {
int choose = JOptionPane.showConfirmDialog(null, Inter.getLocText("FR-Designer_Work_After_Restart_Designer"), null, JOptionPane.YES_NO_OPTION);
if (choose == JOptionPane.OK_OPTION) {
RestartHelper.restart();
}
} else {
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Dependence_Install_Failed"));
}
}
@Override
public void downloadSources() {
this.addMapJSONSiteInfo();
this.addPhantomSiteInfo();
this.installOnline();
}
private class SiteInfo {
String siteKind;
String localDir;
SiteInfo(String siteKind, String localDir) {
this.siteKind = siteKind;
this.localDir = localDir;
}
}
}

BIN
designer_chart/src/com/fr/plugin/chart/background.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

20
designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java

@ -8,7 +8,6 @@ import com.fr.chart.chartdata.BubbleTableDefinition;
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;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
@ -50,7 +49,7 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {f}; double[] columnSize = {f};
double[] rowSize = { p, p,p,p}; double[] rowSize = {p, p};
double[] columnSize_north = {p, f}; double[] columnSize_north = {p, f};
double[] rowSize_north = {p, p, p, p}; double[] rowSize_north = {p, p, p, p};
@ -62,20 +61,17 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon
new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), bubbleSize}, new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), bubbleSize},
}; };
JPanel north = TableLayoutHelper.createTableLayoutPane(components_north,rowSize_north,columnSize_north); JPanel north = TableLayout4VanChartHelper.createGapTableLayoutPane(components_north,rowSize_north,columnSize_north);
north.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15)); north.setBorder(BorderFactory.createEmptyBorder(10, 24, 10, 15));
JPanel filterPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),dataScreeningPane); JPanel filterPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),dataScreeningPane);
dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
Component[][] components = new Component[][]{
new Component[]{north},
new Component[]{filterPane}
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER); this.add(getJSeparator(), BorderLayout.NORTH);
this.add(north, BorderLayout.CENTER);
this.add(filterPane, BorderLayout.SOUTH);
seriesName.addItemListener(tooltipListener); seriesName.addItemListener(tooltipListener);
xCombox.addItemListener(tooltipListener); xCombox.addItemListener(tooltipListener);
yCombox.addItemListener(tooltipListener); yCombox.addItemListener(tooltipListener);

5
designer_chart/src/com/fr/plugin/chart/custom/CustomPlotDesignerPaneFactory.java

@ -10,17 +10,16 @@ import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.attr.plot.VanChartAxisPlot; import com.fr.plugin.chart.attr.plot.VanChartAxisPlot;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.bubble.VanChartBubblePlot; import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.custom.CustomPlotFactory; import com.fr.plugin.chart.bubble.data.VanChartBubblePlotTableDataContentPane;
import com.fr.plugin.chart.custom.component.CustomPlotLocationPane; import com.fr.plugin.chart.custom.component.CustomPlotLocationPane;
import com.fr.plugin.chart.custom.type.CustomPlotType; import com.fr.plugin.chart.custom.type.CustomPlotType;
import com.fr.plugin.chart.bubble.data.VanChartBubblePlotTableDataContentPane;
import com.fr.plugin.chart.scatter.data.VanChartScatterPlotTableDataContentPane;
import com.fr.plugin.chart.designer.style.VanChartStylePane; import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.designer.style.axis.VanChartAxisPane; import com.fr.plugin.chart.designer.style.axis.VanChartAxisPane;
import com.fr.plugin.chart.designer.style.axis.gauge.VanChartGaugeAxisPane; import com.fr.plugin.chart.designer.style.axis.gauge.VanChartGaugeAxisPane;
import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.radar.VanChartRadarPlot; import com.fr.plugin.chart.radar.VanChartRadarPlot;
import com.fr.plugin.chart.scatter.VanChartScatterPlot; import com.fr.plugin.chart.scatter.VanChartScatterPlot;
import com.fr.plugin.chart.scatter.data.VanChartScatterPlotTableDataContentPane;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.util.HashMap; import java.util.HashMap;

59
designer_chart/src/com/fr/plugin/chart/custom/VanChartCustomPlotPane.java

@ -11,12 +11,11 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane; import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.base.VanChartAttrLine; import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.custom.component.VanChartCustomPlotSelectPane; import com.fr.plugin.chart.custom.component.VanChartCustomPlotSelectPane;
import com.fr.plugin.chart.custom.type.CustomPlotType; import com.fr.plugin.chart.custom.type.CustomPlotType;
import com.fr.plugin.chart.custom.type.CustomStyle; import com.fr.plugin.chart.custom.type.CustomStyle;
import com.fr.plugin.chart.custom.CustomPlotFactory;
import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane; import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane;
import com.fr.plugin.chart.vanchart.VanChart; import com.fr.plugin.chart.vanchart.VanChart;
@ -45,7 +44,7 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
//自定义和自动版面的容器,cardLayOut布局 //自定义和自动版面的容器,cardLayOut布局
private JPanel contentPane; private JPanel contentPane;
protected Component[][] getPaneComponents(JPanel typePane){ protected Component[][] getPaneComponents(JPanel typePane) {
initContent(); initContent();
@ -72,14 +71,14 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p, p}; double[] rowSize = {p, p};
customPane = TableLayoutHelper.createTableLayoutPane(components, rowSize , columnSize); customPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
contentPane = new JPanel(new CardLayout()){ contentPane = new JPanel(new CardLayout()) {
@Override @Override
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
if(isCustom){ if (isCustom) {
return customPane.getPreferredSize(); return customPane.getPreferredSize();
} else{ } else {
return new Dimension(autoPane.getWidth(), 0); return new Dimension(autoPane.getWidth(), 0);
} }
} }
@ -98,7 +97,6 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
} }
@Override @Override
protected String[] getTypeIconPath() { protected String[] getTypeIconPath() {
return new String[]{"/com/fr/plugin/chart/custom/images/column_line.png", return new String[]{"/com/fr/plugin/chart/custom/images/column_line.png",
@ -143,22 +141,22 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
} }
Chart[] customChart = CustomIndependentVanChart.CustomVanChartTypes; Chart[] customChart = CustomIndependentVanChart.CustomVanChartTypes;
for(int i = 0, len = customChart.length; i < len; i++){ for (int i = 0, len = customChart.length; i < len; i++) {
if(typeDemo.get(i).isPressing){ if (typeDemo.get(i).isPressing) {
if (i == customChart.length-1){ if (i == customChart.length - 1) {
isCustom = true; isCustom = true;
//先重置自定义组合面板,如果不重置,无法获取选择顺序 //先重置自定义组合面板,如果不重置,无法获取选择顺序
if (lastState == customChart.length-1 && samePlot) { if (lastState == customChart.length - 1 && samePlot) {
//更新数据配置,刪除已经不在的图表数据 //更新数据配置,刪除已经不在的图表数据
dealCustomDefinition(chart); dealCustomDefinition(chart);
customSelectPane.updateBean(chart); customSelectPane.updateBean(chart);
}else if (samePlot){//如果是同一个图表切换过来,则重置面板 } else if (samePlot) {//如果是同一个图表切换过来,则重置面板
customSelectPane.populateBean(chart); customSelectPane.populateBean(chart);
} }
} }
}else { } else {
isCustom = false; isCustom = false;
} }
} }
@ -170,20 +168,20 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
private void dealCustomDefinition(Chart chart) { private void dealCustomDefinition(Chart chart) {
CustomDefinition definition = (CustomDefinition) chart.getFilterDefinition(); CustomDefinition definition = (CustomDefinition) chart.getFilterDefinition();
if (definition == null){ if (definition == null) {
return; return;
} }
Map<CustomPlotType, TopDefinitionProvider> definitionMap = definition.getDefinitionProviderMap(); Map<CustomPlotType, TopDefinitionProvider> definitionMap = definition.getDefinitionProviderMap();
if (definitionMap == null){ if (definitionMap == null) {
return; return;
} }
Map<CustomPlotType, TopDefinitionProvider> newDefinitionMap = new HashMap<CustomPlotType, TopDefinitionProvider>(); Map<CustomPlotType, TopDefinitionProvider> newDefinitionMap = new HashMap<CustomPlotType, TopDefinitionProvider>();
VanChartCustomPlot customPlot = (VanChartCustomPlot) chart.getPlot(); VanChartCustomPlot customPlot = (VanChartCustomPlot) chart.getPlot();
for (int i = 0; i < customPlot.getCustomPlotList().size(); i++){ for (int i = 0; i < customPlot.getCustomPlotList().size(); i++) {
CustomPlotType plotType = CustomPlotFactory.getCustomType(customPlot.getCustomPlotList().get(i)); CustomPlotType plotType = CustomPlotFactory.getCustomType(customPlot.getCustomPlotList().get(i));
TopDefinitionProvider definitionProvider = definitionMap.get(plotType); TopDefinitionProvider definitionProvider = definitionMap.get(plotType);
@ -195,16 +193,17 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
/** /**
* 不同图表切換重置chart屬性 * 不同图表切換重置chart屬性
*
* @param chart * @param chart
* @param newPlot * @param newPlot
*/ */
@Override @Override
protected void resetChartAttr(Chart chart, Plot newPlot){ protected void resetChartAttr(Chart chart, Plot newPlot) {
super.resetChartAttr(chart, newPlot); super.resetChartAttr(chart, newPlot);
//切换图表清空数据配置 //切换图表清空数据配置
chart.setFilterDefinition(null); chart.setFilterDefinition(null);
//设置默认不排序 //设置默认不排序
VanChartTools tools = ((VanChart)chart).getVanChartTools(); VanChartTools tools = ((VanChart) chart).getVanChartTools();
if (tools != null) { if (tools != null) {
tools.setSort(false); tools.setSort(false);
} }
@ -214,19 +213,19 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
* 更新界面内容 * 更新界面内容
*/ */
public void populateBean(Chart chart) { public void populateBean(Chart chart) {
for(ChartImagePane imagePane : typeDemo) { for (ChartImagePane imagePane : typeDemo) {
imagePane.isPressing = false; imagePane.isPressing = false;
} }
//获取上次选中的图标 //获取上次选中的图标
VanChartCustomPlot customPlot = (VanChartCustomPlot)chart.getPlot(); VanChartCustomPlot customPlot = (VanChartCustomPlot) chart.getPlot();
lastTypeIndex = customPlot.getCustomStyle().ordinal(); lastTypeIndex = customPlot.getCustomStyle().ordinal();
typeDemo.get(lastTypeIndex).isPressing = true; typeDemo.get(lastTypeIndex).isPressing = true;
isCustom = customPlot.getCustomStyle() == CustomStyle.CUSTOM; isCustom = customPlot.getCustomStyle() == CustomStyle.CUSTOM;
//自定义选择时,更新自定义面板 //自定义选择时,更新自定义面板
if (isCustom){ if (isCustom) {
customSelectPane.populateBean(chart); customSelectPane.populateBean(chart);
} }
@ -246,17 +245,17 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
return VanChartCustomPlot.VAN_CHART_CUSTOM_PLOT_ID; return VanChartCustomPlot.VAN_CHART_CUSTOM_PLOT_ID;
} }
protected Plot getSelectedClonedPlot(){ protected Plot getSelectedClonedPlot() {
VanChartCustomPlot newPlot = null; VanChartCustomPlot newPlot = null;
Chart[] customChart = CustomIndependentVanChart.CustomVanChartTypes; Chart[] customChart = CustomIndependentVanChart.CustomVanChartTypes;
for(int i = 0, len = customChart.length; i < len; i++){ for (int i = 0, len = customChart.length; i < len; i++) {
if(typeDemo.get(i).isPressing){ if (typeDemo.get(i).isPressing) {
newPlot = (VanChartCustomPlot)customChart[i].getPlot(); newPlot = (VanChartCustomPlot) customChart[i].getPlot();
} }
} }
Plot cloned = null; Plot cloned = null;
try { try {
cloned = (Plot)newPlot.clone(); cloned = (Plot) newPlot.clone();
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
FRLogger.getLogger().error("Error In ScatterChart"); FRLogger.getLogger().error("Error In ScatterChart");
} }
@ -271,7 +270,7 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
/** /**
*删除配置的条件属性 *删除配置的条件属性
*/ */
protected void cloneOldConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException{ protected void cloneOldConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException {
cloneOldDefaultAttrConditionCollection(oldPlot, newPlot); cloneOldDefaultAttrConditionCollection(oldPlot, newPlot);
} }
@ -279,7 +278,7 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
/** /**
* 删除线型配置 * 删除线型配置
*/ */
protected void cloneOldDefaultAttrConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException{ protected void cloneOldDefaultAttrConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException {
if (oldPlot.getConditionCollection() != null) { if (oldPlot.getConditionCollection() != null) {
ConditionCollection newCondition = new ConditionCollection(); ConditionCollection newCondition = new ConditionCollection();
newCondition.setDefaultAttr((ConditionAttr) oldPlot.getConditionCollection().getDefaultAttr().clone()); newCondition.setDefaultAttr((ConditionAttr) oldPlot.getConditionCollection().getDefaultAttr().clone());
@ -288,7 +287,7 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
//删除线型设置 //删除线型设置
ConditionAttr attrList = newCondition.getDefaultAttr(); ConditionAttr attrList = newCondition.getDefaultAttr();
DataSeriesCondition attr = attrList.getExisted(VanChartAttrLine.class); DataSeriesCondition attr = attrList.getExisted(VanChartAttrLine.class);
if (attr != null){ if (attr != null) {
attrList.remove(VanChartAttrLine.class); attrList.remove(VanChartAttrLine.class);
} }
} }

4
designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomPlotSelectPane.java

@ -8,11 +8,11 @@ import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.custom.CustomPlotDesignerPaneFactory;
import com.fr.plugin.chart.custom.CustomPlotFactory;
import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.plugin.chart.custom.VanChartCustomPlot;
import com.fr.plugin.chart.custom.type.CustomPlotType; import com.fr.plugin.chart.custom.type.CustomPlotType;
import com.fr.plugin.chart.custom.type.CustomStyle; import com.fr.plugin.chart.custom.type.CustomStyle;
import com.fr.plugin.chart.custom.CustomPlotDesignerPaneFactory;
import com.fr.plugin.chart.custom.CustomPlotFactory;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;

49
designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java

@ -9,6 +9,7 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.javascript.ChartEmailPane; import com.fr.design.chart.javascript.ChartEmailPane;
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.NameObjectCreator;
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.gui.imenutable.UIMenuNameableCreator; import com.fr.design.gui.imenutable.UIMenuNameableCreator;
@ -25,7 +26,6 @@ import com.fr.js.ParameterJavaScript;
import com.fr.js.ReportletHyperlink; import com.fr.js.ReportletHyperlink;
import com.fr.js.WebHyperlink; import com.fr.js.WebHyperlink;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.designer.other.ChartHyperlinkNameObjectCreartor;
import com.fr.plugin.chart.designer.other.HyperlinkMapFactory; import com.fr.plugin.chart.designer.other.HyperlinkMapFactory;
import com.fr.stable.ListMap; import com.fr.stable.ListMap;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
@ -89,7 +89,6 @@ public class VanChartHyperLinkPane extends UIListControlPane {
} }
public void populate(TargetComponent elementCasePane) { public void populate(TargetComponent elementCasePane) {
// hyperlinkGroupPaneActionProvider.populate(this, elementCasePane);
} }
/** /**
@ -113,7 +112,7 @@ public class VanChartHyperLinkPane extends UIListControlPane {
if (isPopulating) { if (isPopulating) {
return; return;
} }
update((VanChartPlot)plot); update((VanChartPlot) plot);
} }
public void populate(Plot plot) { public void populate(Plot plot) {
@ -125,15 +124,14 @@ public class VanChartHyperLinkPane extends UIListControlPane {
for (HyperlinkProvider provider : providers) { for (HyperlinkProvider provider : providers) {
NameableCreator nc = provider.createHyperlinkCreator(); NameableCreator nc = provider.createHyperlinkCreator();
//todo@shine9.0 //todo@shine9.0
// paneMap.put(nc.getHyperlink(), nc.getUpdatePane()); // paneMap.put(nc.getHyperlink(), nc.getUpdatePane());
} }
//todo@mengao 去掉UIMenuNameableCreator
java.util.List<UIMenuNameableCreator> list = refreshList(paneMap); java.util.List<UIMenuNameableCreator> list = refreshList(paneMap);
ChartHyperlinkNameObjectCreartor[] creators= new ChartHyperlinkNameObjectCreartor[list.size()]; NameObjectCreator[] creators = new NameObjectCreator[list.size()];
for(int i = 0; list != null && i < list.size(); i++) { for (int i = 0; list != null && i < list.size(); i++) {
UIMenuNameableCreator uiMenuNameableCreator = list.get(i); UIMenuNameableCreator uiMenuNameableCreator = list.get(i);
creators[i] = new ChartHyperlinkNameObjectCreartor(uiMenuNameableCreator.getObj(),uiMenuNameableCreator.getName(), uiMenuNameableCreator.getClass(), uiMenuNameableCreator.getPaneClazz()); creators[i] = new NameObjectCreator(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj().getClass(), uiMenuNameableCreator.getPaneClazz());
} }
@ -142,12 +140,12 @@ public class VanChartHyperLinkPane extends UIListControlPane {
java.util.List<NameObject> nameObjects = new ArrayList<NameObject>(); java.util.List<NameObject> nameObjects = new ArrayList<NameObject>();
NameJavaScriptGroup nameGroup = populateHotHyperLink(plot); NameJavaScriptGroup nameGroup = populateHotHyperLink(plot);
for(int i = 0; nameGroup != null && i < nameGroup.size(); i++) { for (int i = 0; nameGroup != null && i < nameGroup.size(); i++) {
NameJavaScript javaScript = nameGroup.getNameHyperlink(i); NameJavaScript javaScript = nameGroup.getNameHyperlink(i);
if(javaScript != null && javaScript.getJavaScript() != null) { if (javaScript != null && javaScript.getJavaScript() != null) {
JavaScript script = javaScript.getJavaScript(); JavaScript script = javaScript.getJavaScript();
UIMenuNameableCreator uiMenuNameableCreator= new UIMenuNameableCreator(javaScript.getName(), script, getUseMap(paneMap, script.getClass())); UIMenuNameableCreator uiMenuNameableCreator = new UIMenuNameableCreator(javaScript.getName(), script, getUseMap(paneMap, script.getClass()));
nameObjects.add(new NameObject(uiMenuNameableCreator.getName(), uiMenuNameableCreator)); nameObjects.add(new NameObject(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj()));
} }
} }
@ -160,7 +158,7 @@ public class VanChartHyperLinkPane extends UIListControlPane {
return plot.getHotHyperLink(); return plot.getHotHyperLink();
} }
protected HashMap getHyperlinkMap(Plot plot){ protected HashMap getHyperlinkMap(Plot plot) {
return HyperlinkMapFactory.getHyperlinkMap(plot); return HyperlinkMapFactory.getHyperlinkMap(plot);
} }
@ -181,10 +179,10 @@ public class VanChartHyperLinkPane extends UIListControlPane {
NameJavaScriptGroup nameGroup = new NameJavaScriptGroup(); NameJavaScriptGroup nameGroup = new NameJavaScriptGroup();
nameGroup.clear(); nameGroup.clear();
for(int i = 0; i < nameables.length; i++) { for (int i = 0; i < nameables.length; i++) {
UIMenuNameableCreator menu = (UIMenuNameableCreator)((NameObject)nameables[i]).getObject(); JavaScript javaScript = (JavaScript) ((NameObject) nameables[i]).getObject();
NameJavaScript nameJava = new NameJavaScript(menu.getName(), (JavaScript)menu.getObj()); String name = nameables[i].getName();
nameJava.setName(nameables[i].getName()); NameJavaScript nameJava = new NameJavaScript(name, javaScript);
nameGroup.addNameHyperlink(nameJava); nameGroup.addNameHyperlink(nameJava);
} }
@ -219,23 +217,16 @@ public class VanChartHyperLinkPane extends UIListControlPane {
} }
protected Class<? extends BasicBeanPane> getUseMap(HashMap map, Object key) { protected Class<? extends BasicBeanPane> getUseMap(HashMap map, Object key) {
if(map.get(key) != null){ if (map.get(key) != null) {
return (Class<? extends BasicBeanPane>)map.get(key); return (Class<? extends BasicBeanPane>) map.get(key);
} }
//引擎在这边放了个provider,当前表单对象 //引擎在这边放了个provider,当前表单对象
for(Object tempKey : map.keySet()){ for (Object tempKey : map.keySet()) {
if(((Class)tempKey).isAssignableFrom((Class)key)){ if (((Class) tempKey).isAssignableFrom((Class) key)) {
return (Class<? extends BasicBeanPane>)map.get(tempKey); return (Class<? extends BasicBeanPane>) map.get(tempKey);
} }
} }
return null; return null;
} }
protected Object getob2Populate (Object ob2Populate) {
if (ob2Populate == null) {
return ob2Populate;
}
return ((UIMenuNameableCreator)ob2Populate).getObj();
}
} }

2
designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomAxisAreaPane.java

@ -2,9 +2,9 @@ package com.fr.plugin.chart.custom.style;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.custom.VanChartCustomPlot;
import com.fr.plugin.chart.custom.CustomPlotDesignerPaneFactory; import com.fr.plugin.chart.custom.CustomPlotDesignerPaneFactory;
import com.fr.plugin.chart.custom.CustomPlotFactory; import com.fr.plugin.chart.custom.CustomPlotFactory;
import com.fr.plugin.chart.custom.VanChartCustomPlot;
import com.fr.plugin.chart.designer.style.background.VanChartAxisAreaPane; import com.fr.plugin.chart.designer.style.background.VanChartAxisAreaPane;
import java.util.List; import java.util.List;

2
designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomPlotLabelTabPane.java

@ -5,10 +5,10 @@ import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.AttrLabel; import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.custom.CustomPlotFactory;
import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.plugin.chart.custom.VanChartCustomPlot;
import com.fr.plugin.chart.custom.component.VanChartCustomPlotTabPane; import com.fr.plugin.chart.custom.component.VanChartCustomPlotTabPane;
import com.fr.plugin.chart.custom.type.CustomPlotType; import com.fr.plugin.chart.custom.type.CustomPlotType;
import com.fr.plugin.chart.custom.CustomPlotFactory;
import com.fr.plugin.chart.designer.PlotFactory; import com.fr.plugin.chart.designer.PlotFactory;
import com.fr.plugin.chart.designer.style.VanChartStylePane; import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.designer.style.label.VanChartPlotLabelPane; import com.fr.plugin.chart.designer.style.label.VanChartPlotLabelPane;

84
designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java

@ -1,84 +0,0 @@
package com.fr.plugin.chart.designer.other;
import com.fr.base.chart.BasePlot;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator;
import com.fr.stable.Nameable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/**
* Created by mengao on 2017/8/18.
*/
public class ChartConditionNameObjectCreator extends NameObjectCreator {
private BasePlot plot;
private ConditionUIMenuNameableCreator conditionUIMenuNameableCreator;
public ChartConditionNameObjectCreator(BasePlot plot, String menuName, Class clazz, Class<? extends BasicBeanPane> updatePane) {
super(menuName, clazz, updatePane);
this.plot = plot;
}
/**
* create Nameable
*
* @param helper
* @return
*/
public Nameable createNameable(UnrepeatedNameHelper helper) {
Constructor<? extends ConditionUIMenuNameableCreator> constructor = null;
try {
constructor = clazzOfInitCase.getConstructor(Plot.class, String.class, Object.class, Class.class);
ConditionUIMenuNameableCreator conditionUIMenuNameableCreator = constructor.newInstance(plot, Inter.getLocText("Chart-Condition_Attributes"), new ConditionAttr(), getUpdatePane());
return new NameObject(helper.createUnrepeatedName(this.menuName()), conditionUIMenuNameableCreator);
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
return null;
}
/**
* @param ob
* @return
*/
public Object acceptObject2Populate(Object ob) {
if (ob instanceof NameObject) {
ob = ((NameObject) ob).getObject();
}
if (clazzOfObject != null && clazzOfObject.isInstance(ob)) {
doSthChanged4Icon(ob);
conditionUIMenuNameableCreator = (ConditionUIMenuNameableCreator) ((ConditionUIMenuNameableCreator) ob).clone();
return ob;
}
return null;
}
/**
* save update bean
*
* @param wrapper
* @param bean
*/
public void saveUpdatedBean(ListModelElement wrapper, Object bean) {
conditionUIMenuNameableCreator.setObj(bean);
((NameObject) wrapper.wrapper).setObject(conditionUIMenuNameableCreator);
}
}

84
designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java

@ -1,84 +0,0 @@
package com.fr.plugin.chart.designer.other;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.gui.imenutable.UIMenuNameableCreator;
import com.fr.general.NameObject;
import com.fr.stable.Nameable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/**
* Created by mengao on 2017/8/21.
*/
public class ChartHyperlinkNameObjectCreartor extends NameObjectCreator {
private Object object;
private UIMenuNameableCreator uIMenuNameableCreator;
public ChartHyperlinkNameObjectCreartor(Object object, String menuName, Class clazz, Class<? extends BasicBeanPane> updatePane) {
super(menuName, clazz, updatePane);
this.object = object;
}
/**
* create Nameable
*
* @param helper
* @return
*/
public Nameable createNameable(UnrepeatedNameHelper helper) {
Constructor<? extends UIMenuNameableCreator> constructor = null;
try {
constructor = clazzOfInitCase.getConstructor(String.class, Object.class, Class.class);
UIMenuNameableCreator uIMenuNameableCreator = constructor.newInstance(menuName, object, getUpdatePane());
return new NameObject(helper.createUnrepeatedName(this.menuName()), uIMenuNameableCreator);
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
return null;
}
/**
* @param ob
* @return
*/
public Object acceptObject2Populate(Object ob) {
if (ob instanceof NameObject) {
ob = ((NameObject) ob).getObject();
}
if (clazzOfObject != null && clazzOfObject.isInstance(ob)) {
doSthChanged4Icon(ob);
uIMenuNameableCreator = ((UIMenuNameableCreator) ob).clone();
if (uIMenuNameableCreator.getObj() != null && object.getClass().isInstance(uIMenuNameableCreator.getObj())) {
return ob;
}
}
return null;
}
/**
* save update bean
*
* @param wrapper
* @param bean
*/
public void saveUpdatedBean(ListModelElement wrapper, Object bean) {
uIMenuNameableCreator.setObj(bean);
((NameObject) wrapper.wrapper).setObject(uIMenuNameableCreator);
}
}

12
designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java

@ -6,14 +6,10 @@ import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.design.gui.imenutable.UIMenuNameableCreator;
import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import java.awt.*; import java.awt.*;
import java.util.ArrayList;
import java.util.List;
/** /**
* Created by Mitisky on 16/5/20. * Created by Mitisky on 16/5/20.
@ -41,17 +37,11 @@ public class VanChartConditionAttrContentPane extends AbstractConditionAttrConte
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(conditionPane, BorderLayout.CENTER); this.add(conditionPane, BorderLayout.CENTER);
//todo@mango
List<UIMenuNameableCreator> list = new ArrayList<UIMenuNameableCreator>();
list.add(new ConditionUIMenuNameableCreator(plot, Inter.getLocText("Chart-Condition_Attributes"), new ConditionAttr(), showPane));
NameObject[] nameables = new NameObject[collection.getConditionAttrSize()]; NameObject[] nameables = new NameObject[collection.getConditionAttrSize()];
for(int i = 0; i < collection.getConditionAttrSize(); i++) { for(int i = 0; i < collection.getConditionAttrSize(); i++) {
ConditionUIMenuNameableCreator c =new ConditionUIMenuNameableCreator(plot, collection.getConditionAttr(i).getName(), collection.getConditionAttr(i), showPane); nameables[i]=(new NameObject(collection.getConditionAttr(i).getName(),collection.getConditionAttr(i)));
nameables[i]=(new NameObject(c.getName(),c));
} }
conditionPane.populate(nameables); conditionPane.populate(nameables);

12
designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java

@ -6,14 +6,13 @@ import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection; import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
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.gui.imenutable.UIMenuNameableCreator;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
@ -36,7 +35,7 @@ public class VanChartListControlPane extends UIListControlPane {
@Override @Override
public NameableCreator[] createNameableCreators() { public NameableCreator[] createNameableCreators() {
return new ChartConditionNameObjectCreator[]{new ChartConditionNameObjectCreator(this.plot, Inter.getLocText("Condition_Attributes"), ConditionUIMenuNameableCreator.class, ChartTypeInterfaceManager.getInstance().getPlotConditionPane((Plot) plot).getClass())}; return new NameObjectCreator[]{new NameObjectCreator(Inter.getLocText("Condition_Attributes"), ConditionAttr.class, ChartTypeInterfaceManager.getInstance().getPlotConditionPane((Plot) plot).getClass())};
} }
@ -77,10 +76,6 @@ public class VanChartListControlPane extends UIListControlPane {
return Inter.getLocText("Condition_Attributes"); return Inter.getLocText("Condition_Attributes");
} }
protected Object getob2Populate(Object ob2Populate) {
return ((ConditionUIMenuNameableCreator) ob2Populate).getObj();
}
/** /**
* Update. * Update.
@ -91,8 +86,7 @@ public class VanChartListControlPane extends UIListControlPane {
cc.clearConditionAttr(); cc.clearConditionAttr();
for (int i = 0; i < nameables.length; i++) { for (int i = 0; i < nameables.length; i++) {
UIMenuNameableCreator uiMenuNameableCreator = (UIMenuNameableCreator) ((NameObject) nameables[i]).getObject(); ConditionAttr ca = (ConditionAttr) ((NameObject) nameables[i]).getObject();
ConditionAttr ca = (ConditionAttr) uiMenuNameableCreator.getObj();
ca.setName(nameables[i].getName()); ca.setName(nameables[i].getName());
cc.addConditionAttr(ca); cc.addConditionAttr(ca);

116
designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java

@ -0,0 +1,116 @@
package com.fr.plugin.chart.designer.style.background;
import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.plugin.chart.attr.DefaultAxisHelper;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.stable.Nameable;
import java.util.ArrayList;
import java.util.List;
/**
* Created by mengao on 2017/8/22.
*/
public class AlertLineListControlPane extends UIListControlPane {
@Override
public void saveSettings() {
if (isPopulating) {
return;
}
update((VanChartPlot) plot);
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
@Override
public NameableCreator[] createNameableCreators() {
return new ChartNameObjectCreator[]{new ChartNameObjectCreator(new String[]{Inter.getLocText("ChartF-X_Axis"), Inter.getLocText("ChartF-Y_Axis")},
Inter.getLocText("Plugin-ChartF_AlertLine"), VanChartAlertValue.class, VanChartAlertValuePane.class)};
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_AlertLine");
}
protected String getAddItemText() {
return Inter.getLocText("Plugin-ChartF_AlertLine");
}
public void populate(Plot plot) {
this.plot = plot;
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList);
ChartNameObjectCreator[] creators = {new ChartNameObjectCreator(axisNames, Inter.getLocText("Plugin-ChartF_AlertLine"), VanChartAlertValue.class, VanChartAlertValuePane.class)};
refreshNameableCreator(creators);
java.util.List<NameObject> nameObjects = new ArrayList<NameObject>();
for (VanChartAxis axis : xAxisList) {
List<VanChartAlertValue> values = axis.getAlertValues();
for (VanChartAlertValue alertValue : values) {
alertValue.setAxisNamesArray(axisNames);
alertValue.setAxisName(axis.getAxisName());
nameObjects.add(new NameObject(alertValue.getAlertPaneSelectName(), alertValue));
}
}
for (VanChartAxis axis : yAxisList) {
List<VanChartAlertValue> values = axis.getAlertValues();
for (VanChartAlertValue alertValue : values) {
alertValue.setAxisNamesArray(axisNames);
alertValue.setAxisName(axis.getAxisName());
nameObjects.add(new NameObject(alertValue.getAlertPaneSelectName(), alertValue));
}
}
populate(nameObjects.toArray(new NameObject[nameObjects.size()]));
doLayout();
}
public void update(Plot plot) {
Nameable[] nameables = this.update();
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
for (VanChartAxis axis : xAxisList) {
List<VanChartAlertValue> axisAlerts = new ArrayList<VanChartAlertValue>();
for (int i = 0; i < nameables.length; i++) {
VanChartAlertValue value = (VanChartAlertValue) ((NameObject) nameables[i]).getObject();
if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) {
value.setAlertPaneSelectName(nameables[i].getName());
axisAlerts.add(value);
}
}
axis.setAlertValues(axisAlerts);
}
for (VanChartAxis axis : yAxisList) {
List<VanChartAlertValue> axisAlerts = new ArrayList<VanChartAlertValue>();
for (int i = 0; i < nameables.length; i++) {
VanChartAlertValue value = (VanChartAlertValue) ((NameObject) nameables[i]).getObject();
if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) {
value.setAlertPaneSelectName(nameables[i].getName());
axisAlerts.add(value);
}
}
axis.setAlertValues(axisAlerts);
}
}
}

121
designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java

@ -0,0 +1,121 @@
package com.fr.plugin.chart.designer.style.background;
import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.plugin.chart.attr.DefaultAxisHelper;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.base.VanChartCustomIntervalBackground;
import com.fr.stable.Nameable;
import java.util.ArrayList;
import java.util.List;
/**
* Created by mengao on 2017/8/22.
*/
public class BackgroundListControlPane extends UIListControlPane {
@Override
public void saveSettings() {
if (isPopulating) {
return;
}
update((VanChartPlot) plot, false);
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
@Override
public NameableCreator[] createNameableCreators() {
return new BackgroundNameObjectCreator[]{new BackgroundNameObjectCreator(new String[]{Inter.getLocText("ChartF-X_Axis"), Inter.getLocText("ChartF-Y_Axis")},
Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), VanChartAlertValue.class, VanChartAlertValuePane.class)};
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_CustomIntervalBackground");
}
@Override
public String getAddItemText() {
return Inter.getLocText("Plugin-ChartF_CustomIntervalBackground");
}
public void populate(Plot plot) {
this.plot = plot;
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList);
BackgroundNameObjectCreator[] creators = {new BackgroundNameObjectCreator(axisNames, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), VanChartCustomIntervalBackground.class, VanChartCustomIntervalBackgroundPane.class)};
refreshNameableCreator(creators);
java.util.List<NameObject> nameObjects = new ArrayList<NameObject>();
for (VanChartAxis axis : xAxisList) {
List<VanChartCustomIntervalBackground> customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray();
for (VanChartCustomIntervalBackground background : customIntervalBackgrounds) {
background.setAxisNamesArray(axisNames);
background.setAxisName(axis.getAxisName());
nameObjects.add(new NameObject(background.getCustomIntervalBackgroundSelectName(), background));
}
}
for (VanChartAxis axis : yAxisList) {
List<VanChartCustomIntervalBackground> customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray();
for (VanChartCustomIntervalBackground background : customIntervalBackgrounds) {
background.setAxisNamesArray(axisNames);
background.setAxisName(axis.getAxisName());
nameObjects.add(new NameObject(background.getCustomIntervalBackgroundSelectName(), background));
}
}
populate(nameObjects.toArray(new NameObject[nameObjects.size()]));
doLayout();
}
public void update(Plot plot, boolean isDefaultIntervalBackground) {
Nameable[] nameables = this.update();
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
for (VanChartAxis axis : xAxisList) {
List<VanChartCustomIntervalBackground> axisCustomBackground = new ArrayList<VanChartCustomIntervalBackground>();
if (!isDefaultIntervalBackground) {
for (int i = 0; i < nameables.length; i++) {
VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground) ((NameObject) nameables[i]).getObject();
if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) {
value.setCustomIntervalBackgroundSelectName(nameables[i].getName());
axisCustomBackground.add(value);
}
}
}
axis.setCustomIntervalBackgroundArray(axisCustomBackground);
}
for (VanChartAxis axis : yAxisList) {
List<VanChartCustomIntervalBackground> axisCustomBackground = new ArrayList<VanChartCustomIntervalBackground>();
if (!isDefaultIntervalBackground) {
for (int i = 0; i < nameables.length; i++) {
VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground) ((NameObject) nameables[i]).getObject();
if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) {
value.setCustomIntervalBackgroundSelectName(nameables[i].getName());
axisCustomBackground.add(value);
}
}
}
axis.setCustomIntervalBackgroundArray(axisCustomBackground);
}
}
}

48
designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java

@ -0,0 +1,48 @@
package com.fr.plugin.chart.designer.style.background;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.general.FRLogger;
import com.fr.general.NameObject;
import com.fr.plugin.chart.base.VanChartCustomIntervalBackground;
import com.fr.stable.Nameable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/**
* Created by mengao on 2017/8/23.
*/
public class BackgroundNameObjectCreator extends ChartNameObjectCreator {
public BackgroundNameObjectCreator(Object object, String menuName, Class clazz, Class<? extends BasicBeanPane> updatePane) {
super(object, menuName, clazz, updatePane);
}
/**
* create Nameable
*
* @param helper
* @return
*/
public Nameable createNameable(UnrepeatedNameHelper helper) {
Constructor<? extends VanChartCustomIntervalBackground> constructor = null;
try {
constructor = clazzOfInitCase.getConstructor();
VanChartCustomIntervalBackground vanChartCustomIntervalBackground = constructor.newInstance();
vanChartCustomIntervalBackground.setAxisNamesArray((String[]) object);
vanChartCustomIntervalBackground.setAxisName(((String[]) object)[0]);
return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartCustomIntervalBackground);
} catch (NoSuchMethodException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (IllegalAccessException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (InstantiationException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (InvocationTargetException e) {
FRLogger.getLogger().error(e.getMessage(), e);
}
return null;
}
}

53
designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java

@ -0,0 +1,53 @@
package com.fr.plugin.chart.designer.style.background;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.general.FRLogger;
import com.fr.general.NameObject;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.stable.Nameable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/**
* Created by mengao on 2017/8/21.
*/
public class ChartNameObjectCreator extends NameObjectCreator {
protected Object object;
public ChartNameObjectCreator(Object object, String menuName, Class clazz, Class<? extends BasicBeanPane> updatePane) {
super(menuName, clazz, updatePane);
this.object = object;
}
/**
* create Nameable
*
* @param helper
* @return
*/
public Nameable createNameable(UnrepeatedNameHelper helper) {
Constructor<? extends VanChartAlertValue> constructor = null;
try {
constructor = clazzOfInitCase.getConstructor();
VanChartAlertValue vanChartAlertValue = constructor.newInstance();
vanChartAlertValue.setAxisNamesArray((String[]) object);
vanChartAlertValue.setAxisName(((String[]) object)[0]);
return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartAlertValue);
} catch (NoSuchMethodException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (IllegalAccessException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (InstantiationException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (InvocationTargetException e) {
FRLogger.getLogger().error(e.getMessage(), e);
}
return null;
}
}

11
designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java

@ -46,6 +46,8 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
private UIComboBox fontName; private UIComboBox fontName;
private ColorSelectBox fontColor; private ColorSelectBox fontColor;
private VanChartAlertValue chartAlertValue;
public VanChartAlertValuePane(){ public VanChartAlertValuePane(){
initComponents(); initComponents();
} }
@ -134,6 +136,7 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
} }
public void populateBean(VanChartAlertValue chartAlertValue){ public void populateBean(VanChartAlertValue chartAlertValue){
this.chartAlertValue =chartAlertValue;
alertAxis = new UIButtonGroup(chartAlertValue.getAxisNamesArray(), chartAlertValue.getAxisNamesArray()); alertAxis = new UIButtonGroup(chartAlertValue.getAxisNamesArray(), chartAlertValue.getAxisNamesArray());
alertAxis.setSelectedItem(chartAlertValue.getAxisName()); alertAxis.setSelectedItem(chartAlertValue.getAxisName());
alertAxis.addChangeListener(new ChangeListener() { alertAxis.addChangeListener(new ChangeListener() {
@ -165,8 +168,7 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
fontColor.setSelectObject(chartAlertValue.getAlertFont().getForeground()); fontColor.setSelectObject(chartAlertValue.getAlertFont().getForeground());
} }
@Override public VanChartAlertValue updateBean(){
public void updateBean(VanChartAlertValue chartAlertValue) {
chartAlertValue.setAxisName(alertAxis.getSelectedItem().toString()); chartAlertValue.setAxisName(alertAxis.getSelectedItem().toString());
chartAlertValue.setAlertValueFormula(new Formula(alertValue.updateBean())); chartAlertValue.setAlertValueFormula(new Formula(alertValue.updateBean()));
@ -191,9 +193,6 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
} else { } else {
chartAlertValue.setAlertPosition(alertTextPosition.getSelectedIndex() == 0 ? Constants.LEFT : Constants.RIGHT); chartAlertValue.setAlertPosition(alertTextPosition.getSelectedIndex() == 0 ? Constants.LEFT : Constants.RIGHT);
} }
} return chartAlertValue;
public VanChartAlertValue updateBean(){
return null;
} }
} }

237
designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java

@ -2,97 +2,90 @@ package com.fr.plugin.chart.designer.style.background;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.UICorrelationComboBoxPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenutable.UIMenuNameableCreator;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.attr.DefaultAxisHelper;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.base.VanChartCustomIntervalBackground;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.designer.component.VanChartUIMenuNameableCreator;
import javax.swing.*; 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;
import java.util.ArrayList;
import java.util.List;
/** /**
* 样式-背景-绘图区背景-坐标轴图表特有间隔背景网格线警戒线 * 样式-背景-绘图区背景-坐标轴图表特有间隔背景网格线警戒线
*/ */
public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
private static final long serialVersionUID = -1880497996650835504L; private static final long serialVersionUID = -1880497996650835504L;
protected ColorSelectBox horizontalGridLine; protected ColorSelectBox horizontalGridLine;
protected ColorSelectBox verticalGridLine; protected ColorSelectBox verticalGridLine;
protected UICorrelationComboBoxPane alertLine; protected AlertLineListControlPane alertLine;
private UIButtonGroup isDefaultIntervalBackground; private UIButtonGroup isDefaultIntervalBackground;
private JPanel centerPane; private JPanel centerPane;
private CardLayout cardLayout; private CardLayout cardLayout;
protected ColorSelectBox horizontalColorBackground; protected ColorSelectBox horizontalColorBackground;
private ColorSelectBox verticalColorBackground; private ColorSelectBox verticalColorBackground;
protected UICorrelationComboBoxPane customIntervalBackground; protected BackgroundListControlPane customIntervalBackground;
public VanChartAxisAreaPane(){ public VanChartAxisAreaPane() {
initComponents(); initComponents();
} }
protected void initComponents(){ protected void initComponents() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = { f }; double[] columnSize = {f};
double[] rowSize = {p,p,p}; double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createGridLinePane(new double[]{p,p,p}, new double[]{p,f})}, new Component[]{createGridLinePane(new double[]{p, p, p}, new double[]{p, f})},
new Component[]{createAlertLinePane()}, new Component[]{createAlertLinePane()},
new Component[]{createIntervalPane(new double[]{p,p,p,p}, new double[]{p,f})}, new Component[]{createIntervalPane(new double[]{p, p, p, p}, new double[]{p, f})},
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
} }
private JPanel createGridLinePane(double[] row, double[] col){ private JPanel createGridLinePane(double[] row, double[] col) {
horizontalGridLine = new ColorSelectBox(100); horizontalGridLine = new ColorSelectBox(100);
verticalGridLine = new ColorSelectBox(100); verticalGridLine = new ColorSelectBox(100);
Component[][] components = getGridLinePaneComponents(); Component[][] components = getGridLinePaneComponents();
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("ChartF-Grid_Line"),panel); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("ChartF-Grid_Line"), panel);
} }
protected Component[][] getGridLinePaneComponents() { protected Component[][] getGridLinePaneComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{null,null}, new Component[]{null, null},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")),horizontalGridLine}, new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")), horizontalGridLine},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")),verticalGridLine}, new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")), verticalGridLine},
}; };
} }
protected JPanel createAlertLinePane(){ protected JPanel createAlertLinePane() {
alertLine = new UICorrelationComboBoxPane(); alertLine = new AlertLineListControlPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"),alertLine); JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"), alertLine);
alertLine.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15));
return panel;
} }
protected JPanel createIntervalPane(double[] row, double[] col){ protected JPanel createIntervalPane(double[] row, double[] col) {
isDefaultIntervalBackground = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_IntervalBackground"), Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")}); isDefaultIntervalBackground = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_IntervalBackground"), Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")});
horizontalColorBackground = new ColorSelectBox(100); horizontalColorBackground = new ColorSelectBox(100);
verticalColorBackground = new ColorSelectBox(100); verticalColorBackground = new ColorSelectBox(100);
Component[][] components = getIntervalPaneComponents(); Component[][] components = getIntervalPaneComponents();
JPanel defaultPane = TableLayoutHelper.createTableLayoutPane(components, row, col); JPanel defaultPane = TableLayoutHelper.createTableLayoutPane(components, row, col);
customIntervalBackground = new UICorrelationComboBoxPane(); customIntervalBackground = new BackgroundListControlPane();
cardLayout = new CardLayout(); cardLayout = new CardLayout();
centerPane = new JPanel(cardLayout); centerPane = new JPanel(cardLayout);
@ -107,43 +100,43 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
JPanel intervalPane = new JPanel(new BorderLayout(0, 6)); JPanel intervalPane = new JPanel(new BorderLayout(0, 6));
intervalPane.add(isDefaultIntervalBackground, BorderLayout.NORTH); intervalPane.add(isDefaultIntervalBackground, BorderLayout.NORTH);
intervalPane.add(centerPane, BorderLayout.CENTER); intervalPane.add(centerPane, BorderLayout.CENTER);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"),intervalPane); JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"), intervalPane);
intervalPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15));
return panel;
} }
protected Component[][] getIntervalPaneComponents() { protected Component[][] getIntervalPaneComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{null,null}, new Component[]{null, null},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")),horizontalColorBackground}, new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")), horizontalColorBackground},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")),verticalColorBackground}, new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")), verticalColorBackground},
}; };
} }
private void checkCardPane(){ private void checkCardPane() {
if(isDefaultIntervalBackground.getSelectedIndex() == 0){ if (isDefaultIntervalBackground.getSelectedIndex() == 0) {
cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_IntervalBackground")); cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_IntervalBackground"));
} else { } else {
cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")); cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"));
} }
} }
protected String title4PopupWindow(){ protected String title4PopupWindow() {
return ""; return "";
} }
public void populateBean(Plot plot){ public void populateBean(Plot plot) {
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot)plot; VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList);
populateGridLine(rectanglePlot); populateGridLine(rectanglePlot);
populateAlert(xAxisList, yAxisList, axisNames); alertLine.populate(plot);
isDefaultIntervalBackground.setSelectedIndex(rectanglePlot.isDefaultIntervalBackground() ? 0 : 1); isDefaultIntervalBackground.setSelectedIndex(rectanglePlot.isDefaultIntervalBackground() ? 0 : 1);
horizontalColorBackground.setSelectObject(rectanglePlot.getDefaultYAxis().getDefaultIntervalBackgroundColor()); horizontalColorBackground.setSelectObject(rectanglePlot.getDefaultYAxis().getDefaultIntervalBackgroundColor());
verticalColorBackground.setSelectObject(rectanglePlot.getDefaultXAxis().getDefaultIntervalBackgroundColor()); verticalColorBackground.setSelectObject(rectanglePlot.getDefaultXAxis().getDefaultIntervalBackgroundColor());
populateCustomIntervalBackground(xAxisList, yAxisList, axisNames); customIntervalBackground.populate(plot);
checkCardPane(); checkCardPane();
} }
@ -152,107 +145,23 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
verticalGridLine.setSelectObject(rectanglePlot.getDefaultXAxis().getMainGridColor()); verticalGridLine.setSelectObject(rectanglePlot.getDefaultXAxis().getMainGridColor());
} }
protected Class<? extends BasicBeanPane> getAlertPaneClass() {
return VanChartAlertValuePane.class;
}
protected void setAlertDemoAxisName(VanChartAlertValue demo, String[] axisNames) {
demo.setAxisName(axisNames[0]);
}
private void populateAlert(List<VanChartAxis> xAxisList, List<VanChartAxis> yAxisList, String[] axisNames){
List<UIMenuNameableCreator> menuList = new ArrayList<UIMenuNameableCreator>();
VanChartAlertValue demo = new VanChartAlertValue();
demo.setAxisNamesArray(axisNames);
setAlertDemoAxisName(demo, axisNames);
menuList.add(new VanChartUIMenuNameableCreator(Inter.getLocText("Plugin-ChartF_AlertLine"), demo, getAlertPaneClass()));
alertLine.refreshMenuAndAddMenuAction(menuList);
List<UIMenuNameableCreator> list = new ArrayList<UIMenuNameableCreator>();
for(VanChartAxis axis: xAxisList){
List<VanChartAlertValue> values = axis.getAlertValues();
for(VanChartAlertValue alertValue : values) {
alertValue.setAxisNamesArray(axisNames);
alertValue.setAxisName(axis.getAxisName());
list.add(new VanChartUIMenuNameableCreator(alertValue.getAlertPaneSelectName(), alertValue, getAlertPaneClass()));
}
}
for(VanChartAxis axis: yAxisList){
List<VanChartAlertValue> values = axis.getAlertValues();
for(VanChartAlertValue alertValue : values) {
alertValue.setAxisNamesArray(axisNames);
alertValue.setAxisName(axis.getAxisName());
list.add(new VanChartUIMenuNameableCreator(alertValue.getAlertPaneSelectName(), alertValue, getAlertPaneClass()));
}
}
alertLine.populateBean(list);
alertLine.doLayout();
}
protected Class<? extends BasicBeanPane> getIntervalPaneClass() {
return VanChartCustomIntervalBackgroundPane.class;
}
protected void setCustomIntervalBackgroundDemoAxisName(VanChartCustomIntervalBackground demo, String[] axisNames) {
demo.setAxisName(axisNames[0]);
}
private void populateCustomIntervalBackground(List<VanChartAxis> xAxisList, List<VanChartAxis> yAxisList, String[] axisNames){
List<UIMenuNameableCreator> menuList = new ArrayList<UIMenuNameableCreator>();
VanChartCustomIntervalBackground demo = new VanChartCustomIntervalBackground();
demo.setAxisNamesArray(axisNames);
setCustomIntervalBackgroundDemoAxisName(demo, axisNames);
menuList.add(new VanChartUIMenuNameableCreator(Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), demo, getIntervalPaneClass()));
customIntervalBackground.refreshMenuAndAddMenuAction(menuList);
List<UIMenuNameableCreator> list = new ArrayList<UIMenuNameableCreator>();
for(VanChartAxis axis: xAxisList){
List<VanChartCustomIntervalBackground> customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray();
for(VanChartCustomIntervalBackground background : customIntervalBackgrounds){
background.setAxisNamesArray(axisNames);
background.setAxisName(axis.getAxisName());
list.add(new VanChartUIMenuNameableCreator(background.getCustomIntervalBackgroundSelectName(), background, getIntervalPaneClass()));
}
}
for(VanChartAxis axis: yAxisList){
List<VanChartCustomIntervalBackground> customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray();
for(VanChartCustomIntervalBackground background : customIntervalBackgrounds){
background.setAxisNamesArray(axisNames);
background.setAxisName(axis.getAxisName());
list.add(new VanChartUIMenuNameableCreator(background.getCustomIntervalBackgroundSelectName(), background, getIntervalPaneClass()));
}
}
customIntervalBackground.populateBean(list);
customIntervalBackground.doLayout();
}
public void updateBean(Plot plot){ public void updateBean(Plot plot) {
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot)plot; VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
updateGirdLine(rectanglePlot); updateGirdLine(rectanglePlot);
updateAlert(xAxisList, yAxisList); alertLine.update(plot);
rectanglePlot.setIsDefaultIntervalBackground(isDefaultIntervalBackground.getSelectedIndex() == 0); rectanglePlot.setIsDefaultIntervalBackground(isDefaultIntervalBackground.getSelectedIndex() == 0);
if(rectanglePlot.isDefaultIntervalBackground()){ if (rectanglePlot.isDefaultIntervalBackground()) {
rectanglePlot.getDefaultYAxis().setDefaultIntervalBackgroundColor(horizontalColorBackground.getSelectObject()); rectanglePlot.getDefaultYAxis().setDefaultIntervalBackgroundColor(horizontalColorBackground.getSelectObject());
rectanglePlot.getDefaultXAxis().setDefaultIntervalBackgroundColor(verticalColorBackground.getSelectObject()); rectanglePlot.getDefaultXAxis().setDefaultIntervalBackgroundColor(verticalColorBackground.getSelectObject());
} else { } else {
rectanglePlot.getDefaultYAxis().setDefaultIntervalBackgroundColor(null); rectanglePlot.getDefaultYAxis().setDefaultIntervalBackgroundColor(null);
rectanglePlot.getDefaultXAxis().setDefaultIntervalBackgroundColor(null); rectanglePlot.getDefaultXAxis().setDefaultIntervalBackgroundColor(null);
} }
updateCustomIntervalBackground(xAxisList, yAxisList); customIntervalBackground.update(plot, isDefaultIntervalBackground.getSelectedIndex() == 0);
} }
protected void updateGirdLine(VanChartRectanglePlot rectanglePlot) { protected void updateGirdLine(VanChartRectanglePlot rectanglePlot) {
@ -260,36 +169,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
rectanglePlot.getDefaultXAxis().setMainGridColor(verticalGridLine.getSelectObject()); rectanglePlot.getDefaultXAxis().setMainGridColor(verticalGridLine.getSelectObject());
} }
private void updateAlert(List<VanChartAxis> xAxisList, List<VanChartAxis> yAxisList){
List<UIMenuNameableCreator> alertList = alertLine.updateBean();
for(VanChartAxis axis : xAxisList){
List<VanChartAlertValue> axisAlerts = new ArrayList<VanChartAlertValue>();
for(UIMenuNameableCreator creator : alertList) {
VanChartAlertValue value = (VanChartAlertValue)creator.getObj();
if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())){
value.setAlertPaneSelectName(creator.getName());
axisAlerts.add(value);
}
}
axis.setAlertValues(axisAlerts);
}
for(VanChartAxis axis : yAxisList){
List<VanChartAlertValue> axisAlerts = new ArrayList<VanChartAlertValue>();
for(UIMenuNameableCreator creator : alertList) {
VanChartAlertValue value = (VanChartAlertValue)creator.getObj();
if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName()) || yAxisEquals(value.getAxisName(), axis.getAxisName())){
value.setAlertPaneSelectName(creator.getName());
axisAlerts.add(value);
}
}
axis.setAlertValues(axisAlerts);
}
}
/** /**
* Y軸和雷達圖的極軸也是相等的 * Y軸和雷達圖的極軸也是相等的
*
* @param axisName * @param axisName
* @param valueAxisName * @param valueAxisName
* @return * @return
@ -299,40 +181,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
ComparatorUtils.equals(VanChartAttrHelper.RADAR_Y_AXIS_PREFIX, axisName); ComparatorUtils.equals(VanChartAttrHelper.RADAR_Y_AXIS_PREFIX, axisName);
} }
private void updateCustomIntervalBackground(List<VanChartAxis> xAxisList, List<VanChartAxis> yAxisList){ public Plot updateBean() {
List<UIMenuNameableCreator> customList = customIntervalBackground.updateBean();
for(VanChartAxis axis : xAxisList){
List<VanChartCustomIntervalBackground> axisCustomBackground = new ArrayList<VanChartCustomIntervalBackground>();
if(isDefaultIntervalBackground.getSelectedIndex() == 1){//tab选中间隔背景,则置所有自定义间隔背景为空数组
for(UIMenuNameableCreator creator : customList) {
VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground)creator.getObj();
if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())){
value.setCustomIntervalBackgroundSelectName(creator.getName());
axisCustomBackground.add(value);
}
}
}
axis.setCustomIntervalBackgroundArray(axisCustomBackground);
}
for(VanChartAxis axis : yAxisList){
List<VanChartCustomIntervalBackground> axisCustomBackground = new ArrayList<VanChartCustomIntervalBackground>();
if(isDefaultIntervalBackground.getSelectedIndex() == 1){//tab选中间隔背景,则置所有自定义间隔背景为空数组
for(UIMenuNameableCreator creator : customList) {
VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground)creator.getObj();
if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())){
value.setCustomIntervalBackgroundSelectName(creator.getName());
axisCustomBackground.add(value);
}
}
}
axis.setCustomIntervalBackgroundArray(axisCustomBackground);
}
}
public Plot updateBean(){
return null; return null;
} }
} }

17
designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java

@ -32,8 +32,7 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane<VanChart
private ColorSelectBox color; private ColorSelectBox color;
private UINumberDragPane transparent; private UINumberDragPane transparent;
public VanChartCustomIntervalBackgroundPane(){ private VanChartCustomIntervalBackground customIntervalBackground;
}
private void doLayoutPane(){ private void doLayoutPane(){
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
@ -44,8 +43,7 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane<VanChart
top.add(createContentPane()); top.add(createContentPane());
} }
private JPanel createContentPane() private JPanel createContentPane() {
{
bottomValue = new TinyFormulaPane(); bottomValue = new TinyFormulaPane();
topValue = new TinyFormulaPane(); topValue = new TinyFormulaPane();
bottomValue.setPreferredSize(new Dimension(124,20)); bottomValue.setPreferredSize(new Dimension(124,20));
@ -90,6 +88,7 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane<VanChart
} }
public void populateBean(VanChartCustomIntervalBackground customIntervalBackground){ public void populateBean(VanChartCustomIntervalBackground customIntervalBackground){
this.customIntervalBackground = customIntervalBackground;
backgroundAxis = new UIButtonGroup(customIntervalBackground.getAxisNamesArray(), customIntervalBackground.getAxisNamesArray()); backgroundAxis = new UIButtonGroup(customIntervalBackground.getAxisNamesArray(), customIntervalBackground.getAxisNamesArray());
backgroundAxis.setSelectedItem(customIntervalBackground.getAxisName()); backgroundAxis.setSelectedItem(customIntervalBackground.getAxisName());
@ -99,20 +98,16 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane<VanChart
topValue.populateBean(Utils.objectToString(customIntervalBackground.getToFormula())); topValue.populateBean(Utils.objectToString(customIntervalBackground.getToFormula()));
color.setSelectObject(customIntervalBackground.getBackgroundColor()); color.setSelectObject(customIntervalBackground.getBackgroundColor());
transparent.populateBean(customIntervalBackground.getAlpha() * VanChartAttrHelper.PERCENT); transparent.populateBean(customIntervalBackground.getAlpha() * VanChartAttrHelper.PERCENT);
} }
public void updateBean(VanChartCustomIntervalBackground customIntervalBackground){ public VanChartCustomIntervalBackground updateBean(){
customIntervalBackground.setAxisName(backgroundAxis.getSelectedItem().toString()); customIntervalBackground.setAxisName(backgroundAxis.getSelectedItem().toString());
customIntervalBackground.setFromFormula(new Formula(bottomValue.updateBean())); customIntervalBackground.setFromFormula(new Formula(bottomValue.updateBean()));
customIntervalBackground.setToFormula(new Formula(topValue.updateBean())); customIntervalBackground.setToFormula(new Formula(topValue.updateBean()));
customIntervalBackground.setBackgroundColor(color.getSelectObject()); customIntervalBackground.setBackgroundColor(color.getSelectObject());
customIntervalBackground.setAlpha(transparent.updateBean() / VanChartAttrHelper.PERCENT); customIntervalBackground.setAlpha(transparent.updateBean() / VanChartAttrHelper.PERCENT);
} return customIntervalBackground;
public VanChartCustomIntervalBackground updateBean(){
return null;
} }
} }

3
designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java

@ -29,7 +29,8 @@ public class GanttReportDataContentPane extends AbstractReportDataContentPane{
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
initAllComponent(); initAllComponent();
JPanel panel = getContentPane(); JPanel panel = getContentPane();
panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); panel.setBorder(BorderFactory.createEmptyBorder(10,24,0,15));
this.add(getJSeparator(), BorderLayout.NORTH);
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight())); this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight()));

18
designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotTableDataContentPane.java

@ -11,12 +11,12 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
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;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -32,7 +32,7 @@ import java.util.List;
*/ */
public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPane implements UIObserver { public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPane implements UIObserver {
private static final int HT = 20; private static final int HT = 20;
private static final int WD = 120; private static final int WD = 100;
private UISpinner levelNumEdit; private UISpinner levelNumEdit;
private UITextField nameField; private UITextField nameField;
protected UIComboBox value; protected UIComboBox value;
@ -103,7 +103,7 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
calculateCombox.reset(); calculateCombox.reset();
calculateCombox.setPreferredSize(new Dimension(WD, HT)); calculateCombox.setPreferredSize(new Dimension(WD, HT));
components_center[levelNum] = new Component[]{new JSeparator(), null}; components_center[levelNum] = new Component[]{getJSeparator(), null};
components_center[levelNum+1] = new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), value}; components_center[levelNum+1] = new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), value};
components_center[levelNum+2] = new Component[]{new UILabel(Inter.getLocText("Chart-Summary_Method")), calculateCombox}; components_center[levelNum+2] = new Component[]{new UILabel(Inter.getLocText("Chart-Summary_Method")), calculateCombox};
@ -112,7 +112,7 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
registerListener4Center(); registerListener4Center();
return TableLayoutHelper.createTableLayoutPane(components_center,rowSize_center,columnSize_center); return TableLayout4VanChartHelper.createGapTableLayoutPane(components_center,rowSize_center,columnSize_center);
} }
@ -175,11 +175,11 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
Component[][] components_north = new Component[][]{ Component[][] components_north = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name")), nameField}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name")), nameField},
new Component[]{new JSeparator(),null }, new Component[]{getJSeparator(),null },
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Level_Number")), levelNumEdit}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Level_Number")), levelNumEdit},
}; };
return TableLayoutHelper.createTableLayoutPane(components_north, rowSize_north, columnSize_north); return TableLayout4VanChartHelper.createGapTableLayoutPane(components_north, rowSize_north, columnSize_north);
} }
private void refreshCenterPane(){ private void refreshCenterPane(){
@ -357,4 +357,10 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
} }
return false; return false;
} }
protected JSeparator getJSeparator() {
JSeparator jSeparator = new JSeparator();
jSeparator.setPreferredSize(new Dimension(220, 2));
return jSeparator;
}
} }

14
designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java

@ -49,6 +49,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
private CardLayout cardLayout; // 卡片布局,选中参数面板时显示mobileWidgetTable,选中body时显示mobileBodyWidgetTable private CardLayout cardLayout; // 卡片布局,选中参数面板时显示mobileWidgetTable,选中body时显示mobileBodyWidgetTable
private JTableHeader header;//把表头单独get出来作为一个组件 private JTableHeader header;//把表头单独get出来作为一个组件
private UIHeadGroup tabsHeaderIconPane; private UIHeadGroup tabsHeaderIconPane;
private XComponent lastAffectedCreator;
public static WidgetPropertyPane getInstance() { public static WidgetPropertyPane getInstance() {
@ -132,9 +133,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
*/ */
private void createPropertyTable() { private void createPropertyTable() {
formWidgetCardPane = new FormWidgetCardPane(designer); formWidgetCardPane = new FormWidgetCardPane(designer);
designer.addDesignerEditListener(new WidgetPropertyDesignerAdapter(formWidgetCardPane)); designer.addDesignerEditListener(new WidgetPropertyDesignerAdapter(formWidgetCardPane));
psp = new UIScrollPane(formWidgetCardPane); // 用来装载属性表table psp = new UIScrollPane(formWidgetCardPane); // 用来装载属性表table
psp.setBorder(null); psp.setBorder(null);
} }
@ -318,6 +317,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
private class WidgetPropertyDesignerAdapter implements DesignerEditListener { private class WidgetPropertyDesignerAdapter implements DesignerEditListener {
FormWidgetCardPane formWidgetCardPane; FormWidgetCardPane formWidgetCardPane;
WidgetPropertyDesignerAdapter(FormWidgetCardPane formWidgetCardPane) { WidgetPropertyDesignerAdapter(FormWidgetCardPane formWidgetCardPane) {
this.formWidgetCardPane = formWidgetCardPane; this.formWidgetCardPane = formWidgetCardPane;
} }
@ -329,14 +329,19 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_RESIZED) { || evt.getCreatorEventID() == DesignerEvent.CREATOR_RESIZED) {
formWidgetCardPane.populate(); formWidgetCardPane.populate();
}else if(evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED){ }else if(evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED){
formWidgetCardPane = new FormWidgetCardPane(designer); // 防止多次触发
if (lastAffectedCreator != null && lastAffectedCreator == evt.getAffectedCreator()) {
return;
}
lastAffectedCreator = evt.getAffectedCreator();
refreshDockingView();
formWidgetCardPane.populate(); formWidgetCardPane.populate();
} }
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
return o instanceof WidgetPropertyDesignerAdapter && ((WidgetPropertyDesignerAdapter) o).formWidgetCardPane == this.formWidgetCardPane; return o instanceof WidgetPropertyDesignerAdapter;
} }
} }
@ -345,7 +350,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
*/ */
private class EventPropertyDesignerAdapter implements DesignerEditListener { private class EventPropertyDesignerAdapter implements DesignerEditListener {
EventPropertyTable propertyTable; EventPropertyTable propertyTable;
private XComponent lastAffectedCreator;
EventPropertyDesignerAdapter(EventPropertyTable eventTable) { EventPropertyDesignerAdapter(EventPropertyTable eventTable) {
this.propertyTable = eventTable; this.propertyTable = eventTable;

25
designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

@ -27,7 +27,7 @@ import java.awt.*;
* Created by ibm on 2017/7/25. * Created by ibm on 2017/7/25.
*/ */
public class FormWidgetCardPane extends AbstractAttrNoScrollPane { public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
private AttributeChangeListener listener2; private AttributeChangeListener listener;
private FormDesigner designer; private FormDesigner designer;
//当前的编辑器属性定义面板 //当前的编辑器属性定义面板
private DataModify<Widget> currentEditorDefinePane; private DataModify<Widget> currentEditorDefinePane;
@ -81,7 +81,6 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
} else { } else {
return null; return null;
} }
} }
/** /**
@ -138,7 +137,7 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
jPanel.add(attriCardPane, BorderLayout.CENTER); jPanel.add(attriCardPane, BorderLayout.CENTER);
this.listener2 = new AttributeChangeListener() { this.listener = new AttributeChangeListener() {
@Override @Override
public void attributeChange() { public void attributeChange() {
updateCreator(); updateCreator();
@ -185,18 +184,18 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
if (widgetBoundPane != null) { if (widgetBoundPane != null) {
widgetBoundPane.populate(); widgetBoundPane.populate();
} }
if (cellWidget instanceof WScaleLayout) { Widget innerWidget = cellWidget;
if (cellWidget.acceptType(WScaleLayout.class)) {
Widget crBoundsWidget = ((WScaleLayout) cellWidget).getBoundsWidget(); Widget crBoundsWidget = ((WScaleLayout) cellWidget).getBoundsWidget();
currentEditorDefinePane.populateBean(((CRBoundsWidget) crBoundsWidget).getWidget()); innerWidget = ((CRBoundsWidget) crBoundsWidget).getWidget();
} else if(cellWidget instanceof WTitleLayout){ } else if(cellWidget.acceptType(WTitleLayout.class)){
CRBoundsWidget crBoundsWidget = ((WTitleLayout) cellWidget).getBodyBoundsWidget(); CRBoundsWidget crBoundsWidget = ((WTitleLayout) cellWidget).getBodyBoundsWidget();
currentEditorDefinePane.populateBean(crBoundsWidget.getWidget()); innerWidget = crBoundsWidget.getWidget();
}else{
currentEditorDefinePane.populateBean(cellWidget);
} }
widgetPropertyPane.populate(cellWidget); currentEditorDefinePane.populateBean(innerWidget);
widgetPropertyPane.populate(innerWidget);
reinitAllListeners(); reinitAllListeners();
this.addAttributeChangeListener(listener2); this.addAttributeChangeListener(listener);
} }
@ -208,12 +207,12 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
} }
fireValueChanged(); fireValueChanged();
if (xCreator instanceof XWScaleLayout) { if (xCreator.acceptType(XWScaleLayout.class)) {
XCreator xCreator1 = xCreator.getEditingChildCreator(); XCreator xCreator1 = xCreator.getEditingChildCreator();
xCreator1.resetData(widget); xCreator1.resetData(widget);
xCreator.removeAll(); xCreator.removeAll();
xCreator.add(xCreator1); xCreator.add(xCreator1);
}else if(xCreator instanceof XWTitleLayout){ }else if(xCreator.acceptType(XWTitleLayout.class)){
XCreator xCreator1 = ((XWTitleLayout) xCreator).getXCreator(0); XCreator xCreator1 = ((XWTitleLayout) xCreator).getXCreator(0);
xCreator1.resetData(widget); xCreator1.resetData(widget);
xCreator.removeAll(); xCreator.removeAll();

15
designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java

@ -9,6 +9,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
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.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -29,8 +30,10 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
private XWParameterLayout root; private XWParameterLayout root;
private UISpinner designerWidth; private UISpinner designerWidth;
private UICheckBox displayReport; private UICheckBox displayReport;
private UICheckBox useParamsTemplate;
private AccessibleBackgroundEditor background; private AccessibleBackgroundEditor background;
private UIButtonGroup hAlignmentPane; private UIButtonGroup hAlignmentPane;
private UITextField labelNameTextField;
public RootDesignDefinePane(XCreator xCreator) { public RootDesignDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -69,7 +72,9 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
public JPanel createAdvancePane() { public JPanel createAdvancePane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
labelNameTextField = new UITextField();
displayReport = new UICheckBox(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery")); displayReport = new UICheckBox(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery"));
useParamsTemplate = new UICheckBox(Inter.getLocText("FR-Designer_Use_Params_Template"));
background = new AccessibleBackgroundEditor(); background = new AccessibleBackgroundEditor();
Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), Icon[] hAlignmentIconArray = {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_center_normal.png"),
@ -80,12 +85,14 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
, Inter.getLocText("FR-Designer-StyleAlignment_Center"), Inter.getLocText("FR-Designer-StyleAlignment_Right")}); , Inter.getLocText("FR-Designer-StyleAlignment_Center"), Inter.getLocText("FR-Designer-StyleAlignment_Right")});
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p}; double[] rowSize = {p, p, 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}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), background}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), background},
new Component[]{displayReport, null}, new Component[]{displayReport, null},
new Component[]{useParamsTemplate, null},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), hAlignmentPane} new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), hAlignmentPane}
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10);
@ -101,8 +108,10 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
@Override @Override
public void populateBean(WParameterLayout ob) { public void populateBean(WParameterLayout ob) {
labelNameTextField.setText(ob.getLabelName());
background.setValue(ob.getBackground()); background.setValue(ob.getBackground());
displayReport.setSelected(ob.isDelayDisplayContent()); displayReport.setSelected(ob.isDelayDisplayContent());
useParamsTemplate.setSelected(ob.isUseParamsTemplate());
designerWidth.setValue(ob.getDesignWidth()); designerWidth.setValue(ob.getDesignWidth());
hAlignmentPane.setSelectedIndex(ob.getPosition()); hAlignmentPane.setSelectedIndex(ob.getPosition());
} }
@ -111,8 +120,10 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
@Override @Override
public WParameterLayout updateBean() { public WParameterLayout updateBean() {
WParameterLayout wParameterLayout = (WParameterLayout) creator.toData(); WParameterLayout wParameterLayout = (WParameterLayout) creator.toData();
wParameterLayout.setLabelName(labelNameTextField.getText());
wParameterLayout.setDesignWidth((int) designerWidth.getValue()); wParameterLayout.setDesignWidth((int) designerWidth.getValue());
wParameterLayout.setDelayDisplayContent(displayReport.isSelected()); wParameterLayout.setDelayDisplayContent(displayReport.isSelected());
wParameterLayout.setUseParamsTemplate(useParamsTemplate.isSelected());
wParameterLayout.setBackground((Background) background.getValue()); wParameterLayout.setBackground((Background) background.getValue());
wParameterLayout.setPosition(hAlignmentPane.getSelectedIndex()); wParameterLayout.setPosition(hAlignmentPane.getSelectedIndex());
return wParameterLayout; return wParameterLayout;

23
designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java

@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
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.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -17,9 +17,10 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
public abstract class ButtonDefinePane<T extends Button> extends AbstractDataModify<T> { public abstract class ButtonDefinePane<T extends Button> extends AbstractDataModify<T> {
private UIPropertyTextField hotkeysTextField; private UITextField hotkeysTextField;
private UIPropertyTextField buttonNameTextField; private UITextField buttonNameTextField;
private AccessibleIconEditor iconPane; private AccessibleIconEditor iconPane;
protected UITextField labelNameTextField;
public ButtonDefinePane(XCreator creator){ public ButtonDefinePane(XCreator creator){
@ -31,18 +32,20 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double rowSize[] = {p, p, p, p, p, p, p}; double rowSize[] = {p, p, p, p, p, p, p, p};
double columnSize[] = {p, f}; double columnSize[] = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
iconPane = new AccessibleIconEditor(); iconPane = new AccessibleIconEditor();
hotkeysTextField = new UIPropertyTextField(); hotkeysTextField = new UITextField();
buttonNameTextField = new UIPropertyTextField(); buttonNameTextField = new UITextField();
labelNameTextField = new UITextField();
Component[] backgroundCompPane = createBackgroundComp(); Component[] backgroundCompPane = createBackgroundComp();
Component[] frFont = createFontPane(); Component[] frFont = createFontPane();
UILabel backgroundLabel = new UILabel(Inter.getLocText("FR-Designer_Background")); UILabel backgroundLabel = new UILabel(Inter.getLocText("FR-Designer_Background"));
backgroundLabel.setVerticalAlignment(SwingConstants.TOP); backgroundLabel.setVerticalAlignment(SwingConstants.TOP);
Component[][] n_components = { Component[][] n_components = {
{new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField}, {new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField},
{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
backgroundCompPane, backgroundCompPane,
frFont, frFont,
{new UILabel(Inter.getLocText("FR-Designer_Icon") + ":"), iconPane}, {new UILabel(Inter.getLocText("FR-Designer_Icon") + ":"), iconPane},
@ -73,7 +76,8 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
@Override @Override
public void populateBean(T btn) { public void populateBean(T btn) {
hotkeysTextField.setText(btn.getHotkeys()); hotkeysTextField.setText(btn.getHotkeys());
buttonNameTextField.setText(btn.getLabelName()); buttonNameTextField.setText(btn.getText());
labelNameTextField.setText(btn.getLabelName());
iconPane.setValue(btn.getIconName()); iconPane.setValue(btn.getIconName());
populateSubButtonPane(btn); populateSubButtonPane(btn);
} }
@ -86,8 +90,9 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
public T updateBean() { public T updateBean() {
T btn = updateSubButtonPane(); T btn = updateSubButtonPane();
btn.setHotkeys(hotkeysTextField.getText()); btn.setHotkeys(hotkeysTextField.getText());
btn.setLabelName(buttonNameTextField.getText()); btn.setLabelName(labelNameTextField.getText());
btn.setIconName((String)iconPane.getValue()); btn.setIconName((String)iconPane.getValue());
btn.setText(buttonNameTextField.getText());
return btn; return btn;
} }

13
designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java

@ -4,7 +4,7 @@ import com.fr.design.designer.creator.XCreator;
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.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -16,9 +16,10 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> { public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private UIPropertyTextField text; private UITextField text;
private UISpinner fontSizePane; private UISpinner fontSizePane;
private FormWidgetValuePane formWidgetValuePane; private FormWidgetValuePane formWidgetValuePane;
protected UITextField labelNameTextField;
public CheckBoxDefinePane(XCreator xCreator) { public CheckBoxDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -27,19 +28,21 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private void iniComoponents() { private void iniComoponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
text = new UIPropertyTextField(); text = new UITextField();
fontSizePane = new UISpinner(0, 20, 1, 0); fontSizePane = new UISpinner(0, 20, 1, 0);
labelNameTextField = new UITextField();
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
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_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Text")), text }, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Text")), text },
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane }, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane },
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane},
}; };
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 3},{1, 1}}; int[][] rowCount = {{1, 1},{1, 1}, {1, 3},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));

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

@ -4,7 +4,7 @@ import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.form.ui.ComboBox; import com.fr.form.ui.ComboBox;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -13,7 +13,7 @@ import java.awt.*;
public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> { public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> {
private UICheckBox removeRepeatCheckBox; private UICheckBox removeRepeatCheckBox;
private UIPropertyTextField waterMarkField; private UITextField waterMarkField;
public ComboBoxDefinePane(XCreator xCreator) { public ComboBoxDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -26,7 +26,7 @@ public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> {
} }
public Component[] createWaterMarkPane() { public Component[] createWaterMarkPane() {
waterMarkField = new UIPropertyTextField(); waterMarkField = new UITextField();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkField}; return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkField};
} }

6
designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java

@ -5,7 +5,7 @@ import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.ComboCheckBox; import com.fr.form.ui.ComboCheckBox;
@ -17,7 +17,7 @@ import java.awt.*;
public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> { public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> {
private UICheckBox supportTagCheckBox; private UICheckBox supportTagCheckBox;
private UIButtonGroup returnType; private UIButtonGroup returnType;
private UIPropertyTextField waterMarkDictPane; private UITextField waterMarkDictPane;
private UICheckBox removeRepeatCheckBox; private UICheckBox removeRepeatCheckBox;
public ComboCheckBoxDefinePane(XCreator xCreator) { public ComboCheckBoxDefinePane(XCreator xCreator) {
@ -31,7 +31,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
} }
public Component[] createWaterMarkPane() { public Component[] createWaterMarkPane() {
waterMarkDictPane = new UIPropertyTextField(); waterMarkDictPane = new UITextField();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}; return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane};
} }

7
designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java

@ -9,6 +9,7 @@ import com.fr.design.gui.ibutton.UIHeadGroup;
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;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -38,6 +39,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private UIComboBox currentFormatComboBox; private UIComboBox currentFormatComboBox;
private UILabel currentSamplelabel; private UILabel currentSamplelabel;
private UIHeadGroup fomatHeadGroup; private UIHeadGroup fomatHeadGroup;
protected UITextField labelNameTextField;
public DateEditorDefinePane(XCreator xCreator) { public DateEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -58,12 +60,13 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
returnTypePane.add(new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), BorderLayout.WEST); returnTypePane.add(new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), BorderLayout.WEST);
returnTypeComboBox = new UIButtonGroup<>(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")}); returnTypeComboBox = new UIButtonGroup<>(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")});
JPanel formatHead = createFormatHead(); JPanel formatHead = createFormatHead();
labelNameTextField = new UITextField();
startDv = new DateValuePane(); startDv = new DateValuePane();
endDv = new DateValuePane(); endDv = new DateValuePane();
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_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
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},
@ -73,7 +76,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
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, p, p}; double[] rowSize = {p, p, p, p, p, p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 3}, {1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 3}, {1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 10); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 10);

5
designer_form/src/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java

@ -34,15 +34,16 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
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_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane }, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane },
dicPane, dicPane,
removeRepeatPane, removeRepeatPane,
waterMarkComponent, waterMarkComponent,
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane} new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}
}; };
double[] rowSize = {p, p, p, p, p, p,p}; double[] rowSize = {p, 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, 1},{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, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
advancePane.add(panel, BorderLayout.NORTH); advancePane.add(panel, BorderLayout.NORTH);

13
designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java

@ -5,7 +5,7 @@ import com.fr.design.foldablepane.UIExpandablePane;
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.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -22,9 +22,11 @@ import java.awt.event.ItemListener;
public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> { public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> {
protected UICheckBox allowBlankCheckBox; protected UICheckBox allowBlankCheckBox;
// richer:错误信息,是所有控件共有的属性,所以放到这里来 // richer:错误信息,是所有控件共有的属性,所以放到这里来
protected UIPropertyTextField errorMsgTextField; protected UITextField errorMsgTextField;
protected JPanel validatePane; protected JPanel validatePane;
protected UISpinner fontSizePane; protected UISpinner fontSizePane;
protected UITextField labelNameTextField;
public FieldEditorDefinePane(XCreator xCreator) { public FieldEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -37,10 +39,11 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
labelNameTextField = new UITextField();
allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null")); allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null"));
allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
fontSizePane = new UISpinner(0, 20, 1, 0); fontSizePane = new UISpinner(0, 20, 1, 0);
errorMsgTextField = new UIPropertyTextField(); errorMsgTextField = new UITextField();
JPanel contentPane = this.setFirstContentPane(); JPanel contentPane = this.setFirstContentPane();
if (contentPane != null) { if (contentPane != null) {
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane); UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane);
@ -54,6 +57,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
this.allowBlankCheckBox.setSelected(ob.isAllowBlank()); this.allowBlankCheckBox.setSelected(ob.isAllowBlank());
this.errorMsgTextField.setText(ob.getErrorMessage()); this.errorMsgTextField.setText(ob.getErrorMessage());
this.fontSizePane.setValue(ob.getFontSize()); this.fontSizePane.setValue(ob.getFontSize());
this.labelNameTextField.setText(ob.getLabelName());
populateSubFieldEditorBean(ob); populateSubFieldEditorBean(ob);
} }
@ -66,12 +70,13 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
e.setAllowBlank(this.allowBlankCheckBox.isSelected()); e.setAllowBlank(this.allowBlankCheckBox.isSelected());
e.setErrorMessage(this.errorMsgTextField.getText()); e.setErrorMessage(this.errorMsgTextField.getText());
e.setFontSize((int)fontSizePane.getValue()); e.setFontSize((int)fontSizePane.getValue());
e.setLabelName(labelNameTextField.getText());
return e; return e;
} }
protected void initErrorMsgPane() { protected void initErrorMsgPane() {
// 错误信息 // 错误信息
errorMsgTextField = new UIPropertyTextField(); errorMsgTextField = new UITextField();
// // richer:主要为了方便查看比较长的错误信息 // // richer:主要为了方便查看比较长的错误信息
errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {

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

@ -5,7 +5,7 @@ import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -18,7 +18,7 @@ import java.awt.*;
import java.util.List; import java.util.List;
public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> { public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
private UIPropertyTextField srcTextField; private UITextField srcTextField;
private ReportletParameterViewPane parameterViewPane; private ReportletParameterViewPane parameterViewPane;
private UICheckBox horizontalCheck; private UICheckBox horizontalCheck;
private UICheckBox verticalCheck; private UICheckBox verticalCheck;
@ -44,7 +44,7 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
Component[][] coms = { Component[][] coms = {
{ horizontalCheck, null }, { horizontalCheck, null },
{ verticalCheck, null }, { verticalCheck, null },
{ new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UIPropertyTextField() }, { new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField() },
{ new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } }; { new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } };
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, LayoutConstants.VGAP_SMALL, 5); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5);

90
designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java

@ -4,13 +4,13 @@ import com.fr.design.designer.creator.XCreator;
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.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.NumberEditor; import com.fr.form.ui.NumberEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.third.fr.pdf.layout.border.Border;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -24,6 +24,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
public NumberEditorDefinePane(XCreator xCreator){ public NumberEditorDefinePane(XCreator xCreator){
super(xCreator); super(xCreator);
} }
private FormWidgetValuePane formWidgetValuePane; private FormWidgetValuePane formWidgetValuePane;
/** /**
* *
@ -37,23 +38,21 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
private SpinnerNumberModel maxValueModel; private SpinnerNumberModel maxValueModel;
private UIBasicSpinner minValueSpinner; private UIBasicSpinner minValueSpinner;
private SpinnerNumberModel minValueModel; private SpinnerNumberModel minValueModel;
private com.fr.design.editor.editor.IntegerEditor decimalLength; private UISpinner decimalLength;
private JPanel limitNumberPane; private JPanel limitNumberPane;
private WaterMarkDictPane waterMarkDictPane; private WaterMarkDictPane waterMarkDictPane;
private ActionListener actionListener1; private ActionListener allowDecimalsListener;
private ActionListener actionListener2;
private ActionListener allowNegativeListener ;
private ActionListener actionListener3; public ActionListener setMaxListener;
private ActionListener setMinListener;
private ActionListener actionListener4 ; private ChangeListener maxValueChangeListener;
private ChangeListener changeListener1; private ChangeListener minValueChangeListener;
private ChangeListener changeListener2 ;
public NumberEditorDefinePane() { public NumberEditorDefinePane() {
super(); super();
@ -73,13 +72,14 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
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_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane} new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}
}; };
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p};
double[] columnSize = {p,f}; double[] columnSize = {p,f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1}}; int[][] rowCount = {{1, 1}, {1, 3},{1, 1},{1, 1}};
JPanel advancePane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel advancePane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
advancePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); advancePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
@ -88,17 +88,19 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
} }
private void initListeners(){ private void initListeners(){
actionListener1 = new ActionListener() { allowDecimalsListener = new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (allowDecimalsCheckBox.isSelected()) { if (allowDecimalsCheckBox.isSelected()) {
limitNumberPane.setVisible(true); limitNumberPane.setVisible(true);
limitNumberPane.setPreferredSize(new Dimension(215,20));
} else { } else {
limitNumberPane.setVisible(false); limitNumberPane.setVisible(false);
limitNumberPane.setPreferredSize(new Dimension(0,0));
} }
} }
}; };
actionListener2 = new ActionListener() { allowNegativeListener = new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -125,7 +127,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
}; };
actionListener3 = new ActionListener() { setMaxListener = new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (setMaxValueCheckBox.isSelected()) { if (setMaxValueCheckBox.isSelected()) {
maxValueSpinner.setEnabled(true); maxValueSpinner.setEnabled(true);
@ -145,7 +147,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
}; };
actionListener4 = new ActionListener() { setMinListener = new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (setMinValueCheckBox.isSelected()) { if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setEnabled(true); minValueSpinner.setEnabled(true);
@ -164,7 +166,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
} }
}; };
changeListener1 = new ChangeListener() { maxValueChangeListener = new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
@ -176,7 +178,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
} }
}; };
changeListener2 = new ChangeListener() { minValueChangeListener = new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
@ -191,42 +193,42 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
public JPanel setValidatePane() { public JPanel setValidatePane() {
initListeners(); initListeners();
// super.addValidatePane();
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals")); this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals"));
this.decimalLength = new com.fr.design.editor.editor.IntegerEditor(); this.decimalLength = new UISpinner(0, Integer.MAX_VALUE, 1, 16);
this.decimalLength.setColumns(4);
allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.allowDecimalsCheckBox.addActionListener(actionListener1); this.allowDecimalsCheckBox.addActionListener(allowDecimalsListener);
this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative")); this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative"));
this.allowNegativeCheckBox.addActionListener(actionListener2); this.allowNegativeCheckBox.addActionListener(allowNegativeListener);
allowNegativeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowNegativeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false); this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false);
setMaxValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); setMaxValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
maxValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.maxValueSpinner); setNotAllowsInvalid(this.maxValueSpinner);
this.setMaxValueCheckBox.addActionListener(actionListener3); this.setMaxValueCheckBox.addActionListener(setMaxListener);
this.maxValueSpinner.addChangeListener(changeListener1); this.maxValueSpinner.addChangeListener(maxValueChangeListener);
this.setMinValueCheckBox = new UICheckBox(Inter.getLocText("Need_Min_Value"), false); this.setMinValueCheckBox = new UICheckBox(Inter.getLocText("Need_Min_Value"), false);
this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
minValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.minValueSpinner); setNotAllowsInvalid(this.minValueSpinner);
minValueSpinner.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); minValueSpinner.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.setMinValueCheckBox.addActionListener(actionListener4); this.setMinValueCheckBox.addActionListener(setMinListener);
this.minValueSpinner.addChangeListener(minValueChangeListener);
setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
UILabel numberLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Double", "Numbers"}));
limitNumberPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{numberLabel, decimalLength}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
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[]{allowDecimalsCheckBox, null }, new Component[]{allowDecimalsCheckBox, null },
new Component[]{new UILabel(Inter.getLocText(new String[]{"Double", "Numbers"})), decimalLength }, new Component[]{limitNumberPane, null},
new Component[]{allowNegativeCheckBox, null}, new Component[]{allowNegativeCheckBox, null},
new Component[]{setMaxValueCheckBox, maxValueSpinner}, new Component[]{setMaxValueCheckBox, maxValueSpinner},
new Component[]{setMinValueCheckBox, minValueSpinner}, new Component[]{setMinValueCheckBox, minValueSpinner},
@ -235,7 +237,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
double[] columnSize = {p,f}; double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}}; int[][] rowCount = {{1, 1},{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, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
return panel; return panel;
} }
@ -273,7 +275,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
minValueSpinner.setValue(new Double(e.getMinValue())); minValueSpinner.setValue(new Double(e.getMinValue()));
} }
formWidgetValuePane.populate(e); formWidgetValuePane.populate(e);
// this.regErrorMsgTextField.setText(e.getRegErrorMessage());
this.waterMarkDictPane.populate(e); this.waterMarkDictPane.populate(e);
} }
@ -284,7 +285,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
formWidgetValuePane.update(ob); formWidgetValuePane.update(ob);
ob.setAllowDecimals(allowDecimalsCheckBox.isSelected()); ob.setAllowDecimals(allowDecimalsCheckBox.isSelected());
if (allowDecimalsCheckBox.isSelected()) { if (allowDecimalsCheckBox.isSelected()) {
ob.setMaxDecimalLength(this.decimalLength.getValue()); ob.setMaxDecimalLength((int)this.decimalLength.getValue());
} }
ob.setAllowNegative(allowNegativeCheckBox.isSelected()); ob.setAllowNegative(allowNegativeCheckBox.isSelected());
@ -306,20 +307,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
return ob; return ob;
} }
private void checkVisible() {
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setEnabled(true);
} else {
minValueSpinner.setEnabled(false);
}
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setEnabled(true);
} else {
minValueSpinner.setEnabled(false);
}
}
private void setNotAllowsInvalid(UIBasicSpinner jspinner) { private void setNotAllowsInvalid(UIBasicSpinner jspinner) {
JComponent editor = jspinner.getEditor(); JComponent editor = jspinner.getEditor();
if (editor instanceof UIBasicSpinner.DefaultEditor) { if (editor instanceof UIBasicSpinner.DefaultEditor) {
@ -331,4 +318,15 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
} }
} }
public Object getValue(UIBasicSpinner jspinner){
JComponent editor = jspinner.getEditor();
if (editor instanceof UIBasicSpinner.DefaultEditor) {
JFormattedTextField ftf = ((UIBasicSpinner.DefaultEditor) editor).getTextField();
ftf.setColumns(10);
JFormattedTextField.AbstractFormatter formatter = ftf.getFormatter();
return ftf.getValue();
}
return null;
}
} }

11
designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java

@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.frpane.RegPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -18,7 +18,7 @@ import java.awt.event.KeyEvent;
public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor> { public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor> {
protected RegPane regPane; protected RegPane regPane;
private UIPropertyTextField waterMarkDictPane; private UITextField waterMarkDictPane;
FormWidgetValuePane formWidgetValuePane; FormWidgetValuePane formWidgetValuePane;
public TextFieldEditorDefinePane(XCreator xCreator) { public TextFieldEditorDefinePane(XCreator xCreator) {
@ -47,7 +47,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
} }
}; };
regPane.addPhoneRegListener(pl); regPane.addPhoneRegListener(pl);
waterMarkDictPane = new UIPropertyTextField(); waterMarkDictPane = new UITextField();
waterMarkDictPane.addKeyListener(new KeyAdapter() { waterMarkDictPane.addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) { public void keyTyped(KeyEvent e) {
regPane.removePhoneRegListener(pl); regPane.removePhoneRegListener(pl);
@ -69,13 +69,14 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
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_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value"), SwingConstants.LEFT), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value"), SwingConstants.LEFT), formWidgetValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark"), SwingConstants.LEFT), waterMarkDictPane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark"), SwingConstants.LEFT), waterMarkDictPane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size"), SwingConstants.LEFT), fontSizePane} new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size"), SwingConstants.LEFT), fontSizePane}
}; };
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p};
double[] columnSize = {p,f}; double[] columnSize = {p,f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1}}; int[][] rowCount = {{1, 1},{1, 3},{1, 1},{1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 10); final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 10);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));

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

@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.form.ui.TreeEditor; import com.fr.form.ui.TreeEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -11,14 +11,14 @@ import java.awt.*;
public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane { public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane {
protected UIPropertyTextField waterMarkDictPane; protected UITextField waterMarkDictPane;
public TreeComboBoxEditorDefinePane(XCreator xCreator) { public TreeComboBoxEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
} }
public Component[] createWaterMarkPane(){ public Component[] createWaterMarkPane(){
waterMarkDictPane = new UIPropertyTextField(); waterMarkDictPane = new UITextField();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}; return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane};
} }

6
designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java

@ -1,6 +1,6 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.WaterMark; import com.fr.form.ui.WaterMark;
@ -8,12 +8,12 @@ import javax.swing.*;
public class WaterMarkDictPane extends JPanel{ public class WaterMarkDictPane extends JPanel{
private UIPropertyTextField waterMarkTextField; private UITextField waterMarkTextField;
public WaterMarkDictPane() { public WaterMarkDictPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0,0,0,0)); this.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
waterMarkTextField = new UIPropertyTextField(); waterMarkTextField = new UITextField();
this.add(waterMarkTextField); this.add(waterMarkTextField);
} }

5
designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java

@ -38,14 +38,15 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
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_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictionaryEditor}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictionaryEditor},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_FRFont")), fontSizePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_FRFont")), fontSizePane},
new Component[]{buttonGroupDictPane, null} new Component[]{buttonGroupDictPane, null}
}; };
double[] rowSize = {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}}; int[][] rowCount = {{1, 1}, {1, 3},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
advancePane.add(panel, BorderLayout.NORTH); advancePane.add(panel, BorderLayout.NORTH);

Loading…
Cancel
Save