From 80ea9bb8435ea1e6605afe1701cc8360f43186d0 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 7 Jul 2020 11:09:10 +0800 Subject: [PATCH 01/23] =?UTF-8?q?REPORT-32427=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=93=8D=E4=BD=9C=E5=86=B3=E7=AD=96=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?TAB=E5=9D=97=EF=BC=8C=E5=87=BA=E7=8E=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapters/layout/FRFitLayoutAdapter.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java index f2156e861e..93da3d04cf 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java @@ -114,6 +114,15 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { XCreator creator = (XCreator) container.getComponent(i); creator.updateChildBound(minHeight); creator.setBackupBound(creator.getBounds()); + //tab布局用到 + ArrayList childrenList = creator.getTargetChildrenList(); + for (int j = 0; j < childrenList.size(); j++) { + XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList.get(j); + for (int m = 0; m < tabLayout.getComponentCount(); m++) { + XCreator childCreator = tabLayout.getXCreator(m); + childCreator.setBackupBound(childCreator.getBounds()); + } + } } } @@ -1039,15 +1048,22 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList.get(j); tabLayout.setBackupBound(tabLayout.getBounds()); int refSize = isHor ? tabLayout.getWidth() : tabLayout.getHeight(); - double percent = (double) offset / refSize; + //double percent = (double) offset / refSize; + double percent = offset / (double) (refSize - offset); if (percent < 0 && !tabLayout.canReduce(percent)) { return; } - setAdjustedSize(tabLayout, offset, isHor); + //setAdjustedSize(tabLayout, offset, isHor); +// for (int m = 0; m < tabLayout.getComponentCount(); m++) { +// XCreator childCreator = tabLayout.getXCreator(m); +// WAbsoluteLayout.BoundsWidget wgt = (WAbsoluteLayout.BoundsWidget) tabLayout.toData().getBoundsWidget(childCreator.toData()); +// wgt.setBounds(tabLayout.getComponent(m).getBounds()); +// } for (int m = 0; m < tabLayout.getComponentCount(); m++) { XCreator childCreator = tabLayout.getXCreator(m); WAbsoluteLayout.BoundsWidget wgt = (WAbsoluteLayout.BoundsWidget) tabLayout.toData().getBoundsWidget(childCreator.toData()); - wgt.setBounds(tabLayout.getComponent(m).getBounds()); + wgt.setBounds(childCreator.getBackupBound()); + wgt.setBackupBounds(childCreator.getBackupBound()); } adjustCreatorsSize(percent, tabLayout, isHor); } From f02f80d88f1e6e7701b0be0f56b3d33aeb00836c Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 7 Jul 2020 11:27:17 +0800 Subject: [PATCH 02/23] =?UTF-8?q?REPORT-32427=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=93=8D=E4=BD=9C=E5=86=B3=E7=AD=96=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?TAB=E5=9D=97=EF=BC=8C=E5=87=BA=E7=8E=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/beans/adapters/layout/FRFitLayoutAdapter.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java index 93da3d04cf..dfb4d94090 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java @@ -1048,17 +1048,10 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList.get(j); tabLayout.setBackupBound(tabLayout.getBounds()); int refSize = isHor ? tabLayout.getWidth() : tabLayout.getHeight(); - //double percent = (double) offset / refSize; double percent = offset / (double) (refSize - offset); if (percent < 0 && !tabLayout.canReduce(percent)) { return; } - //setAdjustedSize(tabLayout, offset, isHor); -// for (int m = 0; m < tabLayout.getComponentCount(); m++) { -// XCreator childCreator = tabLayout.getXCreator(m); -// WAbsoluteLayout.BoundsWidget wgt = (WAbsoluteLayout.BoundsWidget) tabLayout.toData().getBoundsWidget(childCreator.toData()); -// wgt.setBounds(tabLayout.getComponent(m).getBounds()); -// } for (int m = 0; m < tabLayout.getComponentCount(); m++) { XCreator childCreator = tabLayout.getXCreator(m); WAbsoluteLayout.BoundsWidget wgt = (WAbsoluteLayout.BoundsWidget) tabLayout.toData().getBoundsWidget(childCreator.toData()); From 197cb420144c5ec4825ff66fb3b8663166670f9d Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 8 Jul 2020 17:37:02 +0800 Subject: [PATCH 03/23] =?UTF-8?q?REPORT-34465=20=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E9=A1=B5=E9=9D=A2=E6=97=A0=E6=B3=95=E5=85=B3?= =?UTF-8?q?=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/preview/PreviewTableModel.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java index 575ba43f5b..46706cf591 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java @@ -17,6 +17,10 @@ import javax.swing.table.AbstractTableModel; * 这个TableModel主要是预览数据的. 字段TableData必须转化为内置的 */ public class PreviewTableModel extends AbstractTableModel { + + private static final int LEN_LIMIT = 1000; + private static final String THREE_DOT = "..."; + private DataModel dataModel; private String erroMessage = null; @@ -127,11 +131,21 @@ public class PreviewTableModel extends AbstractTableModel { public Object getValueAt(int row, int column) { try { - return dataModel.getValueAt(row, column); + Object value = dataModel.getValueAt(row, column); + if (value != null) { + String strValue = value.toString(); + // 字符长度过长 swing会卡住一会 + // 同时设计器内预览展示也不需要展示太长的字符 + if (strValue.length() > LEN_LIMIT) { + strValue = strValue.substring(0, LEN_LIMIT) + THREE_DOT; + return strValue; + } + } + return value; } catch (TableDataException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); DesignUtils.errorMessage(e.getMessage()); - return ""; + return StringUtils.EMPTY; } } From 1d6ebdaaaab3eaf5c0c46ce7828274dabbe65088 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 9 Jul 2020 13:52:45 +0800 Subject: [PATCH 04/23] =?UTF-8?q?REPORT-34962=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E4=B8=8D=E7=82=B9=E5=87=BB=E5=88=B7=E6=96=B0=E4=B9=9F?= =?UTF-8?q?=E8=83=BD=E6=98=BE=E7=A4=BA=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/tabledata/tabledatapane/DBTableDataPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java index 6ad281e268..6f0e89ff45 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java @@ -29,7 +29,6 @@ import com.fr.design.gui.itableeditorpane.UITableEditorPane; import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.gui.syntax.ui.rtextarea.RTextScrollPane; -import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.ToolBarDef; @@ -316,7 +315,8 @@ public class DBTableDataPane extends AbstractTableDataPane { // com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connect_SQL_Cannot_Null") + "."); } } - + // 保存前 刷新下参数列表 保证获取到最新的参数 + refresh(); List parameterList = editorPane.update(); Parameter[] parameters = parameterList.toArray(new Parameter[parameterList.size()]); From a634abddfd7ccda7700ee84a0b1cbbd8ded4947d Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 9 Jul 2020 14:28:00 +0800 Subject: [PATCH 05/23] =?UTF-8?q?REPORT-31546=20=E5=85=AC=E5=BC=8F?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E7=9A=84=E8=AF=B4=E6=98=8E=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=81=B6=E5=B0=94=E4=BC=9A=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/formula/FormulaPane.java | 97 ++++++++++++------- 1 file changed, 62 insertions(+), 35 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index 9259248ac6..305b580d01 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -246,44 +246,71 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { } public class DoubleClick extends MouseAdapter { + String singlePressContent; + + String doublePressContent; + @Override - public void mouseClicked(MouseEvent e) { + public void mousePressed(MouseEvent e) { int index = tipsList.getSelectedIndex(); if (index != -1) { - String currentLineContent = (String) listModel.getElementAt(index); - if (e.getClickCount() == 2) { - if (ifHasBeenWriten == 0) { - formulaTextArea.setForeground(Color.black); - formulaTextArea.setText(""); + if (e.getClickCount() == 1) { + singlePressContent = (String) listModel.getElementAt(index); + } else if (e.getClickCount() == 2) { + doublePressContent = (String) listModel.getElementAt(index); + } + } + } + + @Override + public void mouseReleased(MouseEvent e) { + int index = tipsList.getSelectedIndex(); + if (index != -1) { + if (e.getClickCount() == 1) { + if (ComparatorUtils.equals((String) listModel.getElementAt(index), singlePressContent)) { + singleClickActuator(singlePressContent); } - formulaTextArea.setForeground(Color.black); - currentPosition = formulaTextArea.getCaretPosition(); - String output = currentLineContent + "()"; - String textAll = formulaTextArea.getText(); - String textReplaced; - int position = 0; - if (insertPosition <= currentPosition) { - textReplaced = textAll.substring(0, insertPosition) + output + textAll.substring(currentPosition); - position = insertPosition + output.length() - 1; - } else { - textReplaced = textAll.substring(0, currentPosition) + output + textAll.substring(insertPosition); - position = currentPosition + output.length() - 1; + } else if (e.getClickCount() == 2) { + if (ComparatorUtils.equals((String) listModel.getElementAt(index), doublePressContent)) { + doubleClickActuator(doublePressContent); } - formulaTextArea.setText(textReplaced); - formulaTextArea.requestFocusInWindow(); - formulaTextArea.setCaretPosition(position); - insertPosition = position; - ifHasBeenWriten = 1; - listModel.removeAllElements(); - } else if (e.getClickCount() == 1) { - refreshDescriptionTextArea(currentLineContent); - - formulaTextArea.requestFocusInWindow(); - fixFunctionNameList(); } } } + + private void singleClickActuator(String currentLineContent) { + refreshDescriptionTextArea(currentLineContent); + + formulaTextArea.requestFocusInWindow(); + fixFunctionNameList(); + } + + private void doubleClickActuator(String currentLineContent) { + if (ifHasBeenWriten == 0) { + formulaTextArea.setForeground(Color.black); + formulaTextArea.setText(""); + } + formulaTextArea.setForeground(Color.black); + currentPosition = formulaTextArea.getCaretPosition(); + String output = currentLineContent + "()"; + String textAll = formulaTextArea.getText(); + String textReplaced; + int position = 0; + if (insertPosition <= currentPosition) { + textReplaced = textAll.substring(0, insertPosition) + output + textAll.substring(currentPosition); + position = insertPosition + output.length() - 1; + } else { + textReplaced = textAll.substring(0, currentPosition) + output + textAll.substring(insertPosition); + position = currentPosition + output.length() - 1; + } + formulaTextArea.setText(textReplaced); + formulaTextArea.requestFocusInWindow(); + formulaTextArea.setCaretPosition(position); + insertPosition = position; + ifHasBeenWriten = 1; + listModel.removeAllElements(); + } } @Override @@ -583,10 +610,10 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { FineJOptionPane.showMessageDialog( FormulaPane.this, /* - * alex:仅仅只需要根据expression是否为null作合法性判断 - * 不需要eval - * TODO 但有个问题,有些函数的参数个数是有规定的,何以判别之 - */ + * alex:仅仅只需要根据expression是否为null作合法性判断 + * 不需要eval + * TODO 但有个问题,有些函数的参数个数是有规定的,何以判别之 + */ (expression != null ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaD_Valid_Formula") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaD_Invalid_Formula")) + ".", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.INFORMATION_MESSAGE); @@ -780,13 +807,13 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { public void valueChanged(TreeSelectionEvent e) { DefaultMutableTreeNode selectedTreeNode = (DefaultMutableTreeNode) variablesTree.getLastSelectedPathComponent(); Object selectedValue = selectedTreeNode.getUserObject(); - Object selectedParentValue = ((DefaultMutableTreeNode)selectedTreeNode.getParent()).getUserObject(); + Object selectedParentValue = ((DefaultMutableTreeNode) selectedTreeNode.getParent()).getUserObject(); if (selectedValue == null) { return; } - if (selectedValue instanceof TextUserObject) { + if (selectedValue instanceof TextUserObject) { //有公式说明的条件:1.属于TextUserObject 2.parent是系统参数 if (ComparatorUtils.equals(((TextFolderUserObject) selectedParentValue).getText(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaPane_Variables"))) { From 5251ff115566fbd597a28f7f4b5115efa5042c4d Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 10 Jul 2020 10:49:29 +0800 Subject: [PATCH 06/23] =?UTF-8?q?REPORT-34596=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=9C=8D=E5=8A=A1=E5=99=A8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=AD=97=E6=AE=B5=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/server/GlobalTableDataAction.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java b/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java index 0e9db97c7a..627a862fb6 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java @@ -5,7 +5,6 @@ package com.fr.design.actions.server; import com.fr.base.BaseUtils; import com.fr.base.TableData; -import com.fr.config.Configuration; import com.fr.design.DesignModelAdapter; import com.fr.design.actions.UpdateAction; import com.fr.design.data.DesignTableDataManager; @@ -18,12 +17,10 @@ import com.fr.design.gui.NameInspector; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrame; import com.fr.design.menu.MenuKeySet; -import com.fr.file.ProcedureConfig; import com.fr.file.TableDataConfig; import com.fr.transaction.CallBackAdaptor; import com.fr.transaction.Configurations; -import com.fr.transaction.Worker; import com.fr.transaction.WorkerFacade; import javax.swing.KeyStroke; @@ -95,6 +92,10 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS } DesignTableDataManager.clearGlobalDs(); + // 保存时 移除服务器数据集列名缓存 + for (String name : tableDataConfig.getTableDatas().keySet()) { + DesignTableDataManager.removeSelectedColumnNames(name); + } Configurations.modify(new WorkerFacade(TableDataConfig.class) { @Override From 79c961546ce0cfaea879d0408fce3b1a1c382a44 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Tue, 14 Jul 2020 11:51:10 +0800 Subject: [PATCH 07/23] =?UTF-8?q?REPORT-33103=20=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E6=97=B6=E5=B0=86=E7=94=A8=E6=9D=A5?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E7=BD=91=E6=A0=BC=E7=9A=84=E7=9F=A9=E5=BD=A2?= =?UTF-8?q?=E7=9A=84height=E5=87=8F=E5=B0=8F0.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-realize/src/main/java/com/fr/grid/GridUI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/grid/GridUI.java b/designer-realize/src/main/java/com/fr/grid/GridUI.java index 62927647aa..5f5476511b 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridUI.java +++ b/designer-realize/src/main/java/com/fr/grid/GridUI.java @@ -481,7 +481,7 @@ public class GridUI extends ComponentUI { // peter:tmpRectangle2D_3只是一个临时的Rectangle2D,由于后面不少地方需要用到这个矩形 this.cell_back_rect.setRect(0, 0, this.tmpRectangle.getWidth() - 1, - this.tmpRectangle.getHeight() - 1); + this.tmpRectangle.getHeight() - 1.5); // peter:对于合并的单元格,需要先白色的背景来清除背景. if (tmpCellElement.getColumnSpan() > 1 || tmpCellElement.getRowSpan() > 1) { // REPORT-23492 要看下是否设置了纸张背景 如果设置了按照背景来画 From 4ca1e7cdfb2eda26dfca0523018d0838863caa5d Mon Sep 17 00:00:00 2001 From: pengda Date: Wed, 15 Jul 2020 09:51:04 +0800 Subject: [PATCH 08/23] =?UTF-8?q?REPORT-34737=20=E7=BB=9D=E5=AF=B9?= =?UTF-8?q?=E7=94=BB=E5=B8=83=E4=B8=AD=E7=9A=84=E7=BB=84=E4=BB=B6=E5=8F=AF?= =?UTF-8?q?=E8=A7=86=E7=8A=B6=E6=80=81=E4=B8=8B=E7=A7=BB=E5=88=B0=E4=BE=A7?= =?UTF-8?q?=E8=BE=B9=E5=90=8E=E7=BB=84=E4=BB=B6=E7=A7=BB=E5=87=BA=E7=94=BB?= =?UTF-8?q?=E5=B8=83=E5=8F=AF=E8=A7=81=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/FRAbsoluteLayoutAdapter.java | 5 +- .../layout/FRAbsoluteLayoutAdapterTest.java | 46 +++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 designer-form/src/test/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapterTest.java diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java index 4bc0f22e49..0c6adeb090 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java @@ -310,14 +310,15 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { public void fix(XCreator creator ,int x, int y) { int height = creator.getHeight(); int width = creator.getWidth(); + //坐标小于0时让它还在容器内 if (x < 0) { - x = container.getX(); + x = 0; } else if (x + creator.getWidth() > container.getWidth()) { x = container.getWidth() - width; } if (y < 0) { - y = container.getY(); + y = 0; } else if (y + creator.getHeight() > container.getHeight()) { y = container.getHeight() - height; } diff --git a/designer-form/src/test/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapterTest.java b/designer-form/src/test/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapterTest.java new file mode 100644 index 0000000000..4d378f6414 --- /dev/null +++ b/designer-form/src/test/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapterTest.java @@ -0,0 +1,46 @@ +package com.fr.design.designer.beans.adapters.layout; + +import com.fr.config.dao.DaoContext; +import com.fr.config.dao.impl.LocalClassHelperDao; +import com.fr.config.dao.impl.LocalEntityDao; +import com.fr.config.dao.impl.LocalXmlEntityDao; +import com.fr.design.designer.creator.XButton; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XWAbsoluteLayout; +import com.fr.form.ui.Button; +import com.fr.form.ui.container.WAbsoluteLayout; +import java.awt.Dimension; +import junit.framework.TestCase; +import org.junit.Assert; + +public class FRAbsoluteLayoutAdapterTest extends TestCase { + @Override + protected void setUp() throws Exception { + DaoContext.setEntityDao(new LocalEntityDao()); + DaoContext.setClassHelperDao(new LocalClassHelperDao()); + DaoContext.setXmlEntityDao(new LocalXmlEntityDao()); + } + + public void testFix(){ + WAbsoluteLayout layout =new WAbsoluteLayout(); + XWAbsoluteLayout container =new XWAbsoluteLayout(layout); + container.setBounds(0,320,400,160); + FRAbsoluteLayoutAdapter frAbsoluteLayoutAdapter = new FRAbsoluteLayoutAdapter(container); + XCreator button = new XButton(new Button(),new Dimension(88,40)); + + frAbsoluteLayoutAdapter.fix(button,-1,-1); + Assert.assertEquals(0,button.getX()); + Assert.assertEquals(0,button.getY()); + + frAbsoluteLayoutAdapter.fix(button,350,200); + Assert.assertEquals(312,button.getX()); + Assert.assertEquals(120,button.getY()); + } + + @Override + protected void tearDown() throws Exception { + DaoContext.setEntityDao(null); + DaoContext.setClassHelperDao(null); + DaoContext.setXmlEntityDao(null); + } +} From 0cf0846a60f34a60221a6c7de9d22b90fef8068d Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Fri, 17 Jul 2020 10:22:48 +0800 Subject: [PATCH 09/23] =?UTF-8?q?REPORT-35259=20=E5=BD=93=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=A0=8F=E5=8F=82=E6=95=B0=E8=BF=87=E5=A4=9A=E6=97=B6?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=9C=89=E4=B8=8B=E6=8B=89=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-form/src/main/java/com/fr/design/mainframe/JForm.java | 1 + .../java/com/fr/design/parameter/ParameterPropertyPane.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 2fbccb1cd3..7cdd7fd600 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -371,6 +371,7 @@ public class JForm extends JTemplate implements BaseJForm Date: Fri, 17 Jul 2020 10:34:34 +0800 Subject: [PATCH 10/23] =?UTF-8?q?REPORT-35259=20=E5=BD=93=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=A0=8F=E5=8F=82=E6=95=B0=E8=BF=87=E5=A4=9A=E6=97=B6?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=9C=89=E4=B8=8B=E6=8B=89=E6=A1=86=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/formula/FormulaPane.java | 89 +++++++------------ 1 file changed, 31 insertions(+), 58 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index 305b580d01..3631fe3dae 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -246,70 +246,43 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { } public class DoubleClick extends MouseAdapter { - String singlePressContent; - - String doublePressContent; - @Override - public void mousePressed(MouseEvent e) { + public void mouseClicked(MouseEvent e) { int index = tipsList.getSelectedIndex(); if (index != -1) { - if (e.getClickCount() == 1) { - singlePressContent = (String) listModel.getElementAt(index); - } else if (e.getClickCount() == 2) { - doublePressContent = (String) listModel.getElementAt(index); - } - } - } - - @Override - public void mouseReleased(MouseEvent e) { - int index = tipsList.getSelectedIndex(); - if (index != -1) { - if (e.getClickCount() == 1) { - if (ComparatorUtils.equals((String) listModel.getElementAt(index), singlePressContent)) { - singleClickActuator(singlePressContent); + String currentLineContent = (String) listModel.getElementAt(index); + if (e.getClickCount() == 2) { + if (ifHasBeenWriten == 0) { + formulaTextArea.setForeground(Color.black); + formulaTextArea.setText(""); } - } else if (e.getClickCount() == 2) { - if (ComparatorUtils.equals((String) listModel.getElementAt(index), doublePressContent)) { - doubleClickActuator(doublePressContent); + formulaTextArea.setForeground(Color.black); + currentPosition = formulaTextArea.getCaretPosition(); + String output = currentLineContent + "()"; + String textAll = formulaTextArea.getText(); + String textReplaced; + int position = 0; + if (insertPosition <= currentPosition) { + textReplaced = textAll.substring(0, insertPosition) + output + textAll.substring(currentPosition); + position = insertPosition + output.length() - 1; + } else { + textReplaced = textAll.substring(0, currentPosition) + output + textAll.substring(insertPosition); + position = currentPosition + output.length() - 1; } - } - } - } - - private void singleClickActuator(String currentLineContent) { - refreshDescriptionTextArea(currentLineContent); - - formulaTextArea.requestFocusInWindow(); - fixFunctionNameList(); - } + formulaTextArea.setText(textReplaced); + formulaTextArea.requestFocusInWindow(); + formulaTextArea.setCaretPosition(position); + insertPosition = position; + ifHasBeenWriten = 1; + listModel.removeAllElements(); + } else if (e.getClickCount() == 1) { + refreshDescriptionTextArea(currentLineContent); - private void doubleClickActuator(String currentLineContent) { - if (ifHasBeenWriten == 0) { - formulaTextArea.setForeground(Color.black); - formulaTextArea.setText(""); - } - formulaTextArea.setForeground(Color.black); - currentPosition = formulaTextArea.getCaretPosition(); - String output = currentLineContent + "()"; - String textAll = formulaTextArea.getText(); - String textReplaced; - int position = 0; - if (insertPosition <= currentPosition) { - textReplaced = textAll.substring(0, insertPosition) + output + textAll.substring(currentPosition); - position = insertPosition + output.length() - 1; - } else { - textReplaced = textAll.substring(0, currentPosition) + output + textAll.substring(insertPosition); - position = currentPosition + output.length() - 1; + formulaTextArea.requestFocusInWindow(); + fixFunctionNameList(); + } } - formulaTextArea.setText(textReplaced); - formulaTextArea.requestFocusInWindow(); - formulaTextArea.setCaretPosition(position); - insertPosition = position; - ifHasBeenWriten = 1; - listModel.removeAllElements(); } } @@ -807,13 +780,13 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { public void valueChanged(TreeSelectionEvent e) { DefaultMutableTreeNode selectedTreeNode = (DefaultMutableTreeNode) variablesTree.getLastSelectedPathComponent(); Object selectedValue = selectedTreeNode.getUserObject(); - Object selectedParentValue = ((DefaultMutableTreeNode) selectedTreeNode.getParent()).getUserObject(); + Object selectedParentValue = ((DefaultMutableTreeNode)selectedTreeNode.getParent()).getUserObject(); if (selectedValue == null) { return; } - if (selectedValue instanceof TextUserObject) { + if (selectedValue instanceof TextUserObject) { //有公式说明的条件:1.属于TextUserObject 2.parent是系统参数 if (ComparatorUtils.equals(((TextFolderUserObject) selectedParentValue).getText(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaPane_Variables"))) { From 4e743d189d7f352c97a31e60d973c81c6598825b Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Fri, 17 Jul 2020 10:37:58 +0800 Subject: [PATCH 11/23] =?UTF-8?q?REPORT-35259=20=E5=BD=93=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=A0=8F=E5=8F=82=E6=95=B0=E8=BF=87=E5=A4=9A=E6=97=B6?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=9C=89=E4=B8=8B=E6=8B=89=E6=A1=86=20?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/formula/FormulaPane.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index 3631fe3dae..9259248ac6 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -583,10 +583,10 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { FineJOptionPane.showMessageDialog( FormulaPane.this, /* - * alex:仅仅只需要根据expression是否为null作合法性判断 - * 不需要eval - * TODO 但有个问题,有些函数的参数个数是有规定的,何以判别之 - */ + * alex:仅仅只需要根据expression是否为null作合法性判断 + * 不需要eval + * TODO 但有个问题,有些函数的参数个数是有规定的,何以判别之 + */ (expression != null ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaD_Valid_Formula") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaD_Invalid_Formula")) + ".", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.INFORMATION_MESSAGE); From a6fcd2b1a5de05c2c5bf0d62a9ecc33b8481a0fa Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 17 Jul 2020 11:35:24 +0800 Subject: [PATCH 12/23] =?UTF-8?q?REPORT-33194=20sql=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=AD=97=E6=AE=B5=E9=A2=84=E8=A7=88=E6=97=A0?= =?UTF-8?q?=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/actions/TableDataSourceAction.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java b/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java index 600f9721ed..a0ca4d9558 100644 --- a/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java @@ -15,6 +15,7 @@ import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import java.util.HashMap; +import java.util.Iterator; import java.util.Map; /* @@ -51,6 +52,10 @@ public class TableDataSourceAction extends TemplateComponentAction iterator = tds.getTableDataNameIterator(); + while (iterator.hasNext()) { + DesignTableDataManager.removeSelectedColumnNames(iterator.next()); + } DesignModelAdapter.getCurrentModelAdapter().renameTableData(tableDataPane.getDsNameChangedMap()); tableDataPane.update(tds); TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()); From ca81c1854a569157135f9538f747ead3bdc72193 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Fri, 24 Jul 2020 15:38:26 +0800 Subject: [PATCH 13/23] =?UTF-8?q?REPORT-30352=20=E5=9C=A8=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E5=9F=9F=E7=9A=84init=E6=96=B9=E6=B3=95=E9=87=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0setMargin()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java b/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java index 01c9238c66..50bec254fd 100644 --- a/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java +++ b/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java @@ -645,6 +645,7 @@ int currentCaretY; // Used to know when to rehighlight current line. setTabsEmulated(false); // Stuff needed by the caret listener below. + setMargin(getInsets()); previousCaretY = currentCaretY = getInsets().top; // Stuff to highlight the current line. From 504e171e1069a15e00072e259ea77aa845109a4a Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Fri, 31 Jul 2020 17:43:52 +0800 Subject: [PATCH 14/23] =?UTF-8?q?REPORT-30352=20=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E5=B0=86RTextAreaBase=E7=9A=84border=E7=9A=84=E5=80=BC?= =?UTF-8?q?=E6=94=B9=E4=B8=BA0=EF=BC=8C=E4=BB=A5=E5=92=8C8.0=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=A4=96=E8=A7=82=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java b/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java index 50bec254fd..708888dba6 100644 --- a/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java +++ b/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java @@ -22,9 +22,11 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import javax.swing.JTextArea; +import javax.swing.border.EmptyBorder; import javax.swing.event.CaretEvent; import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.TextUI; +import javax.swing.plaf.basic.BasicBorders; import javax.swing.text.AbstractDocument; import javax.swing.text.BadLocationException; import javax.swing.text.Caret; @@ -645,7 +647,7 @@ int currentCaretY; // Used to know when to rehighlight current line. setTabsEmulated(false); // Stuff needed by the caret listener below. - setMargin(getInsets()); + setBorder(new BasicBorders.MarginBorder()); previousCaretY = currentCaretY = getInsets().top; // Stuff to highlight the current line. From af1a3184ca257795f1acad72f411820a15aab963 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Fri, 31 Jul 2020 17:46:09 +0800 Subject: [PATCH 15/23] =?UTF-8?q?REPORT-30352=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E4=B8=8D=E9=9C=80=E8=A6=81=E7=9A=84import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java b/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java index 708888dba6..985a9527fa 100644 --- a/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java +++ b/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java @@ -22,7 +22,6 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import javax.swing.JTextArea; -import javax.swing.border.EmptyBorder; import javax.swing.event.CaretEvent; import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.TextUI; From 405197fcb487107a1c879824ebd1ee11735e9a20 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 4 Aug 2020 20:50:26 +0800 Subject: [PATCH 16/23] =?UTF-8?q?REPORT-35569=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=EF=BC=8C=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=8E=A7=E4=BB=B6=EF=BC=8C=E6=92=A4=E9=94=80?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=EF=BC=8C=E5=86=8D=E6=AC=A1=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=9A=84=E6=8E=A7=E4=BB=B6=E4=BC=9A=E7=A9=BA=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parameter/ParameterDesignerProvider.java | 2 +- .../form/parameter/FormParaDesigner.java | 9 ++++--- .../parameter/ParameterDefinitePane.java | 26 ++++++++++++++++--- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterDesignerProvider.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterDesignerProvider.java index abd27f89bf..e0b69fea05 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterDesignerProvider.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterDesignerProvider.java @@ -48,7 +48,7 @@ public interface ParameterDesignerProvider { boolean addingParameter2EditorWithQueryButton(Parameter parameter, int index); - void addingAllParameter2Editor(Parameter[] parameterArray, int currentIndex); + int addingAllParameter2Editor(Parameter[] parameterArray, int currentIndex); JPanel[] toolbarPanes4Form(); diff --git a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java index c72aa45128..b918850616 100644 --- a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java @@ -74,7 +74,7 @@ import java.util.List; public class FormParaDesigner extends FormDesigner implements ParameterDesignerProvider { private static final int NUM_IN_A_LINE = 4; private static final int H_COMPONENT_GAP = 165; - private static final int V_COMPONENT_GAP = 25; + public static final int V_COMPONENT_GAP = 25; private static final int FIRST_V_LOCATION = 35; private static final int FIRST_H_LOCATION = 90; private static final int SECOND_H_LOCATION = 170; @@ -637,9 +637,9 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP * * @param parameterArray 参数 c * @param currentIndex 位置 w - * @return 是否加入 s + * @return currentIndex的最新值 */ - public void addingAllParameter2Editor(Parameter[] parameterArray, int currentIndex) { + public int addingAllParameter2Editor(Parameter[] parameterArray, int currentIndex) { for (int i = 0; i < parameterArray.length; i++) { com.fr.form.ui.Label label = new com.fr.form.ui.Label(); label.setWidgetName("Label" + parameterArray[i].getName()); @@ -667,9 +667,10 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP XCreator xCreator = XCreatorUtils.createXCreator(formSubmitButton); if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * 3 + H_GAP, FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { - return; + currentIndex = ((int) Math.ceil((currentIndex + 1) / (double) NUM_IN_A_LINE)) * NUM_IN_A_LINE; } } + return currentIndex; } /** diff --git a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java index 13d53b5b25..74f1435a4d 100644 --- a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java +++ b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java @@ -17,6 +17,7 @@ import com.fr.design.designer.TargetComponent; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.form.parameter.FormParaDesigner; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.layout.FRGUIPaneFactory; @@ -30,6 +31,10 @@ import com.fr.design.menu.ShortCut; import com.fr.design.menu.ToolBarDef; import com.fr.design.module.DesignModuleFactory; import com.fr.design.style.background.BackgroundPane; +import com.fr.form.main.parameter.FormParameterUI; +import com.fr.form.ui.Widget; +import com.fr.form.ui.container.WAbsoluteLayout; +import com.fr.form.ui.container.WLayout; import com.fr.log.FineLoggerFactory; import com.fr.main.parameter.ReportParameterAttr; import com.fr.main.parameter.TemplateParameterAttr; @@ -46,6 +51,7 @@ import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; +import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; @@ -249,6 +255,22 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus FineLoggerFactory.getLogger().error(e.getMessage(), e); } } + currentIndex = reportParameterAttr.getCurrentIndex(); + //因为以前的版本没有保存currentIndex,所以要计算currentIndex的值 + if (parameterUI != null && parameterUI instanceof FormParameterUI && currentIndex == 0) { + WLayout wLayout = ((FormParameterUI) parameterUI).getContainer(); + int widgetCount = wLayout.getWidgetCount(); + Rectangle endRec = null; + for (int i = 0; i < widgetCount; i++) { + Widget widget = wLayout.getWidget(i); + Rectangle tempRec = ((WAbsoluteLayout.BoundsWidget) widget).getBounds(); + if (endRec == null || tempRec.y > endRec.y) { + endRec = tempRec; + } + } + if (endRec != null) + currentIndex = (int) (Math.ceil(endRec.y / FormParaDesigner.V_COMPONENT_GAP)) * NUM_IN_A_LINE; + } paraDesignEditor.populate(parameterUI); @@ -268,8 +290,6 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus bridge.setBackground(reportParameterAttr.getBackground()); bridge.setUseParamsTemplate(reportParameterAttr.isUseParamsTemplate()); } - - currentIndex = reportParameterAttr.getCurrentIndex(); } @@ -438,7 +458,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus return; } - paraDesignEditor.addingAllParameter2Editor(parameterArray, currentIndex); + currentIndex = paraDesignEditor.addingAllParameter2Editor(parameterArray, currentIndex); parameterArray = null; refreshParameter(); From 9d434f6b36d2cb452d10a1187ea5fae7764397c7 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 5 Aug 2020 15:38:32 +0800 Subject: [PATCH 17/23] =?UTF-8?q?REPORT-36386=20=E8=87=AA=E9=80=82?= =?UTF-8?q?=E5=BA=94=E6=A8=A1=E6=9D=BF=E5=87=BA=E7=8E=B0=E4=B8=8D=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/designer/creator/XWFitLayout.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java index 2376ecc94a..3b671c2179 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java @@ -19,6 +19,7 @@ import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WLayout; import com.fr.form.ui.widget.CRBoundsWidget; +import com.fr.general.ComparatorUtils; import com.fr.general.FRLogger; import com.fr.general.FRScreen; import com.fr.stable.ArrayUtils; @@ -1125,7 +1126,12 @@ public class XWFitLayout extends XLayoutContainer { public Component getBottomComp(int x, int y, int h) { int val = getAcualInterval(); - return this.getComponentAt(x, y+h+default_Length+val); + Component comp = this.getComponentAt(x, y+h+default_Length+val); + if (ComparatorUtils.equals(this, comp)) { + // 如果获取组件等于自身 说明存在偏移 加上一个默认偏移量 + return this.getComponentAt(x + default_Length, y+h+default_Length+val); + } + return comp; } public Component getRightTopComp(int x, int y, int w) { From bf86c35f277a7a66b0b146c22a713a45f2ecc353 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 5 Aug 2020 16:22:32 +0800 Subject: [PATCH 18/23] =?UTF-8?q?REPORT-34847=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=9D=83=E9=99=90-=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9=E6=9D=83=E9=99=90=EF=BC=8C=E9=9C=80=E8=A6=81=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E8=BF=9E=E6=8E=A5=E6=89=8D=E8=83=BD=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/file/TemplateTreePane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java index 93001bde44..5041cc34a3 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java @@ -226,6 +226,8 @@ public class TemplateTreePane extends JPanel implements FileOperations { */ @Override public void refresh() { + // 刷新远程文件夹权限 + NodeAuthProcessor.getInstance().refresh(); reportletsTree.refresh(); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_File_Tree_Refresh_Successfully") + "!"); } From 3470b1c3730f4d512e822541b9c0bb935bb5e8ad Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 5 Aug 2020 20:02:03 +0800 Subject: [PATCH 19/23] =?UTF-8?q?REPORT-35569=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=EF=BC=8C=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=8E=A7=E4=BB=B6=EF=BC=8C=E6=92=A4=E9=94=80?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=EF=BC=8C=E5=86=8D=E6=AC=A1=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=9A=84=E6=8E=A7=E4=BB=B6=E4=BC=9A=E7=A9=BA=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parameter/ParameterDesignerProvider.java | 6 ++- .../form/parameter/FormParaDesigner.java | 45 ++++++++++++++++++- .../parameter/ParameterDefinitePane.java | 2 +- 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterDesignerProvider.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterDesignerProvider.java index e0b69fea05..efafa7cb2e 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterDesignerProvider.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterDesignerProvider.java @@ -48,7 +48,11 @@ public interface ParameterDesignerProvider { boolean addingParameter2EditorWithQueryButton(Parameter parameter, int index); - int addingAllParameter2Editor(Parameter[] parameterArray, int currentIndex); + void addingAllParameter2Editor(Parameter[] parameterArray, int currentIndex); + + default int addingAllParameter2EditorWithReturnValue(Parameter[] parameterArray, int currentIndex) { + return 0; + } JPanel[] toolbarPanes4Form(); diff --git a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java index b918850616..95fb284589 100644 --- a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java @@ -637,9 +637,50 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP * * @param parameterArray 参数 c * @param currentIndex 位置 w - * @return currentIndex的最新值 + * @return 是否加入 s + */ + public void addingAllParameter2Editor(Parameter[] parameterArray, int currentIndex) { + for (int i = 0; i < parameterArray.length; i++) { + com.fr.form.ui.Label label = new com.fr.form.ui.Label(); + label.setWidgetName("Label" + parameterArray[i].getName()); + label.setWidgetValue(new WidgetValue(parameterArray[i].getName() + ":")); + XCreator xCreator = XCreatorUtils.createXCreator(label); + + if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) + + FIRST_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { + break; + } + // 每行显示5组 + EditorHolder editor = new EditorHolder(parameterArray[i]); + editor.setWidgetName(parameterArray[i].getName()); + xCreator = XCreatorUtils.createXCreator(editor); + if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) + + SECOND_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { + break; + } + currentIndex++; + } + if (!isWithQueryButton()) { + FormSubmitButton formSubmitButton = new FormSubmitButton(); + formSubmitButton.setWidgetName("Search"); + formSubmitButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Query")); + XCreator xCreator = XCreatorUtils.createXCreator(formSubmitButton); + if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * 3 + H_GAP, FIRST_V_LOCATION + + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { + return; + } + } + } + + /** + * @Description: 添加所有的参数,并返回当前的currentIndex。此方法为addingAllParameter2Editor的兼容方法。 + * @param parameterArray 参数数组 + * @param currentIndex 添加所有参数前的index值 + * @return: 添加所有参数后的index值 + * @Author: Henry.Wang + * @date: 2020/8/5 19:40 */ - public int addingAllParameter2Editor(Parameter[] parameterArray, int currentIndex) { + public int addingAllParameter2EditorWithReturnValue(Parameter[] parameterArray, int currentIndex) { for (int i = 0; i < parameterArray.length; i++) { com.fr.form.ui.Label label = new com.fr.form.ui.Label(); label.setWidgetName("Label" + parameterArray[i].getName()); diff --git a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java index 74f1435a4d..11ae412ece 100644 --- a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java +++ b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java @@ -458,7 +458,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus return; } - currentIndex = paraDesignEditor.addingAllParameter2Editor(parameterArray, currentIndex); + currentIndex = paraDesignEditor.addingAllParameter2EditorWithReturnValue(parameterArray, currentIndex); parameterArray = null; refreshParameter(); From eb4e56f8e52d1c5a975d126d2b530d0a20270169 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 5 Aug 2020 20:35:16 +0800 Subject: [PATCH 20/23] =?UTF-8?q?=E6=97=A0jira=20=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E7=AD=89=E7=BA=A7=E8=B0=83=E5=88=B01.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 407f1fd17b..711751c9fb 100644 --- a/pom.xml +++ b/pom.xml @@ -28,8 +28,8 @@ maven-compiler-plugin 3.1 - 1.7 - 1.7 + 1.8 + 1.8 From d0622eae43b5a8dc64e4c66f82fdf9ffef23317b Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 5 Aug 2020 22:18:34 +0800 Subject: [PATCH 21/23] =?UTF-8?q?REPORT-35569=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=EF=BC=8C=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=8E=A7=E4=BB=B6=EF=BC=8C=E6=92=A4=E9=94=80?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=EF=BC=8C=E5=86=8D=E6=AC=A1=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=9A=84=E6=8E=A7=E4=BB=B6=E4=BC=9A=E7=A9=BA=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/parameter/FormParaDesigner.java | 35 ++----------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java index 95fb284589..8956125eb3 100644 --- a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java @@ -640,42 +640,13 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP * @return 是否加入 s */ public void addingAllParameter2Editor(Parameter[] parameterArray, int currentIndex) { - for (int i = 0; i < parameterArray.length; i++) { - com.fr.form.ui.Label label = new com.fr.form.ui.Label(); - label.setWidgetName("Label" + parameterArray[i].getName()); - label.setWidgetValue(new WidgetValue(parameterArray[i].getName() + ":")); - XCreator xCreator = XCreatorUtils.createXCreator(label); - - if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) - + FIRST_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { - break; - } - // 每行显示5组 - EditorHolder editor = new EditorHolder(parameterArray[i]); - editor.setWidgetName(parameterArray[i].getName()); - xCreator = XCreatorUtils.createXCreator(editor); - if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) - + SECOND_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { - break; - } - currentIndex++; - } - if (!isWithQueryButton()) { - FormSubmitButton formSubmitButton = new FormSubmitButton(); - formSubmitButton.setWidgetName("Search"); - formSubmitButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Query")); - XCreator xCreator = XCreatorUtils.createXCreator(formSubmitButton); - if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * 3 + H_GAP, FIRST_V_LOCATION - + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { - return; - } - } + addingAllParameter2EditorWithReturnValue(parameterArray, currentIndex); } /** - * @Description: 添加所有的参数,并返回当前的currentIndex。此方法为addingAllParameter2Editor的兼容方法。 * @param parameterArray 参数数组 - * @param currentIndex 添加所有参数前的index值 + * @param currentIndex 添加所有参数前的index值 + * @Description: 添加所有的参数,并返回当前的currentIndex。此方法为addingAllParameter2Editor的兼容方法。 * @return: 添加所有参数后的index值 * @Author: Henry.Wang * @date: 2020/8/5 19:40 From 0c85389c790c74cb905e4842d40bdb58e4f86cf9 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 6 Aug 2020 10:42:20 +0800 Subject: [PATCH 22/23] =?UTF-8?q?=E4=B8=BB=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=20=E4=BF=AE=E6=94=B9=E4=BA=86=E5=AF=B9=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=BB=93=E6=9E=9C=E6=8E=92=E5=BA=8F=E7=9A=84=E6=AF=94?= =?UTF-8?q?=E8=BE=83=E5=99=A8=EF=BC=8C=E5=88=86=E4=B8=BA=E4=BB=A5=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E8=AF=8D=E5=BC=80=E5=A4=B4=E5=92=8C=E4=B8=8D=E4=BB=A5?= =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=E5=BC=80=E5=A4=B4=E4=B8=A4=E9=83=A8?= =?UTF-8?q?=E5=88=86=EF=BC=8C=E5=90=84=E8=87=AA=E4=BB=A5=E5=AD=97=E6=AF=8D?= =?UTF-8?q?=E8=A1=A8=E9=A1=BA=E5=BA=8F=E6=8E=92=E5=88=97=EF=BC=8C=E5=85=B6?= =?UTF-8?q?=E4=B8=AD=E5=9C=A8=E4=BB=A5=E5=85=B3=E9=94=AE=E8=AF=8D=E5=BC=80?= =?UTF-8?q?=E5=A4=B4=E7=9A=84=E9=83=A8=E5=88=86=EF=BC=8C=E6=9C=80=E4=B8=BA?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E5=85=B3=E9=94=AE=E8=AF=8D=E7=9A=84=E6=94=BE?= =?UTF-8?q?=E5=9C=A8=E7=AC=AC=E4=B8=80=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/formula/FormulaPane.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index 96a82d228f..8b68dcdbe4 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -1008,15 +1008,23 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { this.searchKey = searchKey.toLowerCase(); } + /** + * 把以关键词开头的和不以关键词开头的分别按照字母表顺序排序 + * @param o1 待比较对象1 + * @param o2 待比较对象2 + * @return 比较结果,1表示 o1 > o2, -1表示 o1 < o2, 0表示 o1 = o2 + */ @Override public int compare(String o1, String o2) { - if (o1.toLowerCase().startsWith(searchKey)) { - return -1; - } - if (o2.toLowerCase().startsWith(searchKey)) { - return 1; + int result; + boolean o1StartWith = o1.toLowerCase().startsWith(searchKey); + boolean o2StartWith = o2.toLowerCase().startsWith(searchKey); + if (o1StartWith) { + result = o2StartWith ? o1.compareTo(o2) : -1; + } else { + result = o2StartWith ? 1 : o1.compareTo(o2); } - return o2.compareTo(o1); + return result; } } From af69f42bd7fd29bce997f9b609a6e7b3d1091d2b Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 6 Aug 2020 11:05:10 +0800 Subject: [PATCH 23/23] =?UTF-8?q?=E4=B8=BB=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=20=E8=A1=A5=E5=85=85=E4=BA=86=E4=B8=80=E4=B8=AAtest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/formula/FormulaPaneTest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/designer-base/src/test/java/com/fr/design/formula/FormulaPaneTest.java b/designer-base/src/test/java/com/fr/design/formula/FormulaPaneTest.java index c82423daa3..4ac71b5ac0 100644 --- a/designer-base/src/test/java/com/fr/design/formula/FormulaPaneTest.java +++ b/designer-base/src/test/java/com/fr/design/formula/FormulaPaneTest.java @@ -22,4 +22,12 @@ public class FormulaPaneTest extends TestCase { Assert.assertArrayEquals(result, strs); } -} \ No newline at end of file + @Test + public void test4SimilarComparator() { + String[] strs = new String[]{"TESTB", "TESTACD", "Ftest", "Gtest", "TEST"}; + String[] result = new String[]{"TEST", "TESTACD", "TESTB", "Ftest", "Gtest"}; + Arrays.sort(strs, new FormulaPane.SimilarComparator("test")); + Assert.assertArrayEquals(result, strs); + } + +}