|
|
|
@ -193,7 +193,6 @@ public class FormCreatorDropTarget extends DropTarget {
|
|
|
|
|
|
|
|
|
|
private void dealWithContainer(int x, int y, XLayoutContainer container) { |
|
|
|
|
HoverPainter painter = null; |
|
|
|
|
|
|
|
|
|
if (container != current || designer.getPainter() == null) { |
|
|
|
|
// 如果焦点容器不是当前容器
|
|
|
|
|
if (current != null) { |
|
|
|
@ -204,15 +203,9 @@ public class FormCreatorDropTarget extends DropTarget {
|
|
|
|
|
throw new IllegalArgumentException("container can not be null!"); |
|
|
|
|
} |
|
|
|
|
//获取painter的时候要考虑布局之间嵌套的问题
|
|
|
|
|
XLayoutContainer xLayoutContainer = container.getTopLayout(); |
|
|
|
|
if (xLayoutContainer != null && xLayoutContainer.getParent() != null |
|
|
|
|
&& ((XLayoutContainer) xLayoutContainer.getParent()).acceptType(XWAbsoluteLayout.class)) { |
|
|
|
|
if (!xLayoutContainer.isEditable()) { |
|
|
|
|
xLayoutContainer = (XLayoutContainer) xLayoutContainer.getParent(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
XLayoutContainer xLayoutContainer = XCreatorUtils.getTopEditableContainer(container); |
|
|
|
|
painter = AdapterBus.getContainerPainter(designer, |
|
|
|
|
xLayoutContainer != null && xLayoutContainer.acceptType(XWAbsoluteLayout.class) ? xLayoutContainer : container); |
|
|
|
|
xLayoutContainer != null ? xLayoutContainer : container); |
|
|
|
|
|
|
|
|
|
// 为界面设计器设置提示渲染提示器
|
|
|
|
|
designer.setPainter(painter); |
|
|
|
@ -227,8 +220,9 @@ public class FormCreatorDropTarget extends DropTarget {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (painter != null) { |
|
|
|
|
XLayoutContainer xLayoutContainer = XCreatorUtils.getTopEditableContainer(container); |
|
|
|
|
// 为提示渲染器设置焦点位置、区域等渲染参数
|
|
|
|
|
Rectangle rect = ComponentUtils.getRelativeBounds(container); |
|
|
|
|
Rectangle rect = ComponentUtils.getRelativeBounds(xLayoutContainer != null ? xLayoutContainer : container); |
|
|
|
|
rect.x -= designer.getArea().getHorizontalValue(); |
|
|
|
|
rect.y -= designer.getArea().getVerticalValue(); |
|
|
|
|
painter.setRenderingBounds(rect); |
|
|
|
@ -236,7 +230,7 @@ public class FormCreatorDropTarget extends DropTarget {
|
|
|
|
|
painter.setCreator(addingModel.getXCreator()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void promptUser(int x, int y, XLayoutContainer container) { |
|
|
|
|
if (!addingModel.getXCreator().canEnterIntoParaPane() && container.acceptType(XWParameterLayout.class)) { |
|
|
|
|
promptButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Forbid_Drag_Into_Para_Pane")); |
|
|
|
|