|
|
@ -3,14 +3,6 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
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.ArrayList; |
|
|
|
|
|
|
|
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; |
|
|
@ -20,16 +12,26 @@ import com.fr.design.designer.beans.models.SelectionModel; |
|
|
|
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; |
|
|
|
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.WLayout; |
|
|
|
|
|
|
|
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; |
|
|
|
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; |
|
|
|
|
|
|
|
import com.fr.form.ui.container.WLayout; |
|
|
|
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 |
|
|
@ -88,6 +90,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回容器大小的百分比 |
|
|
|
* 返回容器大小的百分比 |
|
|
|
|
|
|
|
* |
|
|
|
* @return the containerPercent |
|
|
|
* @return the containerPercent |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public double getContainerPercent() { |
|
|
|
public double getContainerPercent() { |
|
|
@ -96,6 +99,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设置容器大小的百分比 |
|
|
|
* 设置容器大小的百分比 |
|
|
|
|
|
|
|
* |
|
|
|
* @param containerPercent the containerPercent to set |
|
|
|
* @param containerPercent the containerPercent to set |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setContainerPercent(double containerPercent) { |
|
|
|
public void setContainerPercent(double containerPercent) { |
|
|
@ -106,6 +110,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回界面处根据百分比调整后的最小宽度 |
|
|
|
* 返回界面处根据百分比调整后的最小宽度 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 最小宽度 |
|
|
|
* @return 最小宽度 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int getActualMinWidth() { |
|
|
|
public int getActualMinWidth() { |
|
|
@ -114,6 +119,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回界面处根据百分比调整后的最小高度 |
|
|
|
* 返回界面处根据百分比调整后的最小高度 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 最小高度 |
|
|
|
* @return 最小高度 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int getActualMinHeight() { |
|
|
|
public int getActualMinHeight() { |
|
|
@ -122,6 +128,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回界面处根据百分比调整后的间隔大小(且为偶数) |
|
|
|
* 返回界面处根据百分比调整后的间隔大小(且为偶数) |
|
|
|
|
|
|
|
* |
|
|
|
* @return 间隔 |
|
|
|
* @return 间隔 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int getAcualInterval() { |
|
|
|
public int getAcualInterval() { |
|
|
@ -164,7 +171,8 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
tabLayout.updateBoundsWidget(); |
|
|
|
tabLayout.updateBoundsWidget(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
BoundsWidget boundsWidget = (BoundsWidget) layout.getBoundsWidget(xCreator.toData()); Rectangle rectangle = dealWidgetBound(xCreator.getBounds()); |
|
|
|
BoundsWidget boundsWidget = (BoundsWidget) layout.getBoundsWidget(xCreator.toData()); |
|
|
|
|
|
|
|
Rectangle rectangle = dealWidgetBound(xCreator.getBounds()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private Rectangle calculateBound(Rectangle rec, double pw, double ph) { |
|
|
|
private Rectangle calculateBound(Rectangle rec, double pw, double ph) { |
|
|
@ -207,6 +215,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
* 更新子组件的Bound |
|
|
|
* 更新子组件的Bound |
|
|
|
* 这边主要用于绝对布局子组件在适应区域选项时 |
|
|
|
* 这边主要用于绝对布局子组件在适应区域选项时 |
|
|
|
* 涉及到的不同分辨率下缩放 |
|
|
|
* 涉及到的不同分辨率下缩放 |
|
|
|
|
|
|
|
* |
|
|
|
* @param minHeight 最小高度 |
|
|
|
* @param minHeight 最小高度 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -231,6 +240,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 增加对齐线 |
|
|
|
* 增加对齐线 |
|
|
|
|
|
|
|
* |
|
|
|
* @param connector 对齐线 |
|
|
|
* @param connector 对齐线 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void addConnector(Connector connector) { |
|
|
|
public void addConnector(Connector connector) { |
|
|
@ -244,6 +254,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 去除对齐线 |
|
|
|
* 去除对齐线 |
|
|
|
|
|
|
|
* |
|
|
|
* @param connector 对齐线 |
|
|
|
* @param connector 对齐线 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void removeConnector(Connector connector) { |
|
|
|
public void removeConnector(Connector connector) { |
|
|
@ -253,6 +264,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回对应的widget容器 |
|
|
|
* 返回对应的widget容器 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 返回WAbsoluteLayout |
|
|
|
* @return 返回WAbsoluteLayout |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -267,6 +279,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回默认的容器name |
|
|
|
* 返回默认的容器name |
|
|
|
|
|
|
|
* |
|
|
|
* @return 返回绝对布局容器名 |
|
|
|
* @return 返回绝对布局容器名 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -324,6 +337,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 当前组件zorder位置替换新的控件 |
|
|
|
* 当前组件zorder位置替换新的控件 |
|
|
|
|
|
|
|
* |
|
|
|
* @param widget 控件 |
|
|
|
* @param widget 控件 |
|
|
|
* @param oldcreator 旧组件 |
|
|
|
* @param oldcreator 旧组件 |
|
|
|
* @return 组件 |
|
|
|
* @return 组件 |
|
|
@ -342,6 +356,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 组件增加 |
|
|
|
* 组件增加 |
|
|
|
|
|
|
|
* |
|
|
|
* @param e 容器事件 |
|
|
|
* @param e 容器事件 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -359,6 +374,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 在设计界面中有组件移除的时候,需要通知WLayout容器重新paint |
|
|
|
* 在设计界面中有组件移除的时候,需要通知WLayout容器重新paint |
|
|
|
|
|
|
|
* |
|
|
|
* @param e 容器事件 |
|
|
|
* @param e 容器事件 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -388,14 +404,14 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
XLayoutContainer xTopLayout = XCreatorUtils.getParentXLayoutContainer(this).getTopLayout(); |
|
|
|
XLayoutContainer xTopLayout = XCreatorUtils.getParentXLayoutContainer(this).getTopLayout(); |
|
|
|
if (xTopLayout != null && !xTopLayout.isEditable()) { |
|
|
|
if (xTopLayout != null && !xTopLayout.isEditable()) { |
|
|
|
return xTopLayout; |
|
|
|
return xTopLayout; |
|
|
|
} |
|
|
|
} else { |
|
|
|
else{ |
|
|
|
|
|
|
|
return this; |
|
|
|
return this; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 得到属性名 |
|
|
|
* 得到属性名 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 属性名 |
|
|
|
* @return 属性名 |
|
|
|
* @throws java.beans.IntrospectionException |
|
|
|
* @throws java.beans.IntrospectionException |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -468,6 +484,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* body大小手动调整的时候 |
|
|
|
* body大小手动调整的时候 |
|
|
|
* 按照比例调整组件的宽度 |
|
|
|
* 按照比例调整组件的宽度 |
|
|
|
|
|
|
|
* |
|
|
|
* @param percent 比例 |
|
|
|
* @param percent 比例 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -484,6 +501,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* body大小手动调整的时候 |
|
|
|
* body大小手动调整的时候 |
|
|
|
* 按照比例调整组件的高度 |
|
|
|
* 按照比例调整组件的高度 |
|
|
|
|
|
|
|
* |
|
|
|
* @param percent 比例 |
|
|
|
* @param percent 比例 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|