Browse Source

无JIRA任务 master的boundsWidget到release

master
zack 8 years ago
parent
commit
f7b05c896e
  1. 9
      designer_form/src/com/fr/design/designer/beans/ConnectorCreator.java
  2. 4
      designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java
  3. 2
      designer_form/src/com/fr/design/designer/beans/location/AccessDirection.java
  4. 2
      designer_form/src/com/fr/design/designer/beans/location/Inner.java
  5. 40
      designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java
  6. 18
      designer_form/src/com/fr/design/designer/creator/XWFitLayout.java
  7. 9
      designer_form/src/com/fr/design/designer/creator/XWScaleLayout.java
  8. 2
      designer_form/src/com/fr/design/designer/creator/XWTitleLayout.java
  9. 11
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java
  10. 2
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java
  11. 15
      designer_form/src/com/fr/design/mainframe/ConnectorHelper.java

9
designer_form/src/com/fr/design/designer/beans/ConnectorCreator.java

@ -1,13 +1,12 @@
package com.fr.design.designer.beans; package com.fr.design.designer.beans;
import java.awt.Point; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import java.awt.Rectangle; import com.fr.form.ui.container.WLayout;
import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.PriorityQueue; import java.util.PriorityQueue;
import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.widget.BoundsWidget;
public class ConnectorCreator { public class ConnectorCreator {
public static final int UNIT = 10; public static final int UNIT = 10;

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

@ -16,13 +16,11 @@ 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.BoundsWidget;
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.form.ui.widget.BoundsWidget;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import java.awt.*; import java.awt.*;

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

@ -10,7 +10,7 @@ import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelection; 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.widget.BoundsWidget; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import java.awt.*; import java.awt.*;

2
designer_form/src/com/fr/design/designer/beans/location/Inner.java

@ -9,7 +9,7 @@ import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelection; 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.widget.BoundsWidget; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import java.awt.*; import java.awt.*;

40
designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java

@ -3,31 +3,35 @@
*/ */
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.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;
import com.fr.design.designer.beans.adapters.layout.FRAbsoluteLayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRAbsoluteLayoutAdapter;
import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.beans.location.Direction;
import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.beans.models.SelectionModel;
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.WAbsoluteLayout.BoundsWidget;
import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.widget.BoundsWidget;
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
@ -159,7 +163,15 @@ public class XWAbsoluteLayout extends XLayoutContainer {
if (xCreator.acceptType(XWAbsoluteLayout.class)) { if (xCreator.acceptType(XWAbsoluteLayout.class)) {
((XWAbsoluteLayout) xCreator).updateBoundsWidget(); ((XWAbsoluteLayout) xCreator).updateBoundsWidget();
} }
BoundsWidget boundsWidget = layout.getBoundsWidget(xCreator.toData()); // 如果子组件时tab布局,则tab布局内部的组件的wiget也要更新,否则保存后重新打开大小不对
ArrayList<?> childrenList = xCreator.getTargetChildrenList();
if (!childrenList.isEmpty()) {
for (int i = 0; i < childrenList.size(); i++) {
XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList.get(i);
tabLayout.updateBoundsWidget();
}
}
BoundsWidget boundsWidget = (BoundsWidget) layout.getBoundsWidget(xCreator.toData());
Rectangle rectangle = dealWidgetBound(xCreator.getBounds()); Rectangle rectangle = dealWidgetBound(xCreator.getBounds());
} }
@ -184,7 +196,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
double percentH = ((double) backupBound.height / (double) currentBound.height); double percentH = ((double) backupBound.height / (double) currentBound.height);
for (int index = 0, n = this.getComponentCount(); index < n; index++) { for (int index = 0, n = this.getComponentCount(); index < n; index++) {
XCreator creator = (XCreator) this.getComponent(index); XCreator creator = (XCreator) this.getComponent(index);
BoundsWidget wgt = layout.getBoundsWidget(creator.toData()); BoundsWidget wgt = (BoundsWidget) layout.getBoundsWidget(creator.toData());
// 用当前的显示大小计算后调正具体位置 // 用当前的显示大小计算后调正具体位置
Rectangle wgtBound = creator.getBounds(); Rectangle wgtBound = creator.getBounds();
Rectangle rec = calculateBound(wgtBound, percentW, percentH); Rectangle rec = calculateBound(wgtBound, percentW, percentH);
@ -217,7 +229,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
rec.y = (int) (rec.y / prevContainerPercent * containerPercent); rec.y = (int) (rec.y / prevContainerPercent * containerPercent);
rec.height = (int) (rec.height / prevContainerPercent * containerPercent); rec.height = (int) (rec.height / prevContainerPercent * containerPercent);
rec.width = (int) (rec.width / prevContainerPercent * containerPercent); rec.width = (int) (rec.width / prevContainerPercent * containerPercent);
BoundsWidget wgt = toData().getBoundsWidget(creator.toData()); BoundsWidget wgt = (BoundsWidget) toData().getBoundsWidget(creator.toData());
wgt.setBounds(rec); wgt.setBounds(rec);
creator.setBounds(rec); creator.setBounds(rec);
creator.updateChildBound(minHeight); creator.updateChildBound(minHeight);
@ -481,7 +493,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
XCreator xCreator = (XCreator) getComponent(i); XCreator xCreator = (XCreator) getComponent(i);
Rectangle rectangle = xCreator.getBounds(); Rectangle rectangle = xCreator.getBounds();
xCreator.setBounds((int) (rectangle.x * percent), rectangle.y, (int) (rectangle.width * percent), rectangle.height); xCreator.setBounds((int) (rectangle.x * percent), rectangle.y, (int) (rectangle.width * percent), rectangle.height);
BoundsWidget widget = toData().getBoundsWidget(xCreator.toData()); BoundsWidget widget = (BoundsWidget) toData().getBoundsWidget(xCreator.toData());
widget.setBounds(xCreator.getBounds()); widget.setBounds(xCreator.getBounds());
} }
} }
@ -498,7 +510,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
XCreator xCreator = (XCreator) getComponent(i); XCreator xCreator = (XCreator) getComponent(i);
Rectangle rectangle = xCreator.getBounds(); Rectangle rectangle = xCreator.getBounds();
xCreator.setBounds(rectangle.x, (int) (rectangle.y * percent), rectangle.width, (int) (rectangle.height * percent)); xCreator.setBounds(rectangle.x, (int) (rectangle.y * percent), rectangle.width, (int) (rectangle.height * percent));
BoundsWidget widget = toData().getBoundsWidget(xCreator.toData()); BoundsWidget widget = (BoundsWidget) toData().getBoundsWidget(xCreator.toData());
widget.setBounds(xCreator.getBounds()); widget.setBounds(xCreator.getBounds());
} }
} }

