Browse Source

Merge pull request #3001 in DESIGN/design from bugfix/10.0 to release/10.0

* commit '2a4f776c0587aed70058193e7d11e85fd558bcb1':
  REPORT-42913 之前想多了,这个在调用的时候还没开始渲染整个左侧的面板,此时拿不到父容器高度
  REPORT-42913 为设置上一次关闭设计器时upPane高度加上一个判断,避免upPane高度超过容器总高度
  REPORT-42913 改变电脑分辨率导致设计器的数据集面板丢失 【问题原因】数据集面板的位置与高度都跟parent.getHeight() - toolPaneY有关,而在Windows下,如果先把数据集面板的高度调的比较小,然后减小分辨率或者调大dpi使整个界面放大时,parent.getHeight()会减小,而toolPaneY在这种操作下是不会变的,此时toolPaneY会接近甚至大于parent.getHeight(),导致了数据集面板的位置位于整个屏幕之外,并且高度为负,显示不出来,表现为丢失 【改动思路】用一个成员变量parentHeight存储父容器的高度parent.getHeight(),在layoutContainer()方法中增加一个判断,当发现父容器高度有变化时,及时调整toolPaneY的大小,避免数据集面板无法显示
  REPORT-44051 远程打开含数据集多的模板慢
  REPORT-41512 存储过程返回多个数据集在fr中调用只能返回一个
  无jira任务 bugfix单元测试打包依赖变更
  REPORT-32205 设计器多屏使用问题
  REPORT-43280 参数面板控件选不到
feature/big-screen
superman 4 years ago
parent
commit
22be77c91e
  1. 4
      build.gradle
  2. 18
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java
  3. 18
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java
  4. 2
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  5. 8
      designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java
  6. 5
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  7. 4
      designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java
  8. 3
      designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java
  9. 2
      designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java

4
build.gradle

@ -72,7 +72,9 @@ allprojects {
implementation 'com.fr.datasource:fine-datasource:' + frVersion
implementation 'com.fr.decision:fine-decision:' + frVersion
implementation 'com.fr.schedule:fine-schedule:' + frVersion
implementation 'com.fr.report:fine-report-engine:' + frDevVersion
implementation 'com.fr.report:engine-report:' + frDevVersion
implementation 'com.fr.report:engine-chart:' + frDevVersion
implementation 'com.fr.report:engine-i18n:' + frDevVersion
implementation 'com.fr.design:design-i18n:' + frDevVersion
testImplementation 'org.easymock:easymock:3.5.1'
testImplementation 'org.powermock:powermock-module-junit4:1.7.1'

18
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java

@ -5,6 +5,7 @@ import com.fr.base.StoreProcedureParameter;
import com.fr.data.core.db.TableProcedure;
import com.fr.data.impl.Connection;
import com.fr.data.impl.NameDatabaseConnection;
import com.fr.data.impl.storeproc.ProcedureDataModel;
import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.data.operator.DataOperator;
import com.fr.design.actions.UpdateAction;
@ -29,13 +30,19 @@ import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.ConnectionConfig;
import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.JToolBar;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
@ -273,7 +280,8 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
protected Void doInBackground() throws Exception {
DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER);
sp.setCalculating(true);
sp.creatDataModel(Calculator.createCalculator());
ProcedureDataModel[] dataModels = DesignTableDataManager.createLazyDataModel(sp, false);
sp.refreshDataModelListAndResultNames(dataModels);
return null;
}

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

