From 4595288070a376dd5e86c4fa3b70e4316ca6d55d Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 26 Jul 2021 14:21:00 +0800 Subject: [PATCH 1/8] =?UTF-8?q?REPORT-55091=20=E5=8F=AA=E6=9C=89=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E9=9D=9E=E8=B6=85=E7=AE=A1=E7=94=A8=E6=88=B7=E7=9A=84?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=96=87=E4=BB=B6=E6=97=A0=E6=B3=95=E5=8F=A6?= =?UTF-8?q?=E5=AD=98=E6=88=96=E6=96=B0=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/env/RemoteEnvPane.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 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 ab7f27df08..3635937783 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -363,8 +363,8 @@ public class RemoteEnvPane extends BasicBeanPane { @Override public RemoteDesignerWorkspaceInfo updateBean() { - String url = this.remoteWorkspaceURL.getURL(); - String username = this.usernameInput.getText(); + String url = removeSpaces(this.remoteWorkspaceURL.getURL()); + String username = removeSpaces(this.usernameInput.getText()); String password = new String(this.passwordInput.getPassword()); boolean rememberPwd = this.rememberPwdCheckbox.isSelected(); DesignerEnvProcessor envProcessor = ExtraDesignClassManager.getInstance().getSingle(DesignerEnvProcessor.XML_TAG); @@ -384,6 +384,13 @@ public class RemoteEnvPane extends BasicBeanPane { return info; } + private String removeSpaces(String str) { + if (StringUtils.isNotEmpty(str)) { + return str.trim(); + } + return str; + } + @Override protected String title4PopupWindow() { return "Remote"; From 815f2a4cedae37d5d4c64c612fc7e34ea1f7d653 Mon Sep 17 00:00:00 2001 From: Starryi Date: Mon, 26 Jul 2021 17:14:12 +0800 Subject: [PATCH 2/8] =?UTF-8?q?REPORT-55757=20=E3=80=90=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E5=88=86=E7=A6=BB=E3=80=91=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A4=8D=E7=94=A8-=E6=A0=87=E9=A2=98=E5=9B=BE=E6=A1=88?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=9B=BE=EF=BC=8C=E6=82=AC=E6=B5=AE=E6=97=B6?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E7=9A=84=E9=81=AE=E7=BD=A9=E5=92=8C=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=9B=BE=E6=A0=87=EF=BC=8C=E9=BC=A0=E6=A0=87=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E4=BB=8E=E5=B7=A6=E8=BE=B9/=E4=B8=8A=E8=BE=B9?= =?UTF-8?q?=E6=BB=91=E5=87=BA=EF=BC=8C=E5=88=99=E5=88=A0=E9=99=A4=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E6=B6=88=E5=A4=B1=EF=BC=9B=E4=BD=86=E4=BB=8E=E5=8F=B3?= =?UTF-8?q?=E8=BE=B9/=E4=B8=8B=E8=BE=B9=E6=BB=91=E5=87=BA=EF=BC=8C?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=9B=BE=E6=A0=87=E8=BF=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 不需要在mouseExited里加多余的判断 【改动思路】 同上 --- .../design/gui/xpane/TitleInsetImagePane.java | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java index 2573f6adfa..870cab22d4 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java @@ -24,6 +24,7 @@ import com.fr.general.Background; import com.fr.general.IOUtils; import com.fr.general.ImageWithSuffix; import com.fr.general.act.TitlePacker; +import com.fr.report.core.cal.Rect; import com.fr.stable.Constants; import javax.swing.*; @@ -115,9 +116,13 @@ public class TitleInsetImagePane extends JPanel implements UIObserver { @Override public void mouseExited(MouseEvent e) { super.mouseExited(e); - imagePreviewOverlayPane.setVisible(false); - imageDeleteButton.setVisible(false); - imageDeleteButton.setEnabled(false); + int x = e.getX(); + int y = e.getY(); + if (x <= 0 || getWidth() <= x || y <= 0 || y >= getHeight()) { + imagePreviewOverlayPane.setVisible(false); + imageDeleteButton.setVisible(false); + imageDeleteButton.setEnabled(false); + } } }); @@ -146,6 +151,7 @@ public class TitleInsetImagePane extends JPanel implements UIObserver { IOUtils.readIcon("/com/fr/design/images/buttonicon/icon_delete_inset.png"), new Color(51, 51, 52, 178), 2); + imageDeleteButton.setEnabled(false); imageDeleteButton.setPreferredSize(new Dimension(DELETE_BUTTON_SIZE, DELETE_BUTTON_SIZE)); imagePreviewPane = new ImagePreviewPane(); @@ -207,20 +213,6 @@ public class TitleInsetImagePane extends JPanel implements UIObserver { }).dealWithImageFile(returnVal); } }); - this.imageDeleteButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - imagePreviewPane.setImageWithSuffix(null); - imageLocationPane.setSelectedIndex(DEFAULT_INSET_LOCATION_INDEX); - imagePaddingPane.setValue(DEFAULT_INSET_PADDING); - imagePreviewOverlayPane.setVisible(false); - imageDeleteButton.setVisible(false); - imageDeleteButton.setEnabled(false); - getComponent(1).setVisible(false); - - fireStateChanged(); - } - }); } public void populateBean(TitlePacker packer) { From 908e7dbfadf848f82ed9bb96dbe7572638023896 Mon Sep 17 00:00:00 2001 From: Starryi Date: Mon, 26 Jul 2021 17:36:09 +0800 Subject: [PATCH 3/8] =?UTF-8?q?REPORT-55757=20=E3=80=90=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E5=88=86=E7=A6=BB=E3=80=91=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A4=8D=E7=94=A8-=E6=A0=87=E9=A2=98=E5=9B=BE=E6=A1=88?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=9B=BE=EF=BC=8C=E6=82=AC=E6=B5=AE=E6=97=B6?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E7=9A=84=E9=81=AE=E7=BD=A9=E5=92=8C=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=9B=BE=E6=A0=87=EF=BC=8C=E9=BC=A0=E6=A0=87=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E4=BB=8E=E5=B7=A6=E8=BE=B9/=E4=B8=8A=E8=BE=B9?= =?UTF-8?q?=E6=BB=91=E5=87=BA=EF=BC=8C=E5=88=99=E5=88=A0=E9=99=A4=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E6=B6=88=E5=A4=B1=EF=BC=9B=E4=BD=86=E4=BB=8E=E5=8F=B3?= =?UTF-8?q?=E8=BE=B9/=E4=B8=8B=E8=BE=B9=E6=BB=91=E5=87=BA=EF=BC=8C?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=9B=BE=E6=A0=87=E8=BF=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 不需要在mouseExited里加多余的判断 【改动思路】 同上 --- .../fr/design/gui/xpane/TitleInsetImagePane.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java index 870cab22d4..48d1028e64 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java @@ -24,7 +24,6 @@ import com.fr.general.Background; import com.fr.general.IOUtils; import com.fr.general.ImageWithSuffix; import com.fr.general.act.TitlePacker; -import com.fr.report.core.cal.Rect; import com.fr.stable.Constants; import javax.swing.*; @@ -151,7 +150,6 @@ public class TitleInsetImagePane extends JPanel implements UIObserver { IOUtils.readIcon("/com/fr/design/images/buttonicon/icon_delete_inset.png"), new Color(51, 51, 52, 178), 2); - imageDeleteButton.setEnabled(false); imageDeleteButton.setPreferredSize(new Dimension(DELETE_BUTTON_SIZE, DELETE_BUTTON_SIZE)); imagePreviewPane = new ImagePreviewPane(); @@ -213,6 +211,20 @@ public class TitleInsetImagePane extends JPanel implements UIObserver { }).dealWithImageFile(returnVal); } }); + this.imageDeleteButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + imagePreviewPane.setImageWithSuffix(null); + imageLocationPane.setSelectedIndex(DEFAULT_INSET_LOCATION_INDEX); + imagePaddingPane.setValue(DEFAULT_INSET_PADDING); + imagePreviewOverlayPane.setVisible(false); + imageDeleteButton.setVisible(false); + imageDeleteButton.setEnabled(false); + getComponent(1).setVisible(false); + + fireStateChanged(); + } + }); } public void populateBean(TitlePacker packer) { From b876e8b510d0e1d1b1b57b50c027a4c12fad2fe3 Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Mon, 26 Jul 2021 21:24:11 +0800 Subject: [PATCH 4/8] =?UTF-8?q?REPORT-49910=20=E3=80=90FRX=E3=80=91?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=A0=8F=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=8D=95=E7=8B=AC=E6=9B=BF=E6=8D=A2=E6=96=B0?= =?UTF-8?q?=E5=89=8D=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JWorkBook.java | 3 +-- 1 file changed, 1 insertion(+), 2 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 1148d86a7e..c946a8a039 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 @@ -55,7 +55,6 @@ import com.fr.design.module.DesignModuleFactory; import com.fr.design.parameter.ParameterDefinitePane; import com.fr.design.parameter.ParameterInputPane; import com.fr.design.preview.MobilePreview; -import com.fr.design.preview.PagePlusPreview; import com.fr.design.preview.PagePreview; import com.fr.design.preview.ViewPreview; import com.fr.design.preview.WritePreview; @@ -928,7 +927,7 @@ public class JWorkBook extends JTemplate { public PreviewProvider[] supportPreview() { PreviewProvider[] templatePreviews = super.supportPreview(); return ArrayUtils.addAll(new PreviewProvider[]{ - new PagePreview(), new WritePreview(), new ViewPreview(), new MobilePreview(), new PagePlusPreview() + new PagePreview(), new WritePreview(), new ViewPreview(), new MobilePreview() }, templatePreviews); } From 7adbd182e63c61039399ebc4a5bb6cb182c744c4 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 27 Jul 2021 11:45:32 +0800 Subject: [PATCH 5/8] =?UTF-8?q?REPORT-55757=20=E3=80=90=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E5=88=86=E7=A6=BB=E3=80=91=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A4=8D=E7=94=A8-=E6=A0=87=E9=A2=98=E5=9B=BE=E6=A1=88?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=9B=BE=EF=BC=8C=E6=82=AC=E6=B5=AE=E6=97=B6?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E7=9A=84=E9=81=AE=E7=BD=A9=E5=92=8C=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=9B=BE=E6=A0=87=EF=BC=8C=E9=BC=A0=E6=A0=87=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E4=BB=8E=E5=B7=A6=E8=BE=B9/=E4=B8=8A=E8=BE=B9?= =?UTF-8?q?=E6=BB=91=E5=87=BA=EF=BC=8C=E5=88=99=E5=88=A0=E9=99=A4=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E6=B6=88=E5=A4=B1=EF=BC=9B=E4=BD=86=E4=BB=8E=E5=8F=B3?= =?UTF-8?q?=E8=BE=B9/=E4=B8=8B=E8=BE=B9=E6=BB=91=E5=87=BA=EF=BC=8C?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=9B=BE=E6=A0=87=E8=BF=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 新建一个透明面板监听鼠标移入移除和点击手势,避免监听移入移除 和点击的手势处理冲突 【改动思路】 同上 --- .../design/gui/xpane/TitleInsetImagePane.java | 47 +++++++++++-------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java index 48d1028e64..3671259a20 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java @@ -35,7 +35,6 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; import java.awt.geom.RoundRectangle2D; /** @@ -96,14 +95,21 @@ public class TitleInsetImagePane extends JPanel implements UIObserver { imagePreviewPane.setBounds(0, 0, IMAGE_PREVIEW_SIZE, IMAGE_PREVIEW_SIZE); imagePreviewOverlayPane.setBounds(1, 1, IMAGE_PREVIEW_SIZE - 2, IMAGE_PREVIEW_SIZE - 2); imageDeleteButton.setBounds(IMAGE_PREVIEW_SIZE - DELETE_BUTTON_SIZE, 0, DELETE_BUTTON_SIZE, DELETE_BUTTON_SIZE); - deletableImagePreviewPane.add(imageDeleteButton, 0); - deletableImagePreviewPane.add(imagePreviewOverlayPane, 1); - deletableImagePreviewPane.add(imagePreviewPane, 2); + + JPanel mousePane = new JPanel(); + mousePane.setBounds(0, 0, IMAGE_PREVIEW_SIZE, IMAGE_PREVIEW_SIZE); + mousePane.setOpaque(false); + mousePane.setBackground(null); + + deletableImagePreviewPane.add(mousePane, 0); + deletableImagePreviewPane.add(imageDeleteButton, 1); + deletableImagePreviewPane.add(imagePreviewOverlayPane, 2); + deletableImagePreviewPane.add(imagePreviewPane, 3); imagePreviewOverlayPane.setVisible(false); imageDeleteButton.setVisible(false); imageDeleteButton.setEnabled(false); - deletableImagePreviewPane.addMouseListener(new MouseAdapter() { + mousePane.addMouseListener(new MouseAdapter() { @Override public void mouseEntered(MouseEvent e) { super.mouseEntered(e); @@ -115,12 +121,27 @@ public class TitleInsetImagePane extends JPanel implements UIObserver { @Override public void mouseExited(MouseEvent e) { super.mouseExited(e); + imagePreviewOverlayPane.setVisible(false); + imageDeleteButton.setVisible(false); + imageDeleteButton.setEnabled(false); + } + + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); int x = e.getX(); int y = e.getY(); - if (x <= 0 || getWidth() <= x || y <= 0 || y >= getHeight()) { + Rectangle bounds = imageDeleteButton.getBounds(); + if (bounds.x < x && x < bounds.x + bounds.width && bounds.y < y && y < bounds.y + bounds.height) { + imagePreviewPane.setImageWithSuffix(null); + imageLocationPane.setSelectedIndex(DEFAULT_INSET_LOCATION_INDEX); + imagePaddingPane.setValue(DEFAULT_INSET_PADDING); imagePreviewOverlayPane.setVisible(false); imageDeleteButton.setVisible(false); imageDeleteButton.setEnabled(false); + getComponent(1).setVisible(false); + + fireStateChanged(); } } }); @@ -211,20 +232,6 @@ public class TitleInsetImagePane extends JPanel implements UIObserver { }).dealWithImageFile(returnVal); } }); - this.imageDeleteButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - imagePreviewPane.setImageWithSuffix(null); - imageLocationPane.setSelectedIndex(DEFAULT_INSET_LOCATION_INDEX); - imagePaddingPane.setValue(DEFAULT_INSET_PADDING); - imagePreviewOverlayPane.setVisible(false); - imageDeleteButton.setVisible(false); - imageDeleteButton.setEnabled(false); - getComponent(1).setVisible(false); - - fireStateChanged(); - } - }); } public void populateBean(TitlePacker packer) { From 4fd14630e5b8a3410dfaaf0ae7aa8ba4d044d8fc Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 27 Jul 2021 11:52:43 +0800 Subject: [PATCH 6/8] =?UTF-8?q?REPORT-55839=20=E7=BB=84=E4=BB=B6=E5=A4=8D?= =?UTF-8?q?=E7=94=A8-=E7=A6=81=E7=94=A8tab=E5=9D=97=E7=9A=84=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=9B=BE=E7=89=87=E8=BE=B9=E6=A1=86=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E9=A2=84=E6=9C=9F=E6=98=AF=E5=8F=AA=E9=9D=A2?= =?UTF-8?q?=E5=90=91=E5=9B=BE=E8=A1=A8=E5=9D=97=E4=B8=8E=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 【问题原因】 使用LayoutStylePane的控件都启用了组件边框 【改动思路】 1. 新增控制参数supportBorderImage,控制样式面板中是否支持图片边框 2. supportBorderImage默认为false,不支持图片边框 3. 仅针对报表块和图表块,设置supportBorderImage为true,支持图片边框 --- .../gui/xpane/BorderLineAndImagePane.java | 41 ++++++++++++++----- .../fr/design/gui/xpane/LayoutStylePane.java | 9 +++- .../layout/WTitleLayoutDefinePane.java | 2 +- 3 files changed, 40 insertions(+), 12 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java index b25d66e30f..0f2b853d1b 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java @@ -98,13 +98,13 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver { private int[] ninePoint = new int[] {-1, -1, -1, -1}; - public BorderLineAndImagePane() { - this.initComponents(); + public BorderLineAndImagePane(boolean supportBorderImage) { + this.initComponents(supportBorderImage); this.initLayout(); } - private void initComponents() { - borderLineCombo = new BorderLineAndImageComboBox(); + private void initComponents(boolean supportBorderImage) { + borderLineCombo = new BorderLineAndImageComboBox(supportBorderImage); borderColorPane = new NewColorSelectBox(145); imagePreviewPane = new ImagePreviewPane() {{ setImageStyle(Style.DEFAULT_STYLE); @@ -386,16 +386,25 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver { protected static class BorderLineAndImageComboBox extends LineComboBox { public static final int LINE_PICTURE = -1; - public final static int[] BORDER_LINE_STYLE_ARRAY = new int[] { + public final static int[] BORDER_LINE_AND_IMAGE_STYLE_ARRAY = new int[] { Constants.LINE_NONE, LINE_PICTURE, Constants.LINE_THIN, //1px Constants.LINE_MEDIUM, //2px Constants.LINE_THICK, //3px }; + public final static int[] BORDER_LINE_STYLE_ARRAY = new int[] { + Constants.LINE_NONE, + Constants.LINE_THIN, //1px + Constants.LINE_MEDIUM, //2px + Constants.LINE_THICK, //3px + }; + + private boolean supportBorderImage = false; - public BorderLineAndImageComboBox() { - super(BORDER_LINE_STYLE_ARRAY); + public BorderLineAndImageComboBox(boolean supportBorderImage) { + super(supportBorderImage ? BORDER_LINE_AND_IMAGE_STYLE_ARRAY : BORDER_LINE_STYLE_ARRAY); + this.supportBorderImage = supportBorderImage; } @Override @@ -407,15 +416,27 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver { } public boolean isSelectedBorderLine() { - return getSelectedIndex() > 1; + Object object = getSelectedItem(); + if (object != null) { + int value = (int) object; + return value > 0; + } + return false; } public boolean isSelectedBorderImage() { - return getSelectedIndex() == 1; + Object object = getSelectedItem(); + if (object != null) { + int value = (int) object; + return value == LINE_PICTURE; + } + return false; } public void selectBorderImage() { - this.setSelectedIndex(1); + if (supportBorderImage) { + this.setSelectedIndex(1); + } } } diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java index 7c2094dd74..95659df6b7 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java @@ -88,7 +88,14 @@ public class LayoutStylePane extends BasicBeanPane { //标题背景透明度 protected UIPercentDragPane titleBackgroundOpacityPane; + private boolean supportBorderImage = false; + public LayoutStylePane() { + this(false); + } + + public LayoutStylePane(boolean supportBorderImage) { + this.supportBorderImage = supportBorderImage; this.initLayout(); } @@ -130,7 +137,7 @@ public class LayoutStylePane extends BasicBeanPane { protected JPanel createBackgroundStylePane() { borderStyleCombo = new UIComboBox(BORDER_STYLE); - borderLineAndImagePane = new BorderLineAndImagePane(); + borderLineAndImagePane = new BorderLineAndImagePane(this.supportBorderImage); cornerSpinner = new UISpinner(0,1000,1,0); double p = TableLayout.PREFERRED; diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java index bae310fdb9..004c3e2c67 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java @@ -27,7 +27,7 @@ public abstract class WTitleLayoutDefinePane Date: Tue, 27 Jul 2021 11:52:58 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=A4=96?= =?UTF-8?q?=E5=8F=8C=E5=87=BB=E6=A8=A1=E6=9D=BF=E6=89=93=E5=BC=80=EF=BC=8C?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=86=85=E4=BC=9A=E9=A2=9D=E5=A4=96?= =?UTF-8?q?=E6=89=93=E5=BC=80=E4=B8=80=E4=B8=AA=E7=A9=BA=E7=99=BD=E7=9A=84?= =?UTF-8?q?cpt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/utils/DesignUtils.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 58f5d2a5f6..8bd4e880d9 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 @@ -10,6 +10,7 @@ import com.fr.design.fun.DesignerEnvProcessor; import com.fr.design.gui.UILookAndFeel; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.ui.util.UIUtil; import com.fr.exit.DesignerExiter; import com.fr.file.FileFILE; import com.fr.general.ComparatorUtils; @@ -205,7 +206,13 @@ public class DesignUtils { isMatch = isMatch || path.endsWith(suffix); } if (isMatch) { - DesignerContext.getDesignerFrame().openTemplate(new FileFILE(f)); + // ui线程作为打开入口 + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + DesignerContext.getDesignerFrame().openTemplate(new FileFILE(f)); + } + }); } } } From b2bf9dd2c431717a46614f6762161baa1574d2c6 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 27 Jul 2021 14:56:50 +0800 Subject: [PATCH 8/8] =?UTF-8?q?REPORT-55850=20=E3=80=90=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E5=88=86=E7=A6=BB=E3=80=91=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A4=8D=E7=94=A8-Tab=E7=BB=84=E4=BB=B6=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E5=92=8C=E8=BE=B9=E6=A1=86=E9=A2=84=E8=A7=88=E4=B8=8D=E7=94=9F?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 1. Tab组件样式属性更新后,没有调用initStyl设置XCreator的样式重新渲染 2. Tab不支持圆角 3. Tab样式设置面板因为没有初始化标题相关配置项,导致update时,type变为默认值STANDARD,影响了 XWCardLayout.initStyle内部逻辑 【改动思路】 同上 --- .../cardlayout/XWCardMainBorderLayout.java | 5 ++++- .../design/gui/xpane/CardTagLayoutStylePane.java | 15 ++++++--------- .../com/fr/design/gui/xpane/LayoutStylePane.java | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java index 6009711f71..2f7200acf6 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java @@ -415,7 +415,10 @@ public class XWCardMainBorderLayout extends XWBorderLayout { */ @Override public void firePropertyChange(){ - return; + XWCardLayout cardLayout = this.getCardPart(); + if (cardLayout != null && cardLayout.toData() != null) { + cardLayout.initStyle(); + } } diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java index 5e6f7c06c5..37db551027 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java @@ -3,9 +3,7 @@ */ package com.fr.design.gui.xpane; -import com.fr.form.ui.LayoutBorderStyle; - -import javax.swing.*; +import javax.swing.JPanel; /** * CardTagLayoutBorderPane Pane. @@ -14,14 +12,13 @@ public class CardTagLayoutStylePane extends LayoutStylePane { @Override protected JPanel createTitleStylePane(){ - return null; + JPanel panel = super.createTitleStylePane(); + panel.setVisible(false); + return panel; } @Override - public void updateTitle(LayoutBorderStyle style) { - + protected JPanel createBackgroundStylePane(boolean supportCornerRadius) { + return super.createBackgroundStylePane(false); } - - @Override - protected void populateTitle() { } } diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java index 95659df6b7..453bd5e0da 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java @@ -110,7 +110,7 @@ public class LayoutStylePane extends BasicBeanPane { JPanel titlePane = createTitleStylePane(); JPanel bodyContentPane = currentIsRootLayout ? createBodyContentPane4RootLayout() : createBodyContentPane(); - JPanel backgroundPane = createBackgroundStylePane(); + JPanel backgroundPane = createBackgroundStylePane(true); if (titlePane != null) { container.add(titlePane, BorderLayout.NORTH); @@ -135,14 +135,14 @@ public class LayoutStylePane extends BasicBeanPane { this.add(container, BorderLayout.CENTER); } - protected JPanel createBackgroundStylePane() { + protected JPanel createBackgroundStylePane(boolean supportCornerRadius) { borderStyleCombo = new UIComboBox(BORDER_STYLE); borderLineAndImagePane = new BorderLineAndImagePane(this.supportBorderImage); cornerSpinner = new UISpinner(0,1000,1,0); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] rowSize = {p, p, p, p}; + double[] rowSize = supportCornerRadius ? new double[] {p, p, p, p} : new double[]{p, p, p}; double[] columnSize = {SETTING_LABEL_WIDTH, f}; UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Background_Style"));