From 80ea9bb8435ea1e6605afe1701cc8360f43186d0 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 7 Jul 2020 11:09:10 +0800 Subject: [PATCH 01/14] =?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 f2156e861..93da3d04c 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/14] =?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 93da3d04c..dfb4d9409 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/14] =?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 575ba43f5..46706cf59 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/14] =?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 6ad281e26..6f0e89ff4 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/14] =?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 9259248ac..305b580d0 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/14] =?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 0e9db97c7..627a862fb 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/14] =?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 62927647a..5f5476511 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/14] =?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 4bc0f22e4..0c6adeb09 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 000000000..4d378f641 --- /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/14] =?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 2fbccb1cd..7cdd7fd60 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/14] =?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 305b580d0..3631fe3da 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/14] =?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 3631fe3da..9259248ac 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 1a7bf4bfe0e50341a6451afee254b166ad31d790 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 17 Jul 2020 11:02:23 +0800 Subject: [PATCH 12/14] REPORT-35108 && REPORT-34895 --- .../fr/design/actions/file/OpenRecentReportMenuDef.java | 9 ++++++++- .../write/submit/SmartInsertDBManipulationPane.java | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/OpenRecentReportMenuDef.java b/designer-base/src/main/java/com/fr/design/actions/file/OpenRecentReportMenuDef.java index 2bb026159..7533cb133 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/OpenRecentReportMenuDef.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/OpenRecentReportMenuDef.java @@ -1,6 +1,7 @@ package com.fr.design.actions.file; import java.awt.event.ActionEvent; +import java.io.File; import java.util.List; import com.fr.base.BaseUtils; @@ -11,6 +12,7 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.MenuDef; import com.fr.file.FILEFactory; +import com.fr.file.FileFILE; /** * Open Resent MenuDef. @@ -68,7 +70,12 @@ public class OpenRecentReportMenuDef extends MenuDef { * @param e 事件 */ public void actionPerformed(ActionEvent e) { - DesignerContext.getDesignerFrame().openTemplate(FILEFactory.createFILE(this.getPath())); + File file = new File(this.getPath()); + if (file.exists()) { + DesignerContext.getDesignerFrame().openTemplate(new FileFILE(file)); + } else { + DesignerContext.getDesignerFrame().openTemplate(FILEFactory.createFILE(this.getPath())); + } } public String getPath() { diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index 37d6a639f..a430faeec 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -238,6 +238,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { dlg.setModal(false); dlg.setVisible(true); + dlg.setAlwaysOnTop(true); } private void showDialogAfterAddCellAction() { From a6fcd2b1a5de05c2c5bf0d62a9ecc33b8481a0fa Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 17 Jul 2020 11:35:24 +0800 Subject: [PATCH 13/14] =?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 600f9721e..a0ca4d955 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 b5ecddf42bff1849d7c5f363569bae5253328cb8 Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Fri, 17 Jul 2020 18:25:17 +0800 Subject: [PATCH 14/14] =?UTF-8?q?REPORT-34954=20=E5=9C=A8=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E8=AE=BE=E7=BD=AE=E4=B8=AD=EF=BC=8C=E6=9C=AA?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E6=95=B0=E6=8D=AE=E6=97=B6=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=B8=8A=E4=B8=8B=E6=A0=87=E4=BB=8D=E7=84=B6?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E5=90=8C=E6=97=B6=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/cell/editor/RichTextToolBar.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java index b3a78d34d..a8f4b2ac1 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java @@ -258,6 +258,7 @@ public class RichTextToolBar extends BasicPane{ boolean isSub = RichTextToolBar.this.subPane.isSelected(); MutableAttributeSet attr = new SimpleAttributeSet(); if (!isSub && RichTextToolBar.this.superPane.isSelected()) { + RichTextToolBar.this.superPane.setSelected(false); StyleConstants.setSuperscript(attr, false); } // 调用setCharacterAttributes函数设置文本区选择文本的字体 @@ -273,6 +274,7 @@ public class RichTextToolBar extends BasicPane{ // 调用setCharacterAttributes函数设置文本区选择文本的字体 MutableAttributeSet attr = new SimpleAttributeSet(); if (!isSuper && RichTextToolBar.this.subPane.isSelected()) { + RichTextToolBar.this.subPane.setSelected(false); StyleConstants.setSubscript(attr, false); } StyleConstants.setSuperscript(attr, !isSuper);