From 2a947ac8256f736ec57e6f2c48f649e5ceb9056a Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 3 Dec 2020 17:25:12 +0800 Subject: [PATCH 01/20] =?UTF-8?q?REPORT-44581=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=96=AD=E5=BC=80=E5=90=8Emac=E9=80=89?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E5=AF=B9=E8=AF=9D=E6=A1=86=E5=8F=AA=E8=83=BD?= =?UTF-8?q?=E9=87=8D=E5=90=AF=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=80=91"=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98"?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=98=AF=E4=B8=80=E4=B8=AA=E9=A1=B6=E5=B1=82?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=EF=BC=8C=E5=AE=A2=E6=88=B7=E5=9C=A8=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E4=BF=9D=E5=AD=98=E6=93=8D=E4=BD=9C=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8Ctomcat=E7=AA=81=E7=84=B6=E6=96=AD=E5=BC=80?= =?UTF-8?q?=EF=BC=8C=E4=BC=9A=E8=A7=A6=E5=8F=91"=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5"=E7=9A=84=E6=8F=90=E7=A4=BA=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=EF=BC=8C=E6=8F=90=E7=A4=BA=E5=BC=B9=E7=AA=97=E4=BC=9A?= =?UTF-8?q?=E8=A2=AB"=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98"=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E7=BB=99=E8=A6=86=E7=9B=96=E6=8E=89=EF=BC=8C=E8=A1=A8?= =?UTF-8?q?=E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B7=A5=E4=BD=9C=E7=9B=AE=E5=BD=95"?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E7=9A=84=E4=BA=8C=E7=BA=A7=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E5=B9=B6=E4=B8=8D=E4=BC=9A=E5=9B=A0=E4=B8=BA"=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=B7=A5=E4=BD=9C=E7=9B=AE=E5=BD=95"=E5=8F=98?= =?UTF-8?q?=E6=88=90=E9=A1=B6=E5=B1=82=E5=BC=B9=E7=AA=97=E8=80=8C=E8=A2=AB?= =?UTF-8?q?=E8=A6=86=E7=9B=96)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/EnvChangeEntrance.java | 1 + .../com/fr/design/mainframe/socketio/DesignerSocketIO.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 0ddb749269..1c05b23a5c 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -430,6 +430,7 @@ public class EnvChangeEntrance { // todo 断开了但是没选择新的环境,那么尝试重连旧环境,等接口 } }); + envListDialog.setAlwaysOnTop(true); envListDialog.setVisible(true); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index 33b3b80f7d..48b6eec563 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -175,12 +175,16 @@ public class DesignerSocketIO { UIUtil.invokeAndWaitIfNeeded(new Runnable() { @Override public void run() { + JDialog jDialog = new JDialog(); + jDialog.setAlwaysOnTop(true); + jDialog.setVisible(false); FineJOptionPane.showMessageDialog( - DesignerContext.getDesignerFrame(), + jDialog, Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), UIManager.getString("OptionPane.messageDialogTitle"), JOptionPane.ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + jDialog.dispose(); EnvChangeEntrance.getInstance().chooseEnv(); } }); From 41940d0d812d939daf1df8158ad77762942f5d02 Mon Sep 17 00:00:00 2001 From: zack Date: Mon, 7 Dec 2020 17:27:58 +0800 Subject: [PATCH 02/20] =?UTF-8?q?REPORT-44596=20=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A0=91=E6=8E=A7=E4=BB=B6-=E6=80=A5=E9=80=9F=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E4=BE=9D=E8=B5=96=E5=B1=82=E6=95=B0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/frpane/tree/layer/config/LayerDependenceSettingPane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java index 2c0612e024..b3ad1e179a 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java @@ -142,6 +142,7 @@ public class LayerDependenceSettingPane extends JPanel implements ItemListener { this.model.clear(); this.model.addAll(dependenceList); + this.model.fireTableDataChanged(); } From 972e7f8cd64a5de44a911f4e41223e80c7117265 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 11 Dec 2020 14:49:20 +0800 Subject: [PATCH 03/20] =?UTF-8?q?REPORT-44581=20=E8=BF=9C=E7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7=9A=84=E5=8F=AF=E4=BB=A5=E4=BC=A0=E5=85=A5=E7=88=B6?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E7=9A=84=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=B0=86?= =?UTF-8?q?"=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98"=E4=BC=A0=E5=85=A5?= =?UTF-8?q?=E4=BD=9C=E4=B8=BA=E7=88=B6=E7=AA=97=E5=8F=A3=EF=BC=8C=E8=BF=99?= =?UTF-8?q?=E6=A0=B7=E4=B8=A4=E4=B8=AA=E7=95=8C=E9=9D=A2=E9=83=BD=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E8=A2=AB"=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98"?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 8 ++++++-- .../main/java/com/fr/file/FILEChooserPane.java | 8 ++++++++ .../mainframe/socketio/DesignerSocketIO.java | 15 +++++++++------ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 1c05b23a5c..67e4ed905f 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -51,6 +51,7 @@ import com.fr.workspace.engine.rpc.WorkspaceProxyPool; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import javax.swing.UIManager; +import java.awt.Window; import java.lang.reflect.Method; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -411,8 +412,12 @@ public class EnvChangeEntrance { } public void chooseEnv(final String envName) { + chooseEnv(envName, SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); + } + + public void chooseEnv(final String envName, Window window) { final EnvListPane envListPane = new EnvListPane(); - final BasicDialog envListDialog = envListPane.showWindow(SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); + final BasicDialog envListDialog = envListPane.showWindow(window); envListPane.populateEnvManager(envName); envListDialog.addDialogActionListener(new DialogActionAdapter() { @@ -430,7 +435,6 @@ public class EnvChangeEntrance { // todo 断开了但是没选择新的环境,那么尝试重连旧环境,等接口 } }); - envListDialog.setAlwaysOnTop(true); envListDialog.setVisible(true); } diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index 43c3f43ad8..382732dd97 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -1774,4 +1774,12 @@ public class FILEChooserPane extends BasicPane { } } } + + public boolean isDialogVisible() { + return dialog != null && dialog.isVisible(); + } + + public UIDialog getDialog() { + return dialog; + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index 48b6eec563..19754bfc4a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -12,6 +12,7 @@ import com.fr.design.ui.util.UIUtil; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; +import com.fr.file.FILEChooserPane; import com.fr.log.FineLoggerFactory; import com.fr.report.RemoteDesignConstants; import com.fr.serialization.SerializerHelper; @@ -27,6 +28,7 @@ import io.socket.client.IO; import io.socket.client.Socket; import io.socket.emitter.Emitter; +import java.awt.Window; import java.util.Arrays; import javax.swing.*; import java.io.IOException; @@ -175,17 +177,18 @@ public class DesignerSocketIO { UIUtil.invokeAndWaitIfNeeded(new Runnable() { @Override public void run() { - JDialog jDialog = new JDialog(); - jDialog.setAlwaysOnTop(true); - jDialog.setVisible(false); + // 因为有可能在文件保存界面的时候,弹出连接失败弹窗,为了避免二级弹窗问题,这边对父窗口做个判断 + boolean isFileChooserPaneExist = FILEChooserPane.getInstance().isDialogVisible(); + Window window = isFileChooserPaneExist ? FILEChooserPane.getInstance().getDialog() : DesignerContext.getDesignerFrame(); FineJOptionPane.showMessageDialog( - jDialog, + window, Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), UIManager.getString("OptionPane.messageDialogTitle"), JOptionPane.ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); - jDialog.dispose(); - EnvChangeEntrance.getInstance().chooseEnv(); + // 紧接着弹出的选择工作环境的窗口也判断一下父窗口,否则会被文件保存界面覆盖掉 + Window window1 = isFileChooserPaneExist ? FILEChooserPane.getInstance().getDialog() : SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame()); + EnvChangeEntrance.getInstance().chooseEnv(DesignerEnvManager.getEnvManager().getCurEnvName(), window1); } }); } catch (Exception e) { From 5e9cc42c95e3f3a3da13de9b6b0d47fc511b6fba Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 15 Dec 2020 17:45:25 +0800 Subject: [PATCH 04/20] =?UTF-8?q?REPORT-45015=20=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E5=B1=9E=E6=80=A7-=E6=95=B0=E5=AD=97=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/widget/component/NumberEditorValidatePane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java b/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java index 72a199a5b2..ab4f7e4e2b 100644 --- a/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java +++ b/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java @@ -150,6 +150,7 @@ public class NumberEditorValidatePane extends JPanel { setMaxListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { + errorMsgTextFieldPane.setVisible(setMaxValueCheckBox.isSelected() || setMinValueCheckBox.isSelected()); if (setMaxValueCheckBox.isSelected()) { maxValueSpinner.setEnabled(true); Double value = (double) 0; @@ -171,6 +172,7 @@ public class NumberEditorValidatePane extends JPanel { setMinListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { + errorMsgTextFieldPane.setVisible(setMaxValueCheckBox.isSelected() || setMinValueCheckBox.isSelected()); if (setMinValueCheckBox.isSelected()) { minValueSpinner.setEnabled(true); Double value = (double) 0; From 5a95835d2ac6cc5a709fef12ad27d7ccaa30345a Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 17 Dec 2020 11:39:13 +0800 Subject: [PATCH 05/20] =?UTF-8?q?REPORT-44785=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86-=E6=95=B0=E6=8D=AE=E5=BA=93=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86-=E8=A7=86=E5=9B=BE=E4=B8=8D=E8=83=BD=E5=8F=8A?= =?UTF-8?q?=E6=97=B6=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/gui/ilist/TableViewList.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java b/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java index cccf64e26d..73da78151b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java +++ b/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java @@ -106,6 +106,13 @@ public class TableViewList extends UIList { if (!status) { throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); } + String[] schemas = DataCoreUtils.getDatabaseSchema(datasource); + schemas = (schemas == null || schemas.length == 0) ? new String[]{null} : schemas; + for (String schema : schemas) { + DataCoreUtils.refreshTables(datasource, TableProcedure.TABLE, schema); + DataCoreUtils.refreshTables(datasource, TableProcedure.VIEW, schema); + DataCoreUtils.refreshTables(datasource, TableProcedure.PROCEDURE, schema); + } return processDataInAnotherThread(databaseName, searchFilter, typesFilter); } From 1454cc104f42f93e3a2a747e6792a2166e8122b7 Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 23 Dec 2020 17:28:19 +0800 Subject: [PATCH 06/20] =?UTF-8?q?REPORT-40684=20=E7=BB=98=E5=88=B6?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E8=BE=85=E5=8A=A9=E7=BA=BF=E6=97=B6=E6=8F=90?= =?UTF-8?q?=E5=89=8D=E9=80=82=E9=85=8D=E5=90=88=E5=B9=B6=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=EF=BC=8C=E5=8E=BB=E9=99=A4=E5=90=88=E5=B9=B6=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=E4=BD=BF=E7=94=A8=E8=83=8C=E6=99=AF=E8=A6=86=E7=9B=96?= =?UTF-8?q?=E8=BE=85=E5=8A=A9=E7=BA=BF=E7=9A=84=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/grid/GridUI.java | 331 ++++++++++++------ 1 file changed, 233 insertions(+), 98 deletions(-) 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 5f5476511b..711ecee832 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridUI.java +++ b/designer-realize/src/main/java/com/fr/grid/GridUI.java @@ -49,6 +49,7 @@ import com.fr.stable.script.CalculatorUtils; import com.fr.stable.unit.FU; import com.fr.stable.AssistUtils; import com.fr.third.antlr.ANTLRException; +import com.fr.third.guava.collect.HashMultimap; import javax.swing.JComponent; import javax.swing.UIManager; @@ -73,6 +74,7 @@ import java.awt.geom.Rectangle2D; import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.Objects; public class GridUI extends ComponentUI { @@ -91,6 +93,7 @@ public class GridUI extends ComponentUI { protected List paintCellElementList = new ArrayList(); protected List paintCellElementRectangleList = new ArrayList(); protected List paginateLineList = new ArrayList(); // 分页线 + protected HashMultimap mergeCellElementTable = HashMultimap.create(); // 为了画白色的背景. protected static Background WHITE_Backgorund = ColorBackground.getInstance(Color.WHITE); // CellElementPainter @@ -247,7 +250,7 @@ public class GridUI extends ComponentUI { - reportSettings.getFooterHeight().toPixD(resolution); } - private void paintGridLine(Graphics g, Grid grid, double realWidth, double realHeight, + private void paintGridLine(Graphics g, Grid grid, TemplateElementCase report, double realWidth, double realHeight, int resolution) { Graphics2D g2d = (Graphics2D) g; @@ -257,22 +260,51 @@ public class GridUI extends ComponentUI { // 分页线 paginateLineList.clear(); + // 合并单元格 + mergeCellElementTable.clear(); boolean isShowVerticalPaginateLine = grid.getPaginateLineShowType() == Grid.MULTIPLE_PAGINATE_LINE; boolean isShowHorizontalPaginateLine = grid.getPaginateLineShowType() != Grid.NO_PAGINATE_LINE; - new DrawVerticalLineHelper(grid.getVerticalBeginValue(), verticalEndValue, - grid.isShowGridLine(), isShowVerticalPaginateLine, rowHeightList, paperPaintHeight, - paginateLineList, realWidth, resolution).iterateStart2End(g2d); + Iterator cells = report.intersect(grid.getHorizontalBeginValue(), grid.getVerticalBeginValue(), + horizontalEndValue - grid.getHorizontalBeginValue(), verticalEndValue - grid.getVerticalBeginValue()); + while (cells.hasNext()) { + TemplateCellElement cellElement = (TemplateCellElement) cells.next(); + if (cellElement == null) { + continue; + } + int columnSpan = cellElement.getColumnSpan(); + int rowSpan = cellElement.getRowSpan(); + if (columnSpan > 1 || rowSpan > 1) { + for (int c = 0; c < columnSpan - 1; c++) { + for (int r = 0; r < rowSpan; r++) { + mergeCellElementTable.put(CellPosition.value(cellElement.getRow() + r, cellElement.getColumn() + c), CellPosition.RIGHT); + } + } + for (int r = 0; r < rowSpan - 1; r++) { + for (int c = 0; c < columnSpan; c++) { + mergeCellElementTable.put(CellPosition.value(cellElement.getRow() + r, cellElement.getColumn() + c), CellPosition.BOTTOM); + } + } + } + } + GridRange gridRange = GridRange.range(grid.getHorizontalBeginValue(), horizontalEndValue, grid.getVerticalBeginValue(), verticalEndValue) + .rangeList(rowHeightList, columnWidthList) + .realSize(realWidth, realHeight); + + new DrawVerticalLineHelper(gridRange, grid.isShowGridLine(), + isShowVerticalPaginateLine, paperPaintHeight, + paginateLineList, resolution).iterateStart2End(g2d); - new DrawHorizontalLineHelper(grid.getHorizontalBeginValue(), horizontalEndValue, - grid.isShowGridLine(), isShowHorizontalPaginateLine, columnWidthList, paperPaintWidth, - paginateLineList, realHeight, resolution).iterateStart2End(g2d); + new DrawHorizontalLineHelper(gridRange, grid.isShowGridLine(), + isShowHorizontalPaginateLine, paperPaintWidth, + paginateLineList, resolution).iterateStart2End(g2d); } /** * 最后处理 */ + @Override public void finalize() { try { super.finalize(); @@ -285,80 +317,34 @@ public class GridUI extends ComponentUI { } private static abstract class DrawLineHelper { - private int startIndex; - private int endIndex; + protected GridRange gridRange; - private boolean showGridLine; - private boolean showPaginateLine; + protected boolean showGridLine; + protected boolean showPaginateLine; - private DynamicUnitList sizeList; - private double paperPaintSize; + protected double paperPaintSize; - private List paginateLineList; + protected List paginateLineList; Line2D tmpLine2D = new Line2D.Double(0, 0, 0, 0); - private int resolution; + protected int resolution; - private static final double THRESHOLD = 1.0E-4D; + protected static final double THRESHOLD = 1.0E-4D; - DrawLineHelper(int startIndex, int endIndex, boolean showGridLine, - boolean showPaginateLine, DynamicUnitList sizeList, double paperPaintSize, + DrawLineHelper(GridRange gridRange, boolean showGridLine, + boolean showPaginateLine, double paperPaintSize, List paginateLineList, int resolution) { - this.startIndex = startIndex; - this.endIndex = endIndex; + this.gridRange = gridRange; this.showGridLine = showGridLine; this.showPaginateLine = showPaginateLine; - this.sizeList = sizeList; this.paperPaintSize = paperPaintSize; this.paginateLineList = paginateLineList; this.resolution = resolution; } - protected void iterateStart2End(Graphics2D g2d) { - float tmpSize = 0, paperSumSize = 0, sumSize = 0; - for (int i = 0; i <= endIndex; i++) { - // denny: 开始 - if (i == 0) { - i = startIndex; - - // denny: 增加从0到Grid左边被hide的列宽 - for (int k = 0; k < startIndex; k++) { - tmpSize = sizeList.get(k).toPixF(resolution); - - paperSumSize += tmpSize; - if (paperSumSize >= paperPaintSize) { - paperSumSize = tmpSize; - } - } - } - - // adjust height. - tmpSize = sizeList.get(i).toPixF(resolution); - paperSumSize += tmpSize; - - if (showGridLine) {// paint line. - setLine2D((int) sumSize); - g2d.draw(tmpLine2D); - } - - // paint paper margin line. - if (showPaginateLine && paperSumSize - paperPaintSize > THRESHOLD) { - paginateLineList.add(getPaginateLine2D((int) sumSize)); - paperSumSize = tmpSize; - } - - sumSize += tmpSize; - } - - // paint 最后一个横线.. - if (showGridLine) { - drawLastLine(g2d, (int) sumSize); - } - } - - protected abstract void setLine2D(int sumSize); + protected abstract void iterateStart2End(Graphics2D g2d); protected abstract Line2D.Double getPaginateLine2D(int sumSize); @@ -366,14 +352,12 @@ public class GridUI extends ComponentUI { } private class DrawVerticalLineHelper extends DrawLineHelper { - private double realWidth; - DrawVerticalLineHelper(int startIndex, int endIndex, boolean showGridLine, - boolean showPaginateLine, DynamicUnitList unitSizeList, double paperPaintSize, - List paginateLineList, double realWidth, int resolution) { - super(startIndex, endIndex, showGridLine, showPaginateLine, unitSizeList, + DrawVerticalLineHelper(GridRange gridRange, boolean showGridLine, + boolean showPaginateLine, double paperPaintSize, + List paginateLineList, int resolution) { + super(gridRange, showGridLine, showPaginateLine, paperPaintSize, paginateLineList, resolution); - this.realWidth = realWidth; } @Override @@ -382,25 +366,58 @@ public class GridUI extends ComponentUI { } @Override - protected void setLine2D(int sumHeight) { - tmpLine2D.setLine(0, sumHeight, realWidth, sumHeight); + protected void drawLastLine(Graphics2D g2d, int sumHeight) { + GraphHelper.drawLine(g2d, 0, sumHeight, gridRange.realWidth, sumHeight); } @Override - protected void drawLastLine(Graphics2D g2d, int sumHeight) { - GraphHelper.drawLine(g2d, 0, sumHeight, realWidth, sumHeight); + protected void iterateStart2End(Graphics2D g2d) { + float rowHeight, paperYAxisSumSize = 0, yAxisSumSize = 0; + for (int i = 0; i <= gridRange.yEndIndex; i++) { + if (i == 0) { + i = gridRange.yBeginIndex; + for (int k = 0; k < gridRange.yBeginIndex; k++) { + rowHeight = gridRange.rowHeightList.get(k).toPixF(resolution); + + paperYAxisSumSize += rowHeight; + if (paperYAxisSumSize >= paperPaintSize) { + paperYAxisSumSize = rowHeight; + } + } + } + rowHeight = gridRange.rowHeightList.get(i).toPixF(resolution); + paperYAxisSumSize += rowHeight; + if (showGridLine) { + float columnWidth, xAxisSumSize = 0; + for (int j = gridRange.xBeginIndex; j <= gridRange.xEndIndex; j++) { + columnWidth = gridRange.columnWidthList.get(j).toPixF(resolution); + if (!mergeCellElementTable.get(CellPosition.value(i - 1, j)).contains(CellPosition.BOTTOM)) { + tmpLine2D.setLine(xAxisSumSize, yAxisSumSize, xAxisSumSize + columnWidth, yAxisSumSize); + g2d.draw(tmpLine2D); + } + xAxisSumSize += columnWidth; + } + } + if (showPaginateLine && paperYAxisSumSize - paperPaintSize > THRESHOLD) { + paginateLineList.add(getPaginateLine2D((int) yAxisSumSize)); + paperYAxisSumSize = rowHeight; + } + yAxisSumSize += rowHeight; + } + // paint 最后一个横线.. + if (showGridLine) { + drawLastLine(g2d, (int) yAxisSumSize); + } } } private class DrawHorizontalLineHelper extends DrawLineHelper { - private double realHeight; - DrawHorizontalLineHelper(int startIndex, int endIndex, boolean showGridLine, - boolean showPaginateLine, DynamicUnitList unitSizeList, double paperPaintSize, - List paginateLineList, double realHeight, int resolution) { - super(startIndex, endIndex, showGridLine, showPaginateLine, unitSizeList, + DrawHorizontalLineHelper(GridRange gridRange, boolean showGridLine, + boolean showPaginateLine, double paperPaintSize, + List paginateLineList, int resolution) { + super(gridRange, showGridLine, showPaginateLine, paperPaintSize, paginateLineList, resolution); - this.realHeight = realHeight; } @Override @@ -409,13 +426,47 @@ public class GridUI extends ComponentUI { } @Override - protected void setLine2D(int sumWidth) { - tmpLine2D.setLine(sumWidth, 0, sumWidth, realHeight); + protected void drawLastLine(Graphics2D g2d, int sumWidth) { + GraphHelper.drawLine(g2d, sumWidth, 0, sumWidth, gridRange.realHeight); } @Override - protected void drawLastLine(Graphics2D g2d, int sumWidth) { - GraphHelper.drawLine(g2d, sumWidth, 0, sumWidth, realHeight); + protected void iterateStart2End(Graphics2D g2d) { + float columnWidth, paperXAxisSumSize = 0, xAxisSumSize = 0; + for (int i = 0; i <= gridRange.xEndIndex; i++) { + if (i == 0) { + i = gridRange.xBeginIndex; + for (int k = 0; k < gridRange.xBeginIndex; k++) { + columnWidth = gridRange.columnWidthList.get(k).toPixF(resolution); + paperXAxisSumSize += columnWidth; + if (paperXAxisSumSize >= paperPaintSize) { + paperXAxisSumSize = columnWidth; + } + } + } + columnWidth = gridRange.columnWidthList.get(i).toPixF(resolution); + paperXAxisSumSize += columnWidth; + if (showGridLine) { + float rowHeight, yAxisSumSize = 0; + for (int j = gridRange.yBeginIndex; j <= gridRange.yEndIndex; j++) { + rowHeight = gridRange.rowHeightList.get(j).toPixF(resolution); + if (!mergeCellElementTable.get(CellPosition.value(j, i - 1)).contains(CellPosition.RIGHT)) { + tmpLine2D.setLine(xAxisSumSize, yAxisSumSize, xAxisSumSize, yAxisSumSize + rowHeight); + g2d.draw(tmpLine2D); + } + yAxisSumSize += rowHeight; + } + } + if (showPaginateLine && paperXAxisSumSize - paperPaintSize > THRESHOLD) { + paginateLineList.add(getPaginateLine2D((int) xAxisSumSize)); + paperXAxisSumSize = columnWidth; + } + xAxisSumSize += columnWidth; + } + // paint 最后一个横线.. + if (showGridLine) { + drawLastLine(g2d, (int) xAxisSumSize); + } } } @@ -482,18 +533,6 @@ public class GridUI extends ComponentUI { // peter:tmpRectangle2D_3只是一个临时的Rectangle2D,由于后面不少地方需要用到这个矩形 this.cell_back_rect.setRect(0, 0, this.tmpRectangle.getWidth() - 1, this.tmpRectangle.getHeight() - 1.5); - // peter:对于合并的单元格,需要先白色的背景来清除背景. - if (tmpCellElement.getColumnSpan() > 1 || tmpCellElement.getRowSpan() > 1) { - // REPORT-23492 要看下是否设置了纸张背景 如果设置了按照背景来画 - ReportSettingsProvider reportSettings = getReportSettings(report); - Background currentBackground = reportSettings.getBackground(); - if (currentBackground != null) { - currentBackground.paint(g2d, this.cell_back_rect); - } else { - WHITE_Backgorund.paint(g2d, this.cell_back_rect); - } - //daniel:上面这里就有问题了啊....报表的背景在这个之前画的 会覆盖报表背景....不过只是设计器中看到预览浏览没问题 - } // peter:将这个元素添加到需要paint的元素列表当中去,留着画边框线.. paintCellElementList.add(tmpCellElement); paintCellElementRectangleList.add(this.tmpRectangle.clone()); @@ -1093,8 +1132,7 @@ public class GridUI extends ComponentUI { this.paintBackground(g2d, grid, elementCase, resolution); // 画Grid Line - this.paintGridLine(g2d, grid, realWidth, realHeight, resolution); - + this.paintGridLine(g2d, grid, elementCase, realWidth, realHeight, resolution); // peter:添上线程的支持,有时候,paint元素的时候,可能会有元素被删除了. // 需要先清除画Border需要的元素. paintCellElementList.clear(); @@ -1277,4 +1315,101 @@ public class GridUI extends ComponentUI { paginateLineList.add(new Line2D.Double(0, sumHeight, width, sumHeight)); } } + + /** + * 描述单元格位置的POJO + */ + private static class CellPosition { + public final static int TOP = 0; + public static final int LEFT = 1; + public final static int BOTTOM = 2; + public static final int RIGHT = 4; + public int x; + public int y; + + public CellPosition(int x, int y) { + this.x = x; + this.y = y; + } + + public static CellPosition value(int x, int y) { + return new CellPosition(x, y); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CellPosition that = (CellPosition) o; + return x == that.x && y == that.y; + } + + @Override + public int hashCode() { + return Objects.hash(x, y); + } + } + + /** + * 描述表格范围的POJO + * x轴为水平方向,对应的宽度表为列宽列表 + * y轴为垂直方向,对应的宽度表为行高列表 + */ + private static class GridRange { + + public int xBeginIndex; + public int xEndIndex; + public int yBeginIndex; + public int yEndIndex; + double realWidth; + double realHeight; + /** + * 行高列表,对应y方向线段 + */ + public DynamicUnitList rowHeightList; + + /** + * 列宽列表,对应x方向线段 + */ + public DynamicUnitList columnWidthList; + + public GridRange(int xBeginIndex, int xEndIndex, int yBeginIndex, int yEndIndex) { + this.xBeginIndex = xBeginIndex; + this.xEndIndex = xEndIndex; + this.yBeginIndex = yBeginIndex; + this.yEndIndex = yEndIndex; + } + + /** + * 设置行高列宽列表 + * + * @param rowHeightList 行高列表 + * @param columnWidthList 列宽列表 + */ + public GridRange rangeList(DynamicUnitList rowHeightList, DynamicUnitList columnWidthList) { + this.rowHeightList = rowHeightList; + this.columnWidthList = columnWidthList; + return this; + } + + /** + * 设置表格真实宽高 + * + * @param realWidth 宽度 + * @param realHeight 高度 + */ + public GridRange realSize(double realWidth, double realHeight) { + this.realWidth = realWidth; + this.realHeight = realHeight; + return this; + } + + public static GridRange range(int xBeginIndex, int xEndIndex, int yBeginIndex, int yEndIndex) { + return new GridRange(xBeginIndex, xEndIndex, yBeginIndex, yEndIndex); + } + } } From 7697ec5fa790e0967e67c5cb5d156335234d5533 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 25 Dec 2020 15:27:24 +0800 Subject: [PATCH 07/20] =?UTF-8?q?REPORT-44803=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=8B=96=E5=8A=A8=E7=BB=84=E4=BB=B6=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E5=8F=B3=E4=BE=A7=E4=B8=8D=E8=83=BD=E8=B7=9F=E9=9A=8F?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=A4=A7=E5=B0=8F--=E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80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 9 ++------- .../main/java/com/fr/file/FILEChooserPane.java | 8 -------- .../com/fr/design/mainframe/FormDesignerUI.java | 4 ++-- .../mainframe/socketio/DesignerSocketIO.java | 16 +++++----------- 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 67e4ed905f..a1e0c48316 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -51,7 +51,6 @@ import com.fr.workspace.engine.rpc.WorkspaceProxyPool; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import javax.swing.UIManager; -import java.awt.Window; import java.lang.reflect.Method; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -59,10 +58,10 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; -import java.util.HashSet; import static javax.swing.JOptionPane.ERROR_MESSAGE; import static javax.swing.JOptionPane.QUESTION_MESSAGE; @@ -412,12 +411,8 @@ public class EnvChangeEntrance { } public void chooseEnv(final String envName) { - chooseEnv(envName, SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); - } - - public void chooseEnv(final String envName, Window window) { final EnvListPane envListPane = new EnvListPane(); - final BasicDialog envListDialog = envListPane.showWindow(window); + final BasicDialog envListDialog = envListPane.showWindow(SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); envListPane.populateEnvManager(envName); envListDialog.addDialogActionListener(new DialogActionAdapter() { diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index 382732dd97..43c3f43ad8 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -1774,12 +1774,4 @@ public class FILEChooserPane extends BasicPane { } } } - - public boolean isDialogVisible() { - return dialog != null && dialog.isVisible(); - } - - public UIDialog getDialog() { - return dialog; - } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java index a21a2efad5..8f731d8114 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java @@ -183,12 +183,12 @@ public class FormDesignerUI extends ComponentUI { x1 = 0; x2 = 6; y2 = y1 = bounds.y - designer.getVerticalScaleValue() + (k == 1 ? 0 : bounds.height); - text = Utils.objectToString(bounds.y); + text = Utils.objectToString(y1 + designer.getVerticalScaleValue()); } else { y1 = 0; y2 = 6; x1 = x2 = bounds.x - designer.getHorizontalScaleValue()+ (k == 3 ? 0 : bounds.width); - text = Utils.objectToString(bounds.x); + text = Utils.objectToString(x1 + designer.getHorizontalScaleValue()); } text += com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Indent_Pixel"); g2d.setColor(XCreatorConstants.RESIZE_BOX_BORDER_COLOR); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index 19754bfc4a..512ea41c43 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -12,7 +12,6 @@ import com.fr.design.ui.util.UIUtil; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; -import com.fr.file.FILEChooserPane; import com.fr.log.FineLoggerFactory; import com.fr.report.RemoteDesignConstants; import com.fr.serialization.SerializerHelper; @@ -28,12 +27,12 @@ import io.socket.client.IO; import io.socket.client.Socket; import io.socket.emitter.Emitter; -import java.awt.Window; -import java.util.Arrays; -import javax.swing.*; +import javax.swing.JOptionPane; +import javax.swing.UIManager; import java.io.IOException; import java.net.URI; import java.net.URL; +import java.util.Arrays; public class DesignerSocketIO { @@ -177,18 +176,13 @@ public class DesignerSocketIO { UIUtil.invokeAndWaitIfNeeded(new Runnable() { @Override public void run() { - // 因为有可能在文件保存界面的时候,弹出连接失败弹窗,为了避免二级弹窗问题,这边对父窗口做个判断 - boolean isFileChooserPaneExist = FILEChooserPane.getInstance().isDialogVisible(); - Window window = isFileChooserPaneExist ? FILEChooserPane.getInstance().getDialog() : DesignerContext.getDesignerFrame(); FineJOptionPane.showMessageDialog( - window, + DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), UIManager.getString("OptionPane.messageDialogTitle"), JOptionPane.ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); - // 紧接着弹出的选择工作环境的窗口也判断一下父窗口,否则会被文件保存界面覆盖掉 - Window window1 = isFileChooserPaneExist ? FILEChooserPane.getInstance().getDialog() : SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame()); - EnvChangeEntrance.getInstance().chooseEnv(DesignerEnvManager.getEnvManager().getCurEnvName(), window1); + EnvChangeEntrance.getInstance().chooseEnv(); } }); } catch (Exception e) { From 5cbbe6a541f7bb93bea24e2b2e570b4c6d7ff7fd Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 25 Dec 2020 15:34:42 +0800 Subject: [PATCH 08/20] =?UTF-8?q?REPORT-44803=20=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E4=B8=8B=E4=B9=8B=E5=89=8D=E5=85=B3=E9=97=AD=E7=9A=84pr?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=B7=B2=E6=94=B9=E5=8A=A8=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/EnvChangeEntrance.java | 2 +- .../com/fr/design/mainframe/socketio/DesignerSocketIO.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index a1e0c48316..0ddb749269 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -58,10 +58,10 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; +import java.util.HashSet; import static javax.swing.JOptionPane.ERROR_MESSAGE; import static javax.swing.JOptionPane.QUESTION_MESSAGE; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index 512ea41c43..33b3b80f7d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -27,12 +27,11 @@ import io.socket.client.IO; import io.socket.client.Socket; import io.socket.emitter.Emitter; -import javax.swing.JOptionPane; -import javax.swing.UIManager; +import java.util.Arrays; +import javax.swing.*; import java.io.IOException; import java.net.URI; import java.net.URL; -import java.util.Arrays; public class DesignerSocketIO { From afa46632039de5a43bbbd5c62ccdee3e82681413 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 28 Dec 2020 14:13:08 +0800 Subject: [PATCH 09/20] =?UTF-8?q?REPORT-45473=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=91=BD=E5=90=8D=E8=B6=85=E8=BF=8716=E4=B8=AA?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E6=97=B6=EF=BC=8C=E5=85=B3=E8=81=94=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E4=B8=AD=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E5=90=8D=E7=A7=B0=20=E3=80=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E4=B9=8B=E5=89=8D=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E6=98=AF=E8=B0=83=E7=94=A8=E4=BB=A3=E8=A1=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E5=90=8D=E7=A7=B0=E7=9A=84UILabel?= =?UTF-8?q?=E7=9A=84getPreferredSize()=E8=8E=B7=E5=8F=96width=EF=BC=8C?= =?UTF-8?q?=E7=84=B6=E5=90=8E=E8=B7=9F=E5=B8=B8=E9=87=8F143=E5=8E=BB?= =?UTF-8?q?=E6=AF=94=E8=BE=83=EF=BC=8C=E5=A6=82=E6=9E=9C=E8=B6=85=E8=BF=87?= =?UTF-8?q?=E4=BA=86143=EF=BC=8C=E5=B0=B1=E5=B0=86=E5=85=B6=E4=B8=AD?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=87=8F=E7=9F=AD=E5=87=A0=E4=B8=AA=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=EF=BC=8C=E5=8A=A0=E4=B8=8A"..."=EF=BC=8C=E7=84=B6?= =?UTF-8?q?=E5=90=8E=E5=BE=AA=E7=8E=AF=E6=8E=A5=E7=9D=80=E6=AF=94=E8=BE=83?= =?UTF-8?q?=E3=80=82=E6=AD=A4=E6=97=B6UILabel=E8=BF=98=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=A2=AB=E6=B7=BB=E5=8A=A0=E5=88=B0panel=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E5=BD=93=E8=8E=B7=E5=8F=96=E5=88=B0=E7=9A=84width=E6=AF=94?= =?UTF-8?q?=E8=BE=83=E8=B4=B4=E8=BF=91143=E6=97=B6=EF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E5=BE=AE=E5=8F=98=E5=8C=96?= =?UTF-8?q?=E4=B9=9F=E4=B8=8D=E4=BC=9A=E8=B6=85=E8=BF=87=E5=8E=9F=E6=9D=A5?= =?UTF-8?q?=E7=9A=84143=EF=BC=8C=E6=95=B0=E6=8D=AE=E9=9B=86=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E5=8F=AF=E4=BB=A5=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/tabledata/tabledatapane/MultiTDTableDataPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java index 571e13d447..4a153bfaac 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java @@ -41,7 +41,7 @@ import java.util.Map.Entry; public class MultiTDTableDataPane extends AbstractTableDataPane { - private static final int MAX_LENTH_OF_DATASET = 143; //关联数据集面板最大显示的数据集长度,超出这个长度显示数据集名称+“...” + private static final int MAX_LENTH_OF_DATASET = 130; //关联数据集面板最大显示的数据集长度,超出这个长度显示数据集名称+“...” private static final int MIN_BAR_NUMBER = 10; private static final int SUB_LENGTH = 4; private JPanel centerPanel; From bf63fbf211ca9054e06f5acb2257609951e5929a Mon Sep 17 00:00:00 2001 From: Yyming Date: Mon, 28 Dec 2020 15:22:53 +0800 Subject: [PATCH 10/20] =?UTF-8?q?REPORT-45880=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E6=81=A2=E5=A4=8D=E6=99=AE=E9=80=9A?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=90=8E=E6=96=87=E6=9C=AC=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/grid/selection/CellSelection.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java index 4c90be3c5a..30d7e20783 100644 --- a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java +++ b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java @@ -573,6 +573,11 @@ public class CellSelection extends Selection { for (int i = 0; i < removeElementList.size(); i++) { CellElement element = removeElementList.get(i); element.setValue(null); + CellGUIAttr cellGUIAttr = element.getCellGUIAttr(); + cellGUIAttr.setShowAsDefault(true); + cellGUIAttr.setShowAsHTML(false); + cellGUIAttr.setShowAsDownload(false); + cellGUIAttr.setShowAsImage(false); } break; From b7051b4470167277a4907a362b876e36059b59ec Mon Sep 17 00:00:00 2001 From: Yyming Date: Mon, 28 Dec 2020 16:10:31 +0800 Subject: [PATCH 11/20] =?UTF-8?q?REPORT-45880=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E6=81=A2=E5=A4=8D=E6=99=AE=E9=80=9A?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=90=8E=E6=96=87=E6=9C=AC=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/grid/selection/CellSelection.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java index 30d7e20783..da8788bb93 100644 --- a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java +++ b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java @@ -573,11 +573,7 @@ public class CellSelection extends Selection { for (int i = 0; i < removeElementList.size(); i++) { CellElement element = removeElementList.get(i); element.setValue(null); - CellGUIAttr cellGUIAttr = element.getCellGUIAttr(); - cellGUIAttr.setShowAsDefault(true); - cellGUIAttr.setShowAsHTML(false); - cellGUIAttr.setShowAsDownload(false); - cellGUIAttr.setShowAsImage(false); + setDefault(element); } break; @@ -593,6 +589,15 @@ public class CellSelection extends Selection { return true; } + //设置显示内容为default + private void setDefault(CellElement element) { + CellGUIAttr cellGUIAttr = element.getCellGUIAttr(); + cellGUIAttr.setShowAsDefault(true); + cellGUIAttr.setShowAsHTML(false); + cellGUIAttr.setShowAsDownload(false); + cellGUIAttr.setShowAsImage(false); + } + @Override public int[] getSelectedColumns() { From 9175e0258dd7e4a5f1e587dedd4e63f4212dbb61 Mon Sep 17 00:00:00 2001 From: Yyming Date: Mon, 28 Dec 2020 17:38:12 +0800 Subject: [PATCH 12/20] =?UTF-8?q?REPORT-45880=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E6=81=A2=E5=A4=8D=E6=99=AE=E9=80=9A?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=90=8E=E6=96=87=E6=9C=AC=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/grid/selection/CellSelection.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java index da8788bb93..7f5d86ef1f 100644 --- a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java +++ b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java @@ -592,10 +592,12 @@ public class CellSelection extends Selection { //设置显示内容为default private void setDefault(CellElement element) { CellGUIAttr cellGUIAttr = element.getCellGUIAttr(); - cellGUIAttr.setShowAsDefault(true); - cellGUIAttr.setShowAsHTML(false); - cellGUIAttr.setShowAsDownload(false); - cellGUIAttr.setShowAsImage(false); + if (cellGUIAttr != null) { + cellGUIAttr.setShowAsDefault(true); + cellGUIAttr.setShowAsHTML(false); + cellGUIAttr.setShowAsDownload(false); + cellGUIAttr.setShowAsImage(false); + } } From 0e29ea19399e1e8acfcce8332ff374a4f3897a65 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 29 Dec 2020 15:40:43 +0800 Subject: [PATCH 13/20] =?UTF-8?q?REPORT-44733=E3=80=90=E5=86=92=E7=83=9F?= =?UTF-8?q?=E3=80=91=E9=99=84=E4=BB=B6=E8=A1=A8=E5=8D=95=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA=E4=BC=9A=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/XWAbsoluteLayout.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index da268b0e6c..b1a8a936b9 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -569,6 +569,33 @@ public class XWAbsoluteLayout extends XLayoutContainer { } } + /** + * 重新调整子组件宽度 + * @param width 宽度 + * @param actualSize 是否按照实际大小计算 + */ + public void recalculateChildWidth(int width, boolean actualSize){ + int componentCont = getComponentCount(); + for (int i = 0; i < componentCont; i++) { + XCreator creator = (XCreator) getComponent(i); + creator.recalculateChildWidth(width, actualSize); + } + } + + /** + * 重新调整子组件高度 + * @param height 高度 + * @param actualSize 是否按照实际大小计算 + */ + public void recalculateChildHeight(int height, boolean actualSize){ + int componentCont = getComponentCount(); + for (int i = 0; i < componentCont; i++) { + XCreator creator = (XCreator) getComponent(i); + creator.recalculateChildHeight(height, actualSize); + } + } + + /** * body大小手动调整的时候 * 按照比例调整组件的高度 From bb3689ec67f3703fdc370307c895b5cfe6505215 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 29 Dec 2020 15:55:33 +0800 Subject: [PATCH 14/20] override --- .../java/com/fr/design/designer/creator/XWAbsoluteLayout.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index b1a8a936b9..97c6b406a3 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -574,6 +574,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { * @param width 宽度 * @param actualSize 是否按照实际大小计算 */ + @Override public void recalculateChildWidth(int width, boolean actualSize){ int componentCont = getComponentCount(); for (int i = 0; i < componentCont; i++) { @@ -587,6 +588,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { * @param height 高度 * @param actualSize 是否按照实际大小计算 */ + @Override public void recalculateChildHeight(int height, boolean actualSize){ int componentCont = getComponentCount(); for (int i = 0; i < componentCont; i++) { From 2f039cdcd6666bf60798fe56d573c563061812a3 Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Tue, 29 Dec 2020 17:24:25 +0800 Subject: [PATCH 15/20] =?UTF-8?q?REPORT-46102=20=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E6=94=B9=E8=BF=9B=EF=BC=8C=E6=B0=B4=E5=8D=B0=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E7=9B=B4=E6=8E=A5=E8=BE=93=E5=85=A5=E6=96=87?= =?UTF-8?q?=E5=AD=97=EF=BC=8C=E5=BF=85=E9=A1=BB=E5=9C=A8=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E7=9A=84=E5=85=AC=E5=BC=8F=E9=9D=A2=E6=9D=BF=E4=B8=8B=E6=89=8D?= =?UTF-8?q?=E8=83=BD=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/editor/editor/FormulaEditor.java | 4 ++++ .../java/com/fr/design/report/WatermarkPane.java | 14 ++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/editor/editor/FormulaEditor.java b/designer-base/src/main/java/com/fr/design/editor/editor/FormulaEditor.java index 77ac976bcf..b8dc5ad8fe 100644 --- a/designer-base/src/main/java/com/fr/design/editor/editor/FormulaEditor.java +++ b/designer-base/src/main/java/com/fr/design/editor/editor/FormulaEditor.java @@ -99,6 +99,10 @@ public class FormulaEditor extends Editor { return formula; } + public UITextField getUITextField() { + return currentTextField; + } + /** * Return the value of the CellEditor. */ diff --git a/designer-base/src/main/java/com/fr/design/report/WatermarkPane.java b/designer-base/src/main/java/com/fr/design/report/WatermarkPane.java index 07ec40bfee..588e4601d0 100644 --- a/designer-base/src/main/java/com/fr/design/report/WatermarkPane.java +++ b/designer-base/src/main/java/com/fr/design/report/WatermarkPane.java @@ -1,14 +1,16 @@ package com.fr.design.report; +import com.fr.base.BaseFormula; import com.fr.base.iofile.attr.WatermarkAttr; import com.fr.design.dialog.BasicPane; -import com.fr.design.formula.TinyFormulaPane; +import com.fr.design.editor.editor.FormulaEditor; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UnsignedIntUISpinner; import com.fr.design.gui.style.FRFontPane; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -50,7 +52,7 @@ public class WatermarkPane extends BasicPane { // 水印预览面板 private WatermarkPreviewPane watermarkPreviewPane; // 文字 - private TinyFormulaPane formulaPane; + private FormulaEditor formulaPane; // 字号 private UIComboBox fontSizeComboBox; //横向间距 @@ -119,16 +121,16 @@ public class WatermarkPane extends BasicPane { return watermark; } - public TinyFormulaPane getFormulaPane() { + public FormulaEditor getFormulaPane() { return formulaPane; } - public void setFormulaPane(TinyFormulaPane formulaPane) { + public void setFormulaPane(FormulaEditor formulaPane) { this.formulaPane = formulaPane; } protected UIScrollPane initRightPane() { - formulaPane = new TinyFormulaPane(); + formulaPane = new FormulaEditor(Toolkit.i18nText("Fine-Design_Report_Parameter_Formula")); fontSizeComboBox = new UIComboBox(FRFontPane.FONT_SIZES); fontSizeComboBox.setEditable(true); horizontalGapSpinner = new UnsignedIntUISpinner(100, Integer.MAX_VALUE, 1, 200); @@ -228,7 +230,7 @@ public class WatermarkPane extends BasicPane { } private void populateFourmula(String formula) { - this.formulaPane.populateBean(formula); + this.formulaPane.setValue(BaseFormula.createFormulaBuilder().build(formula)); this.formulaPane.getUITextField().getDocument() .addDocumentListener(new DocumentListener() { @Override From 0d600b351a06f6dbc4d8e3ca9a9f8b4799abafff Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 31 Dec 2020 10:52:12 +0800 Subject: [PATCH 16/20] =?UTF-8?q?REPORT-45775=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E5=8F=AF=E4=BB=A5=E5=A4=8D=E5=88=B6=E5=88=B0=E5=8F=A6?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF--?= =?UTF-8?q?=E6=9D=A5=E6=BA=90=E3=80=90=E5=AE=A2=E6=88=B7=E9=9C=80=E6=B1=82?= =?UTF-8?q?=20510651=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/designer/beans/models/SelectionModel.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index 0f673e30ae..f6c74986e0 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -397,8 +397,10 @@ public class SelectionModel { boolean absoluteCanvas = selectionXCreator.getClass().equals(XWAbsoluteLayout.class); //选中的是否是相对布局编辑器本身 boolean relativeEditor = selectionXCreator.getClass().equals(XWFitLayout.class); + //选中的参数面板编辑器本身 + boolean parameterEditor = selectionXCreator.getClass().equals(XWParameterLayout.class); - return !(tabEditor || absoluteEditor || absoluteCanvas || relativeEditor); + return !(tabEditor || absoluteEditor || absoluteCanvas || relativeEditor || parameterEditor); } else { return false; } From a726e01b01d47c62a668f73141ab8a13053c00b2 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 31 Dec 2020 11:02:58 +0800 Subject: [PATCH 17/20] =?UTF-8?q?REPORT-46268=20frm=E4=B8=AD=E9=80=94?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9A=84=E6=A8=A1=E6=9D=BF=E5=8F=82=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E8=AF=86=E5=88=AB=E4=B8=8D=E5=88=B0=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E4=B8=AD=E7=9A=84=E5=8F=82=E6=95=B0=E6=98=A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9C=A8?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=B7=BB=E5=8A=A0=E6=A8=A1=E6=9D=BF=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E7=9A=84TemplateParameterAction=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=9A=E7=9F=A5DesignModelAdapter=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=8F=82=E6=95=B0=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/actions/TemplateParameterAction.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java b/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java index bd747444e3..c32c059d44 100644 --- a/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java @@ -2,7 +2,7 @@ package com.fr.design.actions; import com.fr.base.BaseUtils; import com.fr.base.Parameter; -import com.fr.design.actions.JTemplateAction; +import com.fr.design.DesignModelAdapter; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.mainframe.JForm; @@ -10,7 +10,7 @@ import com.fr.design.menu.KeySetUtils; import com.fr.design.parameter.ParameterArrayPane; import com.fr.form.main.Form; -import javax.swing.*; +import javax.swing.SwingUtilities; import java.awt.event.ActionEvent; /** @@ -51,6 +51,8 @@ public class TemplateParameterAction extends JTemplateAction { jwb.fireTargetModified(); jwb.getFormDesign().setParameterArray(parameters); jwb.getFormDesign().refreshParameter(); + DesignModelAdapter.getCurrentModelAdapter().fireTargetModified(); + DesignModelAdapter.getCurrentModelAdapter().parameterChanged(); } }); parameterArrayDialog.setVisible(true); From b3f7b37a935d7b9f6d16f1adfc298305caeda82c Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 31 Dec 2020 15:50:36 +0800 Subject: [PATCH 18/20] =?UTF-8?q?REPORT-46268=20frm=E4=B8=AD=E9=80=94?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9A=84=E6=A8=A1=E6=9D=BF=E5=8F=82=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E8=AF=86=E5=88=AB=E4=B8=8D=E5=88=B0=20=E5=8F=91?= =?UTF-8?q?=E7=8E=B0=E5=89=8D=E9=9D=A2=E7=9A=84jwb=E7=9A=84=E5=87=A0?= =?UTF-8?q?=E4=B8=AA=E6=9B=B4=E6=96=B0=E6=93=8D=E4=BD=9C=E5=85=B6=E5=AE=9E?= =?UTF-8?q?=E8=B7=9FDesignModelAdapter=E7=9A=84fireTargetModified()?= =?UTF-8?q?=E5=92=8CparameterChanged()=E9=87=8D=E5=A4=8D=E4=BA=86=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E4=B8=94parameterChanged()=E4=B8=AD=E6=AF=94=E4=B8=8A?= =?UTF-8?q?=E9=9D=A2=E7=9A=84jwb=E7=9A=84=E6=93=8D=E4=BD=9C=E8=BF=98?= =?UTF-8?q?=E5=A4=9A=E4=BA=86=E4=B8=AA=E6=9B=B4=E6=96=B0ParameterPropertyP?= =?UTF-8?q?ane=EF=BC=8Cdebug=E4=BA=86=E4=B8=8B=E5=8F=91=E7=8E=B0=E8=BF=99?= =?UTF-8?q?=E4=B9=9F=E6=98=AF=E4=B8=AA=E5=BF=85=E8=A6=81=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E6=9E=9C=E4=B8=8D=E9=9A=8F=E7=9D=80=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=BC=9A=E9=80=A0=E6=88=90=E4=B8=80=E4=BA=9B=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E4=BD=86=E6=98=AF=E8=BF=98=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=B5=8B=E5=87=BA=E6=9D=A5=EF=BC=8C=E6=89=80?= =?UTF-8?q?=E4=BB=A5=E5=85=B6=E5=AE=9E=E8=BF=99=E9=87=8C=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E5=B0=B1=E6=98=AF=E5=85=A8=E9=87=8F=E6=9B=B4=E6=96=B0=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E5=85=B3=E4=BA=8Ehades=E8=AF=B4=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E5=8F=82=E6=95=B0=E6=9B=B4=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E6=84=9F=E8=A7=89=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E5=90=8E=E9=9D=A2=E5=86=8D=E6=8F=90=E4=B8=AA=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=EF=BC=8C=E7=BB=9F=E4=B8=80=E5=9C=A8DesignModelAdapter.getCurre?= =?UTF-8?q?ntModelAdapter().parameterChanged()=E6=96=B9=E6=B3=95=E4=B8=AD?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/actions/TemplateParameterAction.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java b/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java index c32c059d44..99e432eee1 100644 --- a/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java @@ -48,9 +48,6 @@ public class TemplateParameterAction extends JTemplateAction { for (int i = 0; i < parameters.length; i++) { wbTpl.addParameter(parameters[i]); } - jwb.fireTargetModified(); - jwb.getFormDesign().setParameterArray(parameters); - jwb.getFormDesign().refreshParameter(); DesignModelAdapter.getCurrentModelAdapter().fireTargetModified(); DesignModelAdapter.getCurrentModelAdapter().parameterChanged(); } From cd0a4f9bcab4464eacb041d0ad641658899c347b Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 4 Jan 2021 09:37:45 +0800 Subject: [PATCH 19/20] =?UTF-8?q?=E5=91=BD=E5=90=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/designer/creator/XWAbsoluteLayout.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index 97c6b406a3..9d70b7f0a2 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -576,8 +576,8 @@ public class XWAbsoluteLayout extends XLayoutContainer { */ @Override public void recalculateChildWidth(int width, boolean actualSize){ - int componentCont = getComponentCount(); - for (int i = 0; i < componentCont; i++) { + int componentCount = getComponentCount(); + for (int i = 0; i < componentCount; i++) { XCreator creator = (XCreator) getComponent(i); creator.recalculateChildWidth(width, actualSize); } @@ -590,8 +590,8 @@ public class XWAbsoluteLayout extends XLayoutContainer { */ @Override public void recalculateChildHeight(int height, boolean actualSize){ - int componentCont = getComponentCount(); - for (int i = 0; i < componentCont; i++) { + int componentCount = getComponentCount(); + for (int i = 0; i < componentCount; i++) { XCreator creator = (XCreator) getComponent(i); creator.recalculateChildHeight(height, actualSize); } From 2d174d469fa74fd5cf5f35a0a83d5a3b4cf9a76a Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 4 Jan 2021 13:50:52 +0800 Subject: [PATCH 20/20] =?UTF-8?q?REPORT-46421=20=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E5=8B=BE=E9=80=89=E5=90=8E=20=E6=B8=85=E7=A9=BA=E4=B8=8B?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/component/NumberEditorValidatePane.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java b/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java index ab4f7e4e2b..d77e1e9000 100644 --- a/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java +++ b/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java @@ -150,7 +150,7 @@ public class NumberEditorValidatePane extends JPanel { setMaxListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - errorMsgTextFieldPane.setVisible(setMaxValueCheckBox.isSelected() || setMinValueCheckBox.isSelected()); + refreshErrorMsgTip(); if (setMaxValueCheckBox.isSelected()) { maxValueSpinner.setEnabled(true); Double value = (double) 0; @@ -172,7 +172,7 @@ public class NumberEditorValidatePane extends JPanel { setMinListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - errorMsgTextFieldPane.setVisible(setMaxValueCheckBox.isSelected() || setMinValueCheckBox.isSelected()); + refreshErrorMsgTip(); if (setMinValueCheckBox.isSelected()) { minValueSpinner.setEnabled(true); Double value = (double) 0; @@ -220,6 +220,14 @@ public class NumberEditorValidatePane extends JPanel { }; } + private void refreshErrorMsgTip() { + boolean visible = setMaxValueCheckBox.isSelected() || setMinValueCheckBox.isSelected(); + errorMsgTextFieldPane.setVisible(visible); + if (!visible) { + errorMsgTextField.setText(StringUtils.EMPTY); + } + } + public void populate(NumberEditor e) { allowDecimalsCheckBox.setSelected(e.isAllowDecimals()); if (e.isAllowDecimals()) {