neil 8 years ago
parent
commit
d0ebad3d07
  1. 7
      designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java
  2. 6
      designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java
  3. 3
      designer_form/src/com/fr/design/designer/beans/location/AccessDirection.java
  4. 4
      designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java

7
designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java

@ -41,7 +41,6 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 是否能在指定位置添加组件 * 是否能在指定位置添加组件
*
* @param creator 组件 * @param creator 组件
* @param x 坐标x * @param x 坐标x
* @param y 坐标y * @param y 坐标y
@ -67,7 +66,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
creator.setBounds(rec); creator.setBounds(rec);
return false; return false;
} }
//判断组件能不能拖入绝对布局 //判断下组件能不能拖入绝对布局
if (!creator.canEnterIntoAbsolutePane()){ if (!creator.canEnterIntoAbsolutePane()){
return false; return false;
} }
@ -120,7 +119,6 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 判断是否鼠标在组件的三等分区域如果组件在布局管理器中间上下左右都可能会三等分 * 判断是否鼠标在组件的三等分区域如果组件在布局管理器中间上下左右都可能会三等分
*
* @param parentComp 鼠标所在区域的组件 * @param parentComp 鼠标所在区域的组件
* @param x 坐标x * @param x 坐标x
* @param y 坐标y * @param y 坐标y
@ -270,7 +268,6 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 新拖入组件时计算调整其他关联组件位置大小 * 新拖入组件时计算调整其他关联组件位置大小
*
* @param child 新拖入的组件 * @param child 新拖入的组件
* @param x 鼠标所在x坐标 * @param x 鼠标所在x坐标
* @param y 鼠标所在y坐标 * @param y 鼠标所在y坐标
@ -295,7 +292,6 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 组件拖拽后调整大小 * 组件拖拽后调整大小
*
* @param creator 组件 * @param creator 组件
*/ */
@Override @Override
@ -310,7 +306,6 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 调整组件大小到合适尺寸位置 * 调整组件大小到合适尺寸位置
*
* @param creator 组件 * @param creator 组件
* @param x 坐标x * @param x 坐标x
* @param y 坐标y * @param y 坐标y

6
designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java

@ -16,14 +16,12 @@ 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.FRFitLayoutConstraints; import com.fr.design.designer.properties.FRFitLayoutConstraints;
import com.fr.design.designer.properties.FRFitLayoutPropertiesGroupModel; import com.fr.design.designer.properties.FRFitLayoutPropertiesGroupModel;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.JForm;
import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.ComponentUtils;
import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import java.awt.*; import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
@ -1013,7 +1011,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
setAdjustedSize(tabLayout, offset, isHor); setAdjustedSize(tabLayout, offset, isHor);
for (int m = 0; m < tabLayout.getComponentCount(); m++) { for (int m = 0; m < tabLayout.getComponentCount(); m++) {
XCreator childCreator = tabLayout.getXCreator(m); XCreator childCreator = tabLayout.getXCreator(m);
BoundsWidget wgt = (BoundsWidget) tabLayout.toData().getBoundsWidget(childCreator.toData()); WAbsoluteLayout.BoundsWidget wgt = (WAbsoluteLayout.BoundsWidget) tabLayout.toData().getBoundsWidget(childCreator.toData());
wgt.setBounds(tabLayout.getComponent(m).getBounds()); wgt.setBounds(tabLayout.getComponent(m).getBounds());
} }
adjustCreatorsSize(percent, tabLayout, isHor); adjustCreatorsSize(percent, tabLayout, isHor);

3
designer_form/src/com/fr/design/designer/beans/location/AccessDirection.java

@ -11,6 +11,7 @@ import com.fr.design.mainframe.FormSelection;
import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.ComponentUtils;
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.WAbsoluteLayout.BoundsWidget;
import com.fr.form.ui.container.WParameterLayout;
import java.awt.*; import java.awt.*;
@ -182,7 +183,6 @@ public abstract class AccessDirection implements Direction {
/** /**
* 更新鼠标指针形状 * 更新鼠标指针形状
*
* @param formEditor 设计界面组件 * @param formEditor 设计界面组件
*/ */
public void updateCursor(FormDesigner formEditor) { public void updateCursor(FormDesigner formEditor) {
@ -198,7 +198,6 @@ public abstract class AccessDirection implements Direction {
/** /**
* 生成组件备用的bound * 生成组件备用的bound
*
* @param formEditor 设计界面组件 * @param formEditor 设计界面组件
*/ */
public void backupBounds(FormDesigner formEditor) { public void backupBounds(FormDesigner formEditor) {

4
designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java

@ -133,10 +133,8 @@ public class FormSelectionUtils {
boolean xOut = x < 0 || x + copiedCreator.getWidth() / 2 + xoffset > container.getWidth(); boolean xOut = x < 0 || x + copiedCreator.getWidth() / 2 + xoffset > container.getWidth();
boolean yOut = y < 0 || y + copiedCreator.getHeight() / 2 + yoffset > container.getHeight(); boolean yOut = y < 0 || y + copiedCreator.getHeight() / 2 + yoffset > container.getHeight();
boolean isEdge = (x - DELAY_X_Y == container.getWidth() - copiedCreator.getWidth() / 2 - xoffset)
&& (y - DELAY_X_Y == container.getHeight() - copiedCreator.getHeight() / 2 - yoffset);
y = yOut ? container.getHeight() - copiedCreator.getHeight() / 2 - yoffset : y; y = yOut ? container.getHeight() - copiedCreator.getHeight() / 2 - yoffset : y;
boolean isEdge = (x - DELAY_X_Y == container.getWidth() - copiedCreator.getWidth() / 2 - xoffset);
if (xOut) { if (xOut) {
if (isEdge) { if (isEdge) {
//向左偏移 //向左偏移

Loading…
Cancel
Save