Browse Source

Pull request #3066: REPORT-44714 【10.0.12冒烟】设计器缓存文件记录设计器设置失效

Merge in DESIGN/design from ~YVAN/design:release/10.0 to release/10.0

* commit 'ff0ded7b125833d461601b16c696a3f84ea80f44':
  REPORT-44714 【10.0.12冒烟】设计器缓存文件记录设计器设置失效 将对一些文件的误改动回退一下
  REPORT-44714 【10.0.12冒烟】设计器缓存文件记录设计器设置失效 与产品沟通后,确认修改方案为,当发生了足以造成数据集面板丢失的容器高度变化时,至少保证水平拖拽面板不丢失
  REPORT-44714 修改错误注释
  REPORT-44714 删除调试语句
  REPORT-44714 【10.0.12冒烟】设计器缓存文件记录设计器设置失效 【问题原因】实际上缓存文件的存取没有问题,但是因为此前缓存文件中记录的是上子面板的高度值,而在设计器的打开过程中,父容器的高度会变化(且有时候变为负数),导致了关闭设计器前,上子面板相对于父容器高度的比例与打开设计器之后的比例不同,视觉上就出现了面板高度的偏差 【改动思路】将之前的思路修改为,在容器高度发生变化时,根据上子面板占容器高度的比例去调整上子面板的高度,且将缓存文件中存储上子面板高度修改为存储比例
feature/big-screen
Yvan 4 years ago
parent
commit
e95fbeb148
  1. 12
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 13
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java

12
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -240,7 +240,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
String installHome = StableUtils.getInstallHome(); String installHome = StableUtils.getInstallHome();
//这里不判断路径是.的情况,放在checkValid方法里面,重新选 //这里不判断路径是.的情况,放在checkValid方法里面,重新选
if (installHome != null) { if (installHome != null) {
String name = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_DEFAULT"); String name = Toolkit.i18nText("Fine-Design_Basic_Engine_DEFAULT");
String envPath = designerEnvManager.getDefaultenvPath(installHome); String envPath = designerEnvManager.getDefaultenvPath(installHome);
designerEnvManager.putEnv(name, LocalDesignerWorkspaceInfo.create(name, envPath)); designerEnvManager.putEnv(name, LocalDesignerWorkspaceInfo.create(name, envPath));
designerEnvManager.setCurEnvName(name); designerEnvManager.setCurEnvName(name);
@ -304,8 +304,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
String today = calender.get(Calendar.YEAR) + "-" + (calender.get(Calendar.MONTH) + 1) + "-" + calender.get(Calendar.DAY_OF_MONTH); String today = calender.get(Calendar.YEAR) + "-" + (calender.get(Calendar.MONTH) + 1) + "-" + calender.get(Calendar.DAY_OF_MONTH);
String fileName = StableUtils.pathJoin(logLocation, "fr_" + today + "_%g.log"); String fileName = StableUtils.pathJoin(logLocation, "fr_" + today + "_%g.log");
if (!new java.io.File(fileName).exists()) { if (!new File(fileName).exists()) {
StableUtils.makesureFileExist(new java.io.File(fileName)); StableUtils.makesureFileExist(new File(fileName));
} }
Handler handler = new FileHandler(fileName, true); Handler handler = new FileHandler(fileName, true);
@ -529,7 +529,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
return env; return env;
} }
} }
String name = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); String name = Toolkit.i18nText("Fine-Design_Basic_Workspace_Default");
LocalDesignerWorkspaceInfo newDefaultEnv = LocalDesignerWorkspaceInfo.create(name, defaultenvPath); LocalDesignerWorkspaceInfo newDefaultEnv = LocalDesignerWorkspaceInfo.create(name, defaultenvPath);
this.putEnv(name, newDefaultEnv); this.putEnv(name, newDefaultEnv);
return newDefaultEnv; return newDefaultEnv;
@ -552,7 +552,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} }
} }
} }
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); return Toolkit.i18nText("Fine-Design_Basic_Workspace_Default");
} }
@ -1643,7 +1643,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
if ((tmpVal = reader.getAttrAsString("webinfLocation", null)) != null) { if ((tmpVal = reader.getAttrAsString("webinfLocation", null)) != null) {
// marks:兼容6.1的 // marks:兼容6.1的
// marks:设置默认的目录. // marks:设置默认的目录.
String curReportServerName = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Embedded_Server"); String curReportServerName = Toolkit.i18nText("Fine-Design_Basic_Server_Embedded_Server");
LocalDesignerWorkspaceInfo reportServer = LocalDesignerWorkspaceInfo.create(curReportServerName, tmpVal); LocalDesignerWorkspaceInfo reportServer = LocalDesignerWorkspaceInfo.create(curReportServerName, tmpVal);
this.putEnv(curReportServerName, reportServer); this.putEnv(curReportServerName, reportServer);

13
designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -1,12 +1,10 @@
package com.fr.design.gui.icontainer; package com.fr.design.gui.icontainer;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.collections.utils.MathUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -159,8 +157,7 @@ public class UIResizableContainer extends JPanel {
} }
/** /**
* 设置关闭设计器前最后一次上下子面板的高度 * 设置关闭设计器前最新的上子面板的高度比例
*
* @param toolPaneY * @param toolPaneY
*/ */
public void setLastToolPaneY(int toolPaneY) { public void setLastToolPaneY(int toolPaneY) {
@ -242,10 +239,10 @@ public class UIResizableContainer extends JPanel {
if (parentHeight == -1) { if (parentHeight == -1) {
// 初始化下parentheight,存一下当前的父容器height // 初始化下parentheight,存一下当前的父容器height
parentHeight = parent.getHeight(); parentHeight = parent.getHeight();
} else if (parentHeight != parent.getHeight()) { }
// parentHeight与父容器height不等时,代表用户调整分辨率或者dpi了,此时调整toolPaneY if (parentHeight != parent.getHeight() && (parent.getHeight() - toolPaneHeight) >= 0) {
toolPaneY = toolPaneY * parent.getHeight() / parentHeight; // 调整toolPaneY,保证至少水平的拖拽条horizontToolPane不丢失
toolPaneY = Math.min(toolPaneY, (parent.getHeight() - toolPaneHeight)); toolPaneY = Math.min(toolPaneY, parent.getHeight() - toolPaneHeight);
parentHeight = parent.getHeight(); parentHeight = parent.getHeight();
} }
} }

Loading…
Cancel
Save