|
|
@ -4,8 +4,8 @@ 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.adapters.component.CompositeComponentAdapter; |
|
|
|
import com.fr.design.designer.beans.adapters.component.CompositeComponentAdapter; |
|
|
|
import com.fr.design.designer.creator.XCreator; |
|
|
|
import com.fr.design.designer.creator.XCreator; |
|
|
|
|
|
|
|
import com.fr.design.designer.creator.XCreatorUtils; |
|
|
|
import com.fr.design.designer.creator.XLayoutContainer; |
|
|
|
import com.fr.design.designer.creator.XLayoutContainer; |
|
|
|
import com.fr.design.designer.creator.XWAbsoluteLayout; |
|
|
|
|
|
|
|
import com.fr.design.designer.creator.XWParameterLayout; |
|
|
|
import com.fr.design.designer.creator.XWParameterLayout; |
|
|
|
import com.fr.design.mainframe.FormDesigner; |
|
|
|
import com.fr.design.mainframe.FormDesigner; |
|
|
|
import com.fr.design.utils.ComponentUtils; |
|
|
|
import com.fr.design.utils.ComponentUtils; |
|
|
@ -124,11 +124,10 @@ public class AddingModel { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean add2Container(FormDesigner designer, XLayoutContainer container, int x, int y) { |
|
|
|
public boolean add2Container(FormDesigner designer, XLayoutContainer container, int x, int y) { |
|
|
|
//考虑不同布局嵌套的情况,获取顶层容器
|
|
|
|
//考虑不同布局嵌套的情况,获取顶层容器
|
|
|
|
XLayoutContainer xLayoutContainer = container.getTopLayout(); |
|
|
|
XLayoutContainer xLayoutContainer = XCreatorUtils.getTopEditableContainer(container); |
|
|
|
if (xLayoutContainer != null && xLayoutContainer.acceptType(XWAbsoluteLayout.class)) { |
|
|
|
if (xLayoutContainer != null) { |
|
|
|
container = xLayoutContainer; |
|
|
|
container = xLayoutContainer; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Rectangle rect = ComponentUtils.getRelativeBounds(container); |
|
|
|
Rectangle rect = ComponentUtils.getRelativeBounds(container); |
|
|
|
if (!ComparatorUtils.equals(container.getOuterLayout(), container.getBackupParent())) { |
|
|
|
if (!ComparatorUtils.equals(container.getOuterLayout(), container.getBackupParent())) { |
|
|
|
added = container.getLayoutAdapter().addBean(creator, |
|
|
|
added = container.getLayoutAdapter().addBean(creator, |
|
|
@ -141,4 +140,5 @@ public class AddingModel { |
|
|
|
y + designer.getVerticalScaleValue() - rect.y); |
|
|
|
y + designer.getVerticalScaleValue() - rect.y); |
|
|
|
return added; |
|
|
|
return added; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|