From 9391e36c98d529b61c06c46adc444f7bf930075c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 18 Sep 2020 10:10:35 +0800 Subject: [PATCH 1/9] =?UTF-8?q?CHART-15840=20=E5=9B=BE=E8=A1=A8=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E5=8A=A0=E8=BD=BD=E6=85=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/chart/ChartDesignerActivator.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java index 0cd81f783..8a5e0e7d8 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java @@ -15,6 +15,7 @@ import com.fr.locale.LocaleScope; import com.fr.module.Activator; import com.fr.module.extension.Prepare; import com.fr.plugin.chart.vanchart.export.ImagePainter; +import com.fr.plugin.chart.vanchart.export.PainterDispatcher; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.van.chart.DownloadOnlineSourcesHelper; @@ -46,6 +47,7 @@ public class ChartDesignerActivator extends Activator implements Prepare { ImagePainter.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); ImagePainter.registerDefaultCallbackEvent(HistoryTemplateListCache.getInstance()); + PainterDispatcher.getInstance().distributeDesignPainter(); ChartTypeInterfaceManager.addPluginChangedListener(); } From f66826f607fd8a1e63a57361f9302df1cde1c900 Mon Sep 17 00:00:00 2001 From: Yyming Date: Mon, 21 Sep 2020 11:45:36 +0800 Subject: [PATCH 2/9] =?UTF-8?q?REPORT-39965=20=E6=96=B0=E5=BB=BA=E8=81=9A?= =?UTF-8?q?=E5=90=88=E6=8A=A5=E8=A1=A8=E4=B8=8B=E6=96=B9=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=99=AE=E9=80=9A=E6=8A=A5=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/JWorkBook.java | 14 ++++---------- .../fr/design/mainframe/PolySheetNameTabPane.java | 13 +------------ 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index 80c8b2d0b..a139a5428 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -208,13 +208,7 @@ public class JWorkBook extends JTemplate { } }; - reportComposite.addTargetModifiedListener(new TargetModifiedListener() { - - @Override - public void targetModified(TargetModifiedEvent e) { - JWorkBook.this.fireTargetModified(); - } - }); + reportComposite.addTargetModifiedListener(e -> JWorkBook.this.fireTargetModified()); reportComposite.setParentContainer(centerPane); return centerPane; @@ -241,11 +235,11 @@ public class JWorkBook extends JTemplate { /** * 判断sheet权限 * - * @param rolsName 角色 + * @param rolesName 角色 */ @Override - public void judgeSheetAuthority(String rolsName) { - boolean isCovered = reportComposite.getEditingTemplateReport().getWorkSheetPrivilegeControl().checkInvisible(rolsName); + public void judgeSheetAuthority(String rolesName) { + boolean isCovered = reportComposite.getEditingTemplateReport().getWorkSheetPrivilegeControl().checkInvisible(rolesName); centerPane.setSheeetCovered(isCovered); centerPane.refreshContainer(); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/PolySheetNameTabPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/PolySheetNameTabPane.java index cd61df1b4..73f63826b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/PolySheetNameTabPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/PolySheetNameTabPane.java @@ -11,6 +11,7 @@ import com.fr.design.menu.MenuDef; * @date 2015-2-5-上午10:19:17 * */ +@Deprecated public class PolySheetNameTabPane extends SheetNameTabPane{ /** @@ -19,17 +20,5 @@ public class PolySheetNameTabPane extends SheetNameTabPane{ public PolySheetNameTabPane(ReportComponentComposite reportCompositeX) { super(reportCompositeX); } - - protected void paintAddButton(Graphics2D g2d){ - ADD_POLY_SHEET.paintIcon(this, g2d, iconLocation, 3); - } - - - protected void firstInsertActionPerformed(){ - new PolyReportInsertAction().actionPerformed(null); - } - - protected void addInsertGridShortCut(MenuDef def){ - } } \ No newline at end of file From b306fea3705407c7cf5bde824be3c43540aa5c5e Mon Sep 17 00:00:00 2001 From: Yyming Date: Mon, 21 Sep 2020 14:55:41 +0800 Subject: [PATCH 3/9] =?UTF-8?q?REPORT-39884=20=E6=8D=A2=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/JPolyWorkBook.java | 12 ++----- .../mainframe/PolySheetNameTabPane.java | 36 +++++++++++++------ 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java index 48ddb6a05..ec9a2ce9d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java @@ -1,6 +1,4 @@ -/** - * - */ + package com.fr.design.mainframe; import com.fr.design.mainframe.template.info.JPolyWorkBookProcessInfo; @@ -13,7 +11,6 @@ import com.fr.report.poly.PolyWorkSheet; * 聚合报表Book, 跟WorkBook区别在于不能放入WorkSheet. * * @author neil - * * @date: 2015-2-5-上午8:58:39 */ public class JPolyWorkBook extends JWorkBook { @@ -32,15 +29,12 @@ public class JPolyWorkBook extends JWorkBook { * 创建sheet名称tab面板 * * @param reportCompositeX 当前组件对象 - * * @return sheet名称tab面板 - * * @date 2015-2-5-上午11:42:12 - * */ @Override - public SheetNameTabPane createSheetNameTabPane(ReportComponentComposite reportCompositeX){ - return new PolySheetNameTabPane(reportCompositeX); + public SheetNameTabPane createSheetNameTabPane(ReportComponentComposite reportCompositeX) { + return new SheetNameTabPane(reportCompositeX); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/PolySheetNameTabPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/PolySheetNameTabPane.java index 73f63826b..8969661bf 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/PolySheetNameTabPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/PolySheetNameTabPane.java @@ -1,24 +1,38 @@ package com.fr.design.mainframe; -import java.awt.Graphics2D; import com.fr.design.menu.MenuDef; +import java.awt.Graphics2D; + /** * 获取 - * + * * @date 2015-2-5-上午10:19:17 - * + * @deprecated 让聚合报表也可以新建普通报表sheet, 逻辑和普通报表保持一致, 弃用此个性化设置 */ @Deprecated -public class PolySheetNameTabPane extends SheetNameTabPane{ - - /** - * 构造函数 - */ - public PolySheetNameTabPane(ReportComponentComposite reportCompositeX) { - super(reportCompositeX); - } +public class PolySheetNameTabPane extends SheetNameTabPane { + + /** + * 构造函数 + */ + public PolySheetNameTabPane(ReportComponentComposite reportCompositeX) { + super(reportCompositeX); + } + + protected void paintAddButton(Graphics2D g2d) { + ADD_POLY_SHEET.paintIcon(this, g2d, iconLocation, 3); + } + + + protected void firstInsertActionPerformed() { + new PolyReportInsertAction().actionPerformed(null); + } + + + protected void addInsertGridShortCut(MenuDef def) { + } } \ No newline at end of file From 50b2fcfde5e90b817e860a8d535ae56ed1333bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 21 Sep 2020 16:36:16 +0800 Subject: [PATCH 4/9] =?UTF-8?q?CHART-15518=20=E8=BD=B4=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=88=B020=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/chart/ChartDesignerActivator.java | 2 - ...nChartCustomStackAndAxisConditionPane.java | 8 +- .../component/VanChartAxisButtonPane.java | 75 ++++++++++--------- 3 files changed, 46 insertions(+), 39 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java index 8a5e0e7d8..0cd81f783 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java @@ -15,7 +15,6 @@ import com.fr.locale.LocaleScope; import com.fr.module.Activator; import com.fr.module.extension.Prepare; import com.fr.plugin.chart.vanchart.export.ImagePainter; -import com.fr.plugin.chart.vanchart.export.PainterDispatcher; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.van.chart.DownloadOnlineSourcesHelper; @@ -47,7 +46,6 @@ public class ChartDesignerActivator extends Activator implements Prepare { ImagePainter.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); ImagePainter.registerDefaultCallbackEvent(HistoryTemplateListCache.getInstance()); - PainterDispatcher.getInstance().distributeDesignPainter(); ChartTypeInterfaceManager.addPluginChangedListener(); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java index ceb9bf480..86766676b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java @@ -6,18 +6,19 @@ import com.fr.data.condition.ListCondition; import com.fr.design.beans.BasicBeanPane; import com.fr.design.condition.LiteConditionPane; import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.utils.gui.GUICoreUtils; - import com.fr.plugin.chart.base.AttrSeriesStackAndAxis; import com.fr.van.chart.designer.style.series.VanChartSeriesConditionPane; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JPanel; +import javax.swing.ScrollPaneConstants; import java.awt.Component; import java.awt.Dimension; import java.awt.event.ActionEvent; @@ -46,10 +47,13 @@ public class VanChartCustomStackAndAxisConditionPane extends BasicBeanPane { private static final int B_W = 56; private static final int B_H = 21; private static final int COL_COUNT = 3; + private static final int MAX_COUNT = 20; private UIButton addButton; private UIPopupMenu popupMenu; + private UIMenuItem itemX; + private UIMenuItem itemY; private List indexList_X = new ArrayList(); private List indexList_Y = new ArrayList(); @@ -51,7 +53,7 @@ public class VanChartAxisButtonPane extends BasicBeanPane { private VanChartAxisPane parent; - public VanChartAxisButtonPane(VanChartAxisPane vanChartAxisPane){ + public VanChartAxisButtonPane(VanChartAxisPane vanChartAxisPane) { this.parent = vanChartAxisPane; this.setLayout(new BorderLayout()); @@ -66,6 +68,20 @@ public class VanChartAxisButtonPane extends BasicBeanPane { buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 10, 0)); this.add(buttonPane, BorderLayout.CENTER); + itemX = new UIMenuItem(VanChartAttrHelper.X_AXIS_PREFIX); + itemX.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + addXAxis(); + } + }); + itemY = new UIMenuItem(VanChartAttrHelper.Y_AXIS_PREFIX); + itemY.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + addYAxis(); + } + }); addButton.addActionListener(addListener); } @@ -92,12 +108,12 @@ public class VanChartAxisButtonPane extends BasicBeanPane { pane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); buttonPane.add(pane); } - if(pane != null) { + if (pane != null) { pane.add(indexList_Y.get(i)); } } - if(popupMenu != null){ + if (popupMenu != null) { popupMenu.setVisible(false); } @@ -114,19 +130,19 @@ public class VanChartAxisButtonPane extends BasicBeanPane { indexList_X.clear(); indexList_Y.clear(); List xList = plot.getXAxisList(); - for(VanChartAxis axis : xList){ + for (VanChartAxis axis : xList) { ChartAxisButton x = new ChartAxisButton(plot.getXAxisName(axis)); x.setToolTipText(plot.getXAxisName(axis)); indexList_X.add(x); } List yList = plot.getYAxisList(); - for(VanChartAxis axis : yList){ + for (VanChartAxis axis : yList) { ChartAxisButton y = new ChartAxisButton(plot.getYAxisName(axis)); y.setToolTipText(plot.getYAxisName(axis)); indexList_Y.add(y); } - if(indexList_X.isEmpty()){ + if (indexList_X.isEmpty()) { this.removeAll(); } else { indexList_X.get(0).setSelected(true); @@ -143,7 +159,7 @@ public class VanChartAxisButtonPane extends BasicBeanPane { return null; } - public String getNewChartName(List existList, String prefix){ + public String getNewChartName(List existList, String prefix) { int count = existList.size() + 1; while (true) { String name_test = prefix + count; @@ -165,31 +181,19 @@ public class VanChartAxisButtonPane extends BasicBeanPane { ActionListener addListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - if(popupMenu == null){ - popupMenu = new UIPopupMenu(); - UIMenuItem item_x = new UIMenuItem(VanChartAttrHelper.X_AXIS_PREFIX); - item_x.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - addXAxis(); - } - }); - UIMenuItem item_y = new UIMenuItem(VanChartAttrHelper.Y_AXIS_PREFIX); - item_y.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - addYAxis(); - } - }); - popupMenu.add(item_x); - popupMenu.add(item_y); + popupMenu = new UIPopupMenu(); + if (indexList_X.size() < MAX_COUNT) { + popupMenu.add(itemX); + } + if (indexList_Y.size() < MAX_COUNT) { + popupMenu.add(itemY); } popupMenu.setVisible(true); GUICoreUtils.showPopupMenu(popupMenu, addButton, addButton.getWidth() - popupMenu.getPreferredSize().width, addButton.getY() - 1 + addButton.getHeight()); } }; - private void addXAxis(){ + private void addXAxis() { String name = getNewChartName(indexList_X, VanChartAttrHelper.X_AXIS_PREFIX); ChartAxisButton button = new ChartAxisButton(name); @@ -199,7 +203,7 @@ public class VanChartAxisButtonPane extends BasicBeanPane { layoutPane(); } - private void addYAxis(){ + private void addYAxis() { String name = getNewChartName(indexList_Y, VanChartAttrHelper.Y_AXIS_PREFIX); ChartAxisButton button = new ChartAxisButton(name); @@ -216,9 +220,10 @@ public class VanChartAxisButtonPane extends BasicBeanPane { private class AddButton extends UIButton { - public AddButton(Icon icon){ + public AddButton(Icon icon) { super(icon); } + /** * 组件是否需要响应添加的观察者事件 * @@ -277,19 +282,19 @@ public class VanChartAxisButtonPane extends BasicBeanPane { } private void noSelected() { - for(ChartAxisButton button : indexList_X){ + for (ChartAxisButton button : indexList_X) { button.setSelected(false); } - for(ChartAxisButton button : indexList_Y){ + for (ChartAxisButton button : indexList_Y) { button.setSelected(false); } } private void checkMoveOn(boolean moveOn) { - for(ChartAxisButton button : indexList_X){ + for (ChartAxisButton button : indexList_X) { button.isMoveOn = false; } - for(ChartAxisButton button : indexList_Y){ + for (ChartAxisButton button : indexList_Y) { button.isMoveOn = false; } From c147fec30298c1c7bc0673af4bdfcdc5b16bb812 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Tue, 22 Sep 2020 09:22:10 +0800 Subject: [PATCH 5/9] =?UTF-8?q?REPORT-40025=20=E4=BF=AE=E6=94=B9=E5=9C=A8?= =?UTF-8?q?=E5=B7=B2=E9=80=89=E6=8B=A9=E7=BB=84=E4=BB=B6=E4=B8=AD=E6=8C=89?= =?UTF-8?q?=E5=9D=90=E6=A0=87=E8=8E=B7=E5=8F=96=E7=BB=84=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/XCreatorUtils.java | 7 +-- .../com/fr/design/mainframe/FormDesigner.java | 57 +++++++++++++++---- 2 files changed, 48 insertions(+), 16 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 0c4ea6313..260318023 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 @@ -345,17 +345,16 @@ public class XCreatorUtils { } /** - * 获取组件的最顶层XMainBorderLayout,没有则返回null + * 获取组件的上一层的XMainBorderLayout,没有则返回null * */ @Nullable public static XWCardMainBorderLayout getTopXMainBorderLayout(Container creator) { - XWCardMainBorderLayout result = null; while (creator != null) { if (creator instanceof XWCardMainBorderLayout) { - result = (XWCardMainBorderLayout) creator; + return (XWCardMainBorderLayout) creator; } creator = creator.getParent(); } - return result; + return 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 55c2106b0..ef7760cdb 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 @@ -842,26 +842,59 @@ public class FormDesigner extends TargetComponent
implements TreeSelection if (shouldContinue) { continue; } - //如果组件为XWCardMainBorderLayout的子组件,直接从XWCardMainBorderLayout中去找 - XWCardMainBorderLayout borderLayout = XCreatorUtils.getTopXMainBorderLayout(creator); - if (borderLayout != null) { - return xCreatorAt(x, y, borderLayout, null); + //获取当前组件父组件相对于rootComponent或者paraComponent的距离 + int relativeParentX = getRelativeParentX(creator.getParent()); + int relativeParentY = getRelativeParentY(creator.getParent()); + + //如果不是布局容器,直接进行对比 + if (!(creator instanceof XLayoutContainer)) { + x -= relativeParentX + creator.getX(); + y -= relativeParentY + creator.getY(); + Rectangle rect = ComponentUtils.computeVisibleRect(creator); + // 判断是否处于交叉区域 + if (isIntersectArea(x, y, rect)) { + return creator; + } } + + //如果是布局容器,从布局容器向下找 if (creator instanceof XLayoutContainer) { - return xCreatorAt(x, y, creator, null); + XCreator result = xCreatorAt(x - relativeParentX, y - relativeParentY, creator, null); + if (result != null) return result; } - x -= creator.getX(); - y -= creator.getY(); - Rectangle rect = ComponentUtils.computeVisibleRect(creator); - // 判断是否处于交叉区域 - if (!isIntersectArea(x, y, rect)) { - continue; + + //最后,如果组件为Tab容器中的子组件,再从Tab容器中去找 + XWCardMainBorderLayout borderLayout = XCreatorUtils.getTopXMainBorderLayout(creator); + if (borderLayout != null) { + relativeParentX = getRelativeParentX(borderLayout.getParent()); + relativeParentY = getRelativeParentY(borderLayout.getParent()); + return xCreatorAt(x - relativeParentX, y - relativeParentY, borderLayout, null); } - return creator; } return null; } + /** + * 获取当前组件相对于rootComponent或者paraComponent的横向距离 + */ + private int getRelativeParentX(Container container) { + return returnZero(container) ? 0 : container.getX() + getRelativeParentX(container.getParent()); + } + + /** + * 获取当前组件相对于rootComponent或者paraComponent的纵向距离 + */ + private int getRelativeParentY(Container container) { + return returnZero(container) ? 0 : container.getY() + getRelativeParentY(container.getParent()); + } + + private boolean returnZero(Container container) { + return !(container instanceof XLayoutContainer) + || container == rootComponent + || (paraComponent != null && container == paraComponent); + } + + /** * 刷新顶层组件 * */ From 28cde5e899b3a9151f191d315a82006ca53eed89 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Tue, 22 Sep 2020 09:44:47 +0800 Subject: [PATCH 6/9] =?UTF-8?q?REPORT-40025=20=E4=BF=AE=E6=94=B9=E5=9C=A8?= =?UTF-8?q?=E5=B7=B2=E9=80=89=E6=8B=A9=E7=BB=84=E4=BB=B6=E4=B8=AD=E6=8C=89?= =?UTF-8?q?=E5=9D=90=E6=A0=87=E8=8E=B7=E5=8F=96=E7=BB=84=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=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/mainframe/FormDesigner.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 ef7760cdb..c4fa2df8a 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 @@ -848,11 +848,11 @@ public class FormDesigner extends TargetComponent implements TreeSelection //如果不是布局容器,直接进行对比 if (!(creator instanceof XLayoutContainer)) { - x -= relativeParentX + creator.getX(); - y -= relativeParentY + creator.getY(); + int newX = x - relativeParentX - creator.getX(); + int newY = y - relativeParentY - creator.getY(); Rectangle rect = ComponentUtils.computeVisibleRect(creator); // 判断是否处于交叉区域 - if (isIntersectArea(x, y, rect)) { + if (isIntersectArea(newX, newY, rect)) { return creator; } } @@ -860,7 +860,9 @@ public class FormDesigner extends TargetComponent implements TreeSelection //如果是布局容器,从布局容器向下找 if (creator instanceof XLayoutContainer) { XCreator result = xCreatorAt(x - relativeParentX, y - relativeParentY, creator, null); - if (result != null) return result; + if (result != null) { + return result; + } } //最后,如果组件为Tab容器中的子组件,再从Tab容器中去找 From 41c033b948b7a09d1d0e5cafad27615f8b2ed43f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 22 Sep 2020 16:06:38 +0800 Subject: [PATCH 7/9] =?UTF-8?q?CHART-15704=20=E8=AF=95=E7=AE=A1=E5=9E=8B?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E7=9B=98=E6=A0=87=E7=AD=BE=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=B6=E5=80=99=EF=BC=8C?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E6=8A=8A=E6=89=80=E6=9C=89=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E9=83=BD=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../label/VanChartGaugeCateOrPercentLabelDetailPane.java | 2 +- .../designer/style/label/VanChartGaugeLabelDetailPane.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java index 292dcbfa4..9a5c45382 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java @@ -22,7 +22,7 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe } protected double[] getLabelPaneRowSize(Plot plot, double p) { - if (hasLabelAlign(plot)) { + if (hasLabelAlignPane()) { return new double[]{p, p, p, p}; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java index f06e7c1c7..0921b6d62 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java @@ -123,7 +123,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { } protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { - if (hasLabelAlign(plot)) { + if (hasLabelAlignPane()) { return new Component[][]{ new Component[]{getDataLabelContentPane(), null}, @@ -222,6 +222,10 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { return getGaugeStyle() == GaugeStyle.THERMOMETER && !((VanChartGaugePlot) plot).getGaugeDetailStyle().isHorizontalLayout(); } + protected boolean hasLabelAlignPane() { + return getGaugeStyle() == GaugeStyle.THERMOMETER; + } + public void populate(AttrLabelDetail detail) { super.populate(detail); From 820b3b9edcb6144c77809e0e9ecc7e6b9eba3f3c Mon Sep 17 00:00:00 2001 From: vito Date: Tue, 22 Sep 2020 17:48:18 +0800 Subject: [PATCH 8/9] =?UTF-8?q?REPORT-38376=20JDK11=E4=B8=8BLabel=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=96=87=E5=AD=97=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/utils/DesignUtils.java | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index 2bf64642f..f443a10ec 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -19,10 +19,10 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.CommonCodeUtils; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import com.fr.stable.os.OperatingSystem; import com.fr.start.ServerStarter; import com.fr.workspace.WorkContext; -import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import javax.swing.UIManager; import java.awt.Desktop; @@ -31,7 +31,6 @@ import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.IOException; -import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; @@ -83,6 +82,7 @@ public class DesignUtils { /** * 判断设计器端口是否被其他程序占用 * 尝试去通信,无回应就是其他程序占用端口,否则需要继续判断是否为设计器进程未关闭 + * * @return */ public static boolean isPortOccupied() { @@ -153,7 +153,7 @@ public class DesignUtils { return; } try (Socket socket = new Socket("localhost", port)) { - clientSend(lines, socket); + clientSend(lines, socket); } catch (Exception ignore) { } @@ -189,10 +189,10 @@ public class DesignUtils { DesignerEnvManager.getEnvManager().setCurrentEnv2Default(); ServerStarter.browserDemoURL(); } else if ("check".equals(line)) { - clientSend(new String[] {"response"}, socket); + clientSend(new String[]{"response"}, socket); } else if ("end".equals(line)) { - DesignerExiter.getInstance().execute(); } - else if (StringUtils.isNotEmpty(line)) { + DesignerExiter.getInstance().execute(); + } else if (StringUtils.isNotEmpty(line)) { File f = new File(line); String path = f.getAbsolutePath(); @@ -219,7 +219,7 @@ public class DesignUtils { } - public static void responseToClient(Socket socket) { + public static void responseToClient(Socket socket) { try (OutputStream outputStream = socket.getOutputStream()) { outputStream.write("reponse".getBytes(StandardCharsets.UTF_8)); outputStream.flush(); @@ -285,13 +285,20 @@ public class DesignUtils { return key.startsWith("TextField.") || key.startsWith("PasswordField."); } + /** + * 获取当前系统语言下设计器用的默认字体 + * + * @return 默认字体 + */ private static FRFont getCurrentLocaleFont() { FRFont guiFRFont; Locale defaultLocale = Locale.getDefault(); - - if (isDisplaySimSun(defaultLocale)) { + // JDK9 之后宋体在计算label中字母的空间上出现问题,暂时先用雅黑兼容,以后再统一字体 + if (StableUtils.getMajorJavaVersion() >= 9 && OperatingSystem.isWindows()) { + guiFRFont = getNamedFont("Microsoft YaHei"); + } else if (isDisplaySimSun(defaultLocale)) { guiFRFont = getNamedFont("SimSun"); - } else { + } else { guiFRFont = getNamedFont("Dialog"); } From 380c24445044f36e754e0dc3e7582adc3667c753 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Sep 2020 11:41:18 +0800 Subject: [PATCH 9/9] =?UTF-8?q?REPORT-40458=20=E3=80=90=E5=9B=9E=E5=BD=92?= =?UTF-8?q?=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=87=8D=E5=90=AF=E4=BB=A5?= =?UTF-8?q?=E5=90=8E=E4=BC=9A=E5=8D=A1=E4=BD=8F=EF=BC=8C=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E9=99=A4=E4=BA=86=E8=8F=9C=E5=8D=95=E6=A0=8F=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E9=83=BD=E5=8A=A8=E4=B8=8D=E4=BA=86=20=E3=80=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91editingTemplate=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=88=A4=E7=A9=BA=EF=BC=8C=E5=BD=93=E6=97=B6=E8=87=AA?= =?UTF-8?q?=E5=B7=B1=E6=B5=8B=E8=AF=95=E5=8F=91=E7=8E=B0=E6=98=AF=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E5=87=BA=E7=8E=B0null=E6=83=85=E5=86=B5=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E8=BF=99=E4=B8=AA=E9=97=AE=E9=A2=98=E6=98=AF=E5=9B=A0?= =?UTF-8?q?=E4=B8=BA=E5=AE=89=E8=A3=85=E4=BA=86=E4=B8=80=E4=B8=AA=E6=96=B0?= =?UTF-8?q?=E5=BC=95=E6=93=8E=E6=8F=92=E4=BB=B6=E5=90=8E=EF=BC=8C=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E9=82=A3=E8=BE=B9=E6=9F=90=E4=B8=AA=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E4=BC=9A=E5=9C=A8setCurrentEditingTemplate?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=EF=BC=8C=E8=B0=83=E7=94=A8checkCombineUp?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E6=AD=A4=E6=97=B6getCurrentEditingT?= =?UTF-8?q?emplate=E4=BC=9A=E6=8B=BF=E5=88=B0null=E5=80=BC=EF=BC=8C?= =?UTF-8?q?=E7=84=B6=E5=90=8E=E5=87=BA=E7=8E=B0npe=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=A2=9E=E5=8A=A0=E5=88=A4?= =?UTF-8?q?=E7=A9=BA"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/DesignerFrame.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 92d06d0b5..fe0276b38 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -746,12 +746,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ public void checkCombineUp(boolean flag, ArrayList al) { //Yvan: 检查当前是否为WORK_SHEET状态,因为只有WORK_SHEET中含有格式刷组件,此时是不需要进行checkComponentsByNames的 - JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (jTemplate != null) { - if (jTemplate.getMenuState() != DesignState.WORK_SHEET) { - combineUp.checkComponentsByNames(flag, al); - } + if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getMenuState() == DesignState.WORK_SHEET) { + return; } + combineUp.checkComponentsByNames(flag, al); } /**