From 452e0bf30093c7a7dd1d93d49afdcc121db047c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 7 Sep 2020 15:31:26 +0800 Subject: [PATCH 1/3] =?UTF-8?q?CHART-15610=20=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=A0=BC=E5=BC=8F=E4=B8=8D=E4=BF=9D=E7=95=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/designer/type/AbstractRectanglePlotPane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java index 6712fba900..6babd6a2f2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java @@ -68,6 +68,8 @@ public abstract class AbstractRectanglePlotPane extends AbstractVanChartTypePane VanChartAxis vanChartAxis = vanChartRectanglePlot.getValueAxisList().get(0); cloneAxis.setFormat(vanChartAxis.getFormat()); cloneAxis.setPercentage(vanChartAxis.isPercentage()); + cloneAxis.setCommonValueFormat(vanChartAxis.isCommonValueFormat()); + cloneAxis.setHtmlLabel(vanChartAxis.getHtmlLabel()); } return clonePlot; } catch (CloneNotSupportedException ex) { From 2b73c4dc269ab0efa9edb37cb3eecb55738fb06e Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Mon, 7 Sep 2020 17:45:46 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-38969=20=E4=BF=AE=E6=94=B9=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E7=82=B9=E5=87=BB=E5=9D=90=E6=A0=87=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/FormDesigner.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 5cb0157f9e..d66f1f2a6a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -38,6 +38,7 @@ import com.fr.design.designer.creator.XWBorderLayout; import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWTitleLayout; +import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.event.DesignerOpenedListener; @@ -64,6 +65,7 @@ import com.fr.form.ui.Widget; import com.fr.form.ui.WidgetValue; import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WFitLayout; +import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.general.ComparatorUtils; import com.fr.general.FRLogger; import com.fr.log.FineLoggerFactory; @@ -845,6 +847,7 @@ public class FormDesigner extends TargetComponent
implements TreeSelection x -= creator.getX(); y -= creator.getY(); Rectangle rect = ComponentUtils.computeVisibleRect(creator); + rect.y += nestTabCount(creator) * WCardMainBorderLayout.TAB_HEIGHT; // 判断是否处于交叉区域 if (!isIntersectArea(x, y, rect)) { continue; @@ -852,11 +855,24 @@ public class FormDesigner extends TargetComponent implements TreeSelection if (creator instanceof XWTitleLayout) { return creator.getEditingChildCreator(); } - return creator; + return xCreatorAt(x, y, creator, null); } return null; } + /** + * 计算嵌套的tab层数 + */ + private int nestTabCount(Container xCreator) { + if (xCreator == null) { + return 0; + } + if (xCreator instanceof XWTabFitLayout) { + return 1 + nestTabCount(xCreator.getParent()); + } + return nestTabCount(xCreator.getParent()); + } + /** * 刷新顶层组件 * */ From f3708aadeb90e02d8dce8725a18333496aa512e4 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Mon, 7 Sep 2020 20:38:16 +0800 Subject: [PATCH 3/3] =?UTF-8?q?REPORT-38969=20=E4=BF=AE=E6=94=B9=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E7=82=B9=E5=87=BB=E5=9D=90=E6=A0=87=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/designer/creator/XCreatorUtils.java | 7 +++++++ .../com/fr/design/mainframe/FormDesigner.java | 17 +++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java index 42069e4d8a..072e21fa9f 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java @@ -336,4 +336,11 @@ public class XCreatorUtils { } return IOUtils.readIcon(iconPath); } + + public static boolean containComponent(Container ancestor, Container xCreator) { + while (xCreator != null && xCreator.getParent() != ancestor) { + xCreator = xCreator.getParent(); + } + return xCreator != null; + } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index d66f1f2a6a..40da109cf2 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -191,6 +191,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection this.switchAction = switchAction; topXCreators=new TopXCreators(this); + topXCreators.setVisible(true); add(topXCreators); // 必须刷新"参数/控件树"面板,否则,若最近一次打开模版为 cpt,重启设计器,打开 frm,控件树消失 @@ -836,12 +837,16 @@ public class FormDesigner extends TargetComponent implements TreeSelection /** * 从已选择的组件中找x,y所在的组件 */ - private XCreator xCreatorAt(int x, int y, XCreator[] xCreators) { + private XCreator xCreatorAt(int x, int y,XCreator root) { + XCreator[] xCreators = selectionModel.getSelection().getSelectedCreators(); for (XCreator creator : xCreators) { - if (creator == null || !creator.isVisible()) { - continue; - } - if (creator instanceof XWAbsoluteBodyLayout || creator instanceof XWFitLayout || creator instanceof XWParameterLayout) { + boolean shouldContinue = creator == null + || !creator.isVisible() + || !XCreatorUtils.containComponent(root, creator) + || creator instanceof XWAbsoluteBodyLayout + || creator instanceof XWFitLayout + || creator instanceof XWParameterLayout; + if (shouldContinue) { continue; } x -= creator.getX(); @@ -1072,7 +1077,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection } int relativeX = x + (int) (formArea.getHorizontalValue() / scale) - container.getX(); int relativeY = y + (int) (formArea.getVerticalValue() / scale) - container.getY(); - XCreator result = xCreatorAt(relativeX, relativeY, selectionModel.getSelection().getSelectedCreators()); + XCreator result = xCreatorAt(relativeX, relativeY, container); return result == null ? getComponentAt(x, y, null) : result; }