diff --git a/designer/src/com/fr/design/mainframe/JWorkBook.java b/designer/src/com/fr/design/mainframe/JWorkBook.java index 1e27feeb58..f3722c4ac2 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 1a547c3e6c..4b8572b710 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()); diff --git a/designer_base/src/com/fr/design/data/BasicTableDataTreePane.java b/designer_base/src/com/fr/design/data/BasicTableDataTreePane.java index 45cd0cea70..a76d4a1059 100644 --- a/designer_base/src/com/fr/design/data/BasicTableDataTreePane.java +++ b/designer_base/src/com/fr/design/data/BasicTableDataTreePane.java @@ -118,7 +118,7 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp if (StringUtils.isBlank(tempName)) { nPanel.setShowText(Inter.getLocText(new String[]{"DS-TableData", "ISEMPTY", "PLEASE", "GIVE-NAME"}, new String[]{"", ",", "", "!"})); dg.setButtonEnabled(false); - } else if (!ComparatorUtils.equals(oldName, tempName) && isDsNameRepeaded(tempName, allDSNames)) { + } else if (!ComparatorUtils.equals(oldName, tempName) && isDsNameRepeaded(tempName)) { String[] waring = new String[]{"DS-TableData", "Utils-has_been_existed", "PLEASE", "Rename"}; String[] sign = new String[]{tempName, ",", "", "!"}; nPanel.setShowText(Inter.getLocText(waring, sign)); @@ -324,20 +324,22 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp private String createDsName(String prefix) { int count = 1; allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook()); - while (isDsNameRepeaded(prefix + count, allDSNames)) { + while (isDsNameRepeaded(prefix + count)) { count++; } return prefix + count; } - private boolean isDsNameRepeaded(String name, String[] names) { - boolean repeat = false; - for (int i = 0; i < names.length; i++) { - if (ComparatorUtils.equals(name, names[i])) { - repeat = true; + protected boolean isDsNameRepeaded(String name) { + if (allDSNames == null) { + allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook()); + } + for (int i = 0; i < allDSNames.length; i++) { + if (ComparatorUtils.equals(name, allDSNames[i])) { + return true; } } - return repeat; + return false; } protected KeyAdapter getTableTreeNodeListener(final UpdateAction editAction, final UpdateAction previewTableDataAction, final UpdateAction removeAction, final TableDataSourceOP op, final TableDataTree dataTree) { 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 2e605cafcf..219093c6d9 100644 --- a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java @@ -276,13 +276,14 @@ public class TableDataTreePane extends BasicTableDataTreePane { * @param tableDataSource 数据集 */ public void addTableData(String srcName, TableDataSource tableDataSource) { + allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook()); 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) {//如果有同名的就拼上来源名称 + if (tds.getTableData(tdName) != null || isDsNameRepeaded(tdName)) {//如果有同名的就拼上来源名称 tdName = srcName + tdName; } int i = 0; diff --git a/designer_base/src/com/fr/design/gui/frpane/TreeSettingPane.java b/designer_base/src/com/fr/design/gui/frpane/TreeSettingPane.java index 65df6f0625..a8a72fc1e3 100644 --- a/designer_base/src/com/fr/design/gui/frpane/TreeSettingPane.java +++ b/designer_base/src/com/fr/design/gui/frpane/TreeSettingPane.java @@ -23,6 +23,7 @@ import javax.swing.*; import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.util.Arrays; public class TreeSettingPane extends BasicPane implements DataCreatorUI { private JTreeControlPane controlPane; @@ -133,7 +134,7 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI { for (LayerConfig layerConfig : layerConfigList) { layerConfigs[i++] = layerConfig; } - this.layerDataControlPane.populate(new NameObject("tree", layerConfigs)); + this.layerDataControlPane.populate(new NameObject("Tree Layer Data", layerConfigs)); } else { buildBox.setSelectedIndex(2); } @@ -154,10 +155,12 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI { if (buildBox.getSelectedIndex() == 1) { TableDataDictionary dictionary = this.autoBuildPane.update(); te.setAutoBuild(true); + te.setLayerBuild(false); te.setDictionary(dictionary); te.setNodeOrDict(dictionary); } else if (buildBox.getSelectedIndex() == 2) { te.setAutoBuild(false); + te.setLayerBuild(false); NameObject no = this.controlPane.update(); if (no != null) { TreeEditor editor = (TreeEditor) no.getObject(); @@ -174,6 +177,11 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI { te.setNodeOrDict(editor.getTreeNodeAttr()); te.setPerformanceFirst(editor.isPerformanceFirst()); } + } else { + LayerConfig[] configs = (LayerConfig[]) layerDataControlPane.update().getObject(); + te.setAutoBuild(false); + te.setLayerBuild(true); + te.setLayerConfigs(Arrays.asList(configs)); } return te; } @@ -206,15 +214,17 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI { if (buildBox.getSelectedIndex() == 1) { TableDataDictionary dictionary = this.autoBuildPane.update(); tcb.setAutoBuild(true); - tcb.setDictionary(dictionary); - tcb.setNodeOrDict(dictionary); - } else if (buildBox.getSelectedIndex() == 2) { - tcb.setAutoBuild(false); - NameObject no = this.controlPane.update(); - if (no != null) { - if (no.getObject() instanceof TreeComboBoxEditor) { - return (TreeComboBoxEditor) no.getObject(); - } + tcb.setLayerBuild(false); + tcb.setDictionary(dictionary); + tcb.setNodeOrDict(dictionary); + } else if (buildBox.getSelectedIndex() == 2) { + tcb.setAutoBuild(false); + tcb.setLayerBuild(false); + NameObject no = this.controlPane.update(); + if (no != null) { + if (no.getObject() instanceof TreeComboBoxEditor) { + return (TreeComboBoxEditor) no.getObject(); + } TreeEditor editor = (TreeEditor) no.getObject(); tcb.setAllowBlank(editor.isAllowBlank()); @@ -230,7 +240,12 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI { tcb.setNodeOrDict(editor.getTreeNodeAttr()); tcb.setPerformanceFirst(editor.isPerformanceFirst()); } - } + }else { + LayerConfig[] configs = (LayerConfig[]) layerDataControlPane.update().getObject(); + tcb.setAutoBuild(false); + tcb.setLayerBuild(true); + tcb.setLayerConfigs(Arrays.asList(configs)); + } return tcb; } 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 86945674bf..13ea214ec5 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/designer/properties/WidgetPropertyTable.java b/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java index 9f53dddcce..f69771a54a 100644 --- a/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java +++ b/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java @@ -21,6 +21,7 @@ import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.cardlayout.XWCardLayout; +import com.fr.general.ComparatorUtils; public class WidgetPropertyTable extends AbstractPropertyTable { @@ -71,7 +72,7 @@ public class WidgetPropertyTable extends AbstractPropertyTable { if (size == 0 || size == 1) { XCreator creator = size == 0 ? designer.getRootComponent() : designer.getSelectionModel().getSelection() .getSelectedCreator(); - if (designer.isRoot(creator)) { + if (ComparatorUtils.equals(creator, designer.getRootComponent())) { groups = designer.getDesignerMode().createRootDesignerPropertyGroup(); } else { groups = getCreatorPropertyGroup(designer, creator); 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 a7936a8288..d5de1eb4ff 100644 --- a/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java @@ -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); } diff --git a/designer_form/src/com/fr/design/mainframe/FormDesigner.java b/designer_form/src/com/fr/design/mainframe/FormDesigner.java index 8422bfdb40..b24b2d96fc 100644 --- a/designer_form/src/com/fr/design/mainframe/FormDesigner.java +++ b/designer_form/src/com/fr/design/mainframe/FormDesigner.java @@ -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()); @@ -853,7 +853,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection * @return 是则返回true */ public boolean isRoot(XCreator comp) { - return comp == rootComponent; + return comp == rootComponent || comp.acceptType(XWAbsoluteBodyLayout.class); } // 计算鼠标事件e所发生的位置相对根组件的位置关系 diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index ddaf79e5b7..4c015811c0 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -621,6 +621,7 @@ public class JForm extends JTemplate implements BaseJForm { 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() { diff --git a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java index 324ff62bb3..cc7f1d7690 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); - } // /** * 选中的组件是否在参数面板里 diff --git a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java index d495e9c06a..e1decfe2b4 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java @@ -33,6 +33,7 @@ public class ParameterToolBarPane extends BasicBeanPane { private static final int GAP_H = 4; private static final int GAP_V = 6; private static final int GAP_BV = 4; + private static final int WIDTH = 225; private static final int L_H = 18; @@ -140,7 +141,7 @@ public class ParameterToolBarPane extends BasicBeanPane { } public void layoutContainer(Container parent) { - int width = parent.getWidth(); + int width = parent.getWidth() == 0 ? WIDTH : parent.getWidth(); int x = 0; int y = L_H + GAP_H;