From cc2e281c11466372c12e570ff73ba0943cc69f6c Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 18 Sep 2020 17:59:49 +0800 Subject: [PATCH 01/11] =?UTF-8?q?MOBILE-29339=20=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E6=A8=AA=E5=90=91=E5=B8=83=E5=B1=80=E5=9D=97=E4=B8=AD=E9=97=B4?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=8F=92=E5=85=A5=E6=96=B0=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapters/layout/FRFitLayoutAdapter.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 dfb4d94090..24c3a19dbc 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 @@ -3,6 +3,7 @@ */ package com.fr.design.designer.beans.adapters.layout; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.GroupModel; import com.fr.design.designer.beans.ConstraintsGroupModel; import com.fr.design.designer.beans.HoverPainter; @@ -18,6 +19,7 @@ import com.fr.design.designer.creator.cardlayout.XWCardTitleLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.designer.properties.FRFitLayoutConstraints; import com.fr.design.designer.properties.FRFitLayoutPropertiesGroupModel; +import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.utils.ComponentUtils; import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.container.WAbsoluteLayout; @@ -32,6 +34,7 @@ import java.awt.Dimension; import java.awt.Rectangle; import java.util.ArrayList; import java.util.List; +import java.util.Set; /** * 自适应布局的容器适配器 @@ -161,7 +164,8 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { //布局控件要先判断是不是可编辑 XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer((XCreator) comp).getTopLayout(); - if (topLayout != null && !isMatchEdge && !topLayout.isEditable() && !topLayout.acceptType(XWAbsoluteLayout.class)) { + boolean access = topLayout != null && !isMatchEdge && !topLayout.isEditable() && !topLayout.acceptType(XWAbsoluteLayout.class) && !isExtraContainer(comp); + if (access) { return false; } @@ -178,6 +182,18 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { return y > upHeight && y < downHeight ? horizonValid : verticalValid; } + private boolean isExtraContainer(Component comp) { + if (container != null) { + Set set = ExtraDesignClassManager.getInstance().getArray(FormWidgetOptionProvider.XML_TAG); + for (FormWidgetOptionProvider provider : set) { + if (provider.isContainer() && ComparatorUtils.equals(provider.appearanceForWidget(), comp.getClass())) { + return true; + } + } + } + return false; + } + // 间隔区域 private boolean checkInterval(Component comp) { return container.getComponentCount() > 0 && comp == container; From 163c5a1a2d03803bd35ac2222adeb6e8f5d83271 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 25 Sep 2020 11:27:26 +0800 Subject: [PATCH 02/11] =?UTF-8?q?REPORT-40259=E3=80=90=E5=9B=9E=E5=BD=92?= =?UTF-8?q?=E3=80=91Tomcat=20=E4=B8=8B=E9=80=9A=E8=BF=87=20IP=20=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E8=AE=BF=E9=97=AE=E6=95=B0=E6=8D=AE=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=EF=BC=8C=E5=88=87=E6=8D=A2=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=E9=85=8D=E7=BD=AE=E9=A1=B5=E9=9D=A2url?= =?UTF-8?q?=E5=8F=98=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/env/RemoteEnvPane.java | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 54cfddc8d3..515ce3690c 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -1,7 +1,5 @@ package com.fr.env; -import com.fr.base.FRContext; -import com.fr.base.ServerConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.BasicBeanPane; @@ -444,38 +442,6 @@ public class RemoteEnvPane extends BasicBeanPane { new double[]{FILL} )); - setDefaultAppAndServlet(); - } - - /** - * 设置 app 和 servlet 默认值 - */ - private void setDefaultAppAndServlet() { - setWrap(webAppNameInput, () -> FRContext.getCommonOperator().getAppName(), RemoteWorkspaceURL.DEFAULT_WEB_APP_NAME); - setWrap(servletNameInput, () -> ServerConfig.getInstance().getServletName(), RemoteWorkspaceURL.DEFAULT_SERVLET_NAME); - } - - private void setWrap(final UITextField textField, final Supplier supplier, final String defaultName) { - new SwingWorker() { - - @Override - protected String doInBackground() throws Exception { - return supplier.get(); - } - - @Override - protected void done() { - String name = defaultName; - try { - name = get(); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage() , e); - } - if (StringUtils.isEmpty(textField.getText())) { - textField.setText(name); - } - } - }.execute(); } From a1b92c6eb83cf3134ec50a6a23f9e2c80ea87ddd Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 25 Sep 2020 11:50:22 +0800 Subject: [PATCH 03/11] =?UTF-8?q?REPORT-40495=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF-=E5=A4=9Asheet-windows=E4=B8=8B=E9=9F=A9?= =?UTF-8?q?=E6=96=87=E5=90=8D=E7=A7=B0=E7=9A=84sheet=E4=B8=8D=E8=A2=AB?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E6=97=B6=E4=B8=8D=E6=98=BE=E7=A4=BA=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E3=80=91=E4=B9=8B=E5=89=8D=E7=94=A8=E7=9A=84Graphics2D?= =?UTF-8?q?=E7=9A=84drawString=E6=96=B9=E6=B3=95=EF=BC=8C=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E7=94=BB=E5=87=BA=E9=9F=A9=E6=96=87=E7=9A=84sheetName?= =?UTF-8?q?=EF=BC=8Cdebug=E5=8F=91=E7=8E=B0=E8=B5=B0=E5=88=B0=E9=87=8C?= =?UTF-8?q?=E9=9D=A2=EF=BC=8CfontInfo=E4=B8=AD=E7=9A=84font=3Dnull?= =?UTF-8?q?=EF=BC=8C=E8=80=8CGraphHelper=E7=9A=84drawString=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E8=BF=99=E4=B8=AA=E6=96=B9=E6=B3=95debug?= =?UTF-8?q?=E8=B5=B0=E5=88=B0=E9=87=8C=E9=9D=A2=E5=8F=91=E7=8E=B0font?= =?UTF-8?q?=E4=B8=80=E7=9B=B4=E6=98=AF=E6=AD=A3=E5=B8=B8=E7=9A=84=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E4=B8=94=E4=B8=A4=E4=B8=AA=E6=96=B9=E6=B3=95=E9=87=8C?= =?UTF-8?q?=E9=9D=A2=E7=9A=84Graphics2D=E4=B9=9F=E9=83=BD=E6=98=AFSunGraph?= =?UTF-8?q?ics2D=EF=BC=8C=E5=B0=B1=E5=BE=88=E5=A5=87=E6=80=AA=EF=BC=8C?= =?UTF-8?q?=E6=B2=A1=E6=90=9E=E6=87=82=E4=B8=BA=E5=95=A5=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=B0=86=E8=B0=83?= =?UTF-8?q?=E7=94=A8Graphics2D=E7=9A=84drawString=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=B8=BA=E8=B0=83=E7=94=A8GraphHelper?= =?UTF-8?q?=E7=9A=84drawString=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/SheetNameTabPane.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java index 52f1fe1f0c..0c7c359f0a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java @@ -134,7 +134,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse * 编辑的对象实例 */ private ReportComponentComposite reportComposite; - + private int selectedIndex = -1; private JPanel buttonPane; @@ -332,7 +332,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse leftButton.setEnabled(buttonEnabled); rightButton.setEnabled(buttonEnabled); } - + /** * 抽出来方便OEM * @return @@ -417,10 +417,10 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse // 画两个添加sheet图标 iconLocation = isOvertakeWidth ? (int) (maxWidth) : addIconlocation + GRAP; - + paintAddButton(g2d); } - + protected void paintAddButton(Graphics2D g2d){ getAddWorkSheet().paintIcon(this, g2d, iconLocation, 3); ADD_POLY_SHEET.paintIcon(this, g2d, iconLocation + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE, 3); @@ -496,7 +496,8 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse sheetIcon.paintIcon(this, g2d, (int) textX + charWidth, 2); g2d.setPaint(getForeground()); - g2d.drawString(sheetName, (int) textX + charWidth + 14, textAscent); + // REPORT-40495 之前的g2d.drawString()无法画出韩文sheetName,修改成GraphHelper的drawString + GraphHelper.drawString(g2d, sheetName, (int) textX + charWidth + 14, textAscent); } /** @@ -626,7 +627,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse processRightMouseButton(evtX, evtY); } } - + private void processRightMouseButton(int evtX, int evtY){ MenuDef def = new MenuDef(); addInsertGridShortCut(def); @@ -636,14 +637,14 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse def.updateMenu(); GUICoreUtils.showPopupMenu(tabPop, this, evtX - 1, evtY - 1); } - + private void processLeftMouseButton(int evtX){ if (evtX > iconLocation && evtX < iconLocation + GRID_TOSHEET_RIGHT) { firstInsertActionPerformed(); } else if (evtX > iconLocation + POLY_TOSHEET_LEFT && evtX < iconLocation + POLY_TOSHEET_RIGHT) { new PolyReportInsertAction().actionPerformed(null); } - + } protected void addInsertGridShortCut(MenuDef def){ @@ -847,7 +848,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse } protected class GridReportInsertAction extends SheetInsertAction { - + @Override protected TemplateReport newTemplateReport() { return new WorkSheet(); From b6085f1a3e24e28e4c11bb759c04abdab8f16c89 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 25 Sep 2020 12:28:27 +0800 Subject: [PATCH 04/11] =?UTF-8?q?REPORT-38557=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=90JDK11=E3=80=91=E6=B7=BB=E5=8A=A0=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E7=9A=84=E9=9D=A2=E6=9D=BF=E9=87=8C=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/web/CustomIconPane.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java b/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java index 12c72c5cd3..54f1755b94 100644 --- a/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java +++ b/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.base.GraphHelper; import com.fr.base.Icon; import com.fr.base.IconManager; +import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; @@ -401,9 +402,9 @@ public class CustomIconPane extends BasicPane { private void init() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); double p = TableLayout.PREFERRED; - double rowSize[] = {p, p}; - double columnSize[] = {p, p, p}; - + double[] rowSize = {p, p}; + double[] columnSize = {p, p}; + int[][] rowCount = {{1, 1}, {1, 1}}; UIButton browseButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_SelectIcon")); browseButton.setPreferredSize(new Dimension(80, 25)); browseButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_this_button")); @@ -442,7 +443,7 @@ public class CustomIconPane extends BasicPane { imagePane.add(browseButton); Component[][] components = {{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":"), nameTextField}, {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon") + ":"), imagePane}}; - JPanel centerPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1); this.add(centerPane, BorderLayout.CENTER); } From 2cb92e14d1fa0564fe262200b08d3997adbbe4a2 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 25 Sep 2020 14:28:18 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=EF=BC=8C=E6=98=8E=E7=A1=AEbug=E5=8E=9F=E5=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/SheetNameTabPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java index 0c7c359f0a..ead1cf2f1e 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java @@ -496,7 +496,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse sheetIcon.paintIcon(this, g2d, (int) textX + charWidth, 2); g2d.setPaint(getForeground()); - // REPORT-40495 之前的g2d.drawString()无法画出韩文sheetName,修改成GraphHelper的drawString + // REPORT-40495 之前的g2d.drawString(),在windows下默认宋体时,无法绘制韩文字符,而GraphHelper的drawString中对韩文做了额外处理,可以绘制韩文字符 GraphHelper.drawString(g2d, sheetName, (int) textX + charWidth + 14, textAscent); } From 78473a8c3483c7c28bf165b165eaf1b3cb0c8337 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Fri, 25 Sep 2020 16:17:42 +0800 Subject: [PATCH 06/11] =?UTF-8?q?REPORT-40496=20=E3=80=9010.0.10=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=87=8C=E7=9A=84?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8D=87=E7=BA=A7=E4=B8=8E=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E7=9A=84=E6=9B=B4=E6=96=B0=E5=8D=87=E7=BA=A7=E4=B8=8D=E4=B8=80?= =?UTF-8?q?=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/update/ui/dialog/UpdateMainDialog.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java index 3992be6a91..05608c62e6 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java @@ -544,7 +544,7 @@ public class UpdateMainDialog extends UIDialog { private void showDownLoadInfo() { //形如 Build#release-2018.07.31.03.03.52.80 String buildNO = downloadFileConfig.optString("buildNO"); - Date jarDate = (new SimpleDateFormat("yyyy.MM.dd")).parse(buildNO, new ParsePosition(buildNO.indexOf("-") + 1)); + Date jarDate = (new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss")).parse(buildNO, new ParsePosition(buildNO.indexOf("-") + 1)); String serverVersionNO = downloadFileConfig.optString("versionNO"); String currentVersionNO = ProductConstants.RELEASE_VERSION; String[] serverVersionSplitStr = serverVersionNO.split("\\."); @@ -556,8 +556,8 @@ public class UpdateMainDialog extends UIDialog { //形如 Build#release-2018.07.31.03.03.52.80 String currentNO = GeneralUtils.readBuildNO(); if (!".".equals(StableUtils.getInstallHome())) { - Date currentDate = (new SimpleDateFormat("yyyy.MM.dd")).parse(currentNO, new ParsePosition(currentNO.indexOf("-") + 1)); - if (DateUtils.subtractDate(jarDate, currentDate, DateUtils.DAY) > 0) { + Date currentDate = (new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss")).parse(currentNO, new ParsePosition(currentNO.indexOf("-") + 1)); + if (DateUtils.subtractDate(jarDate, currentDate, DateUtils.SECOND) > 0) { updateButton.setEnabled(true); updateLabel.setVisible(true); loadingLabel.stopLoading(buildNO.contains("-") ? buildNO.substring(buildNO.lastIndexOf("-") + 1) : buildNO); From e324f2ea84d0ff8613adfebdb2ec4a1571bb46cd Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 25 Sep 2020 16:59:16 +0800 Subject: [PATCH 07/11] =?UTF-8?q?REPORT-40553=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8-=E8=BF=9E=E7=BB=AD=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E7=A9=BA=E7=99=BD=E8=AE=BE=E8=AE=A1=E9=9D=A2=E6=9D=BF=EF=BC=8C?= =?UTF-8?q?body=E6=B2=A1=E6=9C=89=E5=A4=84=E4=BA=8E=E6=9C=AA=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/EditingMouseListener.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 0e66964b43..f275fa312e 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -166,7 +166,7 @@ public class EditingMouseListener extends MouseInputAdapter { // 获取焦点,以便获取热键 designer.requestFocus(); } - if (e.getButton() == MouseEvent.BUTTON1) { + if (e.getButton() == MouseEvent.BUTTON1 && e.getX() > 0 && e.getY() > 0) { Direction dir = selectionModel.getDirectionAt(e); if (!DesignerMode.isAuthorityEditing()) { @@ -177,13 +177,10 @@ public class EditingMouseListener extends MouseInputAdapter { if (designer.isDrawLineMode()) { designer.updateDrawLineMode(e); } else { - int relativeX = Math.max(0, e.getX()); - int relativeY = Math.max(0, e.getY()); - if (selectionModel.hasSelectionComponent() && selectionModel.getSelection().getRelativeBounds().contains( - designer.getHorizontalScaleValue() + relativeX, - designer.getVerticalScaleValue() + relativeY)) { + designer.getHorizontalScaleValue() + e.getX(), + designer.getVerticalScaleValue() + e.getY())) { lastPressEvent = e; lastXCreator = selectionModel.getSelection().getSelectedCreator(); } else { From 4eacb923fb87040cd3550ecab69911124569a3f1 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 25 Sep 2020 17:07:07 +0800 Subject: [PATCH 08/11] =?UTF-8?q?REPORT-40553=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8-=E8=BF=9E=E7=BB=AD=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E7=A9=BA=E7=99=BD=E8=AE=BE=E8=AE=A1=E9=9D=A2=E6=9D=BF=EF=BC=8C?= =?UTF-8?q?body=E6=B2=A1=E6=9C=89=E5=A4=84=E4=BA=8E=E6=9C=AA=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EditingMouseListener.java | 47 ++++++++++++------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index f482f7c97e..f275fa312e 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -166,7 +166,7 @@ public class EditingMouseListener extends MouseInputAdapter { // 获取焦点,以便获取热键 designer.requestFocus(); } - if (e.getButton() == MouseEvent.BUTTON1) { + if (e.getButton() == MouseEvent.BUTTON1 && e.getX() > 0 && e.getY() > 0) { Direction dir = selectionModel.getDirectionAt(e); if (!DesignerMode.isAuthorityEditing()) { @@ -177,13 +177,10 @@ public class EditingMouseListener extends MouseInputAdapter { if (designer.isDrawLineMode()) { designer.updateDrawLineMode(e); } else { - int relativeX = Math.max(0, e.getX()); - int relativeY = Math.max(0, e.getY()); - if (selectionModel.hasSelectionComponent() && selectionModel.getSelection().getRelativeBounds().contains( - designer.getHorizontalScaleValue() + relativeX, - designer.getVerticalScaleValue() + relativeY)) { + designer.getHorizontalScaleValue() + e.getX(), + designer.getVerticalScaleValue() + e.getY())) { lastPressEvent = e; lastXCreator = selectionModel.getSelection().getSelectedCreator(); } else { @@ -363,7 +360,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } // component.getParent() 是报表块所在的XWTitleLayout int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xElementCase.getY(); if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) { if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -405,16 +402,7 @@ public class EditingMouseListener extends MouseInputAdapter { } private void setCoverPaneNotDisplay(XCreator component, MouseEvent e, boolean isLinkedHelpDialog) { - if (xElementCase != null) { - int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); - int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); - Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); - if (rect.contains(e.getPoint())) { - return; - } - xElementCase.displayCoverPane(false); - } if (xChartEditor != null) { xChartEditor.displayCoverPane(false); } @@ -425,6 +413,15 @@ public class EditingMouseListener extends MouseInputAdapter { if (xTopLayoutContainer != null) { xTopLayoutContainer.setMouseEnter(false); } + //不知道为什么要对XElementCase进行判断,但是直接return会有bug,所以把他放在最后 + if (xElementCase != null) { + int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); + int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); + Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); + if (!rect.contains(e.getPoint())) { + xElementCase.displayCoverPane(false); + } + } designer.repaint(); } @@ -462,7 +459,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xChartEditor.getY(); if (e.getX() + GAP > minX && e.getX() - GAP < minX + button.getWidth()) { if (e.getY() + GAP > minY && e.getY() - GAP < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -700,6 +697,7 @@ public class EditingMouseListener extends MouseInputAdapter { currentXCreator.stopEditing(); currentXCreator = null; currentEditor = null; + refreshTopXCreator(); return true; } return true; @@ -727,4 +725,19 @@ public class EditingMouseListener extends MouseInputAdapter { } currentEditor.getEditorTarget().setBounds(bounds); } + + /** + * 刷新顶层组件 + * */ + public void refreshTopXCreator(boolean isEditing){ + designer.refreshTopXCreator(isEditing); + } + + /** + * 刷新顶层组件 + * */ + public void refreshTopXCreator(){ + refreshTopXCreator(false); + } + } From 367c8f23ea295d6fe653e221538be566662e4d42 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 25 Sep 2020 17:17:27 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EditingMouseListener.java | 39 ++++++------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index f275fa312e..2d9df7126c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -177,6 +177,7 @@ public class EditingMouseListener extends MouseInputAdapter { if (designer.isDrawLineMode()) { designer.updateDrawLineMode(e); } else { + if (selectionModel.hasSelectionComponent() && selectionModel.getSelection().getRelativeBounds().contains( designer.getHorizontalScaleValue() + e.getX(), @@ -360,7 +361,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } // component.getParent() 是报表块所在的XWTitleLayout int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xElementCase.getY(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) { if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -402,7 +403,16 @@ public class EditingMouseListener extends MouseInputAdapter { } private void setCoverPaneNotDisplay(XCreator component, MouseEvent e, boolean isLinkedHelpDialog) { + if (xElementCase != null) { + int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); + int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); + Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); + if (rect.contains(e.getPoint())) { + return; + } + xElementCase.displayCoverPane(false); + } if (xChartEditor != null) { xChartEditor.displayCoverPane(false); } @@ -413,15 +423,6 @@ public class EditingMouseListener extends MouseInputAdapter { if (xTopLayoutContainer != null) { xTopLayoutContainer.setMouseEnter(false); } - //不知道为什么要对XElementCase进行判断,但是直接return会有bug,所以把他放在最后 - if (xElementCase != null) { - int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); - int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); - Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); - if (!rect.contains(e.getPoint())) { - xElementCase.displayCoverPane(false); - } - } designer.repaint(); } @@ -459,7 +460,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xChartEditor.getY(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); if (e.getX() + GAP > minX && e.getX() - GAP < minX + button.getWidth()) { if (e.getY() + GAP > minY && e.getY() - GAP < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -697,7 +698,6 @@ public class EditingMouseListener extends MouseInputAdapter { currentXCreator.stopEditing(); currentXCreator = null; currentEditor = null; - refreshTopXCreator(); return true; } return true; @@ -725,19 +725,4 @@ public class EditingMouseListener extends MouseInputAdapter { } currentEditor.getEditorTarget().setBounds(bounds); } - - /** - * 刷新顶层组件 - * */ - public void refreshTopXCreator(boolean isEditing){ - designer.refreshTopXCreator(isEditing); - } - - /** - * 刷新顶层组件 - * */ - public void refreshTopXCreator(){ - refreshTopXCreator(false); - } - } From 44273fdf06543a4cb2e3c17a3757eec9e3781868 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 25 Sep 2020 17:47:46 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/EditingMouseListener.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 2d9df7126c..7d2ba0cc92 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -166,7 +166,7 @@ public class EditingMouseListener extends MouseInputAdapter { // 获取焦点,以便获取热键 designer.requestFocus(); } - if (e.getButton() == MouseEvent.BUTTON1 && e.getX() > 0 && e.getY() > 0) { + if (e.getButton() == MouseEvent.BUTTON1 && !beyondValidArea(e)) { Direction dir = selectionModel.getDirectionAt(e); if (!DesignerMode.isAuthorityEditing()) { @@ -195,6 +195,16 @@ public class EditingMouseListener extends MouseInputAdapter { e.translatePoint(oldX - e.getX(), oldY - e.getY()); } + private boolean beyondValidArea(MouseEvent e) { + if (e.getX() < 0 || e.getY() < 0 || + e.getX() > designer.getRootComponent().getWidth() || + e.getY() > (designer.getRootComponent().getHeight() + designer.getParaHeight())) { + return true; + } + return false; + } + + private void offsetEventPoint(MouseEvent e){ int x = designer.getRelativeX(e.getX()); int y = designer.getRelativeY(e.getY()); From ae699c5dd8b456b46cd7b7eb393fbf871fb398ec Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 25 Sep 2020 17:48:14 +0800 Subject: [PATCH 11/11] =?UTF-8?q?REPORT-40553=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8-=E8=BF=9E=E7=BB=AD=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E7=A9=BA=E7=99=BD=E8=AE=BE=E8=AE=A1=E9=9D=A2=E6=9D=BF=EF=BC=8C?= =?UTF-8?q?body=E6=B2=A1=E6=9C=89=E5=A4=84=E4=BA=8E=E6=9C=AA=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/EditingMouseListener.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index f275fa312e..e179590154 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -166,7 +166,7 @@ public class EditingMouseListener extends MouseInputAdapter { // 获取焦点,以便获取热键 designer.requestFocus(); } - if (e.getButton() == MouseEvent.BUTTON1 && e.getX() > 0 && e.getY() > 0) { + if (e.getButton() == MouseEvent.BUTTON1 && !beyondValidArea(e)) { Direction dir = selectionModel.getDirectionAt(e); if (!DesignerMode.isAuthorityEditing()) { @@ -194,6 +194,15 @@ public class EditingMouseListener extends MouseInputAdapter { e.translatePoint(oldX - e.getX(), oldY - e.getY()); } + private boolean beyondValidArea(MouseEvent e) { + if (e.getX() < 0 || e.getY() < 0 || + e.getX() > designer.getRootComponent().getWidth() || + e.getY() > (designer.getRootComponent().getHeight() + designer.getParaHeight())) { + return true; + } + return false; + } + private void offsetEventPoint(MouseEvent e){ int x = designer.getRelativeX(e.getX()); int y = designer.getRelativeY(e.getY());