Browse Source

Pull request #10580: fix: REPORT-82928 && REPORT-80211

Merge in DESIGN/design from ~HARRISON/design:final/11.0 to final/11.0

* commit 'b877e9d9344b902912627f3ab64b3d0beeb4664e':
  refactor: 变更方法的长度
  REPORT-80211 设计器语言修改为英文,启动页进入后限制有误 修改一下长度。
  fix: REPORT-82928【视觉验收】设计器起始页 debug 相关的源码。处理问题 详见:https://kms.fineres.com/pages/viewpage.action?pageId=572293771
new-design
Harrison-刘珂 2 years ago
parent
commit
3e4dfbe38e
  1. 62
      designer-base/src/main/java/com/fr/startup/ui/StartupPageWorkspacePanel.java
  2. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  3. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  4. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  5. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties

62
designer-base/src/main/java/com/fr/startup/ui/StartupPageWorkspacePanel.java

@ -4,6 +4,7 @@ import com.fr.base.svg.IconUtils;
import com.fr.design.components.tooltip.ModernToolTip;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.FRGraphics2D;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.ColorUtils;
@ -17,6 +18,8 @@ import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JToolTip;
import javax.swing.JViewport;
import javax.swing.RepaintManager;
import javax.swing.ScrollPaneConstants;
import javax.swing.border.EmptyBorder;
import java.awt.BasicStroke;
@ -28,9 +31,11 @@ import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.RenderingHints;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.ImageObserver;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
@ -127,9 +132,15 @@ public class StartupPageWorkspacePanel extends JPanel {
this.contentPanel = generateUnLimitContentPanel(this.partitions);
this.add(contentPanel, BorderLayout.NORTH);
}
private JComponent generateUnLimitContentPanel(List<List<StartupWorkspaceBean>> partitions) {
JComponent panel = generateUnLimitContentPanel0(partitions);
ColorUtils.transparentBackground(panel);
return panel;
}
private JComponent generateUnLimitContentPanel0(List<List<StartupWorkspaceBean>> partitions) {
JPanel workspaceDescWrapper = new JPanel();
workspaceDescWrapper.setLayout(new BorderLayout(0, 0));
workspaceDescWrapper.setBorder(new EmptyBorder(0, 0, 0, 0));
@ -142,16 +153,28 @@ public class StartupPageWorkspacePanel extends JPanel {
}
boolean needScroll = partitions.size() > 4;
if (needScroll) {
// 滚动条
UIScrollPane scrollPane = new UIScrollPane(workspaceDescPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setBorder(new EmptyBorder(10, 0, 0, 0));
scrollPane.setPreferredSize(new Dimension(CONTENT_WIDTH, SCROLL_HEIGHT));
workspaceDescWrapper.add(scrollPane, BorderLayout.CENTER);
return workspaceDescWrapper;
return generateScrollUnLimitContentPanel(workspaceDescWrapper, workspaceDescPanel);
}
workspaceDescWrapper.add(workspaceDescPanel, BorderLayout.CENTER);
ColorUtils.transparentBackground(workspaceDescWrapper);
return workspaceDescWrapper;
}
@NotNull
private JPanel generateScrollUnLimitContentPanel(JPanel workspaceDescWrapper, JPanel workspaceDescPanel) {
// 滚动条
UIScrollPane scrollPane = new UIScrollPane(workspaceDescPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
JViewport viewport = scrollPane.getViewport();
JViewport scrollViewport = new TransparentScrollViewPort();
// 动态画图
scrollViewport.addChangeListener(e -> repaintAll());
scrollViewport.setView(viewport.getView());
scrollPane.setViewport(scrollViewport);
scrollPane.setBorder(new EmptyBorder(10, 0, 0, 0));
scrollPane.setPreferredSize(new Dimension(CONTENT_WIDTH, SCROLL_HEIGHT));
workspaceDescWrapper.add(scrollPane, BorderLayout.CENTER);
return workspaceDescWrapper;
}
@ -580,4 +603,27 @@ public class StartupPageWorkspacePanel extends JPanel {
this.getRootPane().repaint();
}
/**
* 支持透明的滚动视图
*/
private class TransparentScrollViewPort extends JViewport {
/**
* 从而屏蔽掉 {@link RepaintManager.PaintManager#paintDoubleBuffered(JComponent, Image, Graphics, int, int, int, int)}
*
* @return 创建一个不会实际画图的 Graphics
*/
@Override
public Graphics getGraphics() {
Graphics graphics = super.getGraphics();
return new FRGraphics2D((Graphics2D) graphics) {
@Override
public boolean drawImage(Image img, int x, int y, ImageObserver observer) {
return true;
}
};
}
}
}

1
designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties

@ -15,6 +15,7 @@ com.fr.design.report.fit.firstColumn=120*20
com.fr.design.report.fit.column=160*20
com.fr.design.lock.LockInfoDialog=500*180
com.fr.design.mainframe.ForbiddenPane.refreshButton=75*24
com.fr.start.common.DesignerOpenEmptyPanel.createButton=120*24
com.fr.design.cell.expand.sort.pane=257*185
com.fr.design.sort.rule.item=125*20
com.fr.design.ds.column.sort.pane=250*180

1
designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties

@ -14,6 +14,7 @@ com.fr.design.report.fit.firstColumn=170*20
com.fr.design.report.fit.column=100*20
com.fr.design.lock.LockInfoDialog=500*180
com.fr.design.mainframe.ForbiddenPane.refreshButton=68*24
com.fr.start.common.DesignerOpenEmptyPanel.createButton=120*24
com.fr.design.cell.expand.sort.pane=257*170
com.fr.design.sort.rule.item=125*20
com.fr.design.ds.column.sort.pane=250*165

1
designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties

@ -14,6 +14,7 @@ com.fr.design.report.fit.firstColumn=130*20
com.fr.design.report.fit.column=100*20
com.fr.design.lock.LockInfoDialog=500*180
com.fr.design.mainframe.ForbiddenPane.refreshButton=80*24
com.fr.start.common.DesignerOpenEmptyPanel.createButton=70*24
com.fr.design.cell.expand.sort.pane=267*165
com.fr.design.sort.rule.item=125*20
com.fr.design.ds.column.sort.pane=250*180

1
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties

@ -14,6 +14,7 @@ com.fr.design.report.fit.firstColumn=80*20
com.fr.design.report.fit.column=100*20
com.fr.design.lock.LockInfoDialog=400*180
com.fr.design.mainframe.ForbiddenPane.refreshButton=68*24
com.fr.start.common.DesignerOpenEmptyPanel.createButton=70*24
com.fr.design.cell.expand.sort.pane=227*155
com.fr.design.sort.rule.item=80*20
com.fr.design.ds.column.sort.pane=220*150

Loading…
Cancel
Save