From fd2f80b6c101ecd2775eed930d611530fec5425c Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Mon, 14 Nov 2016 15:23:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=83=A8=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JWorkBook.java | 2 + .../parameter/ParameterDefinitePane.java | 18 +- .../gui/icontainer/UIResizableContainer.java | 8 +- .../form/parameter/FormParaDesigner.java | 189 ++++++++-------- .../com/fr/design/mainframe/FormDesigner.java | 202 +++++++++--------- .../src/com/fr/design/mainframe/JForm.java | 4 +- 6 files changed, 216 insertions(+), 207 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/JWorkBook.java b/designer/src/com/fr/design/mainframe/JWorkBook.java index 1e27feeb5..f3722c4ac 100644 --- a/designer/src/com/fr/design/mainframe/JWorkBook.java +++ b/designer/src/com/fr/design/mainframe/JWorkBook.java @@ -732,6 +732,7 @@ public class JWorkBook extends JTemplate { } } else { DesignerContext.getDesignerFrame().resetToolkitByPlus(JWorkBook.this); + EastRegionContainerPane.getInstance().removeParameterPane(); if (delegate4ToolbarMenuAdapter() instanceof PolyDesigner) { PolyDesigner polyDesigner = (PolyDesigner) delegate4ToolbarMenuAdapter(); if (polyDesigner.getSelectionType() == PolyDesigner.SelectionType.NONE || polyDesigner.getSelection() == null) { @@ -752,6 +753,7 @@ public class JWorkBook extends JTemplate { EastRegionContainerPane.getInstance().replaceUpPane(allowAuthorityUpPane()); EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); } + centerPane.needToShowCoverAndHidPane(); } diff --git a/designer/src/com/fr/design/parameter/ParameterDefinitePane.java b/designer/src/com/fr/design/parameter/ParameterDefinitePane.java index 1a547c3e6..eb02932b6 100644 --- a/designer/src/com/fr/design/parameter/ParameterDefinitePane.java +++ b/designer/src/com/fr/design/parameter/ParameterDefinitePane.java @@ -20,7 +20,9 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.AuthorityToolBarPane; +import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.JWorkBook; +import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.menu.*; import com.fr.design.module.DesignModuleFactory; @@ -244,7 +246,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus isdelayItem.setSelected(reportParameterAttr.isDelayPlaying()); isshowWindowItem.setSelected(reportParameterAttr.isShowWindow()); isEditing = true; - + EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance().getPreferredSize().height); ParameterBridge bridge = paraDesignEditor.getParaComponent(); if (parameterUI != null) { bridge.setDelayDisplayContent(reportParameterAttr.isDelayPlaying()); @@ -455,13 +457,13 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus */ public ShortCut[] shortcut4FileMenu() { return (ShortCut[]) ArrayUtils.addAll(BaseUtils.isAuthorityEditing() ? - new ShortCut[]{new SaveTemplateAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()), - new UndoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()), - new RedoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate())} : - new ShortCut[]{new SaveTemplateAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()), - new SaveAsTemplateAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()), - new UndoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()), - new RedoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate())}, + new ShortCut[]{new SaveTemplateAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()), + new UndoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()), + new RedoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate())} : + new ShortCut[]{new SaveTemplateAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()), + new SaveAsTemplateAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()), + new UndoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()), + new RedoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate())}, new ShortCut[0] ); } diff --git a/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java index 86945674b..13ea214ec 100644 --- a/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java @@ -29,6 +29,7 @@ public class UIResizableContainer extends JPanel { private VerticalToolPane verticalToolPane; private int direction; + private boolean hasParameterPane; private static final int MAX_WIDTH = 300; private static final int MIN_WIDTH = 165; @@ -89,7 +90,6 @@ public class UIResizableContainer extends JPanel { add(horizontToolPane); add(downPane); add(verticalToolPane); - add(parameterPane); } public UIResizableContainer(JComponent upPane, int direction) { @@ -102,7 +102,6 @@ public class UIResizableContainer extends JPanel { setLayout(containerLayout); add(upPane); add(horizontToolPane); - add(parameterPane); } @@ -141,7 +140,7 @@ public class UIResizableContainer extends JPanel { * @param height */ public void setParameterHeight(int height) { - paraHeight = height; + paraHeight = hasParameterPane? height : 0; refreshContainer(); } @@ -274,13 +273,16 @@ public class UIResizableContainer extends JPanel { public void addParameterPane(JComponent pane) { add(this.parameterPane = pane); + hasParameterPane = true; refreshContainer(); } public void removeParameterPane() { remove(this.parameterPane); setParameterHeight(0); + hasParameterPane = false; refreshContainer(); + } /** diff --git a/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java b/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java index a7936a828..692359bbd 100644 --- a/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java @@ -110,7 +110,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP public void initBeforeUpEdit() { WidgetToolBarPane.getInstance(this); EastRegionContainerPane.getInstance().replaceDownPane( - FormWidgetDetailPane.getInstance(this)); + FormWidgetDetailPane.getInstance(this)); if (!BaseUtils.isAuthorityEditing()) { EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(this)); EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height); @@ -123,35 +123,35 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP } - /** - * 创建权限编辑面板 - * @return 面板 - */ + /** + * 创建权限编辑面板 + * @return 面板 + */ public AuthorityEditPane createAuthorityEditPane() { return new FormWidgetAuthorityEditPane(this); } - /** - * 内容属性表面板 - * @return 内容属性表面板 - */ + /** + * 内容属性表面板 + * @return 内容属性表面板 + */ public JPanel getEastUpPane() { return WidgetPropertyPane.getInstance(this); } - /** - * 参数属性表 - * @return 参数属性表 - */ + /** + * 参数属性表 + * @return 参数属性表 + */ public JPanel getEastDownPane() { return FormWidgetDetailPane.getInstance(this); } - /** - * 权限编辑面板 - * @return 权限编辑面板 - */ + /** + * 权限编辑面板 + * @return 权限编辑面板 + */ public AuthorityEditPane getAuthorityEditPane() { FormWidgetAuthorityEditPane formWidgetAuthorityEditPane = new FormWidgetAuthorityEditPane(this); formWidgetAuthorityEditPane.populateDetials(); @@ -233,6 +233,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP } ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean( p.getParameterArray() == null ? new Parameter[0] : p.getParameterArray()); + EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance().getPreferredSize().height); } @@ -247,9 +248,9 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP return xx.isEmpty(); } - protected void setToolbarButtons(boolean flag) { - DesignerContext.getDesignerFrame().checkCombineUp(!flag, NAME_ARRAY_LIST); - } + protected void setToolbarButtons(boolean flag) { + DesignerContext.getDesignerFrame().checkCombineUp(!flag, NAME_ARRAY_LIST); + } /** * 看看参数面板中的控件是否有和模板参数同名的 @@ -311,17 +312,17 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP return SearchQueryCreators(rootContainer); } - /** - * 返回复制粘贴删除等动作 - * @return 同上 - */ - public Action[] getActions() { - if (designer_actions == null) { - designer_actions = new Action[]{new CutAction(this), new CopyAction(this), new PasteAction(this), - new FormDeleteAction(this)}; - } - return designer_actions; - } + /** + * 返回复制粘贴删除等动作 + * @return 同上 + */ + public Action[] getActions() { + if (designer_actions == null) { + designer_actions = new Action[]{new CutAction(this), new CopyAction(this), new PasteAction(this), + new FormDeleteAction(this)}; + } + return designer_actions; + } private boolean SearchQueryCreators(XLayoutContainer rootContainer) { boolean b = false; @@ -353,9 +354,9 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP ParameterPropertyPane.getInstance().populateBean(p); } - /** - * 初始化 - */ + /** + * 初始化 + */ public void initWidgetToolbarPane() { WidgetToolBarPane.getInstance(this); } @@ -377,38 +378,38 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP this.refreshRoot(); } - /** - * 报表直接判断底层是否是绝对布局 - * @return 是则返回true - */ - public boolean hasWAbsoluteLayout() { - return this.getTarget().getContainer() instanceof WAbsoluteLayout; - } - - /** - * 刷新底层容器 - */ - public void refreshRoot() { - XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(this.getTarget() - .getContainer()); - if (layoutContainer == null) { - layoutContainer = new XWParameterLayout(); - } - layoutContainer.setSize(LARGE_PREFERRED_SIZE); - setRootComponent(layoutContainer); - } - - /** - * 是否是报表的参数面板 - * @return 是 - */ - public boolean isFormParaDesigner(){ - return true; - } - - public XLayoutContainer getParaComponent() { - return getRootComponent(); - } + /** + * 报表直接判断底层是否是绝对布局 + * @return 是则返回true + */ + public boolean hasWAbsoluteLayout() { + return this.getTarget().getContainer() instanceof WAbsoluteLayout; + } + + /** + * 刷新底层容器 + */ + public void refreshRoot() { + XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(this.getTarget() + .getContainer()); + if (layoutContainer == null) { + layoutContainer = new XWParameterLayout(); + } + layoutContainer.setSize(LARGE_PREFERRED_SIZE); + setRootComponent(layoutContainer); + } + + /** + * 是否是报表的参数面板 + * @return 是 + */ + public boolean isFormParaDesigner(){ + return true; + } + + public XLayoutContainer getParaComponent() { + return getRootComponent(); + } private void paintLinkParameters(Graphics clipg) { Parameter[] paras = DesignModelAdapter.getCurrentModelAdapter().getParameters(); @@ -493,8 +494,8 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP public void populateRootSize() { ((FormParameterUI) getTarget()).setDesignSize(getRootComponent().getSize()); if (getParaComponent().acceptType(XWParameterLayout.class)) { - WParameterLayout layout = (WParameterLayout)getParaComponent().toData(); - layout.setDesignWidth(getRootComponent().getWidth()); + WParameterLayout layout = (WParameterLayout)getParaComponent().toData(); + layout.setDesignWidth(getRootComponent().getWidth()); } } @@ -551,12 +552,12 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP return true; } - /** - * 加入参数 - * @param parameter 参数 c - * @param currentIndex 位置 w - * @return 是否加入 s - */ + /** + * 加入参数 + * @param parameter 参数 c + * @param currentIndex 位置 w + * @return 是否加入 s + */ public boolean addingParameter2Editor(Parameter parameter, int currentIndex) { com.fr.form.ui.Label label = new com.fr.form.ui.Label(); String name = parameter.getName(); @@ -577,12 +578,12 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP } - /** - * 加入参数 - * @param parameter 参数 c - * @param currentIndex 位置 w - * @return 是否加入 s - */ + /** + * 加入参数 + * @param parameter 参数 c + * @param currentIndex 位置 w + * @return 是否加入 s + */ public boolean addingParameter2EditorWithQueryButton(Parameter parameter, int currentIndex) { com.fr.form.ui.Label label = new com.fr.form.ui.Label(); String name = parameter.getName(); @@ -611,12 +612,12 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP return true; } - /** - * 加入参数 - * @param parameterArray 参数 c - * @param currentIndex 位置 w - * @return 是否加入 s - */ + /** + * 加入参数 + * @param parameterArray 参数 c + * @param currentIndex 位置 w + * @return 是否加入 s + */ public void addingAllParameter2Editor(Parameter[] parameterArray, int currentIndex) { for (int i = 0; i < parameterArray.length; i++) { com.fr.form.ui.Label label = new com.fr.form.ui.Label(); @@ -669,18 +670,18 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP return true; } - /** - * 工具栏 - * @return 工具栏面板 g - */ + /** + * 工具栏 + * @return 工具栏面板 g + */ public JPanel[] toolbarPanes4Form() { return new JPanel[]{FormParaPane.getInstance(this)}; } - /** - * 复制等按钮 - * @return 按钮组 a - */ + /** + * 复制等按钮 + * @return 按钮组 a + */ public JComponent[] toolBarButton4Form() { return new JComponent[]{new CutAction(this).createToolBarComponent(), new CopyAction(this).createToolBarComponent(), new PasteAction(this).createToolBarComponent(), new FormDeleteAction(this).createToolBarComponent()}; diff --git a/designer_form/src/com/fr/design/mainframe/FormDesigner.java b/designer_form/src/com/fr/design/mainframe/FormDesigner.java index 8422bfdb4..6f5fe2a47 100644 --- a/designer_form/src/com/fr/design/mainframe/FormDesigner.java +++ b/designer_form/src/com/fr/design/mainframe/FormDesigner.java @@ -121,7 +121,7 @@ public class FormDesigner extends TargetComponent
implements TreeSelection private static final int H_GAP = 105; public FormDesigner(Form form) { - this(form, null); + this(form, null); } public FormDesigner(Form form, Action switchAction) { @@ -186,14 +186,14 @@ public class FormDesigner extends TargetComponent implements TreeSelection public void refreshParameter(){ XLayoutContainer rootContainer = this.getParaComponent(); if (rootContainer != null){ - java.util.List namelist = new ArrayList(); - rootContainer.getAllXCreatorNameList(rootContainer,namelist); - // parameterArray是报表的所有参数, nameList是已经在参数面板添加过控件的参数名 - // 与已有的参数列表比较 如果已经存在 就除去 - Parameter[] ps = getParameterArray(); - if (ps != null) { - removeSame(ps, namelist); - } + java.util.List namelist = new ArrayList(); + rootContainer.getAllXCreatorNameList(rootContainer,namelist); + // parameterArray是报表的所有参数, nameList是已经在参数面板添加过控件的参数名 + // 与已有的参数列表比较 如果已经存在 就除去 + Parameter[] ps = getParameterArray(); + if (ps != null) { + removeSame(ps, namelist); + } } ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean( getParameterArray() == null ? new Parameter[0] : getParameterArray()); @@ -201,15 +201,15 @@ public class FormDesigner extends TargetComponent implements TreeSelection EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height); } - private void removeSame(Parameter[] parameters, List namelist){ - for (Parameter parameter : parameters) { - for (String name : namelist) { - if (name.equalsIgnoreCase(parameter.getName())) { - setParameterArray((Parameter[]) ArrayUtils.removeElement(getParameterArray(), parameter)); - } - } - } - } + private void removeSame(Parameter[] parameters, List namelist){ + for (Parameter parameter : parameters) { + for (String name : namelist) { + if (name.equalsIgnoreCase(parameter.getName())) { + setParameterArray((Parameter[]) ArrayUtils.removeElement(getParameterArray(), parameter)); + } + } + } + } /** @@ -405,10 +405,10 @@ public class FormDesigner extends TargetComponent implements TreeSelection * 加入参数面板 */ public void addParaComponent(){ - if (paraComponent != null) { - return ; - } - paraHeight = WBorderLayout.DEFAULT_SIZE; + if (paraComponent != null) { + return ; + } + paraHeight = WBorderLayout.DEFAULT_SIZE; paraComponent = new XWParameterLayout(); paraComponent.toData().setWidgetName("para"); paraComponent.setSize(paraComponent.initEditorSize()); @@ -428,10 +428,10 @@ public class FormDesigner extends TargetComponent implements TreeSelection * @return 父容器 */ public Component getTopContainer(){ - if(rootComponent != null){ - // 返回root所在的父容器,非designer - return LayoutUtils.getTopContainer(rootComponent); - } + if(rootComponent != null){ + // 返回root所在的父容器,非designer + return LayoutUtils.getTopContainer(rootComponent); + } return XCreatorUtils.createXCreator(this.getTarget().getContainer()); } @@ -448,9 +448,9 @@ public class FormDesigner extends TargetComponent implements TreeSelection * @param height 高度 */ public void setParaHeight(int height){ - XWBorderLayout container = (XWBorderLayout) getTopContainer(); - container.toData().setNorthSize(height); - container.setSize(container.getWidth(), container.getHeight() + height - getParaHeight()); + XWBorderLayout container = (XWBorderLayout) getTopContainer(); + container.toData().setNorthSize(height); + container.setSize(container.getWidth(), container.getHeight() + height - getParaHeight()); paraHeight = height; } @@ -475,39 +475,39 @@ public class FormDesigner extends TargetComponent implements TreeSelection * @param elementCaseContainer 容器 */ public void switchTab(FormElementCaseContainerProvider elementCaseContainer){ - if(this.switchAction == null){ - return; - } - this.elementCaseContainer = elementCaseContainer; - this.switchAction.actionPerformed(null); + if(this.switchAction == null){ + return; + } + this.elementCaseContainer = elementCaseContainer; + this.switchAction.actionPerformed(null); } public void setElementCaseContainer(FormElementCaseContainerProvider elementCaseContainer){ - this.elementCaseContainer = elementCaseContainer; + this.elementCaseContainer = elementCaseContainer; } public FormElementCaseProvider getElementCase(){ - return this.elementCaseContainer.getElementCase(); + return this.elementCaseContainer.getElementCase(); } public String getElementCaseContainerName(){ - return this.elementCaseContainer.getElementCaseContainerName(); + return this.elementCaseContainer.getElementCaseContainerName(); } public void setElementCase(FormElementCaseProvider elementCase){ - this.elementCaseContainer.setElementCase(elementCase); + this.elementCaseContainer.setElementCase(elementCase); } public void setElementCaseBackground(BufferedImage image){ - this.elementCaseContainer.setBackground(image); + this.elementCaseContainer.setBackground(image); } public Dimension getElementCaseContainerSize(){ - return this.elementCaseContainer.getSize(); + return this.elementCaseContainer.getSize(); } public FormElementCaseContainerProvider getElementCaseContainer(){ - return this.elementCaseContainer; + return this.elementCaseContainer; } protected FormDesignerModeForSpecial createFormDesignerTargetMode() { @@ -604,7 +604,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection * @param width 指定的宽度 */ public void updateWidth(int width) { - //TODO + //TODO } /** @@ -615,12 +615,12 @@ public class FormDesigner extends TargetComponent implements TreeSelection * @return 不返回任何对象 */ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - if(rootComponent != null){ - LayoutUtils.layoutRootContainer(rootComponent); - } - if(paraComponent != null){ - LayoutUtils.layoutRootContainer(paraComponent); - } + if(rootComponent != null){ + LayoutUtils.layoutRootContainer(rootComponent); + } + if(paraComponent != null){ + LayoutUtils.layoutRootContainer(paraComponent); + } repaint(); return null; } @@ -640,7 +640,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection @Override public void fireCreatorModified(DesignerEvent evt) { - // 只有选择组件时不触发模版更新,其他都要触发 + // 只有选择组件时不触发模版更新,其他都要触发 if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) { FormDesigner.this.fireTargetModified(); //bug59192 @@ -702,7 +702,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection * 从root组件递归查找x,y所在的组件,注意是正在被设计的组件,因此其name属性必须不为空 */ private XCreator xCreatorAt(int x, int y, XCreator root, XCreator[] except) { - if (root == null || !root.isVisible()) { + if (root == null || !root.isVisible()) { return null; } x -= root.getX(); @@ -758,21 +758,21 @@ public class FormDesigner extends TargetComponent implements TreeSelection * 刷新底层容器 */ public void refreshRoot() { - // 撤销恢复操作都会refreshRoot,这时候的target.getContainer里的widget会和之前不一样,所以不用root判断来取 - XLayoutContainer formLayoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(this.getTarget().getContainer()); + // 撤销恢复操作都会refreshRoot,这时候的target.getContainer里的widget会和之前不一样,所以不用root判断来取 + XLayoutContainer formLayoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(this.getTarget().getContainer()); // 布局默认都是1,底层的border改为0,不然没意义 this.getTarget().getContainer().setMargin(new PaddingMargin(0,0,0,0)); formLayoutContainer.setBorder(null); if (formLayoutContainer.acceptType(XWBorderLayout.class)) { - WBorderLayout borderLayout = (WBorderLayout) formLayoutContainer.toData(); + WBorderLayout borderLayout = (WBorderLayout) formLayoutContainer.toData(); Widget northWidget = borderLayout.getLayoutWidget(WBorderLayout.NORTH); - Widget centerWidget = borderLayout.getLayoutWidget(WBorderLayout.CENTER); + Widget centerWidget = borderLayout.getLayoutWidget(WBorderLayout.CENTER); //本身含有,这儿得先清空再加 formLayoutContainer.removeAll(); refreshNorth(northWidget, formLayoutContainer); - refreshCenter(centerWidget, formLayoutContainer); + refreshCenter(centerWidget, formLayoutContainer); } else { formLayoutContainer.setSize(LARGE_PREFERRED_SIZE); @@ -781,43 +781,43 @@ public class FormDesigner extends TargetComponent implements TreeSelection } private void refreshNorth(Widget northWidget, XLayoutContainer formLayoutContainer) { - // 如果没有参数界面, 那么就处理下高度以及参数界面的按钮要点亮 - if (northWidget == null) { - paraComponent = null; - paraHeight = 0; - FormParaWidgetPane.getInstance(this); - return; - } - - XLayoutContainer northContainer = (XLayoutContainer) XCreatorUtils.createXCreator(northWidget); - paraHeight = ((XWBorderLayout)formLayoutContainer).toData().getNorthSize(); - paraComponent = northContainer; - northContainer.setSize(0,paraHeight); - formLayoutContainer.add(northContainer, WBorderLayout.NORTH); - } - - private void refreshCenter(Widget centerWidget, XLayoutContainer formLayoutContainer) { - // 不存在center块, 说明是新建的模板 - if (centerWidget == null) { - XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(new WFitLayout("body")); - layoutContainer.setSize(LARGE_PREFERRED_SIZE); - setRootComponent(layoutContainer); - formLayoutContainer.add(rootComponent, WBorderLayout.CENTER); - return; - } - - XLayoutContainer centerContainer = (XLayoutContainer) XCreatorUtils.createXCreator(centerWidget); - Dimension d = new Dimension(); - d.width = ((WFitLayout) centerWidget).getContainerWidth(); - d.height = ((WFitLayout) centerWidget).getContainerHeight(); - centerContainer.setSize(d); - formLayoutContainer.setSize(d.width, d.height + paraHeight); - setRootComponent(centerContainer); - // 再次打开时,layout下root,有内边距的话组件加上 - LayoutUtils.layoutContainer(centerContainer); - formLayoutContainer.add(rootComponent, WBorderLayout.CENTER); + // 如果没有参数界面, 那么就处理下高度以及参数界面的按钮要点亮 + if (northWidget == null) { + paraComponent = null; + paraHeight = 0; + FormParaWidgetPane.getInstance(this); + return; } + XLayoutContainer northContainer = (XLayoutContainer) XCreatorUtils.createXCreator(northWidget); + paraHeight = ((XWBorderLayout)formLayoutContainer).toData().getNorthSize(); + paraComponent = northContainer; + northContainer.setSize(0,paraHeight); + formLayoutContainer.add(northContainer, WBorderLayout.NORTH); + } + + private void refreshCenter(Widget centerWidget, XLayoutContainer formLayoutContainer) { + // 不存在center块, 说明是新建的模板 + if (centerWidget == null) { + XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(new WFitLayout("body")); + layoutContainer.setSize(LARGE_PREFERRED_SIZE); + setRootComponent(layoutContainer); + formLayoutContainer.add(rootComponent, WBorderLayout.CENTER); + return; + } + + XLayoutContainer centerContainer = (XLayoutContainer) XCreatorUtils.createXCreator(centerWidget); + Dimension d = new Dimension(); + d.width = ((WFitLayout) centerWidget).getContainerWidth(); + d.height = ((WFitLayout) centerWidget).getContainerHeight(); + centerContainer.setSize(d); + formLayoutContainer.setSize(d.width, d.height + paraHeight); + setRootComponent(centerContainer); + // 再次打开时,layout下root,有内边距的话组件加上 + LayoutUtils.layoutContainer(centerContainer); + formLayoutContainer.add(rootComponent, WBorderLayout.CENTER); + } + protected Insets getOutlineInsets() { return new Insets(10, 10, 10, 10); @@ -962,8 +962,8 @@ public class FormDesigner extends TargetComponent implements TreeSelection public void startDraggingComponent(XCreator xCreator, MouseEvent lastPressEvent, int x, int y) { // 根据所选择的组件的BeanInfo生成相应的AddingModel // AddingModel和StateModel不一样,适合当前选择的组件相关的 - int creatorWidth = xCreator.getWidth(); - int creatorHeight = xCreator.getHeight(); + int creatorWidth = xCreator.getWidth(); + int creatorHeight = xCreator.getHeight(); this.addingModel = new AddingModel(xCreator, x, y); TransferHandler handler = new DesignerTransferHandler(this, addingModel); setTransferHandler(handler); @@ -1007,9 +1007,9 @@ public class FormDesigner extends TargetComponent implements TreeSelection } } - /** - * 显示权限编辑界面 - */ + /** + * 显示权限编辑界面 + */ public void showAuthorityEditPane() { HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setAuthorityMode(true); if (isSupportAuthority()) { @@ -1023,9 +1023,9 @@ public class FormDesigner extends TargetComponent implements TreeSelection } /** - * 是否支持权限编辑 - * @return 是则返回true - */ + * 是否支持权限编辑 + * @return 是则返回true + */ public boolean isSupportAuthority() { int size = getSelectionModel().getSelection().size(); XCreator creator = size == 0 ? getRootComponent() : getSelectionModel().getSelection() @@ -1036,7 +1036,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection protected void setToolbarButtons(boolean flag) { //自适应布局和底层都不能删除 - DesignerContext.getDesignerFrame().checkCombineUp(!(isRoot(getSelectionModel().getSelection().getSelectedCreator()) || flag), NAME_ARRAY_LIST); + DesignerContext.getDesignerFrame().checkCombineUp(!(isRoot(getSelectionModel().getSelection().getSelectedCreator()) || flag), NAME_ARRAY_LIST); } private void invalidateLayout() { @@ -1092,7 +1092,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection */ public Action[] getActions() { if (designer_actions == null) { - //先把复制粘贴按钮去掉,只留下删除 + //先把复制粘贴按钮去掉,只留下删除 // designer_actions = new Action[]{new CutAction(this), new CopyAction(this), new PasteAction(this), // new FormDeleteAction(this)}; designer_actions = new Action[]{new FormDeleteAction(this)}; @@ -1236,7 +1236,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection public ToolBarMenuDockPlus getToolBarMenuDockPlus() { - return StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, ToolBarMenuDockPlus.class); + return StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, ToolBarMenuDockPlus.class); } /** diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index bbc1706d9..4c015811c 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -609,17 +609,19 @@ public class JForm extends JTemplate implements BaseJForm { EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); return; } + if (formDesign.isReportBlockEditing()) { if (elementCaseDesign != null) { + EastRegionContainerPane.getInstance().removeParameterPane(); EastRegionContainerPane.getInstance().replaceDownPane(elementCaseDesign.getEastDownPane()); EastRegionContainerPane.getInstance().replaceUpPane(elementCaseDesign.getEastUpPane()); return; } } - EastRegionContainerPane.getInstance().replaceUpPane(WidgetPropertyPane.getInstance(formDesign)); EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(formDesign)); + EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(formDesign).getPreferredSize().height); if (EastRegionContainerPane.getInstance().getDownPane() == null) { new Thread() { public void run() { From 993f22837b42bf215f199b037396715382ef296c Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Mon, 14 Nov 2016 15:46:37 +0800 Subject: [PATCH 2/2] rt --- .../design/mainframe/WidgetPropertyPane.java | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java index 324ff62bb..cc7f1d769 100644 --- a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java @@ -124,15 +124,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper } componentTree = new ComponentTree(designer); - - ComponentTreeModel treeModel = (ComponentTreeModel) componentTree.getModel(); - XCreator root = (XCreator)treeModel.getRoot(); - int childCount = treeModel.getChildCount(root); - //按照节点添加para在下的,但这里需要para节点在上,调整一下位置 - if(childCount == NODE_LENGTH){ - adjustPosition(treeModel, designer); - } - widgetPropertyTables = new ArrayList(); propertyTable = new WidgetPropertyTable(designer); designer.addDesignerEditListener(new WidgetPropertyDesignerAdapter(propertyTable)); @@ -198,22 +189,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper isrefresh = false; } - - /** - * 调整结构树para和body的位置 - * - * @param treeModel - * @param formDesigner - */ - private void adjustPosition(ComponentTreeModel treeModel,FormDesigner formDesigner){ - XCreator root = (XCreator)treeModel.getRoot(); - if(treeModel.getChild(root,0) instanceof XWParameterLayout){ - return; - } - root.add((Component)(treeModel.getChild(root,0)),1); - treeModel.setRoot(root); - componentTree = new ComponentTree(formDesigner,treeModel); - } // /** * 选中的组件是否在参数面板里