Browse Source

Merge pull request #10442 in DESIGN/design from release/11.0 to bugfix/11.0

* commit '7dd12510148f19ff66a6874acf94c4f6fd42647e':
  REPORT-79296 报表引擎属性显示不全 【问题原因】未考虑i8n英文环境下的Label自动换行 【改动思路】将涉及到的Label自动换行处理,略修改了原代码创建panel的布局方式,实际显示效果无变化。 【Review建议】
  REPORT-82110 设计器取色bug 【问题原因】取色器ColorPicker取色是基于截屏后读取颜色的,因此需确保弹出框全部关闭后截屏。 【改动思路】1、取色前添加hidePopupMenu的操作 2、使用invokeLater确保异步任务执行完成后截屏 3、为规避REPORT-25645的macOS适配问题,新增hidePopupMenu4PickColor的方法 【Review建议】
  REPORT-82110 设计器取色bug 【问题原因】取色器ColorPicker取色是基于截屏后读取颜色的,因此需确保弹出框全部关闭后截屏。 【改动思路】1、取色前添加hidePopupMenu的操作 2、使用invokeLater确保异步任务执行完成后截屏 3、为避免REPORT-25645的macOS适配问题,新增hidePopupMenu4PickColor的方法 【Review建议】
bugfix/11.0
superman 2 years ago
parent
commit
0a88a8666c
  1. 10
      designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java
  2. 11
      designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java
  3. 33
      designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java

10
designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java

@ -67,16 +67,10 @@ public class ColorPicker extends JDialog implements ActionListener {
hideCursor(); hideCursor();
// 如果要求实时变化,确保先关闭弹窗,再截屏 // 如果要求实时变化,确保先关闭弹窗,再截屏
// 主要针对"图案"选项卡中的"前景"、"背景"
if (this.setColorRealTime) { if (this.setColorRealTime) {
colorSelectable.setColor(Color.WHITE); // setColor 可以关闭弹窗 colorSelectable.setColor(Color.WHITE); // setColor 可以关闭弹窗
try { // REPORT-82110 确保关闭所有弹窗后截屏
Thread.sleep(100); // 等待弹窗关闭 SwingUtilities.invokeLater(colorPickerPanel :: captureScreen);
} catch (InterruptedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
Thread.currentThread().interrupt();
}
colorPickerPanel.captureScreen();
} }
} }

11
designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java

