Browse Source

REPORT-67489 tab标题高度修改,布局内部组件大小不会适应缩放

feature/x
kerry 3 years ago
parent
commit
ee8ccd76c7
  1. 11
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java
  2. 11
      designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java
  3. 12
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java
  4. 1
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java

11
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java

@ -3,6 +3,7 @@ package com.fr.design.designer.beans.adapters.layout;
import com.fr.design.designer.beans.models.AddingModel; import com.fr.design.designer.beans.models.AddingModel;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout;
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
@ -10,6 +11,7 @@ import com.fr.design.form.layout.FRBorderLayout;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -41,6 +43,15 @@ public class FRCardMainBorderLayoutAdapter extends FRBorderLayoutAdapter {
if (!beyondBounds) { if (!beyondBounds) {
super.fix(creator); super.fix(creator);
} }
//对于Tab布局,内部的某个组件尺寸改变后,需要重新layout下其他关联的组件
XLayoutContainer xLayoutContainer = creator.getTopLayout();
if (xLayoutContainer.acceptType(XWCardMainBorderLayout.class)) {
XWCardMainBorderLayout cardMainBorderLayout = (XWCardMainBorderLayout) xLayoutContainer;
LayoutUtils.layoutContainer(cardMainBorderLayout);
cardMainBorderLayout.updateBoundsWidget();
}
} }
private boolean calculateBeyondBounds(XCreator creator) { private boolean calculateBeyondBounds(XCreator creator) {

11
designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java

@ -7,7 +7,7 @@ import com.fr.base.GraphHelper;
import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRAbsoluteLayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRAbsoluteLayoutAdapter;
import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.beans.location.Direction;
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout;
import com.fr.design.designer.properties.mobile.MobileBooKMarkUsePropertyUI; import com.fr.design.designer.properties.mobile.MobileBooKMarkUsePropertyUI;
import com.fr.design.form.layout.FRAbsoluteLayout; import com.fr.design.form.layout.FRAbsoluteLayout;
import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.form.util.FormDesignerUtils;
@ -34,7 +34,6 @@ import java.awt.Rectangle;
import java.awt.event.ContainerEvent; import java.awt.event.ContainerEvent;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.beans.IntrospectionException; import java.beans.IntrospectionException;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
/** /**
@ -119,12 +118,8 @@ public class XWAbsoluteLayout extends XLayoutContainer {
((XWAbsoluteLayout) xCreator).updateBoundsWidget(); ((XWAbsoluteLayout) xCreator).updateBoundsWidget();
} }
// 如果子组件时tab布局,则tab布局内部的组件的wiget也要更新,否则保存后重新打开大小不对 // 如果子组件时tab布局,则tab布局内部的组件的wiget也要更新,否则保存后重新打开大小不对
ArrayList<?> childrenList = xCreator.getTargetChildrenList(); if (xCreator.acceptType(XWCardMainBorderLayout.class)){
if (!childrenList.isEmpty()) { ((XWCardMainBorderLayout) xCreator).updateBoundsWidget();
for (int i = 0; i < childrenList.size(); i++) {
XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList.get(i);
tabLayout.updateBoundsWidget();
}
} }
} }

12
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java

@ -17,6 +17,7 @@ import com.fr.design.designer.creator.XWidgetCreator;
import com.fr.design.mainframe.CoverReportPane; import com.fr.design.mainframe.CoverReportPane;
import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.EditingMouseListener;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.event.Listener; import com.fr.form.event.Listener;
import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.LayoutBorderStyle;
@ -425,6 +426,7 @@ public class XWCardMainBorderLayout extends XWBorderLayout {
} }
xwCardTitleLayout.setBounds(parentBounds); xwCardTitleLayout.setBounds(parentBounds);
this.addCardPart((XWCardLayout)this.getComponent(0)); this.addCardPart((XWCardLayout)this.getComponent(0));
LayoutUtils.layoutContainer(this);
} }
@Override @Override
@ -448,4 +450,14 @@ public class XWCardMainBorderLayout extends XWBorderLayout {
public void setShowOuterShadowBorder(boolean showOuterShadowBorder) { public void setShowOuterShadowBorder(boolean showOuterShadowBorder) {
this.showOuterShadowBorder = showOuterShadowBorder; this.showOuterShadowBorder = showOuterShadowBorder;
} }
public void updateBoundsWidget() {
ArrayList<?> childrenList = this.getTargetChildrenList();
if (!childrenList.isEmpty()) {
for (int i = 0; i < childrenList.size(); i++) {
XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList.get(i);
tabLayout.updateBoundsWidget();
}
}
}
} }

1
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java

@ -278,7 +278,6 @@ public class XWCardTagLayout extends XWHorizontalBoxLayout {
@Override @Override
public void doLayout() { public void doLayout() {
setTabsAndAdjust();
//设置布局 //设置布局
super.doLayout(); super.doLayout();
} }

Loading…
Cancel
Save