|
|
@ -35,9 +35,8 @@ import com.fr.design.designer.creator.XLayoutContainer; |
|
|
|
import com.fr.design.designer.creator.XWAbsoluteBodyLayout; |
|
|
|
import com.fr.design.designer.creator.XWAbsoluteBodyLayout; |
|
|
|
import com.fr.design.designer.creator.XWAbsoluteLayout; |
|
|
|
import com.fr.design.designer.creator.XWAbsoluteLayout; |
|
|
|
import com.fr.design.designer.creator.XWBorderLayout; |
|
|
|
import com.fr.design.designer.creator.XWBorderLayout; |
|
|
|
import com.fr.design.designer.creator.XWFitLayout; |
|
|
|
|
|
|
|
import com.fr.design.designer.creator.XWParameterLayout; |
|
|
|
import com.fr.design.designer.creator.XWParameterLayout; |
|
|
|
import com.fr.design.designer.creator.XWTitleLayout; |
|
|
|
import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; |
|
|
|
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; |
|
|
|
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; |
|
|
|
import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; |
|
|
|
import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; |
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
@ -46,7 +45,6 @@ import com.fr.design.file.HistoryTemplateListPane; |
|
|
|
import com.fr.design.form.util.XCreatorConstants; |
|
|
|
import com.fr.design.form.util.XCreatorConstants; |
|
|
|
import com.fr.design.fun.RightSelectionHandlerProvider; |
|
|
|
import com.fr.design.fun.RightSelectionHandlerProvider; |
|
|
|
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; |
|
|
|
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; |
|
|
|
import com.fr.design.mainframe.widget.topxcreator.TopXCreators; |
|
|
|
|
|
|
|
import com.fr.design.menu.MenuDef; |
|
|
|
import com.fr.design.menu.MenuDef; |
|
|
|
import com.fr.design.menu.ShortCut; |
|
|
|
import com.fr.design.menu.ShortCut; |
|
|
|
import com.fr.design.menu.ToolBarDef; |
|
|
|
import com.fr.design.menu.ToolBarDef; |
|
|
@ -65,7 +63,6 @@ import com.fr.form.ui.Widget; |
|
|
|
import com.fr.form.ui.WidgetValue; |
|
|
|
import com.fr.form.ui.WidgetValue; |
|
|
|
import com.fr.form.ui.container.WBorderLayout; |
|
|
|
import com.fr.form.ui.container.WBorderLayout; |
|
|
|
import com.fr.form.ui.container.WFitLayout; |
|
|
|
import com.fr.form.ui.container.WFitLayout; |
|
|
|
import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; |
|
|
|
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.FRLogger; |
|
|
|
import com.fr.general.FRLogger; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
@ -837,47 +834,35 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 从已选择的组件中找x,y所在的组件 |
|
|
|
* 从已选择的组件中找x,y所在的组件 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private XCreator xCreatorAt(int x, int y,XCreator root) { |
|
|
|
private XCreator xCreatorAt(int x, int y, XCreator root) { |
|
|
|
XCreator[] xCreators = selectionModel.getSelection().getSelectedCreators(); |
|
|
|
XCreator[] xCreators = selectionModel.getSelection().getSelectedCreators(); |
|
|
|
for (XCreator creator : xCreators) { |
|
|
|
for (XCreator creator : xCreators) { |
|
|
|
boolean shouldContinue = creator == null |
|
|
|
boolean shouldContinue = creator == null |
|
|
|
|| !creator.isVisible() |
|
|
|
|| !creator.isVisible() |
|
|
|
|| !XCreatorUtils.containComponent(root, creator) |
|
|
|
|| !XCreatorUtils.containComponent(root, creator); |
|
|
|
|| creator instanceof XWAbsoluteBodyLayout |
|
|
|
|
|
|
|
|| creator instanceof XWFitLayout |
|
|
|
|
|
|
|
|| creator instanceof XWParameterLayout; |
|
|
|
|
|
|
|
if (shouldContinue) { |
|
|
|
if (shouldContinue) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//如果组件为XWCardMainBorderLayout的子组件,直接从XWCardMainBorderLayout中去找
|
|
|
|
|
|
|
|
XWCardMainBorderLayout borderLayout = XCreatorUtils.getTopXMainBorderLayout(creator); |
|
|
|
|
|
|
|
if (borderLayout != null) { |
|
|
|
|
|
|
|
return xCreatorAt(x, y, borderLayout, null); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (creator instanceof XLayoutContainer) { |
|
|
|
|
|
|
|
return xCreatorAt(x, y, creator, null); |
|
|
|
|
|
|
|
} |
|
|
|
x -= creator.getX(); |
|
|
|
x -= creator.getX(); |
|
|
|
y -= creator.getY(); |
|
|
|
y -= creator.getY(); |
|
|
|
Rectangle rect = ComponentUtils.computeVisibleRect(creator); |
|
|
|
Rectangle rect = ComponentUtils.computeVisibleRect(creator); |
|
|
|
rect.y += nestTabCount(creator) * WCardMainBorderLayout.TAB_HEIGHT; |
|
|
|
|
|
|
|
// 判断是否处于交叉区域
|
|
|
|
// 判断是否处于交叉区域
|
|
|
|
if (!isIntersectArea(x, y, rect)) { |
|
|
|
if (!isIntersectArea(x, y, rect)) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
if (creator instanceof XWTitleLayout) { |
|
|
|
return creator; |
|
|
|
return creator.getEditingChildCreator(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return xCreatorAt(x, y, creator, null); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 计算嵌套的tab层数 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private int nestTabCount(Container xCreator) { |
|
|
|
|
|
|
|
if (xCreator == null) { |
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (xCreator instanceof XWTabFitLayout) { |
|
|
|
|
|
|
|
return 1 + nestTabCount(xCreator.getParent()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return nestTabCount(xCreator.getParent()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 刷新顶层组件 |
|
|
|
* 刷新顶层组件 |
|
|
|
* */ |
|
|
|
* */ |
|
|
|