@ -153,12 +153,23 @@ public class UIToolbarColorButton extends UICombinationButton implements PopupHi
popupWin = null; popupWin = null;
} }
/**
* 取色器取色时隐藏弹出框与另一个hide的区别是无需经过macOS的判断以规避REPORT-25645的mac适配bug
*/
public void hidePopupMenu4PickColor() {
if (popupWin != null) {
popupWin.setVisible(false);
}
popupWin = null;
}
private ColorControlWindow getColorControlWindow() { private ColorControlWindow getColorControlWindow() {
//find parant. //find parant.
if (this.popupWin == null) { if (this.popupWin == null) {
this.popupWin = new ColorControlWindow(this.isCanBeNull(), UIToolbarColorButton.this) { this.popupWin = new ColorControlWindow(this.isCanBeNull(), UIToolbarColorButton.this) {
@Override @Override
protected void colorChanged() { protected void colorChanged() {
hidePopupMenu4PickColor();
UIToolbarColorButton.this.setColor(this.getColor()); UIToolbarColorButton.this.setColor(this.getColor());
} }

33
designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java

@ -12,12 +12,14 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.SiteCenter; import com.fr.general.SiteCenter;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.report.core.ReportUtils; import com.fr.report.core.ReportUtils;
import com.fr.report.stable.LayerReportAttr; import com.fr.report.stable.LayerReportAttr;
import com.fr.report.worksheet.WorkSheet; import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import javax.swing.AbstractButton; import javax.swing.AbstractButton;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
@ -26,13 +28,11 @@ import javax.swing.JLayeredPane;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JRadioButton; import javax.swing.JRadioButton;
import javax.swing.SwingConstants;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Desktop; import java.awt.Desktop;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
@ -121,7 +121,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
/** /**
* 目前先屏蔽后面新引擎显示页码再加上相关代码 * 目前先屏蔽后面新引擎显示页码再加上相关代码
* */ */
private void createEngineXSettingPane() { private void createEngineXSettingPane() {
outEngineXSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine")); outEngineXSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine"));
outEngineXSettingPane.setBounds(0, 0, 570, 240); outEngineXSettingPane.setBounds(0, 0, 570, 240);
@ -168,7 +168,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
private JPanel createTipPane(String tipText) { private JPanel createTipPane(String tipText) {
JPanel tipPane = new JPanel(); JPanel tipPane = new JPanel();
UILabel tip = new UILabel(tipText, SwingConstants.LEFT); UILabel tip = FRWidgetFactory.createLineWrapLabel(tipText, 420);
tip.setForeground(new Color(128, 128, 128)); tip.setForeground(new Color(128, 128, 128));
tipPane.add(tip); tipPane.add(tip);
return tipPane; return tipPane;
@ -185,19 +185,18 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
} }
private JPanel createAdvicePane() { private JPanel createAdvicePane() {
JPanel advicePane = new JPanel(new BorderLayout()); JPanel advicePane = new JPanel(FRGUIPaneFactory.create1ColumnGridLayout());
FRExplainLabel topExplainLabel = new FRExplainLabel(Toolkit.i18nText("Fine-Design_Report_Report_Engine_Warnning_Info")); // 上侧文字
advicePane.add(topExplainLabel, BorderLayout.NORTH); UILabel topExplainLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Report_Engine_Warnning_Info"), 480);
topExplainLabel.setForeground(new Color(0, 0, 0)); topExplainLabel.setForeground(new Color(0, 0, 0));
FlowLayout flowLayout = new FlowLayout(FlowLayout.LEADING); advicePane.add(topExplainLabel);
flowLayout.setHgap(0); // 下侧文字及链接
flowLayout.setVgap(0); JPanel adviceDownPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
JPanel adviceDownPane = new JPanel(flowLayout); advicePane.add(adviceDownPane);
advicePane.add(adviceDownPane, BorderLayout.CENTER); UILabel downExplainLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Report_Detail_Reference"));
FRExplainLabel downExplainLabel = new FRExplainLabel(Toolkit.i18nText("Fine-Design_Report_Report_Detail_Reference"));
adviceDownPane.add(downExplainLabel); adviceDownPane.add(downExplainLabel);
downExplainLabel.setForeground(new Color(0, 0, 0)); downExplainLabel.setForeground(new Color(0, 0, 0));
JLabel helper = new FRExplainLabel( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help")); JLabel helper = new FRExplainLabel(Toolkit.i18nText("Fine-Design_Report_Community_Help"));
helper.setForeground(new Color(1, 159, 222)); helper.setForeground(new Color(1, 159, 222));
adviceDownPane.add(helper); adviceDownPane.add(helper);
helper.addMouseListener(new MouseAdapter() { helper.addMouseListener(new MouseAdapter() {
@ -304,6 +303,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
} }
} }
} }
public void setDefaultAttr() { public void setDefaultAttr() {
clientPaging.setSelected(false); clientPaging.setSelected(false);
lineEngineCountPerPageEditor.setValue(30); lineEngineCountPerPageEditor.setValue(30);
@ -315,10 +315,12 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
private class SelectActionListener implements ActionListener { private class SelectActionListener implements ActionListener {
private AbstractButton source; private AbstractButton source;
private JPanel target; private JPanel target;
private SelectActionListener(AbstractButton source, JPanel target) { private SelectActionListener(AbstractButton source, JPanel target) {
this.source = source; this.source = source;
this.target = target; this.target = target;
} }
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (source.isSelected()) { if (source.isSelected()) {
@ -334,6 +336,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
private JLayeredPane target; private JLayeredPane target;
private JPanel showTarget; private JPanel showTarget;
private JPanel notShowTarget; private JPanel notShowTarget;
private EngineSelectActionListener(AbstractButton source, JLayeredPane target, JPanel showTarget, JPanel notShowTarget) { private EngineSelectActionListener(AbstractButton source, JLayeredPane target, JPanel showTarget, JPanel notShowTarget) {
this.source = source; this.source = source;
this.target = target; this.target = target;
@ -344,7 +347,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
/** /**
* 由于屏蔽了新引擎设置由于新引擎设置界面是空的行式引擎的设置界面会显示出来因此每次界面转换时将不需要显示的界面屏蔽 * 由于屏蔽了新引擎设置由于新引擎设置界面是空的行式引擎的设置界面会显示出来因此每次界面转换时将不需要显示的界面屏蔽
* 不需要屏蔽新引擎设置时就不需要showTarget.setVisible(true);notShowTarget.setVisible(false);这两行代码了 * 不需要屏蔽新引擎设置时就不需要showTarget.setVisible(true);notShowTarget.setVisible(false);这两行代码了
* **/ **/
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (source.isSelected()) { if (source.isSelected()) {

Loading…
Cancel
Save