From 477854d2af1d34be24f9717d77de96322611d574 Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 20 Oct 2016 01:21:39 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=9D=97=E5=85=B1?= =?UTF-8?q?=E4=BA=AB=EF=BC=8C=E5=B8=AE=E5=8A=A9=E4=BF=A1=E6=81=AF=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=EF=BC=8C=E6=95=B0=E6=8D=AE=E9=9B=86=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E5=88=B0=E8=A1=A8=E5=8D=95=E3=80=82=E4=BB=A5=E5=8F=8A=E5=86=85?= =?UTF-8?q?=E8=BE=B9=E8=B7=9D=E7=9A=84=E4=B8=80=E4=B8=AAbug=E6=94=B9?= =?UTF-8?q?=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/BasicTableDataTreePane.java | 4 + .../data/datapane/TableDataTreePane.java | 20 ++ .../com/fr/design/icon/IconPathConstants.java | 2 +- .../fr/design/images/control/help_close.png | Bin 0 -> 801 bytes .../fr/design/images/control/help_open.png | Bin 0 -> 895 bytes .../fr/design/designer/creator/XCreator.java | 21 ++ .../designer/creator/XCreatorUtils.java | 1 + .../design/designer/creator/XElementCase.java | 22 +- .../fr/design/mainframe/CoverReportPane.java | 140 ++++++-- .../mainframe/EditingMouseListener.java | 38 +- .../mainframe/ElementCaseHelpDialog.java | 73 ++++ .../mainframe/FormCreatorDropTarget.java | 340 +++++++++--------- 12 files changed, 441 insertions(+), 220 deletions(-) create mode 100644 designer_base/src/com/fr/design/images/control/help_close.png create mode 100644 designer_base/src/com/fr/design/images/control/help_open.png create mode 100644 designer_form/src/com/fr/design/mainframe/ElementCaseHelpDialog.java diff --git a/designer_base/src/com/fr/design/data/BasicTableDataTreePane.java b/designer_base/src/com/fr/design/data/BasicTableDataTreePane.java index 32049380d5..a6fd601a82 100644 --- a/designer_base/src/com/fr/design/data/BasicTableDataTreePane.java +++ b/designer_base/src/com/fr/design/data/BasicTableDataTreePane.java @@ -3,6 +3,7 @@ package com.fr.design.data; import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.base.TableData; +import com.fr.data.TableDataSource; import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.design.DesignModelAdapter; import com.fr.design.actions.UpdateAction; @@ -423,4 +424,7 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp this.setSmallIcon(BaseUtils.readIcon(IconPathConstants.TD_CONNECTION_ICON_PATH)); } } + public void addTableData(TableDataSource tableDataSource){ + + } } diff --git a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java index 162957ebf4..911b0d9c94 100644 --- a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java @@ -39,6 +39,7 @@ import java.awt.event.ActionEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.HashMap; +import java.util.Iterator; import java.util.Map; public class TableDataTreePane extends BasicTableDataTreePane { @@ -138,6 +139,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { populate(new TableDataSourceOP(tc)); this.checkButtonEnabled(); } + protected void initbuttonGroup() { Icon[] iconArray = {BaseUtils.readIcon("/com/fr/design/images/data/datasource.png"), BaseUtils.readIcon("/com/fr/design/images/data/dock/serverdatabase.png")}; final Integer[] modeArray = {TEMPLATE_TABLE_DATA, SERVER_TABLE_DATA}; @@ -267,4 +269,22 @@ public class TableDataTreePane extends BasicTableDataTreePane { public TableDataTree getDataTree() { return dataTree; } + + public void addTableData(TableDataSource tableDataSource) { + DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER); + TableDataSource tds = tc.getBook(); + Iterator tdIterator = tableDataSource.getTableDataNameIterator(); + while (tdIterator.hasNext()) { + String tdName = (String) tdIterator.next(); + TableData td = tableDataSource.getTableData(tdName); + if (tds.getTableData(tdName) != null) { + tds.putTableData(tdName + "-fr-el", td); + } else { + tds.putTableData(tdName, td); + } + } + tc.fireTargetModified(); + tc.parameterChanged(); + dataTree.refresh(); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/icon/IconPathConstants.java b/designer_base/src/com/fr/design/icon/IconPathConstants.java index c254e04d67..4a86bcf6f1 100644 --- a/designer_base/src/com/fr/design/icon/IconPathConstants.java +++ b/designer_base/src/com/fr/design/icon/IconPathConstants.java @@ -1 +1 @@ -package com.fr.design.icon; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 6.5.6 * Date: 12-12-18 * Time: 上午9:42 * 用于保存所有图标路径的类 */ public class IconPathConstants { private IconPathConstants() { } public static final String ADD_POPMENU_ICON_PATH = "/com/fr/design/images/control/addPopup.png"; public static final String DS_ICON_PATH = "/com/fr/design/images/data/datasource.png"; public static final String CLASS_TD_ICON_PATH = "/com/fr/design/images/data/source/classTableData.png"; public static final String EMB_TD_ICON_PATH = "/com/fr/design/images/data/dataTable.png"; public static final String DS_RELATION_TD_ICON_PATH = "/com/fr/design/images/data/multi.png"; public static final String FILE_TD_ICON_PATH = "/com/fr/design/images/data/file.png"; public static final String DS_TREE_TD_ICON_PATH = "/com/fr/design/images/data/tree.png"; public static final String DS_QUERY_ICON_PATH = "/com/fr/design/images/data/database.png"; public static final String PREVIEW_ICON_PATH = "/com/fr/design/images/m_file/preview.png"; public static final String TD_EDIT_ICON_PATH = "/com/fr/design/images/control/edit.png"; public static final String TD_REMOVE_ICON_PATH = "/com/fr/base/images/cell/control/remove.png"; public static final String TD_CONNECTION_ICON_PATH = "/com/fr/design/images/m_web/connection.png"; public static final String SP_SHOW_ICON_PATH = "/com/fr/design/images/data/store_procedure.png"; public static final String STD_SHOW_ICON_PATH = "/com/fr/design/images/data/dock/serverdatabase.png"; public static final String XMLA_ICON_PATH = "/com/fr/design/images/data/cube.png"; public static final String FORBID_ICON_PATH ="/com/fr/web/images/form/forbid.png"; } \ No newline at end of file +package com.fr.design.icon; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 6.5.6 * Date: 12-12-18 * Time: 上午9:42 * 用于保存所有图标路径的类 */ public class IconPathConstants { private IconPathConstants() { } public static final String ADD_POPMENU_ICON_PATH = "/com/fr/design/images/control/addPopup.png"; public static final String DS_ICON_PATH = "/com/fr/design/images/data/datasource.png"; public static final String CLASS_TD_ICON_PATH = "/com/fr/design/images/data/source/classTableData.png"; public static final String EMB_TD_ICON_PATH = "/com/fr/design/images/data/dataTable.png"; public static final String DS_RELATION_TD_ICON_PATH = "/com/fr/design/images/data/multi.png"; public static final String FILE_TD_ICON_PATH = "/com/fr/design/images/data/file.png"; public static final String DS_TREE_TD_ICON_PATH = "/com/fr/design/images/data/tree.png"; public static final String DS_QUERY_ICON_PATH = "/com/fr/design/images/data/database.png"; public static final String PREVIEW_ICON_PATH = "/com/fr/design/images/m_file/preview.png"; public static final String TD_EDIT_ICON_PATH = "/com/fr/design/images/control/edit.png"; public static final String TD_EL_SHARE_HELP_ICON_PATH = "/com/fr/design/images/control/help_open.png"; public static final String TD_EL_SHARE_CLOSE_ICON_PATH = "/com/fr/design/images/control/help_close.png"; public static final String TD_REMOVE_ICON_PATH = "/com/fr/base/images/cell/control/remove.png"; public static final String TD_CONNECTION_ICON_PATH = "/com/fr/design/images/m_web/connection.png"; public static final String SP_SHOW_ICON_PATH = "/com/fr/design/images/data/store_procedure.png"; public static final String STD_SHOW_ICON_PATH = "/com/fr/design/images/data/dock/serverdatabase.png"; public static final String XMLA_ICON_PATH = "/com/fr/design/images/data/cube.png"; public static final String FORBID_ICON_PATH ="/com/fr/web/images/form/forbid.png"; } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/images/control/help_close.png b/designer_base/src/com/fr/design/images/control/help_close.png new file mode 100644 index 0000000000000000000000000000000000000000..036865c18968c1647044a5b5f1dbb75a6d590b9d GIT binary patch literal 801 zcmV++1K#|JP)Px%+et)0R7efIRy}W1F%-RaQ#C;WwF&LesldjDK!TMCrXUpf3msV)2tuMS15!G4 zVdO7BKx8T`U5f-_W8-7$&^Ad06)zR-Gxzw#iQkL;g3^e)_~Ra*CX3}KQ$(Pz=(nymFNw5 z0?+euwh`Q2I7oQ<4X4sAi|YJ?gdhcDX(h-XM5* zt3(S-_ThVv-hLjvMt80h>H38{b$>^+@vcJ=Up|M0`SRkDj4$k{5C)tpNG&9Upc@wp zRJ~eE@Su%;_%R{iJyw7Yd!vd6KnFZqtjO54m7ySn&^87f@P3ObIiw&zfb`bocuIyC z$?CR;ubG6OEGF$kG6LTLvLaM_tgwj^FyCL4yDVdnB@80pNw zPY-Q>8wwc+1kn#aG6?V<3!%fSBdRrb8yuC7TtMtIGDFsd#fl*0NmU4r^+t86rt=G) za%5+h7znb2Fa~~~5O~24oED4Izg*=c$JA3a=EE1k{7JMJ==%>`eTq_`s+)%s4Si;) z!0-oo{CfW>SJzJUV#hmFx4#77Pl%xd_FsNiu~fXJc*+q)+~>R&25Xi0H?Cuxy>*t~ fy)qjx%^&e!Dn3F>!HmBV00000NkvXXu0mjfGk9d# literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/control/help_open.png b/designer_base/src/com/fr/design/images/control/help_open.png new file mode 100644 index 0000000000000000000000000000000000000000..b988d678fe13913c1e76e8dd2ac22a08cb41362f GIT binary patch literal 895 zcmV-_1AzRAP)Px&IY~r8R7efIR!wMAK@gtZyfjU$ttLdYf}lNEV{amQw1`+Q1*u*XuO2;0MX>2X zXs_P%`IhOUO^poXXd8;_c zhOeE`uy${&q`(D3wHBiX22rro+1_ZQ_}GSi6u$$>g@}ONA+^D zmZ6jqgO3)5%EEfE6(HDx9`s?S);7i-&ujsu()B`Ho(qv48AuMh`c*K54m%?D&RyL0 zR|pkS@}e73+c1*BESJ7D8@gy%P^?AJ@;aX^r=*T>hLMobg`_bcXlEUfHW?&u>-3Qr z_3V#Oa%YHy5L9NQ4>Kk`o6J(y^hbpQ75jq%_b8uPm}ktu^oAFgPqx#cWQ(s8GnpdY zeYK+VGS`|&?vc)g4F-bsLP=4+=%bFKFd~BkiK972CXcCKaRO2c3K} z`8@BxUZtYmF_e~sMD^ZmE|`Nv=)(eQVLdZR~ScfEa%*LGv8Ea#J*#Y zot!lrB*lhB;20dsX&xNgVCzR&)1oN`0e$@CeDxa6DsVXUg?;dCFqD6^a@N!y z!zWG*)J5*-Tq`YlF}+48Wr4)@VAp+d=)b(K94I2Z8PLjkE2GTAwP=R$ZXAW4`{t-u^7X7%=wH5w{{XmS VQVTmPss;c6002ovPDHLkV1i?!vbF#K literal 0 HcmV?d00001 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 552402398a..d030104a23 100644 --- a/designer_form/src/com/fr/design/designer/creator/XCreator.java +++ b/designer_form/src/com/fr/design/designer/creator/XCreator.java @@ -12,6 +12,10 @@ import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.*; import com.fr.design.utils.gui.LayoutUtils; +import com.fr.form.share.ShareLoader; +import com.fr.form.ui.AbstractFormSharableEditor; +import com.fr.form.ui.ElCaseBindInfo; +import com.fr.form.ui.FormSharableEditor; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WTitleLayout; import com.fr.stable.StableUtils; @@ -590,4 +594,21 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo * @param msg 帮助信息 */ public void setSharedMsg(String msg){} + + /** + * 根据widget设置Xcreator共享信息 + * @param widget + */ + public void setShareMsgByWidget(Widget widget){ + if (widget != null && (widget instanceof FormSharableEditor)) { + String shareId = ((AbstractFormSharableEditor) widget).getShareId(); + ElCaseBindInfo info = ShareLoader.getLoader().getElCaseBindInfoById(shareId); + if (info != null) { + + setSharedMsg(info.getGuideInfo()); + + } + } + + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java b/designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java index e0fc683552..36158f821b 100644 --- a/designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java @@ -157,6 +157,7 @@ public class XCreatorUtils { FRContext.getLogger().error("Error to create xcreator!"); creator = new NullCreator(widget, d); } + creator.setShareMsgByWidget(widget);//设置共享信息 return creator; } diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 252ec35c78..0e0d35637b 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -35,7 +35,7 @@ import java.beans.PropertyDescriptor; public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider{ private UILabel imageLable; - private JPanel coverPanel; + private CoverReportPane coverPanel; private FormDesigner designer; //缩略图 private BufferedImage thumbnailImage; @@ -181,11 +181,10 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme * @param display 是否 */ public void displayCoverPane(boolean display){ - coverPanel.setVisible(display); - coverPanel.setPreferredSize(editor.getPreferredSize()); - coverPanel.setBounds(editor.getBounds()); - editor.repaint(); - } + coverPanel.setVisible(display); + coverPanel.setBounds(1, 1, (int) editor.getBounds().getWidth(), (int) editor.getBounds().getHeight()); + editor.repaint(); + } public JComponent getCoverPane(){ return coverPanel; @@ -263,7 +262,11 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme */ public void respondClick(EditingMouseListener editingMouseListener,MouseEvent e){ super.respondClick(editingMouseListener, e); - switchTab(e,editingMouseListener); + if (this.isHelpBtnOnFocus()) { + coverPanel.setMsgDisplay(e); + }else { + switchTab(e,editingMouseListener); + } } @@ -280,4 +283,9 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { return new WidgetPropertyUIProvider[]{ new ElementCasePropertyUI(this)}; } + + @Override + public void setSharedMsg(String msg) { + coverPanel.setHelpMsg(msg); + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/CoverReportPane.java b/designer_form/src/com/fr/design/mainframe/CoverReportPane.java index 183cf24eea..42dc62040c 100644 --- a/designer_form/src/com/fr/design/mainframe/CoverReportPane.java +++ b/designer_form/src/com/fr/design/mainframe/CoverReportPane.java @@ -1,12 +1,19 @@ package com.fr.design.mainframe; -import com.fr.base.BaseUtils; +import com.fr.design.constants.UIConstants; +import com.fr.design.designer.beans.events.DesignerEditListener; +import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.icon.IconPathConstants; +import com.fr.form.share.ShareConstants; +import com.fr.general.FRScreen; +import com.fr.general.IOUtils; import com.fr.general.Inter; +import com.fr.stable.StringUtils; import javax.swing.*; import java.awt.*; +import java.awt.event.MouseEvent; /** * Created with IntelliJ IDEA. @@ -14,59 +21,122 @@ import java.awt.*; * Date: 14-7-24 * Time: 上午9:09 */ -public class CoverReportPane extends JPanel{ +public class CoverReportPane extends JPanel { private UIButton editButton; + private Icon controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_CLOSE_ICON_PATH); + private JComponent controlButton = new JComponent() { + protected void paintComponent(Graphics g) { + g.setColor(UIConstants.NORMAL_BACKGROUND); + g.fillArc(0, 0, ShareConstants.SHARE_EL_CONTROL_BUTTON_HW, ShareConstants.SHARE_EL_CONTROL_BUTTON_HW, + 0, 360); + controlMode.paintIcon(this, g, 0, 0); + } + }; + + + private String helpMsg;//帮助信息(后续帮助信息可能会变成标配,就直接放这边了) + + private ElementCaseHelpDialog helpDialog = null; private AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 60 / 100.0F); - public CoverReportPane(){ - setLayout(coverLayout); + public CoverReportPane() { + this(StringUtils.EMPTY); + } + + public CoverReportPane(String helpMsg) { + this.helpMsg = helpMsg; + setLayout(getCoverLayout()); setBackground(null); setOpaque(false); - editButton = new UIButton(Inter.getLocText("Edit"), BaseUtils.readIcon(IconPathConstants.TD_EDIT_ICON_PATH)){ + editButton = new UIButton(Inter.getLocText("Edit"), IOUtils.readIcon(IconPathConstants.TD_EDIT_ICON_PATH)) { @Override public Dimension getPreferredSize() { - return new Dimension(60,24); + return new Dimension(60, 24); } }; editButton.setBorderPainted(false); editButton.setExtraPainted(false); - editButton.setBackground(new Color(176,196,222)); + editButton.setBackground(new Color(176, 196, 222)); add(editButton); + add(controlButton); + WidgetPropertyPane.getInstance().getEditingFormDesigner().addDesignerEditListener(new DesignerEditListener() { + @Override + public void fireCreatorModified(DesignerEvent evt) { + if (evt.getCreatorEventID() == (DesignerEvent.CREATOR_DELETED) + || evt.getCreatorEventID() == (DesignerEvent.CREATOR_RESIZED)) { + destroyHelpDialog(); + } + } + }); + } + public String getHelpMsg() { + return helpMsg; } - private LayoutManager coverLayout = new LayoutManager() { + public void setHelpMsg(String helpMsg) { + this.helpMsg = helpMsg; + } - @Override - public void removeLayoutComponent(Component comp) { + public void setMsgDisplay(MouseEvent e) { + if (helpDialog == null) { + controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_CLOSE_ICON_PATH); + controlButton.repaint(); + helpDialog = new ElementCaseHelpDialog(DesignerContext.getDesignerFrame(), helpMsg); + double screenValue = FRScreen.getByDimension(Toolkit.getDefaultToolkit().getScreenSize()).getValue(); + int offsetX = 0; + if (screenValue < FormArea.DEFAULT_SLIDER) { + offsetX = (int) ((1 - screenValue / FormArea.DEFAULT_SLIDER) + * WidgetPropertyPane.getInstance().getEditingFormDesigner().getRootComponent().getWidth() / 2); + } + int rX = WestRegionContainerPane.getInstance().getWidth() + e.getX() + offsetX - 227;//弹出框宽度190加上图标的宽度27加上10的偏移 + int rY = 165 + e.getY();//165是设计器最上面几个面板的高度 + helpDialog.setLocationRelativeTo(DesignerContext.getDesignerFrame(), rX, rY); + helpDialog.showWindow(); + } else { + controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_HELP_ICON_PATH); + controlButton.repaint(); + helpDialog.dispose(); + helpDialog = null; } + } - @Override - public Dimension preferredLayoutSize(Container parent) { - return parent.getPreferredSize(); - } + protected LayoutManager getCoverLayout() { + return new LayoutManager() { - @Override - public Dimension minimumLayoutSize(Container parent) { - return null; - } + @Override + public void removeLayoutComponent(Component comp) { + } - @Override - public void layoutContainer(Container parent) { - int width = parent.getParent().getWidth(); - int height = parent.getParent().getHeight(); - int preferWidth = editButton.getPreferredSize().width; - int preferHeight = editButton.getPreferredSize().height; - editButton.setBounds((width - preferWidth)/2, (height - preferHeight)/2, preferWidth, preferHeight); - } + @Override + public Dimension preferredLayoutSize(Container parent) { + return parent.getPreferredSize(); + } + + @Override + public Dimension minimumLayoutSize(Container parent) { + return null; + } + + @Override + public void layoutContainer(Container parent) { + int width = parent.getParent().getWidth(); + int height = parent.getParent().getHeight(); + int preferWidth = editButton.getPreferredSize().width; + int preferHeight = editButton.getPreferredSize().height; + editButton.setBounds((width - preferWidth) / 2, (height - preferHeight) / 2, preferWidth, preferHeight); + controlButton.setBounds((width - 28), 0, 27, 27); + } + + @Override + public void addLayoutComponent(String name, Component comp) { + } + }; + } - @Override - public void addLayoutComponent(String name, Component comp) { - } - }; public void paint(Graphics g) { Graphics2D g2d = (Graphics2D) g; @@ -77,4 +147,14 @@ public class CoverReportPane extends JPanel{ g2d.setComposite(oldComposite); super.paint(g); } + + public void destroyHelpDialog() { + if (helpDialog != null) { + controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_HELP_ICON_PATH); + controlButton.repaint(); + helpDialog.dispose(); + helpDialog = null; + } + } + } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/EditingMouseListener.java b/designer_form/src/com/fr/design/mainframe/EditingMouseListener.java index fc25bd1245..0aa77281d1 100644 --- a/designer_form/src/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer_form/src/com/fr/design/mainframe/EditingMouseListener.java @@ -1,14 +1,5 @@ package com.fr.design.mainframe; -import java.awt.Color; -import java.awt.Container; -import java.awt.Cursor; -import java.awt.Rectangle; -import java.awt.event.MouseEvent; - -import javax.swing.*; -import javax.swing.event.MouseInputAdapter; - import com.fr.base.BaseUtils; import com.fr.design.beans.location.MoveUtils; import com.fr.design.designer.beans.AdapterBus; @@ -29,6 +20,11 @@ import com.fr.design.utils.gui.LayoutUtils; import com.fr.general.Inter; import com.fr.stable.Constants; +import javax.swing.*; +import javax.swing.event.MouseInputAdapter; +import java.awt.*; +import java.awt.event.MouseEvent; + /** * 普通模式下的鼠标点击、位置处理器 */ @@ -291,18 +287,28 @@ public class EditingMouseListener extends MouseInputAdapter { if (component.isReport()) { xElementCase = (XElementCase)component; - UIButton button = (UIButton)xElementCase.getCoverPane().getComponent(0); + UIButton button = (UIButton)xElementCase.getCoverPane().getComponent(0); + JComponent button1= (JComponent) xElementCase.getCoverPane().getComponent(1); if(designer.getCursor().getType() ==Cursor.HAND_CURSOR) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } // component.getParent() 是报表块所在的XWTitleLayout int minX = button.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue(); + int minX1 = button1.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue(); int minY = button.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue(); - if(e.getX() + GAP > minX && e.getX() - GAP < minX + button.getWidth()){ - if( e.getY() + GAP > minY && e.getY() - GAP < minY + button.getHeight()){ - designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - } - } - xElementCase.displayCoverPane(true); + int minY1 = button1.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue(); + if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) { + if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) { + designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + } + } + xElementCase.setHelpBtnOnFocus(false); + if (e.getX() + GAP - xElementCase.getInsets().left > minX1 && e.getX() - GAP - xElementCase.getInsets().left < minX1 + button1.getWidth()) { + if (e.getY() + GAP - xElementCase.getInsets().top > minY1 && e.getY() - GAP - xElementCase.getInsets().top < minY1 + button1.getHeight()) { + designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + xElementCase.setHelpBtnOnFocus(true); + } + } + xElementCase.displayCoverPane(true); xElementCase.setDirections(Direction.TOP_BOTTOM_LEFT_RIGHT); designer.repaint(); diff --git a/designer_form/src/com/fr/design/mainframe/ElementCaseHelpDialog.java b/designer_form/src/com/fr/design/mainframe/ElementCaseHelpDialog.java new file mode 100644 index 0000000000..60b699107c --- /dev/null +++ b/designer_form/src/com/fr/design/mainframe/ElementCaseHelpDialog.java @@ -0,0 +1,73 @@ +package com.fr.design.mainframe; + +import com.fr.design.dialog.UIDialog; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.itextarea.UITextArea; + +import javax.swing.*; +import java.awt.*; + +/** + * @author zack + * @date 2016-10-14 + * @since 8.0 + */ +public class ElementCaseHelpDialog extends UIDialog { + + private static final int OUTER_WIDTH = 190; + private static final int OUTER_HEIGHT = 120; + + + private String helpMsg; + private UIScrollPane helpArea; + + + public ElementCaseHelpDialog(Frame parent, String helpMsg) { + super(parent); + this.helpMsg = helpMsg; + setUndecorated(true); + initHelpArea(); + JPanel panel = (JPanel) getContentPane(); + initComponents(panel); + setSize(new Dimension(OUTER_WIDTH, OUTER_HEIGHT)); + } + + private void initHelpArea() { + UITextArea textArea = new UITextArea(helpMsg); + textArea.setEditable(false); + textArea.setBorder(null); + helpArea = new UIScrollPane(textArea); + helpArea.setBounds(0, 0, 190, 120); + helpArea.setBorder(null); + } + + private void initComponents(JPanel contentPane) { + contentPane.setLayout(new BorderLayout()); + add(helpArea, BorderLayout.CENTER); + } + + /** + * 打开帮助框 + */ + public void showWindow() { + setVisible(true); + this.setResizable(false); + } + + /** + * 略 + */ + @Override + public void checkValid() throws Exception { + + } + + public void setLocationRelativeTo(JFrame c, int x, int y) { + int dx = 0, dy = 0; + Point compLocation = c.getLocationOnScreen();//获取设计器Jframe坐标作为相对位置原点 + setLocation(dx + x, dy + y); + dx = compLocation.x; + dy = compLocation.y + c.getRootPane().getY();//加上底层容器的y坐标(其实就是设计器最上方图标栏的高度) + setLocation(dx + x, dy + y); + } +} \ 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 1172a4b645..91c39f988f 100644 --- a/designer_form/src/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer_form/src/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -1,20 +1,8 @@ package com.fr.design.mainframe; -import java.awt.Color; -import java.awt.Component; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.Toolkit; -import java.awt.dnd.DropTarget; -import java.awt.dnd.DropTargetDragEvent; -import java.awt.dnd.DropTargetDropEvent; -import java.awt.dnd.DropTargetEvent; -import java.util.ArrayList; - -import javax.swing.BorderFactory; -import javax.swing.JWindow; - import com.fr.base.BaseUtils; +import com.fr.design.DesignModelAdapter; +import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.HoverPainter; import com.fr.design.designer.beans.Painter; @@ -25,177 +13,192 @@ import com.fr.design.form.util.XCreatorConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.icon.IconPathConstants; import com.fr.design.utils.ComponentUtils; +import com.fr.form.share.ShareLoader; +import com.fr.form.ui.SharableElementCaseEditor; import com.fr.form.ui.Widget; import com.fr.general.Inter; import com.fr.stable.Constants; +import javax.swing.*; +import java.awt.*; +import java.awt.dnd.DropTarget; +import java.awt.dnd.DropTargetDragEvent; +import java.awt.dnd.DropTargetDropEvent; +import java.awt.dnd.DropTargetEvent; + /** * 添加模式下鼠标事件处理器。 */ public class FormCreatorDropTarget extends DropTarget { - private FormDesigner designer; - /** - * 当前鼠标的设计组件 - */ - private Component current; - /** - * 当前添加模式对应的model - */ - private AddingModel addingModel; + private FormDesigner designer; + /** + * 当前鼠标的设计组件 + */ + private Component current; + /** + * 当前添加模式对应的model + */ + private AddingModel addingModel; private final static int GAP = 30; private JWindow promptWindow = new JWindow(); private UIButton promptButton = new UIButton("", BaseUtils.readIcon(IconPathConstants.FORBID_ICON_PATH)); - public FormCreatorDropTarget(FormDesigner designer) { - this.designer = designer; - this.addingModel = designer.getAddingModel(); + public FormCreatorDropTarget(FormDesigner designer) { + this.designer = designer; + this.addingModel = designer.getAddingModel(); this.promptWindow.add(promptButton); - } + } + + private void adding(int x, int y) { + // 当前鼠标所在的组件 + XCreator hoveredComponent = designer.getComponentAt(x, y); - private void adding(int x, int y) { - // 当前鼠标所在的组件 - XCreator hoveredComponent = designer.getComponentAt(x, y); + // 获取该组件所在的焦点容器 + XLayoutContainer container = XCreatorUtils.getHotspotContainer(hoveredComponent); - // 获取该组件所在的焦点容器 - XLayoutContainer container = XCreatorUtils.getHotspotContainer(hoveredComponent); - - //cardTagLayout里用到 - container.stopAddingState(designer); + //cardTagLayout里用到 + container.stopAddingState(designer); - boolean success = false; + boolean success = false; - if (container != null) { - // 如果是容器,则调用其acceptComponent接受组件 - AddingModel model = designer.getAddingModel(); + if (container != null) { + // 如果是容器,则调用其acceptComponent接受组件 + AddingModel model = designer.getAddingModel(); - boolean chartEnter2Para =!addingModel.getXCreator().canEnterIntoParaPane() && container.acceptType(XWParameterLayout.class); + boolean chartEnter2Para = !addingModel.getXCreator().canEnterIntoParaPane() && container.acceptType(XWParameterLayout.class); boolean formSubmit2Adapt = !addingModel.getXCreator().canEnterIntoAdaptPane() && container.acceptType(XWFitLayout.class); - if (model != null && !chartEnter2Para && !formSubmit2Adapt) { - success = model.add2Container(designer, container, x, y); - } + if (model != null && !chartEnter2Para && !formSubmit2Adapt) { + success = model.add2Container(designer, container, x, y); + } cancelPromptWidgetForbidEnter(); - } + } - if (success) { - // 如果添加成功,则触发相应事件 + if (success) { + // 如果添加成功,则触发相应事件 XCreator xCreator = container.acceptType(XWParameterLayout.class) ? designer.getParaComponent() : designer.getRootComponent(); - //SetSelection时要确保选中的是最顶层的布局 - //tab布局添加的时候是初始化了XWCardLayout,实际上最顶层的布局是XWCardMainBorderLayout - XCreator addingXCreator = addingModel.getXCreator(); - Widget widget = (addingXCreator.getTopLayout() != null) ? (addingXCreator.getTopLayout().toData()) : addingXCreator.toData(); - designer.getSelectionModel().setSelectedCreators( - FormSelectionUtils.rebuildSelection(xCreator, new Widget[]{widget})); - designer.getEditListenerTable().fireCreatorModified(addingModel.getXCreator(), DesignerEvent.CREATOR_ADDED); - } else { - Toolkit.getDefaultToolkit().beep(); - } - - // 取消提示 - designer.setPainter(null); - // 切换添加状态到普通状态 - designer.stopAddingState(); - } - - private void entering(int x, int y) { - // 将要添加的组件图标移动到鼠标下的位置 - addingModel.moveTo(x, y); - designer.repaint(); - } - - private void exiting() { + //SetSelection时要确保选中的是最顶层的布局 + //tab布局添加的时候是初始化了XWCardLayout,实际上最顶层的布局是XWCardMainBorderLayout + XCreator addingXCreator = addingModel.getXCreator(); + if (addingXCreator.isShared()) { + SharableElementCaseEditor sharableEditor = ShareLoader.getLoader().getSharedElCaseEditorById(addingXCreator.getShareId()); + if (sharableEditor != null) { + TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).addTableData(sharableEditor.getTableDataSource()); + } + } + Widget widget = (addingXCreator.getTopLayout() != null) ? (addingXCreator.getTopLayout().toData()) : addingXCreator.toData(); + designer.getSelectionModel().setSelectedCreators( + FormSelectionUtils.rebuildSelection(xCreator, new Widget[]{widget})); + designer.getEditListenerTable().fireCreatorModified(addingModel.getXCreator(), DesignerEvent.CREATOR_ADDED); + } else { + Toolkit.getDefaultToolkit().beep(); + } + + // 取消提示 + designer.setPainter(null); + // 切换添加状态到普通状态 + designer.stopAddingState(); + } + + private void entering(int x, int y) { + // 将要添加的组件图标移动到鼠标下的位置 + addingModel.moveTo(x, y); + designer.repaint(); + } + + private void exiting() { cancelPromptWidgetForbidEnter(); - // 隐藏组件图标 - addingModel.reset(); - designer.setPainter(null); - designer.repaint(); - } - - private void hovering(int x, int y) { - // 当前位置移植鼠标e所在的位置 - addingModel.moveTo(x, y); - // 获取e所在的焦点组件 - XCreator hotspot = designer.getComponentAt(x, y); - // 获取焦点组件所在的焦点容器 - XLayoutContainer container = XCreatorUtils.getHotspotContainer(hotspot); + // 隐藏组件图标 + addingModel.reset(); + designer.setPainter(null); + designer.repaint(); + } + + private void hovering(int x, int y) { + // 当前位置移植鼠标e所在的位置 + addingModel.moveTo(x, y); + // 获取e所在的焦点组件 + XCreator hotspot = designer.getComponentAt(x, y); + // 获取焦点组件所在的焦点容器 + XLayoutContainer container = XCreatorUtils.getHotspotContainer(hotspot); //提示组件是否可以拖入 promptUser(x, y, container); - if (container != null) { - HoverPainter painter = null; - - if (container != current || designer.getPainter() == null) { - // 如果焦点容器不是当前容器 - if (current != null) { - // 取消前一个焦点容器的提示渲染器 - designer.setPainter(null); - } - //获取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); - - // 将当前容器更新为新的容器 - current = container; - } else { - // 获取当前设计界面的提示渲染器 - Painter p = designer.getPainter(); - if (p instanceof HoverPainter) { - painter = (HoverPainter) p; - } - } - - if (painter != null) { - // 为提示渲染器设置焦点位置、区域等渲染参数 - Rectangle rect = ComponentUtils.getRelativeBounds(container); - rect.x -= designer.getArea().getHorizontalValue(); - rect.y -= designer.getArea().getVerticalValue(); - painter.setRenderingBounds(rect); - painter.setHotspot(new Point(x, y)); - painter.setCreator(addingModel.getXCreator()); - } - } else { - // 如果鼠标不在任何组件上,则取消提示器 - designer.setPainter(null); - current = null; - } - designer.repaint(); - } - - private void promptUser(int x, int y, XLayoutContainer container){ - if (!addingModel.getXCreator().canEnterIntoParaPane() && container.acceptType(XWParameterLayout.class)){ + if (container != null) { + HoverPainter painter = null; + + if (container != current || designer.getPainter() == null) { + // 如果焦点容器不是当前容器 + if (current != null) { + // 取消前一个焦点容器的提示渲染器 + designer.setPainter(null); + } + //获取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); + + // 将当前容器更新为新的容器 + current = container; + } else { + // 获取当前设计界面的提示渲染器 + Painter p = designer.getPainter(); + if (p instanceof HoverPainter) { + painter = (HoverPainter) p; + } + } + + if (painter != null) { + // 为提示渲染器设置焦点位置、区域等渲染参数 + Rectangle rect = ComponentUtils.getRelativeBounds(container); + rect.x -= designer.getArea().getHorizontalValue(); + rect.y -= designer.getArea().getVerticalValue(); + painter.setRenderingBounds(rect); + painter.setHotspot(new Point(x, y)); + painter.setCreator(addingModel.getXCreator()); + } + } else { + // 如果鼠标不在任何组件上,则取消提示器 + designer.setPainter(null); + current = null; + } + designer.repaint(); + } + + private void promptUser(int x, int y, XLayoutContainer container) { + if (!addingModel.getXCreator().canEnterIntoParaPane() && container.acceptType(XWParameterLayout.class)) { promptButton.setText(Inter.getLocText("FR-Designer_Forbid_Drag_into_Para_Pane")); - promptWidgetForbidEnter(x ,y ,container); - } else if (!addingModel.getXCreator().canEnterIntoAdaptPane() && container.acceptType(XWFitLayout.class)){ + promptWidgetForbidEnter(x, y, container); + } else if (!addingModel.getXCreator().canEnterIntoAdaptPane() && container.acceptType(XWFitLayout.class)) { promptButton.setText(Inter.getLocText("FR-Designer_Forbid_Drag_into_Adapt_Pane")); - promptWidgetForbidEnter(x ,y , container); + promptWidgetForbidEnter(x, y, container); } else { cancelPromptWidgetForbidEnter(); } } - private void promptWidgetForbidEnter(int x,int y, XLayoutContainer container){ + private void promptWidgetForbidEnter(int x, int y, XLayoutContainer container) { container.setBorder(BorderFactory.createLineBorder(Color.RED, Constants.LINE_MEDIUM)); - int screen_X = (int)designer.getArea().getLocationOnScreen().getX(); - int screen_Y = (int)designer.getArea().getLocationOnScreen().getY(); + int screen_X = (int) designer.getArea().getLocationOnScreen().getX(); + int screen_Y = (int) designer.getArea().getLocationOnScreen().getY(); this.promptWindow.setSize(promptWindow.getPreferredSize()); this.promptWindow.setPreferredSize(promptWindow.getPreferredSize()); - promptWindow.setLocation( screen_X + x + GAP ,screen_Y + y + GAP); + promptWindow.setLocation(screen_X + x + GAP, screen_Y + y + GAP); promptWindow.setVisible(true); } - private void cancelPromptWidgetForbidEnter(){ - if (designer.getParaComponent() != null){ + private void cancelPromptWidgetForbidEnter() { + if (designer.getParaComponent() != null) { designer.getParaComponent().setBorder(BorderFactory.createLineBorder(XCreatorConstants.LAYOUT_SEP_COLOR, Constants.LINE_THIN)); } designer.getRootComponent().setBorder(BorderFactory.createLineBorder(XCreatorConstants.LAYOUT_SEP_COLOR, Constants.LINE_THIN)); @@ -204,45 +207,50 @@ public class FormCreatorDropTarget extends DropTarget { /** * 拖拽进入 - * @param dtde 事件 + * + * @param dtde 事件 */ - public void dragEnter(DropTargetDragEvent dtde) { - Point loc = dtde.getLocation(); - this.entering(loc.x, loc.y); - } + public void dragEnter(DropTargetDragEvent dtde) { + Point loc = dtde.getLocation(); + this.entering(loc.x, loc.y); + } /** * 拖拽移动经过 - * @param dtde 事件 + * + * @param dtde 事件 */ - public void dragOver(DropTargetDragEvent dtde) { - Point loc = dtde.getLocation(); - hovering(loc.x, loc.y); - } + public void dragOver(DropTargetDragEvent dtde) { + Point loc = dtde.getLocation(); + hovering(loc.x, loc.y); + } /** * 拖拽事件 - * @param dtde 事件 + * + * @param dtde 事件 */ - public void dropActionChanged(DropTargetDragEvent dtde) { - } + public void dropActionChanged(DropTargetDragEvent dtde) { + } /** * 拖拽离开 - * @param dte 事件 + * + * @param dte 事件 */ - public void dragExit(DropTargetEvent dte) { - this.exiting(); - } + public void dragExit(DropTargetEvent dte) { + this.exiting(); + } /** * 拖拽释放 - * @param dtde 事件 + * + * @param dtde 事件 */ - public void drop(DropTargetDropEvent dtde) { - Point loc = dtde.getLocation(); - this.adding(loc.x, loc.y); + public void drop(DropTargetDropEvent dtde) { + Point loc = dtde.getLocation(); + this.adding(loc.x, loc.y); //针对在表单中拖入一个控件直接ctrl+s无反应 designer.requestFocus(); - } + } } \ No newline at end of file From 76363600114a06d5f7f9646bfec66d4ff66dd7c1 Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 20 Oct 2016 09:37:32 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E6=BC=8F=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/ShareWidgetButton.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java b/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java index 955e54822a..531c52fee6 100644 --- a/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java +++ b/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java @@ -6,7 +6,9 @@ import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.form.share.ShareLoader; +import com.fr.form.ui.AbstractFormSharableEditor; import com.fr.form.ui.ElCaseBindInfo; +import com.fr.form.ui.FormSharableEditor; import com.fr.form.ui.Widget; import com.fr.general.ComparatorUtils; import com.fr.stable.StringUtils; @@ -118,6 +120,7 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot Object source = e.getSource(); Widget creatorSource = null; String shareId = StringUtils.EMPTY; + String helpMsg = StringUtils.EMPTY; if (source instanceof ShareWidgetButton) { ShareWidgetButton no = (ShareWidgetButton) e.getSource(); if (no == null) { @@ -125,10 +128,15 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot } shareId = no.getBindInfo().getId(); creatorSource = ShareLoader.getLoader().getElCaseEditorById(shareId); + ElCaseBindInfo info = ShareLoader.getLoader().getElCaseBindInfoById(shareId); + if (info != null) { + helpMsg = info.getGuideInfo(); + } } if (creatorSource != null) { XCreator xCreator = XCreatorUtils.createXCreator(creatorSource); xCreator.setShareId(shareId); + xCreator.setSharedMsg(helpMsg); WidgetToolBarPane.getTarget().startDraggingBean(xCreator); lastPressEvent = null; this.setBorder(null); @@ -152,6 +160,9 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot ShareWidgetButton shareWidgetButton = (ShareWidgetButton) dge.getComponent(); if (shareWidgetButton != null) { Widget widget = ShareLoader.getLoader().getElCaseEditorById(shareWidgetButton.getBindInfo().getId()); + if (widget instanceof FormSharableEditor) { + ((AbstractFormSharableEditor) widget).setShareId(shareWidgetButton.getBindInfo().getId()); + } DragAndDropTransferable dragAndDropTransferable = new DragAndDropTransferable(widget); dge.startDrag(DragSource.DefaultCopyDrop, dragAndDropTransferable, this); } From f1b68a1798bdff583d3f387fc18e0667b591d6b2 Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 20 Oct 2016 10:04:27 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/BasicTableDataTreePane.java | 8 +++++++- .../data/datapane/TableDataTreePane.java | 19 ++++++++++++++----- .../mainframe/FormCreatorDropTarget.java | 9 ++++++--- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/designer_base/src/com/fr/design/data/BasicTableDataTreePane.java b/designer_base/src/com/fr/design/data/BasicTableDataTreePane.java index a6fd601a82..45cd0cea70 100644 --- a/designer_base/src/com/fr/design/data/BasicTableDataTreePane.java +++ b/designer_base/src/com/fr/design/data/BasicTableDataTreePane.java @@ -424,7 +424,13 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp this.setSmallIcon(BaseUtils.readIcon(IconPathConstants.TD_CONNECTION_ICON_PATH)); } } - public void addTableData(TableDataSource tableDataSource){ + + /** + * 合并数据集 + * @param srcName 数据集来源(比如报表块,就是报表块的名称) + * @param tableDataSource 数据集 + */ + public void addTableData(String srcName, TableDataSource tableDataSource) { } } diff --git a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java index 911b0d9c94..618c2edec2 100644 --- a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java @@ -270,18 +270,27 @@ public class TableDataTreePane extends BasicTableDataTreePane { return dataTree; } - public void addTableData(TableDataSource tableDataSource) { + /** + * 合并数据集 + * @param srcName 数据集来源(比如报表块,就是报表块的名称) + * @param tableDataSource 数据集 + */ + public void addTableData(String srcName, TableDataSource tableDataSource) { DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER); TableDataSource tds = tc.getBook(); Iterator tdIterator = tableDataSource.getTableDataNameIterator(); while (tdIterator.hasNext()) { String tdName = (String) tdIterator.next(); TableData td = tableDataSource.getTableData(tdName); - if (tds.getTableData(tdName) != null) { - tds.putTableData(tdName + "-fr-el", td); - } else { - tds.putTableData(tdName, td); + if (tds.getTableData(tdName) != null) {//如果有同名的就拼上来源名称 + tdName = srcName + tdName; + } + int i = 0; + while (tds.getTableData(tdName) != null) { + i++;//如果拼上名字后依然已经存在就加编号 + tdName += i; } + tds.putTableData(tdName, td); } tc.fireTargetModified(); tc.parameterChanged(); diff --git a/designer_form/src/com/fr/design/mainframe/FormCreatorDropTarget.java b/designer_form/src/com/fr/design/mainframe/FormCreatorDropTarget.java index 91c39f988f..7e7035bb73 100644 --- a/designer_form/src/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer_form/src/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -14,6 +14,7 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.icon.IconPathConstants; import com.fr.design.utils.ComponentUtils; import com.fr.form.share.ShareLoader; +import com.fr.form.ui.ElCaseBindInfo; import com.fr.form.ui.SharableElementCaseEditor; import com.fr.form.ui.Widget; import com.fr.general.Inter; @@ -83,9 +84,11 @@ public class FormCreatorDropTarget extends DropTarget { //tab布局添加的时候是初始化了XWCardLayout,实际上最顶层的布局是XWCardMainBorderLayout XCreator addingXCreator = addingModel.getXCreator(); if (addingXCreator.isShared()) { - SharableElementCaseEditor sharableEditor = ShareLoader.getLoader().getSharedElCaseEditorById(addingXCreator.getShareId()); - if (sharableEditor != null) { - TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).addTableData(sharableEditor.getTableDataSource()); + String shareId = addingXCreator.getShareId(); + SharableElementCaseEditor sharableEditor = ShareLoader.getLoader().getSharedElCaseEditorById(shareId); + ElCaseBindInfo bindInfo = ShareLoader.getLoader().getElCaseBindInfoById(shareId); + if (sharableEditor != null && bindInfo != null) { + TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).addTableData(bindInfo.getName(),sharableEditor.getTableDataSource()); } } Widget widget = (addingXCreator.getTopLayout() != null) ? (addingXCreator.getTopLayout().toData()) : addingXCreator.toData(); From 76856c4e5fe1a2681d7bd912b5c3ab2a0dd7843a Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 20 Oct 2016 15:59:53 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=B8=AE=E5=8A=A9?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=94=B9=E4=B8=80=E4=B8=8B=E6=96=B9=E6=A1=88?= =?UTF-8?q?=EF=BC=8C=E9=80=9A=E8=BF=87widget=E5=A2=9E=E5=8A=A0description?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/creator/XCreator.java | 22 +++++-------------- .../designer/creator/XCreatorUtils.java | 2 +- .../design/designer/creator/XElementCase.java | 2 +- .../src/com/fr/design/mainframe/JForm.java | 11 +++++++++- .../design/mainframe/ShareWidgetButton.java | 11 ---------- 5 files changed, 18 insertions(+), 30 deletions(-) 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 d030104a23..d47009ff95 100644 --- a/designer_form/src/com/fr/design/designer/creator/XCreator.java +++ b/designer_form/src/com/fr/design/designer/creator/XCreator.java @@ -12,10 +12,6 @@ import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.*; import com.fr.design.utils.gui.LayoutUtils; -import com.fr.form.share.ShareLoader; -import com.fr.form.ui.AbstractFormSharableEditor; -import com.fr.form.ui.ElCaseBindInfo; -import com.fr.form.ui.FormSharableEditor; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WTitleLayout; import com.fr.stable.StableUtils; @@ -590,24 +586,18 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo } /** - * 设置共享帮助信息 + * 设置描述信息 * @param msg 帮助信息 */ - public void setSharedMsg(String msg){} + public void setXDescrption(String msg){} /** - * 根据widget设置Xcreator共享信息 + * 根据widget设置Xcreator描述信息 * @param widget */ - public void setShareMsgByWidget(Widget widget){ - if (widget != null && (widget instanceof FormSharableEditor)) { - String shareId = ((AbstractFormSharableEditor) widget).getShareId(); - ElCaseBindInfo info = ShareLoader.getLoader().getElCaseBindInfoById(shareId); - if (info != null) { - - setSharedMsg(info.getGuideInfo()); - - } + public void setXDescrption(Widget widget){ + if (widget != null) { + setXDescrption(widget.getDescription()); } } diff --git a/designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java b/designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java index 36158f821b..3c58e2f192 100644 --- a/designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java @@ -157,7 +157,7 @@ public class XCreatorUtils { FRContext.getLogger().error("Error to create xcreator!"); creator = new NullCreator(widget, d); } - creator.setShareMsgByWidget(widget);//设置共享信息 + creator.setXDescrption(widget);//设置描述信息 return creator; } diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 0e0d35637b..a056779a16 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -285,7 +285,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme } @Override - public void setSharedMsg(String msg) { + public void setXDescrption(String msg) { coverPanel.setHelpMsg(msg); } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index ef18f07135..679fcf9820 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -36,6 +36,8 @@ import com.fr.file.FILE; import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseProvider; import com.fr.form.main.Form; +import com.fr.form.share.ShareLoader; +import com.fr.form.ui.ElCaseBindInfo; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WLayout; @@ -51,6 +53,7 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; +import java.util.ArrayList; import java.util.HashMap; public class JForm extends JTemplate implements BaseJForm { @@ -622,7 +625,13 @@ public class JForm extends JTemplate implements BaseJForm { } else { JPanel pane = new JPanel(); pane.setLayout(new BorderLayout()); - pane.add(FormWidgetDetailPane.getInstance(formDesign), BorderLayout.CENTER); + //pane.add(FormWidgetDetailPane.getInstance(formDesign), BorderLayout.CENTER); + ArrayList elCaseBindInfos = new ArrayList<>(); + for (ElCaseBindInfo info : + ShareLoader.getLoader().getAllBindInfos().values()) { + elCaseBindInfos.add(info); + } + pane.add(new ShareWidgetPane(elCaseBindInfos.toArray(new ElCaseBindInfo[elCaseBindInfos.size()])), BorderLayout.CENTER); EastRegionContainerPane.getInstance().replaceDownPane(pane); } } diff --git a/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java b/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java index 531c52fee6..955e54822a 100644 --- a/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java +++ b/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java @@ -6,9 +6,7 @@ import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.form.share.ShareLoader; -import com.fr.form.ui.AbstractFormSharableEditor; import com.fr.form.ui.ElCaseBindInfo; -import com.fr.form.ui.FormSharableEditor; import com.fr.form.ui.Widget; import com.fr.general.ComparatorUtils; import com.fr.stable.StringUtils; @@ -120,7 +118,6 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot Object source = e.getSource(); Widget creatorSource = null; String shareId = StringUtils.EMPTY; - String helpMsg = StringUtils.EMPTY; if (source instanceof ShareWidgetButton) { ShareWidgetButton no = (ShareWidgetButton) e.getSource(); if (no == null) { @@ -128,15 +125,10 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot } shareId = no.getBindInfo().getId(); creatorSource = ShareLoader.getLoader().getElCaseEditorById(shareId); - ElCaseBindInfo info = ShareLoader.getLoader().getElCaseBindInfoById(shareId); - if (info != null) { - helpMsg = info.getGuideInfo(); - } } if (creatorSource != null) { XCreator xCreator = XCreatorUtils.createXCreator(creatorSource); xCreator.setShareId(shareId); - xCreator.setSharedMsg(helpMsg); WidgetToolBarPane.getTarget().startDraggingBean(xCreator); lastPressEvent = null; this.setBorder(null); @@ -160,9 +152,6 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot ShareWidgetButton shareWidgetButton = (ShareWidgetButton) dge.getComponent(); if (shareWidgetButton != null) { Widget widget = ShareLoader.getLoader().getElCaseEditorById(shareWidgetButton.getBindInfo().getId()); - if (widget instanceof FormSharableEditor) { - ((AbstractFormSharableEditor) widget).setShareId(shareWidgetButton.getBindInfo().getId()); - } DragAndDropTransferable dragAndDropTransferable = new DragAndDropTransferable(widget); dge.startDrag(DragSource.DefaultCopyDrop, dragAndDropTransferable, this); } From 2346a959984da004ab9219e6e0d4897d5ed58ace Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 20 Oct 2016 16:01:33 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E8=BF=98=E5=8E=9Fjform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_form/src/com/fr/design/mainframe/JForm.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index 679fcf9820..ef18f07135 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -36,8 +36,6 @@ import com.fr.file.FILE; import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseProvider; import com.fr.form.main.Form; -import com.fr.form.share.ShareLoader; -import com.fr.form.ui.ElCaseBindInfo; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WLayout; @@ -53,7 +51,6 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; -import java.util.ArrayList; import java.util.HashMap; public class JForm extends JTemplate implements BaseJForm { @@ -625,13 +622,7 @@ public class JForm extends JTemplate implements BaseJForm { } else { JPanel pane = new JPanel(); pane.setLayout(new BorderLayout()); - //pane.add(FormWidgetDetailPane.getInstance(formDesign), BorderLayout.CENTER); - ArrayList elCaseBindInfos = new ArrayList<>(); - for (ElCaseBindInfo info : - ShareLoader.getLoader().getAllBindInfos().values()) { - elCaseBindInfos.add(info); - } - pane.add(new ShareWidgetPane(elCaseBindInfos.toArray(new ElCaseBindInfo[elCaseBindInfos.size()])), BorderLayout.CENTER); + pane.add(FormWidgetDetailPane.getInstance(formDesign), BorderLayout.CENTER); EastRegionContainerPane.getInstance().replaceDownPane(pane); } } From 3e68fea0476b8ccd6e5e12bee756477d489dd605 Mon Sep 17 00:00:00 2001 From: zhouping Date: Fri, 21 Oct 2016 10:36:25 +0800 Subject: [PATCH 06/13] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20release?= =?UTF-8?q?=E7=9A=84=E4=BF=AE=E6=94=B9=E5=90=8C=E6=AD=A5=E4=B8=80=E4=BB=BD?= =?UTF-8?q?=E5=88=B0dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/itable/AbstractPropertyTable.java | 6 +++ ...bsoluteBodyLayoutPropertiesGroupModel.java | 44 ++++++++++++++++--- .../FRFitLayoutPropertiesGroupModel.java | 26 ++++++++++- .../mainframe/FormHierarchyTreePane.java | 14 ++++-- .../src/com/fr/design/mainframe/JForm.java | 20 +++++++-- 5 files changed, 94 insertions(+), 16 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/itable/AbstractPropertyTable.java b/designer_base/src/com/fr/design/gui/itable/AbstractPropertyTable.java index f16be99639..02a6f547b8 100644 --- a/designer_base/src/com/fr/design/gui/itable/AbstractPropertyTable.java +++ b/designer_base/src/com/fr/design/gui/itable/AbstractPropertyTable.java @@ -66,6 +66,9 @@ public abstract class AbstractPropertyTable extends JTable { public TableCellRenderer getCellRenderer(int row, int column) { if (groups != null) { Point pIndex = getGroupIndex(row); + if (pIndex == null){ + return super.getCellRenderer(row, column); + } PropertyGroup group = groups.get(pIndex.x); if (pIndex.y == 0) { if (column == 0) { @@ -192,6 +195,9 @@ public abstract class AbstractPropertyTable extends JTable { @Override public Object getValueAt(int row, int column) { Point pIndex = getGroupIndex(row); + if (pIndex == null){ + return null; + } PropertyGroup group = groups.get(pIndex.x); if (pIndex.y == 0) { if (column == 0) { diff --git a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java index 1a7ab03d3f..fff14f03d0 100644 --- a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java +++ b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java @@ -1,7 +1,7 @@ package com.fr.design.designer.properties; -import com.fr.design.designer.creator.XWAbsoluteBodyLayout; -import com.fr.design.designer.creator.XWFitLayout; +import com.fr.design.designer.creator.*; +import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormSelectionUtils; import com.fr.design.mainframe.WidgetPropertyPane; @@ -93,6 +93,8 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr if (row == 0) { if (state == WBodyLayoutType.FIT.getTypeValue()) { XWFitLayout xfl = (XWFitLayout) xwAbsoluteLayout.getBackupParent(); + //备份一下组件间隔 + int compInterval = xfl.toData().getCompInterval(); Component[] components = xwAbsoluteLayout.getComponents(); Arrays.sort(components, new ComparatorComponentLocation()); @@ -102,15 +104,35 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr xfl.toData().setLayoutType(WBodyLayoutType.FIT); for (Component comp : components) { - xfl.add(comp); + XCreator xCreator = (XCreator)comp; + if (xCreator.shouldScaleCreator()){ + XLayoutContainer parentPanel = xCreator.initCreatorWrapper(xCreator.getHeight()); + xfl.add(parentPanel, xCreator.toData().getWidgetName()); + continue; + } + xfl.add(xCreator); } - moveComponents2FitLayout(xfl, components); + //这边计算的时候会先把组件间隔去掉 + moveComponents2FitLayout(xfl); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); - formDesigner.getSelectionModel().setSelectedCreators( - FormSelectionUtils.rebuildSelection(xfl, new Widget[]{xfl.toData()})); + formDesigner.getSelectionModel().setSelectedCreator(xfl); xfl.convert(); LayoutUtils.layoutContainer(xfl); xfl.adjustCreatorsWhileSlide(xfl.getContainerPercent() - 1.0); + + for (int i = 0; i < components.length; i++) { + Component comp = xfl.getComponent(i); + XCreator creator = (XCreator) comp; + creator.setBackupBound(components[i].getBounds()); + } + + //把组件间隔加上 + if (xfl.toData().getCompInterval() != compInterval) { + xfl.moveContainerMargin(); + xfl.moveCompInterval(xfl.getAcualInterval()); + xfl.toData().setCompInterval(compInterval); + xfl.addCompInterval(xfl.getAcualInterval()); + } return true; } } @@ -147,8 +169,9 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr } //把绝对布局中的元素按规则移动到自适应布局中 - private void moveComponents2FitLayout(XWFitLayout xwFitLayout, Component[] components) { + private void moveComponents2FitLayout(XWFitLayout xwFitLayout) { int eachRowCount = 4; + Component[] components = xwFitLayout.getComponents(); if (components.length <= 1){ return; } @@ -156,6 +179,7 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr int layoutHeight = xwFitLayout.getHeight() - xwFitLayout.toData().getMargin().getTop() - xwFitLayout.toData().getMargin().getBottom(); int leftMargin = xwFitLayout.toData().getMargin().getLeft(); int topMargin = xwFitLayout.toData().getMargin().getTop(); + xwFitLayout.toData().setCompInterval(0); int row = (components.length / eachRowCount) + (components.length % eachRowCount == 0 ? 0 : 1); //最后一行的列数不定 int column = components.length % eachRowCount == 0 ? eachRowCount : components.length % eachRowCount; @@ -182,6 +206,12 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr lastRowHeight ); } + for (int i = 0;i < components.length;i++){ + if (components[i] instanceof XWCardMainBorderLayout){ + ((XWCardMainBorderLayout)components[i]).recalculateChildWidth(components[i].getWidth()); + ((XWCardMainBorderLayout)components[i]).recalculateChildHeight(components[i].getHeight()); + } + } xwFitLayout.updateBoundsWidget(); } diff --git a/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java b/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java index f6b8ccaf22..c9654e26d0 100644 --- a/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java +++ b/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java @@ -4,8 +4,7 @@ package com.fr.design.designer.properties; import com.fr.design.beans.GroupModel; -import com.fr.design.designer.creator.XWAbsoluteBodyLayout; -import com.fr.design.designer.creator.XWFitLayout; +import com.fr.design.designer.creator.*; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormSelectionUtils; import com.fr.design.mainframe.WidgetPropertyPane; @@ -91,8 +90,23 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel { } } + private XLayoutContainer selectedBodyLayout(FormDesigner formDesigner) { + XLayoutContainer rootLayout = formDesigner.getRootComponent(); + if (rootLayout.getComponentCount() == 1 && rootLayout.getXCreator(0).acceptType(XWAbsoluteBodyLayout.class)){ + rootLayout = (XWAbsoluteBodyLayout)rootLayout.getXCreator(0); + } + return rootLayout; + } + @Override public Object getValue(int row, int column) { + FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + XLayoutContainer rootLayout = selectedBodyLayout(formDesigner); + if (rootLayout != formDesigner.getRootComponent() + && formDesigner.getSelectionModel().getSelection().getSelectedCreator() == formDesigner.getRootComponent()) { + formDesigner.getSelectionModel().setSelectedCreators( + FormSelectionUtils.rebuildSelection(xfl, new Widget[]{selectedBodyLayout(formDesigner).toData()})); + } if (column == 0) { switch (row) { case 0: @@ -140,6 +154,14 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel { XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0,0)); xfl.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0); for (Component component : components) { + XCreator xCreator = (XCreator)component; + //部分控件被ScaleLayout包裹着,绝对布局里面要放出来 + if (xCreator.acceptType(XWScaleLayout.class)){ + if (xCreator.getComponentCount() > 0 && ((XCreator)xCreator.getComponent(0)).shouldScaleCreator()) { + component = xCreator.getComponent(0); + component.setBounds(xCreator.getBounds()); + } + } xwAbsoluteBodyLayout.add(component); } FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); diff --git a/designer_form/src/com/fr/design/mainframe/FormHierarchyTreePane.java b/designer_form/src/com/fr/design/mainframe/FormHierarchyTreePane.java index 410519cafb..2f424a7b7c 100644 --- a/designer_form/src/com/fr/design/mainframe/FormHierarchyTreePane.java +++ b/designer_form/src/com/fr/design/mainframe/FormHierarchyTreePane.java @@ -5,7 +5,8 @@ import java.awt.event.ActionEvent; import javax.swing.BorderFactory; import javax.swing.Icon; - +import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWAbsoluteBodyLayout; import com.fr.design.actions.community.NeedAction; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.mainframe.widget.UITreeComboBox; @@ -171,10 +172,17 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree */ private void adjustPosition(ComponentTreeModel treeModel,FormDesigner formDesigner){ XCreator root = (XCreator)treeModel.getRoot(); - if(treeModel.getChild(root,PARA) instanceof XWParameterLayout){ + XCreator firstChild = (XCreator)treeModel.getChild(root,PARA); + if(firstChild.acceptType(XWParameterLayout.class)){ return; } - root.add((Component)(treeModel.getChild(root,PARA)),BODY); + // 绝对布局作为body的时候 + // 获取第一个子节点的方法中屏蔽了fit + // 这边另外处理一下 + else if (firstChild.acceptType(XWAbsoluteBodyLayout.class) && firstChild.getBackupParent() != null) { + firstChild = firstChild.getBackupParent(); + } + root.add(firstChild,BODY); treeModel.setRoot(root); componentTree = new ComponentTree(formDesigner,treeModel); } diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index ef18f07135..661ba0ab96 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -9,9 +9,7 @@ import com.fr.design.constants.UIConstants; import com.fr.design.designer.beans.actions.FormDeleteAction; import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEvent; -import com.fr.design.designer.creator.XComponent; -import com.fr.design.designer.creator.XCreator; -import com.fr.design.designer.creator.XCreatorUtils; +import com.fr.design.designer.creator.*; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; @@ -436,6 +434,18 @@ public class JForm extends JTemplate implements BaseJForm { return !inECUndoForm && this.getUndoManager().canUndo(); } + // 返回当前的body, + // 假如当前body是自适应的话就沿用, + // 假如当前body是绝对布局的话就返回绝对布局body + private XLayoutContainer selectedBodyLayout() { + XLayoutContainer rootLayout = formDesign.getRootComponent(); + for (int i = 0; i < rootLayout.getComponentCount(); i++){ + if (rootLayout.getXCreator(i).acceptType(XWAbsoluteBodyLayout.class)){ + rootLayout = (XWAbsoluteBodyLayout)rootLayout.getXCreator(i); + } + } + return rootLayout; + } @Override /** * 应用undoState的表单数据 @@ -447,7 +457,9 @@ public class JForm extends JTemplate implements BaseJForm { if (this.index == FORM_TAB) { JForm.this.refreshRoot(); this.formDesign.getArea().setAreaSize(u.getAreaSize(), u.getHorizontalValue(), u.getVerticalValue(), u.getWidthValue(), u.getHeightValue(), u.getSlideValue()); - this.formDesign.getSelectionModel().setSelectedCreators(FormSelectionUtils.rebuildSelection(formDesign.getRootComponent(), u.getSelectWidgets())); + //撤销的时候要重新选择的body布局 + this.formDesign.getSelectionModel().setSelectedCreators(FormSelectionUtils.rebuildSelection(formDesign.getRootComponent(), + formDesign.getRootComponent() == selectedBodyLayout() ? u.getSelectWidgets() : new Widget[]{selectedBodyLayout().toData()})); } else { String widgetName = this.formDesign.getElementCaseContainerName(); //这儿太坑了,u.getForm() 与 getTarget内容不一样 From 48eff3e882badbb9233d36f808437363660c06dc Mon Sep 17 00:00:00 2001 From: zack Date: Fri, 21 Oct 2016 14:13:34 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=85=B1=E4=BA=ABfireTargetChange=E4=BC=9A?= =?UTF-8?q?=E5=A4=9A=E8=AE=B0=E4=BD=8F=E4=B8=80=E6=AC=A1=E7=8A=B6=E6=80=81?= =?UTF-8?q?ctrl+z=E7=9A=84=E6=97=B6=E5=80=99=E5=BE=97=E5=A4=9A=E6=8C=89?= =?UTF-8?q?=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/data/datapane/TableDataTreePane.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java index 618c2edec2..2e605cafcf 100644 --- a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java @@ -292,7 +292,6 @@ public class TableDataTreePane extends BasicTableDataTreePane { } tds.putTableData(tdName, td); } - tc.fireTargetModified(); tc.parameterChanged(); dataTree.refresh(); } From 14403f3459f56671ab9111981dc898fdbd4edf03 Mon Sep 17 00:00:00 2001 From: zhouping Date: Fri, 21 Oct 2016 14:15:58 +0800 Subject: [PATCH 08/13] =?UTF-8?q?REPORT-533=20=E8=A1=A8=E5=8D=95=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E5=B8=83=E5=B1=80=E6=96=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java index fff14f03d0..bdaad048aa 100644 --- a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java +++ b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java @@ -173,6 +173,7 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr int eachRowCount = 4; Component[] components = xwFitLayout.getComponents(); if (components.length <= 1){ + xwFitLayout.updateBoundsWidget(); return; } int layoutWidth = xwFitLayout.getWidth() - xwFitLayout.toData().getMargin().getLeft() - xwFitLayout.toData().getMargin().getRight(); From 2c4780d0828569adbaed0e85b67d268a7886f1fd Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 21 Oct 2016 15:48:22 +0800 Subject: [PATCH 09/13] =?UTF-8?q?REPORT-565=20=E8=A7=A3=E5=86=B3=E6=97=A5?= =?UTF-8?q?=E6=96=87=E8=AE=BE=E8=AE=A1=E5=99=A8=E4=B8=8B=E8=B6=85=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E5=AF=B9=E8=AF=9D=E6=A1=86=E5=90=8E=E7=9A=84=E6=96=87?= =?UTF-8?q?=E5=AD=97=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/hyperlink/AbstractHyperlinkPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java index 8a2773f58a..36297d1656 100644 --- a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java @@ -63,12 +63,12 @@ public abstract class AbstractHyperlinkPane extends BasicBe newWindowConfPane.add(new UILabel(Inter.getLocText("FR-Designer_Height") + ": ")); heightTextFiled = new UINumberField(); heightTextFiled.setText(String.valueOf(DEFAULT_H_VALUE)); - heightTextFiled.setPreferredSize(new Dimension(60, 20)); + heightTextFiled.setPreferredSize(new Dimension(40, 20)); newWindowConfPane.add(heightTextFiled); newWindowConfPane.add(new UILabel(" " + Inter.getLocText("FR-Designer_Width") + ": ")); widthTextFiled = new UINumberField(); widthTextFiled.setText(String.valueOf(DEFAULT_V_VALUE)); - widthTextFiled.setPreferredSize(new Dimension(60, 20)); + widthTextFiled.setPreferredSize(new Dimension(40, 20)); newWindowConfPane.add(widthTextFiled); JPanel centerPanel = new JPanel(new BorderLayout()); From d92bc1810816e2cbe25ae6885d66f94026801c09 Mon Sep 17 00:00:00 2001 From: zack Date: Fri, 21 Oct 2016 15:53:16 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20NPE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/CoverReportPane.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/CoverReportPane.java b/designer_form/src/com/fr/design/mainframe/CoverReportPane.java index 42dc62040c..63ec66f5a5 100644 --- a/designer_form/src/com/fr/design/mainframe/CoverReportPane.java +++ b/designer_form/src/com/fr/design/mainframe/CoverReportPane.java @@ -62,15 +62,17 @@ public class CoverReportPane extends JPanel { editButton.setBackground(new Color(176, 196, 222)); add(editButton); add(controlButton); - WidgetPropertyPane.getInstance().getEditingFormDesigner().addDesignerEditListener(new DesignerEditListener() { - @Override - public void fireCreatorModified(DesignerEvent evt) { - if (evt.getCreatorEventID() == (DesignerEvent.CREATOR_DELETED) - || evt.getCreatorEventID() == (DesignerEvent.CREATOR_RESIZED)) { - destroyHelpDialog(); + if (WidgetPropertyPane.getInstance().getEditingFormDesigner() != null) { + WidgetPropertyPane.getInstance().getEditingFormDesigner().addDesignerEditListener(new DesignerEditListener() { + @Override + public void fireCreatorModified(DesignerEvent evt) { + if (evt.getCreatorEventID() == (DesignerEvent.CREATOR_DELETED) + || evt.getCreatorEventID() == (DesignerEvent.CREATOR_RESIZED)) { + destroyHelpDialog(); + } } - } - }); + }); + } } public String getHelpMsg() { From 3e6056314b061109b70508374dbdfe2f5ae9ebb2 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 21 Oct 2016 15:54:51 +0800 Subject: [PATCH 11/13] =?UTF-8?q?REPORT-565=20=E8=A7=A3=E5=86=B3=E6=97=A5?= =?UTF-8?q?=E6=96=87=E8=AE=BE=E8=AE=A1=E5=99=A8=E4=B8=8B=E8=B6=85=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E5=AF=B9=E8=AF=9D=E6=A1=86=E5=90=8E=E7=9A=84=E6=96=87?= =?UTF-8?q?=E5=AD=97=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/hyperlink/AbstractHyperlinkPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java index 36297d1656..8a2773f58a 100644 --- a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java @@ -63,12 +63,12 @@ public abstract class AbstractHyperlinkPane extends BasicBe newWindowConfPane.add(new UILabel(Inter.getLocText("FR-Designer_Height") + ": ")); heightTextFiled = new UINumberField(); heightTextFiled.setText(String.valueOf(DEFAULT_H_VALUE)); - heightTextFiled.setPreferredSize(new Dimension(40, 20)); + heightTextFiled.setPreferredSize(new Dimension(60, 20)); newWindowConfPane.add(heightTextFiled); newWindowConfPane.add(new UILabel(" " + Inter.getLocText("FR-Designer_Width") + ": ")); widthTextFiled = new UINumberField(); widthTextFiled.setText(String.valueOf(DEFAULT_V_VALUE)); - widthTextFiled.setPreferredSize(new Dimension(40, 20)); + widthTextFiled.setPreferredSize(new Dimension(60, 20)); newWindowConfPane.add(widthTextFiled); JPanel centerPanel = new JPanel(new BorderLayout()); From 0a8aeb8c6188825ab614d25b777da60d9a2338ec Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 21 Oct 2016 16:29:08 +0800 Subject: [PATCH 12/13] =?UTF-8?q?REPORT-560=20&&=20REPORT-565=20=20?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=A5=E6=9C=9F=E6=8E=A7=E4=BB=B6=E8=AE=BE?= =?UTF-8?q?=E7=BD=AEformat=E5=90=8E=E6=97=A0=E6=B3=95=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=92=8C=E6=97=A5=E6=96=87=E8=AE=BE=E8=AE=A1=E5=99=A8=E4=B8=8B?= =?UTF-8?q?=E8=B6=85=E9=93=BE=E6=8E=A5=E5=AF=B9=E8=AF=9D=E6=A1=86=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E5=90=8E=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/ui/DateEditorDefinePane.java | 93 ++++++++----------- .../hyperlink/AbstractHyperlinkPane.java | 4 +- 2 files changed, 40 insertions(+), 57 deletions(-) diff --git a/designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java index 2cd4dfaddc..b85a18a52d 100644 --- a/designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java @@ -31,7 +31,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane 0) { try { SimpleDateFormat simpleDateFormat = new SimpleDateFormat(text); - String sample = simpleDateFormat.format(new Date()); - Color c = Color.black; - if (!ArrayUtils.contains(FormatField.getInstance().getDateFormatArray(), text)) { - sample += " " + Inter.getLocText("DateFormat-Custom_Warning"); - c = Color.red; - } + String sample = simpleDateFormat.format(new Date()); + Color c = Color.black; + if (!ArrayUtils.contains(FormatField.getInstance().getDateFormatArray(), text)) { + sample += " " + Inter.getLocText("DateFormat-Custom_Warning"); + c = Color.red; + } this.sampleLabel.setText(sample); - this.sampleLabel.setForeground(c); + this.sampleLabel.setForeground(c); } catch (Exception exp) { this.sampleLabel.setForeground(Color.red); this.sampleLabel.setText(exp.getMessage()); @@ -143,12 +126,12 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane 0) { try { - simpleDateFormat = new SimpleDateFormat(patternTextField.getText()); + simpleDateFormat = new SimpleDateFormat(text); this.sampleLabel.setText(simpleDateFormat.format(new Date())); } catch (Exception exp) { simpleDateFormat = new SimpleDateFormat(""); diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java index 8a2773f58a..36297d1656 100644 --- a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java @@ -63,12 +63,12 @@ public abstract class AbstractHyperlinkPane extends BasicBe newWindowConfPane.add(new UILabel(Inter.getLocText("FR-Designer_Height") + ": ")); heightTextFiled = new UINumberField(); heightTextFiled.setText(String.valueOf(DEFAULT_H_VALUE)); - heightTextFiled.setPreferredSize(new Dimension(60, 20)); + heightTextFiled.setPreferredSize(new Dimension(40, 20)); newWindowConfPane.add(heightTextFiled); newWindowConfPane.add(new UILabel(" " + Inter.getLocText("FR-Designer_Width") + ": ")); widthTextFiled = new UINumberField(); widthTextFiled.setText(String.valueOf(DEFAULT_V_VALUE)); - widthTextFiled.setPreferredSize(new Dimension(60, 20)); + widthTextFiled.setPreferredSize(new Dimension(40, 20)); newWindowConfPane.add(widthTextFiled); JPanel centerPanel = new JPanel(new BorderLayout()); From c84934b2351b81dce97198340f6eeb5d1bba6095 Mon Sep 17 00:00:00 2001 From: zhouping Date: Fri, 21 Oct 2016 17:21:28 +0800 Subject: [PATCH 13/13] =?UTF-8?q?REPORT-533=20=E8=A1=A8=E5=8D=95=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E5=B8=83=E5=B1=80=E6=96=B0=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=20bugfix=20=E5=88=87=E6=8D=A2=E4=B9=8B=E5=90=8E=E4=B8=8D?= =?UTF-8?q?=E7=AD=89=E5=88=86=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/designer/creator/XWFitLayout.java | 8 ++++++-- .../FRAbsoluteBodyLayoutPropertiesGroupModel.java | 7 +++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java b/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java index 20b12d8881..50fa38db93 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java @@ -21,6 +21,7 @@ import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.PaddingMargin; 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.WFitLayout; import com.fr.form.ui.container.WLayout; import com.fr.general.FRScreen; @@ -685,7 +686,10 @@ public class XWFitLayout extends XLayoutContainer { if (isRefreshing) { return; } - LayoutUtils.layoutContainer(this); + //当前的body布局为绝对布局的时候不要doLayout + if (toData().getBodyLayoutType() != WBodyLayoutType.ABSOLUTE){ + LayoutUtils.layoutContainer(this); + } WFitLayout layout = this.toData(); //自适应布局新增控件后,其他控件位置也会变 XWidgetCreator creator = (XWidgetCreator) e.getChild(); @@ -834,7 +838,7 @@ public class XWFitLayout extends XLayoutContainer { * 处理自适应布局的directions * @param xcreator 组件 */ - private void dealDirections(XCreator xcreator, boolean isInit) { + public void dealDirections(XCreator xcreator, boolean isInit) { if (xcreator == null) { return; } diff --git a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java index bdaad048aa..6b29a172e5 100644 --- a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java +++ b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java @@ -101,13 +101,13 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr xfl.getLayoutAdapter().removeBean(xwAbsoluteLayout, xwAbsoluteLayout.getWidth(), xwAbsoluteLayout.getHeight()); xfl.remove(xwAbsoluteLayout); - xfl.toData().setLayoutType(WBodyLayoutType.FIT); for (Component comp : components) { XCreator xCreator = (XCreator)comp; if (xCreator.shouldScaleCreator()){ XLayoutContainer parentPanel = xCreator.initCreatorWrapper(xCreator.getHeight()); xfl.add(parentPanel, xCreator.toData().getWidgetName()); + parentPanel.updateChildBound(xfl.getActualMinHeight()); continue; } xfl.add(xCreator); @@ -116,9 +116,6 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr moveComponents2FitLayout(xfl); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); formDesigner.getSelectionModel().setSelectedCreator(xfl); - xfl.convert(); - LayoutUtils.layoutContainer(xfl); - xfl.adjustCreatorsWhileSlide(xfl.getContainerPercent() - 1.0); for (int i = 0; i < components.length; i++) { Component comp = xfl.getComponent(i); @@ -133,6 +130,7 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr xfl.toData().setCompInterval(compInterval); xfl.addCompInterval(xfl.getAcualInterval()); } + xfl.toData().setLayoutType(WBodyLayoutType.FIT); return true; } } @@ -212,6 +210,7 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr ((XWCardMainBorderLayout)components[i]).recalculateChildWidth(components[i].getWidth()); ((XWCardMainBorderLayout)components[i]).recalculateChildHeight(components[i].getHeight()); } + xwFitLayout.dealDirections((XCreator)components[i], false); } xwFitLayout.updateBoundsWidget(); }