@ -45,6 +45,7 @@ public class UIResizableContainer extends JPanel {
private boolean isLeftRightDragEnabled = true;
private boolean isDownPaneVisible = true ;
private int paraHeight;
private int parentHeight = -1;
public UIResizableContainer(int direction) {
this(new JPanel(), new JPanel(), direction);
@ -207,7 +208,8 @@ public class UIResizableContainer extends JPanel {
if (verticalToolPane == null || downPane == null) {
return;
}
// REPORT-42913 如果用户修改了分辨率或者dpi,可能造成toolPaneY大于parent.getHeight,整个downPane将丢失,因此这里调整下toolPaneY
adjustToolPaneY(parent);
if (direction == Constants.RIGHT) {
if(isDownPaneVisible){
upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY);
@ -236,6 +238,18 @@ public class UIResizableContainer extends JPanel {
}
}
private void adjustToolPaneY(Container parent) {
if (parentHeight == -1) {
// 初始化下parentheight,存一下当前的父容器height
parentHeight = parent.getHeight();
} else if (parentHeight != parent.getHeight()) {
// parentHeight与父容器height不等时,代表用户调整分辨率或者dpi了,此时调整toolPaneY
toolPaneY = toolPaneY * parent.getHeight() / parentHeight;
toolPaneY = Math.min(toolPaneY, (parent.getHeight() - toolPaneHeight));
parentHeight = parent.getHeight();
}
}
@Override
public void addLayoutComponent(String name, Component comp) {
}
@ -540,4 +554,4 @@ public class UIResizableContainer extends JPanel {
jf.setSize(500, 500);
jf.setVisible(true);
}
}
}

2
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -136,9 +136,9 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
this.editingFILE = file;
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder());
designModel = createDesignModel();
addCenterPane();
this.undoState = createUndoState();
designModel = createDesignModel();
consumeTimer.setEnabled(shouldInitForCollectInfo(isNewFile));
initAndStartPlugin();

8
designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java

@ -298,7 +298,11 @@ public final class GUICoreUtils {
* @param win the current window august:现在要考虑左边日志模板的影响
*/
public static void centerWindow(Window win) {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
// Toolkit.getDefaultToolkit().getScreenSize()在有多个显示器也只能获取到主屏的大小
// getGraphicsConfiguration().getBounds()能获取多个屏时 设计器主体界面所在屏的大小和对应的坐标
Rectangle rectangle = win.getGraphicsConfiguration().getBounds();
Dimension screenSize = rectangle.getSize();
Dimension winSize = win.getSize();
@ -308,7 +312,7 @@ public final class GUICoreUtils {
if (winSize.width > screenSize.width) {
winSize.width = screenSize.width;
}
win.setLocation((screenSize.width - winSize.width) / 2, (screenSize.height - winSize.height) / 2 - WINDOW_GAP);
win.setLocation(rectangle.x + (screenSize.width - winSize.width) / 2, rectangle.y + (screenSize.height - winSize.height) / 2 - WINDOW_GAP);
}
/**

5
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe;
import com.fr.base.Parameter;
import com.fr.base.ScreenResolution;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignState;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
@ -204,7 +205,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
*/
public void populateParameterPropertyPane() {
//参数
setParameterArray(getNoRepeatParas(getTarget().getParameters()));
setParameterArray(DesignModelAdapter.getCurrentModelAdapter().getParameters());
refreshParameter();
//容器
ParameterPropertyPane.getInstance().populateBean(this);
@ -728,7 +729,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) {
FormDesigner.this.fireTargetModified();
if (evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED) {
setParameterArray(getNoRepeatParas(getTarget().getParameters()));
setParameterArray(getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters()));
refreshParameter();
}
} else {

4
designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java

@ -36,10 +36,10 @@ public class FormModelAdapter extends DesignModelAdapter<Form, BaseJForm<Form>>
* 参数改变.
*/
public void parameterChanged() {
//实时更新参数
jTemplate.populateParameter();
// 更新缓存的参数
updateCachedParameter();
//实时更新参数
jTemplate.populateParameter();
}
/**

3
designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java

@ -66,9 +66,10 @@ public class WorkBookModelAdapter extends DesignModelAdapter<WorkBook, JWorkBook
* 参数改变.
*/
public void parameterChanged() {
// 参数改变 先更新缓存
updateCachedParameter();
jTemplate.updateReportParameterAttr();
jTemplate.populateReportParameterAttr();
updateCachedParameter();
}
/**

2
designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java

@ -275,7 +275,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
paraDesignEditor.populate(parameterUI);
parameterArray = getNoRepeatParas(getTargetParameter(workBook));
parameterArray = getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters());
refreshParameter();
allParameters = reportParameterAttr.getParameters();

Loading…
Cancel
Save