Browse Source

Merge pull request #3982 in DESIGN/design from feature/10.0 to research/10.0

* commit '97cc8c190a14ad29457064f25de9b4cfae5048d3':
  KERNEL-7376 优化设计器上一些性能问题
  REPORT-49686 决策报表自适应布局,添加参数面板后,无法通过右侧设置面板调整绝对画布块的大小 【问题原因】这里绝对画布块的高度调整要分为两种方式,一种是拖拽改变,另一种是在右侧面板中改变高度数值,问题的原因是此前REPORT-7588中,拖拽时会走到FormSelection#fixCreator(),这里面为绝对画布块做特殊处理时,漏算了参数面板的高度,然后在REPORT-34739中,FRFitLayoutAdapter#fix()方法中处理了一下参数面板造成的偏移,所以拖拽的逻辑都正常;但是如果在右侧面板中改变高度时,会直接走到FRFitLayoutAdapter#fix()中,此时是没有漏算参数面板高度的,因此经过处理之后,反而组件的backupBound会多了个参数面板高度,这样会造成每次改变都加上这个高度,就出现了bug现象 【改动思路】把判断参数面板是否漏算的逻辑放到FormSelection#fixCreator()中
  CHART-18881 单元格图表有时候无法点出图表属性面板
  REPORT-50809 frm模版与cpt模版在设计器内预览图标大小不一致
research/10.0
superman 4 years ago
parent
commit
73a4a42384
  1. 2
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java
  2. 8
      designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
  3. BIN
      designer-base/src/main/resources/com/fr/design/images/buttonicon/run24.png
  4. 12
      designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java
  5. 10
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java
  6. 18
      designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java

2
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

@ -64,7 +64,6 @@ public class HistoryTemplateListCache implements CallbackEvent {
* @param selected 选择的
*/
public void closeSelectedReport(JTemplate<?, ?> selected) {
DesignModuleFactory.clearChartPropertyPane();
DesignTableDataManager.closeTemplate(selected);
//直接关闭模板的时候(当且仅当设计器tab上只剩一个模板)退出权限编辑
if (DesignModeContext.isAuthorityEditing() && historyList.size() <= 1) {
@ -92,7 +91,6 @@ public class HistoryTemplateListCache implements CallbackEvent {
* @param selected 选择的
*/
public void closeVirtualSelectedReport(JTemplate<?, ?> selected) {
DesignModuleFactory.clearChartPropertyPane();
DesignTableDataManager.closeTemplate(selected);
if (contains(selected) == -1) {
return;

8
designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java

@ -243,14 +243,6 @@ public class DesignModuleFactory {
return bp;
}
public static void clearChartPropertyPane() {
if (instance.chartPropertyPaneClass != null) {
StableUtils.clearInstance(instance.chartPropertyPaneClass);
}
}
public static void registerButtonDetailPaneClass(Class clazz) {
instance.buttonDetailPaneClass = clazz;
}

BIN
designer-base/src/main/resources/com/fr/design/images/buttonicon/run24.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 942 B

After

Width:  |  Height:  |  Size: 736 B

12
designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java

@ -24,14 +24,8 @@ public class ChartPropertyPane extends BaseChartPropertyPane {
* 创建图表属性表实例.
*/
private synchronized static ChartPropertyPane getInstance() {
//创建新图表时,创建属性表配置面板
if (singleton == null) {
singleton = new ChartPropertyPane();
return new ChartPropertyPane();
}
return singleton;
}
private static ChartPropertyPane singleton;
protected TargetComponentContainer container = new TargetComponentContainer();
@ -160,8 +154,4 @@ public class ChartPropertyPane extends BaseChartPropertyPane {
chartEditPane.setSupportCellData(supportCellData);
}
}
public synchronized static void clear() {
singleton = null;
}
}

10
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java

@ -347,15 +347,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
//拖拽组件原大小、位置
Rectangle backupBound = creator.getBackupBound();
backupBound.x -= container.getX();
// REPORT-34739 对绝对画布块的backupBound.y的调整还需要考虑一下参数面板块的高度造成的偏移
int paraHeight = 0;
if (creator.acceptType(XWAbsoluteLayout.class)) {
JTemplate<?, ?> jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jTemplate instanceof JForm) {
paraHeight = ((JForm) jTemplate).getFormDesign().getParaHeight();
}
}
backupBound.y -= (container.getY() - paraHeight);
backupBound.y -= container.getY();
//当前拖拽组件的位置
int x = creator.getX();
int y = creator.getY();

18
designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java

@ -12,6 +12,7 @@ import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout;
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.utils.ComponentUtils;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.Widget;
@ -270,7 +271,9 @@ public class FormSelection {
LayoutAdapter layoutAdapter = AdapterBus.searchLayoutAdapter(designer, creator);
if (layoutAdapter != null) {
if (creator.acceptType(XWAbsoluteLayout.class) && recs.size() > i) {
creator.setBackupBound(recs.get(i));
Rectangle rectangle = recs.get(i);
check4ParaPane(rectangle);
creator.setBackupBound(rectangle);
} else {
creator.setBackupBound(backupBounds);
}
@ -280,6 +283,19 @@ public class FormSelection {
}
}
/**
* 检查下有没有参数面板如果存在处理下参数面板造成的偏移量
* @param rectangle
*/
private void check4ParaPane(Rectangle rectangle) {
int paraHeight = 0;
JTemplate<?, ?> jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jTemplate instanceof JForm) {
paraHeight = ((JForm) jTemplate).getFormDesign().getParaHeight();
}
rectangle.y += paraHeight;
}
private void removeCreatorFromContainer(XCreator creator) {
XLayoutContainer parent = XCreatorUtils.getParentXLayoutContainer(creator);
if (parent == null) {

Loading…
Cancel
Save