|
|
@ -3,31 +3,35 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
package com.fr.design.designer.creator; |
|
|
|
package com.fr.design.designer.creator; |
|
|
|
|
|
|
|
|
|
|
|
import java.awt.*; |
|
|
|
|
|
|
|
import java.awt.event.ContainerEvent; |
|
|
|
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
|
|
|
import java.awt.image.BufferedImage; |
|
|
|
|
|
|
|
import java.beans.IntrospectionException; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.design.designer.beans.AdapterBus; |
|
|
|
import com.fr.design.designer.beans.AdapterBus; |
|
|
|
import com.fr.design.designer.beans.ComponentAdapter; |
|
|
|
import com.fr.design.designer.beans.ComponentAdapter; |
|
|
|
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.beans.models.SelectionModel; |
|
|
|
import com.fr.design.designer.beans.models.SelectionModel; |
|
|
|
|
|
|
|
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; |
|
|
|
import com.fr.design.form.layout.FRAbsoluteLayout; |
|
|
|
import com.fr.design.form.layout.FRAbsoluteLayout; |
|
|
|
import com.fr.design.icon.IconPathConstants; |
|
|
|
import com.fr.design.icon.IconPathConstants; |
|
|
|
import com.fr.design.mainframe.*; |
|
|
|
import com.fr.design.mainframe.EditingMouseListener; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.FormArea; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.FormDesigner; |
|
|
|
import com.fr.form.ui.Connector; |
|
|
|
import com.fr.form.ui.Connector; |
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
import com.fr.form.ui.container.WAbsoluteLayout; |
|
|
|
import com.fr.form.ui.container.WAbsoluteLayout; |
|
|
|
|
|
|
|
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; |
|
|
|
import com.fr.form.ui.container.WLayout; |
|
|
|
import com.fr.form.ui.container.WLayout; |
|
|
|
import com.fr.form.ui.widget.BoundsWidget; |
|
|
|
|
|
|
|
import com.fr.general.FRScreen; |
|
|
|
import com.fr.general.FRScreen; |
|
|
|
import com.fr.general.IOUtils; |
|
|
|
import com.fr.general.IOUtils; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.Inter; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.awt.*; |
|
|
|
|
|
|
|
import java.awt.event.ContainerEvent; |
|
|
|
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
|
|
|
import java.awt.image.BufferedImage; |
|
|
|
|
|
|
|
import java.beans.IntrospectionException; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author richer |
|
|
|
* @author richer |
|
|
|
* @since 6.5.3 |
|
|
|
* @since 6.5.3 |
|
|
@ -159,7 +163,15 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
if (xCreator.acceptType(XWAbsoluteLayout.class)) { |
|
|
|
if (xCreator.acceptType(XWAbsoluteLayout.class)) { |
|
|
|
((XWAbsoluteLayout) xCreator).updateBoundsWidget(); |
|
|
|
((XWAbsoluteLayout) xCreator).updateBoundsWidget(); |
|
|
|
} |
|
|
|
} |
|
|
|
BoundsWidget boundsWidget = layout.getBoundsWidget(xCreator.toData()); |
|
|
|
// 如果子组件时tab布局,则tab布局内部的组件的wiget也要更新,否则保存后重新打开大小不对
|
|
|
|
|
|
|
|
ArrayList<?> childrenList = xCreator.getTargetChildrenList(); |
|
|
|
|
|
|
|
if (!childrenList.isEmpty()) { |
|
|
|
|
|
|
|
for (int i = 0; i < childrenList.size(); i++) { |
|
|
|
|
|
|
|
XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList.get(i); |
|
|
|
|
|
|
|
tabLayout.updateBoundsWidget(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
BoundsWidget boundsWidget = (BoundsWidget) layout.getBoundsWidget(xCreator.toData()); |
|
|
|
Rectangle rectangle = dealWidgetBound(xCreator.getBounds()); |
|
|
|
Rectangle rectangle = dealWidgetBound(xCreator.getBounds()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -184,7 +196,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
double percentH = ((double) backupBound.height / (double) currentBound.height); |
|
|
|
double percentH = ((double) backupBound.height / (double) currentBound.height); |
|
|
|
for (int index = 0, n = this.getComponentCount(); index < n; index++) { |
|
|
|
for (int index = 0, n = this.getComponentCount(); index < n; index++) { |
|
|
|
XCreator creator = (XCreator) this.getComponent(index); |
|
|
|
XCreator creator = (XCreator) this.getComponent(index); |
|
|
|
BoundsWidget wgt = layout.getBoundsWidget(creator.toData()); |
|
|
|
BoundsWidget wgt = (BoundsWidget) layout.getBoundsWidget(creator.toData()); |
|
|
|
// 用当前的显示大小计算后调正具体位置
|
|
|
|
// 用当前的显示大小计算后调正具体位置
|
|
|
|
Rectangle wgtBound = creator.getBounds(); |
|
|
|
Rectangle wgtBound = creator.getBounds(); |
|
|
|
Rectangle rec = calculateBound(wgtBound, percentW, percentH); |
|
|
|
Rectangle rec = calculateBound(wgtBound, percentW, percentH); |
|
|
@ -217,7 +229,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
rec.y = (int) (rec.y / prevContainerPercent * containerPercent); |
|
|
|
rec.y = (int) (rec.y / prevContainerPercent * containerPercent); |
|
|
|
rec.height = (int) (rec.height / prevContainerPercent * containerPercent); |
|
|
|
rec.height = (int) (rec.height / prevContainerPercent * containerPercent); |
|
|
|
rec.width = (int) (rec.width / prevContainerPercent * containerPercent); |
|
|
|
rec.width = (int) (rec.width / prevContainerPercent * containerPercent); |
|
|
|
BoundsWidget wgt = toData().getBoundsWidget(creator.toData()); |
|
|
|
BoundsWidget wgt = (BoundsWidget) toData().getBoundsWidget(creator.toData()); |
|
|
|
wgt.setBounds(rec); |
|
|
|
wgt.setBounds(rec); |
|
|
|
creator.setBounds(rec); |
|
|
|
creator.setBounds(rec); |
|
|
|
creator.updateChildBound(minHeight); |
|
|
|
creator.updateChildBound(minHeight); |
|
|
@ -481,7 +493,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
XCreator xCreator = (XCreator) getComponent(i); |
|
|
|
XCreator xCreator = (XCreator) getComponent(i); |
|
|
|
Rectangle rectangle = xCreator.getBounds(); |
|
|
|
Rectangle rectangle = xCreator.getBounds(); |
|
|
|
xCreator.setBounds((int) (rectangle.x * percent), rectangle.y, (int) (rectangle.width * percent), rectangle.height); |
|
|
|
xCreator.setBounds((int) (rectangle.x * percent), rectangle.y, (int) (rectangle.width * percent), rectangle.height); |
|
|
|
BoundsWidget widget = toData().getBoundsWidget(xCreator.toData()); |
|
|
|
BoundsWidget widget = (BoundsWidget) toData().getBoundsWidget(xCreator.toData()); |
|
|
|
widget.setBounds(xCreator.getBounds()); |
|
|
|
widget.setBounds(xCreator.getBounds()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -498,7 +510,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
XCreator xCreator = (XCreator) getComponent(i); |
|
|
|
XCreator xCreator = (XCreator) getComponent(i); |
|
|
|
Rectangle rectangle = xCreator.getBounds(); |
|
|
|
Rectangle rectangle = xCreator.getBounds(); |
|
|
|
xCreator.setBounds(rectangle.x, (int) (rectangle.y * percent), rectangle.width, (int) (rectangle.height * percent)); |
|
|
|
xCreator.setBounds(rectangle.x, (int) (rectangle.y * percent), rectangle.width, (int) (rectangle.height * percent)); |
|
|
|
BoundsWidget widget = toData().getBoundsWidget(xCreator.toData()); |
|
|
|
BoundsWidget widget = (BoundsWidget) toData().getBoundsWidget(xCreator.toData()); |
|
|
|
widget.setBounds(xCreator.getBounds()); |
|
|
|
widget.setBounds(xCreator.getBounds()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|