From de754516cce1e598dbe0ccb1e75000102e9d0cd7 Mon Sep 17 00:00:00 2001 From: zhouping Date: Mon, 29 Aug 2016 00:18:13 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E7=BB=9D=E5=AF=B9=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E6=B5=8B=E8=AF=95bug=E4=BF=AE=E6=94=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hanlder/BottomCornerMouseHanlder.java | 10 ++++++ .../fr/design/beans/location/MoveUtils.java | 22 ++++++++++-- .../layout/FRAbsoluteLayoutAdapter.java | 34 ++++++++++++++++++- .../beans/location/AccessDirection.java | 4 +-- .../design/designer/beans/location/Inner.java | 10 ++++++ .../designer/beans/models/AddingModel.java | 7 ++++ .../fr/design/designer/creator/XCreator.java | 8 +++++ .../designer/creator/XWAbsoluteLayout.java | 20 ++++++++++- .../designer/creator/XWParameterLayout.java | 5 +++ .../fr/design/form/parameter/XFormSubmit.java | 2 +- .../fr/design/gui/core/FormWidgetOption.java | 2 +- .../mainframe/FormCreatorDropTarget.java | 18 ++++++---- 12 files changed, 126 insertions(+), 16 deletions(-) diff --git a/designer/src/com/fr/poly/hanlder/BottomCornerMouseHanlder.java b/designer/src/com/fr/poly/hanlder/BottomCornerMouseHanlder.java index 7668411c8..729562740 100644 --- a/designer/src/com/fr/poly/hanlder/BottomCornerMouseHanlder.java +++ b/designer/src/com/fr/poly/hanlder/BottomCornerMouseHanlder.java @@ -183,6 +183,16 @@ public class BottomCornerMouseHanlder extends MouseInputAdapter { public Point getDesignerLocationOnScreen() { return null; } + + @Override + public int getDesignerScrollVerticalValue() { + return 0; + } + + @Override + public int getDesignerScrollHorizontalValue() { + return 0; + } }; private RectangleIterator getRectangleIt(){ diff --git a/designer_base/src/com/fr/design/beans/location/MoveUtils.java b/designer_base/src/com/fr/design/beans/location/MoveUtils.java index 50179e312..f796768a6 100644 --- a/designer_base/src/com/fr/design/beans/location/MoveUtils.java +++ b/designer_base/src/com/fr/design/beans/location/MoveUtils.java @@ -3,8 +3,6 @@ */ package com.fr.design.beans.location; -import com.fr.stable.ArrayUtils; - import javax.swing.*; import java.awt.*; import java.util.ArrayList; @@ -98,6 +96,18 @@ public class MoveUtils { * @param line 吸附线 */ void setEquidistantLine(Absorptionline line); + + /** + * 获取设计器垂直滚动条的值 + * @return 滚动条的值 + */ + int getDesignerScrollVerticalValue(); + + /** + * 获取设计器水平滚动条的值 + * @return 滚动条的值 + */ + int getDesignerScrollHorizontalValue(); } public interface RectangleIterator { @@ -457,7 +467,13 @@ public class MoveUtils { right = equidistantLines.get(i).getReference(); } } - line = Absorptionline.createEquidistantAbsorptionline(operatingRectangle, top, left, bottom, right); + operatingRectangle.x -= designer.getDesignerScrollHorizontalValue(); + operatingRectangle.y -= designer.getDesignerScrollVerticalValue(); + line = Absorptionline.createEquidistantAbsorptionline(operatingRectangle, + top - designer.getDesignerScrollVerticalValue(), + left - designer.getDesignerScrollHorizontalValue(), + bottom - designer.getDesignerScrollVerticalValue(), + right - designer.getDesignerScrollHorizontalValue()); } designer.setEquidistantLine(line); } diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java index 28516a4b2..3c0f1155c 100644 --- a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java +++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java @@ -46,6 +46,10 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { * @param y 坐标y * @return 能则返回true */ + //这个地方的逻辑非常复杂, + // 1.当前绝对布局是不可编辑且是最外层,那么其他控件添加在它周围, + // 2.当前绝对布局是不可编辑且不是最外层,那么控件不可添加,(嵌套) + // 3.当前绝对布局可编辑,那么控件添加 @Override public boolean accept(XCreator creator, int x, int y) { Component comp = container.getComponentAt(x, y); @@ -55,11 +59,29 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { if (comp == null){ return false; } + //判断下组件能不能拖入绝对布局 + if (!creator.canEnterIntoAbsolutePane()){ + return false; + } XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer((XCreator)comp).getTopLayout(); if(topLayout != null){ if (topLayout.isEditable()){ //判断有没有和当前控件重叠 - Rectangle curRec = new Rectangle(x, y, creator.getWidth(), creator.getHeight()); + //先计算当前控件的位置 + int creatorX, creatorY; + if (XCreatorUtils.getParentXLayoutContainer(creator) != null) { + + Rectangle creatorRectangle = ComponentUtils.getRelativeBounds(creator); + creatorX = creatorRectangle.x; + creatorY = creatorRectangle.y; + } else { + int w = creator.getWidth() / 2; + int h = creator.getHeight() / 2; + creatorX = x - w; + creatorY = y - h; + } + //再判断和布局中其他控件重叠 + Rectangle curRec = new Rectangle(creatorX, creatorY, creator.getWidth(), creator.getHeight()); WAbsoluteLayout wAbsoluteLayout = (WAbsoluteLayout)topLayout.toData(); for (int i = 0, count = wAbsoluteLayout.getWidgetCount(); i < count; i++) { WAbsoluteLayout.BoundsWidget temp = (WAbsoluteLayout.BoundsWidget) wAbsoluteLayout.getWidget(i); @@ -68,9 +90,19 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { return false; } } + if (creatorX < 0 + || creatorX + creator.getWidth() > container.getWidth() + || creatorY < 0 + || creatorY + creator.getHeight() > container.getHeight()) { + return false; + } return x >= 0 && y >= 0 && creator.getHeight() <= container.getHeight() && creator.getWidth() <= container.getWidth(); } + //绝对布局嵌套,处于内层,不可编辑,不添加,topLayout只能获取到最外层可编辑的布局 + else if (((XLayoutContainer)topLayout.getParent()).acceptType(XWAbsoluteLayout.class)) { + return false; + } else { return acceptWidget(creator, x, y); } diff --git a/designer_form/src/com/fr/design/designer/beans/location/AccessDirection.java b/designer_form/src/com/fr/design/designer/beans/location/AccessDirection.java index b44145c0c..dde93b4ef 100644 --- a/designer_form/src/com/fr/design/designer/beans/location/AccessDirection.java +++ b/designer_form/src/com/fr/design/designer/beans/location/AccessDirection.java @@ -53,9 +53,9 @@ public abstract class AccessDirection implements Direction { //参数面板可以无下限拉长 if (y < 0) { y = 0; - } else if (y > designer.getRootComponent().getHeight() && designer.getSelectionModel().hasSelectionComponent() + } else if (y > designer.getRootComponent().getHeight() + designer.getParaHeight() && designer.getSelectionModel().hasSelectionComponent() && !designer.getSelectionModel().getSelection().getSelectedCreator().acceptType(XWParameterLayout.class)) { - y = designer.getRootComponent().getHeight(); + y = designer.getRootComponent().getHeight() + designer.getParaHeight(); } return new Point(x, y); } diff --git a/designer_form/src/com/fr/design/designer/beans/location/Inner.java b/designer_form/src/com/fr/design/designer/beans/location/Inner.java index c97e3248a..c54796a0a 100644 --- a/designer_form/src/com/fr/design/designer/beans/location/Inner.java +++ b/designer_form/src/com/fr/design/designer/beans/location/Inner.java @@ -119,6 +119,16 @@ public class Inner extends AccessDirection { public void setEquidistantLine(Absorptionline line) { designer.getStateModel().setEquidistantLine(line); } + + @Override + public int getDesignerScrollHorizontalValue() { + return designer.getArea().getHorizontalValue(); + } + + @Override + public int getDesignerScrollVerticalValue() { + return designer.getArea().getVerticalValue(); + } }; //判断当前操作的是不是参数面板,要特殊处理 boolean isParameterLayout = ((XCreator)(designer.getSelectionModel().getSelection().getSelectedCreator().getParent())).acceptType(XWParameterLayout.class); diff --git a/designer_form/src/com/fr/design/designer/beans/models/AddingModel.java b/designer_form/src/com/fr/design/designer/beans/models/AddingModel.java index 21c68f605..ee02afa65 100644 --- a/designer_form/src/com/fr/design/designer/beans/models/AddingModel.java +++ b/designer_form/src/com/fr/design/designer/beans/models/AddingModel.java @@ -2,6 +2,7 @@ package com.fr.design.designer.beans.models; import java.awt.Rectangle; +import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.mainframe.FormDesigner; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.ComponentAdapter; @@ -115,6 +116,12 @@ public class AddingModel { * @return 成功返回true */ public boolean add2Container(FormDesigner designer, XLayoutContainer container, int x, int y) { + //考虑不同布局嵌套的情况,获取顶层容器 + XLayoutContainer xLayoutContainer = container.getTopLayout(); + if(xLayoutContainer != null && xLayoutContainer.acceptType(XWAbsoluteLayout.class)){ + container = xLayoutContainer; + } + Rectangle rect = ComponentUtils.getRelativeBounds(container); if(!ComparatorUtils.equals(container.getOuterLayout(), container.getBackupParent())){ return added = container.getLayoutAdapter().addBean(creator,x,y); diff --git a/designer_form/src/com/fr/design/designer/creator/XCreator.java b/designer_form/src/com/fr/design/designer/creator/XCreator.java index c9b05f9b6..62cfe0b25 100644 --- a/designer_form/src/com/fr/design/designer/creator/XCreator.java +++ b/designer_form/src/com/fr/design/designer/creator/XCreator.java @@ -316,6 +316,14 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo return true; } + /** + * 该组件是否可以拖入绝对布局 + * @return 是则返回true + */ + public boolean canEnterIntoAbsolutePane() { + return true; + } + /** * 该组件是否可以拖拽(表单中参数面板和自适应布局不可以拖拽) * @return 是则返回true diff --git a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java index 34a2a156d..a1fc32c40 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -78,6 +78,16 @@ public class XWAbsoluteLayout extends XLayoutContainer { initPercent(); } + /** + * 初始化时默认的组件大小 + * + * @return 默认Dimension + */ + @Override + public Dimension initEditorSize() { + return new Dimension(500, 300); + } + //根据屏幕大小来确定显示的百分比, 1440*900默认100%, 1366*768缩放90% private void initPercent(){ Toolkit toolkit = Toolkit.getDefaultToolkit(); @@ -155,6 +165,9 @@ public class XWAbsoluteLayout extends XLayoutContainer { if (xCreator.hasTitleStyle()) { xCreator = (XLayoutContainer)xCreator.getParent(); } + if (xCreator.acceptType(XWAbsoluteLayout.class)){ + ((XWAbsoluteLayout) xCreator).updateBoundsWidget(); + } BoundsWidget boundsWidget = layout.getBoundsWidget(xCreator.toData()); Rectangle rectangle = dealWidgetBound(xCreator.getBounds()); } @@ -186,6 +199,11 @@ public class XWAbsoluteLayout extends XLayoutContainer { Rectangle rec = calculateBound(wgtBound, percentW, percentH); wgt.setBounds(rec); creator.setBounds(rec); + //绝对布局嵌套,要更新内部的绝对布局 + if (creator.acceptType(XWAbsoluteLayout.class)){ + creator.setBackupBound(wgtBound); + ((XWAbsoluteLayout) creator).updateBoundsWidget(); + } } } } @@ -223,7 +241,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { @Override protected String getIconName() { - return "layout_absolute.png"; + return "layout_absolute_new.png"; } /** diff --git a/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java b/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java index d847245e1..d85c610ac 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java @@ -190,4 +190,9 @@ public class XWParameterLayout extends XWAbsoluteLayout { @Override public void updateBoundsWidget() { } + + @Override + protected String getIconName() { + return "layout_absolute.png"; + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/form/parameter/XFormSubmit.java b/designer_form/src/com/fr/design/form/parameter/XFormSubmit.java index 094fdeb7a..3d8f3d914 100644 --- a/designer_form/src/com/fr/design/form/parameter/XFormSubmit.java +++ b/designer_form/src/com/fr/design/form/parameter/XFormSubmit.java @@ -1 +1 @@ -package com.fr.design.form.parameter; import com.fr.design.designer.creator.XButton; import com.fr.design.designer.creator.XCreator; import com.fr.form.parameter.FormSubmitButton; import java.awt.*; /** * 提交按钮 * @editor zhou * @since 2012-3-23下午3:36:00 */ public class XFormSubmit extends XButton { public XFormSubmit(FormSubmitButton widget, Dimension initSize) { super(widget, initSize); } /** * 是否有查询按钮 * @param xCreator 控件或容器 * @return 有无查询按钮 */ public boolean SearchQueryCreators(XCreator xCreator) { return true; } /** * 该组件是否可以拖入表单主体 * @return 是则返回true */ public boolean canEnterIntoAdaptPane(){ return false; } @Override protected String getIconName() { return "preview_16.png"; } } \ No newline at end of file +package com.fr.design.form.parameter; import com.fr.design.designer.creator.XButton; import com.fr.design.designer.creator.XCreator; import com.fr.form.parameter.FormSubmitButton; import java.awt.*; /** * 提交按钮 * @editor zhou * @since 2012-3-23下午3:36:00 */ public class XFormSubmit extends XButton { public XFormSubmit(FormSubmitButton widget, Dimension initSize) { super(widget, initSize); } /** * 是否有查询按钮 * @param xCreator 控件或容器 * @return 有无查询按钮 */ public boolean SearchQueryCreators(XCreator xCreator) { return true; } /** * 该组件是否可以拖入表单主体 * @return 是则返回true */ public boolean canEnterIntoAdaptPane(){ return false; } /** * 该组件是否可以拖入绝对布局 * * @return 是则返回true */ @Override public boolean canEnterIntoAbsolutePane() { return false; } @Override protected String getIconName() { return "preview_16.png"; } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/gui/core/FormWidgetOption.java b/designer_form/src/com/fr/design/gui/core/FormWidgetOption.java index 76287c30f..214d2cd67 100644 --- a/designer_form/src/com/fr/design/gui/core/FormWidgetOption.java +++ b/designer_form/src/com/fr/design/gui/core/FormWidgetOption.java @@ -1 +1 @@ -package com.fr.design.gui.core; import javax.swing.Icon; import com.fr.base.BaseUtils; import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WCardLayout; import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WHorizontalBoxLayout; import com.fr.form.ui.container.WParameterLayout; import com.fr.form.ui.container.WVerticalBoxLayout; import com.fr.general.Inter; /** * Author : Shockway * Date: 13-6-17 * Time: 上午10:40 */ public class FormWidgetOption extends WidgetOption { /** * 返回名字 * @return 名字 */ @Override public String optionName() { return null; } /** * 返回图标 * @return 图标 */ @Override public Icon optionIcon() { return null; } /** * 组件类 * @return 类 */ @Override public Class widgetClass() { return null; } /** * 返回组件 * @return 控件 */ @Override public Widget createWidget() { return null; } /* * 表单容器 */ public static WidgetOption[] getFormContainerInstance() { return new WidgetOption[] { ABSOLUTELAYOUTCONTAINER, BORDERLAYOUTCONTAINER, HORIZONTALBOXLAYOUTCONTAINER, VERTICALBOXLAYOUTCONTAINER, CARDLAYOUTCONTAINER, FITLAYOUTCONTAINER }; } /** * 表单工具栏上的布局 * @return 控件 */ public static WidgetOption[] getFormLayoutInstance() { return new WidgetOption[] {CARDLAYOUTCONTAINER, ABSOLUTELAYOUTCONTAINER}; } public static final WidgetOption ABSOLUTELAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_AbsoluteLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_absolute.png"), WAbsoluteLayout.class); public static final WidgetOption BORDERLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_BorderLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_border.png"), WBorderLayout.class); public static final WidgetOption CARDLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_CardLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/card_layout_16.png"), WCardLayout.class); public static final WidgetOption HORIZONTALBOXLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_Layout-HBox"), BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_h_16.png"), WHorizontalBoxLayout.class); public static final WidgetOption VERTICALBOXLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_VerticalBoxLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_v_16.png"), WVerticalBoxLayout.class); public static final WidgetOption FITLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_v_16.png"), WFitLayout.class); public static final WidgetOption PARAMETERCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_Para-Body"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_parameter.png"), WParameterLayout.class); public static final WidgetOption ELEMENTCASE = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_Form-Report"), BaseUtils.readIcon("/com/fr/web/images/form/resources/report_16.png"), ElementCaseEditor.class); } \ No newline at end of file +package com.fr.design.gui.core; import javax.swing.Icon; import com.fr.base.BaseUtils; import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WCardLayout; import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WHorizontalBoxLayout; import com.fr.form.ui.container.WParameterLayout; import com.fr.form.ui.container.WVerticalBoxLayout; import com.fr.general.Inter; /** * Author : Shockway * Date: 13-6-17 * Time: 上午10:40 */ public class FormWidgetOption extends WidgetOption { /** * 返回名字 * @return 名字 */ @Override public String optionName() { return null; } /** * 返回图标 * @return 图标 */ @Override public Icon optionIcon() { return null; } /** * 组件类 * @return 类 */ @Override public Class widgetClass() { return null; } /** * 返回组件 * @return 控件 */ @Override public Widget createWidget() { return null; } /* * 表单容器 */ public static WidgetOption[] getFormContainerInstance() { return new WidgetOption[] { ABSOLUTELAYOUTCONTAINER, BORDERLAYOUTCONTAINER, HORIZONTALBOXLAYOUTCONTAINER, VERTICALBOXLAYOUTCONTAINER, CARDLAYOUTCONTAINER, FITLAYOUTCONTAINER }; } /** * 表单工具栏上的布局 * @return 控件 */ public static WidgetOption[] getFormLayoutInstance() { return new WidgetOption[] {CARDLAYOUTCONTAINER, ABSOLUTELAYOUTCONTAINER}; } public static final WidgetOption ABSOLUTELAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_AbsoluteLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_absolute_new.png"), WAbsoluteLayout.class); public static final WidgetOption BORDERLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_BorderLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_border.png"), WBorderLayout.class); public static final WidgetOption CARDLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_CardLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/card_layout_16.png"), WCardLayout.class); public static final WidgetOption HORIZONTALBOXLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_Layout-HBox"), BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_h_16.png"), WHorizontalBoxLayout.class); public static final WidgetOption VERTICALBOXLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_VerticalBoxLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_v_16.png"), WVerticalBoxLayout.class); public static final WidgetOption FITLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_v_16.png"), WFitLayout.class); public static final WidgetOption PARAMETERCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_Para-Body"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_parameter.png"), WParameterLayout.class); public static final WidgetOption ELEMENTCASE = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_Form-Report"), BaseUtils.readIcon("/com/fr/web/images/form/resources/report_16.png"), ElementCaseEditor.class); } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/FormCreatorDropTarget.java b/designer_form/src/com/fr/design/mainframe/FormCreatorDropTarget.java index ed4cf4190..1172a4b64 100644 --- a/designer_form/src/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer_form/src/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -20,11 +20,7 @@ import com.fr.design.designer.beans.HoverPainter; import com.fr.design.designer.beans.Painter; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.models.AddingModel; -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.XWFitLayout; -import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.designer.creator.*; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.icon.IconPathConstants; @@ -135,8 +131,16 @@ public class FormCreatorDropTarget extends DropTarget { // 取消前一个焦点容器的提示渲染器 designer.setPainter(null); } - - painter = AdapterBus.getContainerPainter(designer, container); + //获取painter的时候要考虑布局之间嵌套的问题 + XLayoutContainer xLayoutContainer = container.getTopLayout(); + if (xLayoutContainer != null && xLayoutContainer.getParent() != null + && ((XLayoutContainer)xLayoutContainer.getParent()).acceptType(XWAbsoluteLayout.class)){ + if(!xLayoutContainer.isEditable()){ + xLayoutContainer = (XLayoutContainer)xLayoutContainer.getParent(); + } + } + painter = AdapterBus.getContainerPainter(designer, + xLayoutContainer != null && xLayoutContainer.acceptType(XWAbsoluteLayout.class) ? xLayoutContainer : container); // 为界面设计器设置提示渲染提示器 designer.setPainter(painter); From 05e4fc08cd0641933dcf81ad853864e01dbd120d Mon Sep 17 00:00:00 2001 From: Fangjie Hu Date: Mon, 29 Aug 2016 14:38:31 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E7=94=BB=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_chart/src/com/fr/design/chart/gui/ChartComponent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/chart/gui/ChartComponent.java b/designer_chart/src/com/fr/design/chart/gui/ChartComponent.java index a33fdc166..186b7eb6c 100644 --- a/designer_chart/src/com/fr/design/chart/gui/ChartComponent.java +++ b/designer_chart/src/com/fr/design/chart/gui/ChartComponent.java @@ -316,7 +316,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene //不直接画chartGlyph而画image的原因是表单的柱形图会溢出表单 //其他图都ok,其实感觉应该是柱形图画的不对,应该也可以改那边 Image chartImage = chartGlyph.toImage(chartWidth,chartHeight,ScreenResolution.getScreenResolution()); - g2d.drawImage(chartImage, 0, 0, chartWidth, chartHeight, null); + g2d.drawImage(chartImage, 0, 0, null); } } From d6788f0f0a0cbadeed83d5588df5a42b4673c3ba Mon Sep 17 00:00:00 2001 From: sunmondong Date: Mon, 29 Aug 2016 17:35:55 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E7=BC=A9=E5=B0=8F=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/build.gradle | 2 +- designer_base/build.gradle.bak | 4 ++-- designer_chart/build.gradle | 2 +- designer_chart/build.gradle.bak | 4 ++-- designer_form/build.gradle | 2 +- designer_form/build.gradle.bak | 20 ++++++++++---------- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/designer_base/build.gradle b/designer_base/build.gradle index cbaf1a695..285295c56 100644 --- a/designer_base/build.gradle +++ b/designer_base/build.gradle @@ -33,7 +33,7 @@ def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) dependencies{ compile fileTree(dir:'../../../finereport-lib-stable',include:'**/*.jar') -compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/*.jar") +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/*/build/libs/*.jar") testCompile 'junit:junit:4.12' } diff --git a/designer_base/build.gradle.bak b/designer_base/build.gradle.bak index bd5f62e8e..e7c5a8e1f 100644 --- a/designer_base/build.gradle.bak +++ b/designer_base/build.gradle.bak @@ -33,7 +33,7 @@ def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) dependencies{ compile fileTree(dir:'../../../finereport-lib-stable',include:'**/*.jar') -compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/*.jar") +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") testCompile 'junit:junit:4.12' } @@ -56,7 +56,7 @@ task compressJS{ fileset(dir:'../../../finereport-lib4build-stable',includes:'**/*.jar') } } - ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false", , charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){ + ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false",charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){ fileset (dir:"${srcDir}/src"){ include (name:'**/*.js') include (name:'**/*.css') diff --git a/designer_chart/build.gradle b/designer_chart/build.gradle index 946649195..ec39e786a 100644 --- a/designer_chart/build.gradle +++ b/designer_chart/build.gradle @@ -31,7 +31,7 @@ def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) //指定外部依赖 dependencies{ compile fileTree(dir:'../../../finereport-lib-stable',include:'**/*.jar') -compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/*.jar") +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/*/build/libs/*.jar") testCompile 'junit:junit:4.12' } diff --git a/designer_chart/build.gradle.bak b/designer_chart/build.gradle.bak index 2a9777371..92f055162 100644 --- a/designer_chart/build.gradle.bak +++ b/designer_chart/build.gradle.bak @@ -31,7 +31,7 @@ def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) //指定外部依赖 dependencies{ compile fileTree(dir:'../../../finereport-lib-stable',include:'**/*.jar') -compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/*.jar") +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") testCompile 'junit:junit:4.12' } @@ -54,7 +54,7 @@ task compressJS{ fileset(dir:'../../../finereport-lib4build-stable',includes:'**/*.jar') } } - ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false", , charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){ + ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false",charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){ fileset (dir:"${srcDir}/src"){ include (name:'**/*.js') include (name:'**/*.css') diff --git a/designer_form/build.gradle b/designer_form/build.gradle index ca89333a4..6c0df949c 100644 --- a/designer_form/build.gradle +++ b/designer_form/build.gradle @@ -33,7 +33,7 @@ def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) //声明外部依赖 dependencies{ compile fileTree(dir:'../../../finereport-lib-stable',include:'**/*.jar') -compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")//,exclude:"finereport-design-stable/${branchName}/build/libs/*.jar") +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/*/build/libs/*.jar") testCompile 'junit:junit:4.12' } diff --git a/designer_form/build.gradle.bak b/designer_form/build.gradle.bak index f6c634dd1..4204c2415 100644 --- a/designer_form/build.gradle.bak +++ b/designer_form/build.gradle.bak @@ -3,19 +3,19 @@ apply plugin: 'java' tasks.withType(JavaCompile){ options.encoding = 'UTF-8' } -//ָjdk汾 +//指定构建的jdk版本 sourceCompatibility=1.8 -//ָɵjar汾 +//指定生成的jar包版本 version='8.0' def srcDir="." -//ָjar +//指明生成jar包的名字 jar{ baseName='fr-designer-report' } -//Դλ +//源码所在位置 sourceSets{ main{ java{ @@ -25,20 +25,20 @@ sourceSets{ } } -//ȡʲô֧ +//获取什么分支名 FileTree files =fileTree(dir:'./',include:'build.gradle') def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\')) buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\')) def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) -//ⲿ +//声明外部依赖 dependencies{ compile fileTree(dir:'../../../finereport-lib-stable',include:'**/*.jar') -compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")//,exclude:"finereport-design-stable/${branchName}/build/libs/*.jar") +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") testCompile 'junit:junit:4.12' } -//ָ޷ļ· +//指明无法编译文件所在路径 def dataContent ={def dir -> copySpec{ from ("${dir}"){ @@ -47,7 +47,7 @@ def dataContent ={def dir -> } } -//.javaļƵclassesļ +//将非.java文件复制到classes文件夹下 参与打包 task copyFile(type:Copy,dependsOn:compileJava){ copy{ with dataContent.call("${srcDir}/src") @@ -58,7 +58,7 @@ task copyFile(type:Copy,dependsOn:compileJava){ } -//ѹĿеjsļ +//压缩项目中的js文件 task compressJS{ ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ classpath { From 59a3e8f7bec4dc4515095cc27f1e5012d065f5f1 Mon Sep 17 00:00:00 2001 From: sunmondong Date: Mon, 29 Aug 2016 18:07:17 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/build.gradle | 2 +- designer_base/build.gradle.bak | 2 +- designer_chart/build.gradle | 2 +- designer_chart/build.gradle.bak | 2 +- designer_form/build.gradle | 2 +- designer_form/build.gradle.bak | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/designer_base/build.gradle b/designer_base/build.gradle index 285295c56..e7c5a8e1f 100644 --- a/designer_base/build.gradle +++ b/designer_base/build.gradle @@ -33,7 +33,7 @@ def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) dependencies{ compile fileTree(dir:'../../../finereport-lib-stable',include:'**/*.jar') -compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/*/build/libs/*.jar") +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") testCompile 'junit:junit:4.12' } diff --git a/designer_base/build.gradle.bak b/designer_base/build.gradle.bak index e7c5a8e1f..285295c56 100644 --- a/designer_base/build.gradle.bak +++ b/designer_base/build.gradle.bak @@ -33,7 +33,7 @@ def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) dependencies{ compile fileTree(dir:'../../../finereport-lib-stable',include:'**/*.jar') -compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/*/build/libs/*.jar") testCompile 'junit:junit:4.12' } diff --git a/designer_chart/build.gradle b/designer_chart/build.gradle index ec39e786a..92f055162 100644 --- a/designer_chart/build.gradle +++ b/designer_chart/build.gradle @@ -31,7 +31,7 @@ def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) //指定外部依赖 dependencies{ compile fileTree(dir:'../../../finereport-lib-stable',include:'**/*.jar') -compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/*/build/libs/*.jar") +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") testCompile 'junit:junit:4.12' } diff --git a/designer_chart/build.gradle.bak b/designer_chart/build.gradle.bak index 92f055162..ec39e786a 100644 --- a/designer_chart/build.gradle.bak +++ b/designer_chart/build.gradle.bak @@ -31,7 +31,7 @@ def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) //指定外部依赖 dependencies{ compile fileTree(dir:'../../../finereport-lib-stable',include:'**/*.jar') -compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/*/build/libs/*.jar") testCompile 'junit:junit:4.12' } diff --git a/designer_form/build.gradle b/designer_form/build.gradle index 6c0df949c..4204c2415 100644 --- a/designer_form/build.gradle +++ b/designer_form/build.gradle @@ -33,7 +33,7 @@ def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) //声明外部依赖 dependencies{ compile fileTree(dir:'../../../finereport-lib-stable',include:'**/*.jar') -compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/*/build/libs/*.jar") +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") testCompile 'junit:junit:4.12' } diff --git a/designer_form/build.gradle.bak b/designer_form/build.gradle.bak index 4204c2415..6c0df949c 100644 --- a/designer_form/build.gradle.bak +++ b/designer_form/build.gradle.bak @@ -33,7 +33,7 @@ def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) //声明外部依赖 dependencies{ compile fileTree(dir:'../../../finereport-lib-stable',include:'**/*.jar') -compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/*/build/libs/*.jar") testCompile 'junit:junit:4.12' } From 52af1da90319089e0a1bd45d5a38afcae212d48c Mon Sep 17 00:00:00 2001 From: zack Date: Mon, 29 Aug 2016 19:04:18 +0800 Subject: [PATCH 5/6] =?UTF-8?q?bug103155,tab=E5=B8=83=E5=B1=80=E7=9A=84?= =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=E5=8A=9F=E8=83=BD=E5=85=88=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/CompositeComponentAdapter.java | 36 ++++++++----------- .../fr/design/designer/creator/XCreator.java | 9 +++++ .../creator/cardlayout/XWCardLayout.java | 30 +++++++--------- 3 files changed, 36 insertions(+), 39 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/component/CompositeComponentAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/component/CompositeComponentAdapter.java index e6f607e41..12bd2515f 100644 --- a/designer_form/src/com/fr/design/designer/beans/adapters/component/CompositeComponentAdapter.java +++ b/designer_form/src/com/fr/design/designer/beans/adapters/component/CompositeComponentAdapter.java @@ -1,38 +1,31 @@ package com.fr.design.designer.beans.adapters.component; -import java.awt.AlphaComposite; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.event.MouseEvent; -import java.beans.IntrospectionException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; - -import javax.swing.Action; -import javax.swing.JComponent; -import javax.swing.JPopupMenu; - import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.beans.GroupModel; -import com.fr.design.mainframe.FormDesigner; -import com.fr.design.gui.xtable.PropertyGroupModel; import com.fr.design.designer.beans.ComponentAdapter; import com.fr.design.designer.beans.actions.ChangeNameAction; import com.fr.design.designer.beans.events.DesignerEditor; import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.designer.creator.XButton; import com.fr.design.designer.creator.XCreator; +import com.fr.design.form.util.XCreatorConstants; +import com.fr.design.gui.xtable.PropertyGroupModel; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.utils.ComponentUtils; +import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.Button; import com.fr.form.ui.Widget; -import com.fr.design.form.util.XCreatorConstants; import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; -import com.fr.design.utils.ComponentUtils; -import com.fr.design.utils.gui.LayoutUtils; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.MouseEvent; +import java.beans.IntrospectionException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; public class CompositeComponentAdapter implements ComponentAdapter { @@ -81,7 +74,8 @@ public class CompositeComponentAdapter implements ComponentAdapter { } //底层布局或者是自适应布局都不能删除 boolean isRootComponent = ComponentUtils.isRootComponent(xCreator) || designer.isRoot(xCreator); - changeVarNameAction.setEnabled(!isRootComponent); + //bug103155 有的布局的重命名(tab布局)涉及到其他非子节点的属性修改,支持起来比较麻烦,先屏蔽了控件树面板的修改,强制使用属性面板修改 + changeVarNameAction.setEnabled(!isRootComponent && xCreator.supportRenameInWidgetTree()); popupMenu.add(changeVarNameAction); Action[] actions = designer.getActions(); diff --git a/designer_form/src/com/fr/design/designer/creator/XCreator.java b/designer_form/src/com/fr/design/designer/creator/XCreator.java index 62cfe0b25..ab08de3fe 100644 --- a/designer_form/src/com/fr/design/designer/creator/XCreator.java +++ b/designer_form/src/com/fr/design/designer/creator/XCreator.java @@ -544,4 +544,13 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { return new WidgetPropertyUIProvider[0]; } + + /** + * 控件树面板中是否支持重命名选项 + * + * @return 控件树面板中是否支持重命名选项 + */ + public boolean supportRenameInWidgetTree() { + return true; + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java index e5d8d44d2..b5c155c70 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java @@ -3,33 +3,17 @@ */ package com.fr.design.designer.creator.cardlayout; -import java.awt.CardLayout; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.event.ContainerEvent; -import java.beans.IntrospectionException; - -import javax.swing.border.Border; - import com.fr.base.background.ColorBackground; import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRCardLayoutAdapter; import com.fr.design.designer.beans.models.SelectionModel; -import com.fr.design.designer.creator.CRPropertyDescriptor; -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.XWidgetCreator; +import com.fr.design.designer.creator.*; import com.fr.design.form.layout.FRCardLayout; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.widget.editors.CardTagWLayoutBorderStyleEditor; import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer; -import com.fr.form.ui.CardAddButton; -import com.fr.form.ui.CardSwitchButton; -import com.fr.form.ui.LayoutBorderStyle; -import com.fr.form.ui.Widget; -import com.fr.form.ui.WidgetTitle; +import com.fr.form.ui.*; import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WCardLayout; import com.fr.form.ui.container.WLayout; @@ -41,6 +25,11 @@ import com.fr.general.Inter; import com.fr.stable.Constants; import com.fr.stable.core.PropertyChangeAdapter; +import javax.swing.border.Border; +import java.awt.*; +import java.awt.event.ContainerEvent; +import java.beans.IntrospectionException; + /** * @author richer * @since 6.5.3 @@ -379,4 +368,9 @@ public class XWCardLayout extends XLayoutContainer { public XLayoutContainer getTopLayout() { return this.getBackupParent().getTopLayout(); } + + @Override + public boolean supportRenameInWidgetTree() { + return false; + } } \ No newline at end of file From f468fc4491644d9c2c851e64d37921e063db1824 Mon Sep 17 00:00:00 2001 From: zhouping Date: Tue, 30 Aug 2016 10:59:27 +0800 Subject: [PATCH 6/6] bug:103653 --- .../fr/design/designer/beans/painters/FRFitLayoutPainter.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/beans/painters/FRFitLayoutPainter.java b/designer_form/src/com/fr/design/designer/beans/painters/FRFitLayoutPainter.java index 8634ae172..e29908075 100644 --- a/designer_form/src/com/fr/design/designer/beans/painters/FRFitLayoutPainter.java +++ b/designer_form/src/com/fr/design/designer/beans/painters/FRFitLayoutPainter.java @@ -107,10 +107,9 @@ public class FRFitLayoutPainter extends AbstractPainter{ // 下边缘 Rectangle bottomEdge = new Rectangle(containerX, bottomY, containerWidth, BORDER_PROPORTION); if(bottomEdge.intersects(currentXY)){ - hotspot_bounds.y -= WCardMainBorderLayout.TAB_HEIGHT/2; + hotspot_bounds.y += (container.getHeight() - WCardMainBorderLayout.TAB_HEIGHT)/2; hot_rec[WIDTH] = container.getWidth(); hot_rec[HEIGHT] = (container.getHeight() + WCardMainBorderLayout.TAB_HEIGHT)/2; - accept = false; } //左右边缘的高度 -10*2 是为了不和上下边缘重合