18
designer_form/src/com/fr/design/designer/creator/XWFitLayout.java

@ -1,14 +1,5 @@
package com.fr.design.designer.creator; package com.fr.design.designer.creator;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.event.ContainerEvent;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRFitLayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRFitLayoutAdapter;
import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.beans.location.Direction;
@ -20,14 +11,19 @@ import com.fr.design.mainframe.FormArea;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.PaddingMargin;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WFitLayout;
import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.widget.BoundsWidget;
import com.fr.general.FRScreen; import com.fr.general.FRScreen;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import java.awt.*;
import java.awt.event.ContainerEvent;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/** /**
* @author jim * @author jim
* @date 2014-6-23 * @date 2014-6-23

9
designer_form/src/com/fr/design/designer/creator/XWScaleLayout.java

@ -3,16 +3,15 @@
*/ */
package com.fr.design.designer.creator; package com.fr.design.designer.creator;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.event.ContainerEvent;
import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRScaleLayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRScaleLayoutAdapter;
import com.fr.design.form.layout.FRScaleLayout; import com.fr.design.form.layout.FRScaleLayout;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.form.ui.container.WScaleLayout; import com.fr.form.ui.container.WScaleLayout;
import com.fr.form.ui.widget.BoundsWidget;
import java.awt.*;
import java.awt.event.ContainerEvent;
/** /**
* 自适应布局中添加组件时部分控件如数字文本下拉等需要保持控件默认高度21 用此容器来实现 * 自适应布局中添加组件时部分控件如数字文本下拉等需要保持控件默认高度21 用此容器来实现

2
designer_form/src/com/fr/design/designer/creator/XWTitleLayout.java

@ -11,7 +11,7 @@ import com.fr.form.ui.Label;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetTitle; import com.fr.form.ui.WidgetTitle;
import com.fr.form.ui.container.WTitleLayout; import com.fr.form.ui.container.WTitleLayout;
import com.fr.form.ui.widget.BoundsWidget; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import java.awt.*; import java.awt.*;

11
designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java

@ -3,10 +3,6 @@
*/ */
package com.fr.design.designer.creator.cardlayout; package com.fr.design.designer.creator.cardlayout;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
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.models.SelectionModel; import com.fr.design.designer.beans.models.SelectionModel;
@ -17,12 +13,17 @@ import com.fr.design.designer.creator.XWBorderLayout;
import com.fr.design.icon.IconPathConstants; import com.fr.design.icon.IconPathConstants;
import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.EditingMouseListener;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WBorderLayout;
import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout;
import com.fr.form.ui.widget.BoundsWidget;
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.MouseEvent;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
/** /**
* card布局主体框架 * card布局主体框架
* *

2
designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java

@ -18,7 +18,7 @@ import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.form.ui.container.cardlayout.WTabFitLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.form.ui.widget.BoundsWidget; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;

15
designer_form/src/com/fr/design/mainframe/ConnectorHelper.java

@ -1,18 +1,15 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import com.fr.form.ui.widget.BoundsWidget;
import com.fr.stable.Constants;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.design.designer.beans.ConnectorCreator; import com.fr.design.designer.beans.ConnectorCreator;
import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.form.ui.Connector; import com.fr.form.ui.Connector;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.stable.Constants;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
public class ConnectorHelper { public class ConnectorHelper {
//这个类是用来画连接线的,暂时用不到 //这个类是用来画连接线的,暂时用不到

Loading…
Cancel
Save