fr_shine 8 years ago
parent
commit
24471026c4
  1. 2
      designer/src/com/fr/design/mainframe/JWorkBook.java
  2. 4
      designer/src/com/fr/design/parameter/ParameterDefinitePane.java
  3. 18
      designer_base/src/com/fr/design/data/BasicTableDataTreePane.java
  4. 3
      designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java
  5. 37
      designer_base/src/com/fr/design/gui/frpane/TreeSettingPane.java
  6. 8
      designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java
  7. 3
      designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java
  8. 1
      designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java
  9. 18
      designer_form/src/com/fr/design/mainframe/FormDesigner.java
  10. 1
      designer_form/src/com/fr/design/mainframe/JForm.java
  11. 25
      designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java
  12. 3
      designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

2
designer/src/com/fr/design/mainframe/JWorkBook.java

@ -732,6 +732,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
} }
} else { } else {
DesignerContext.getDesignerFrame().resetToolkitByPlus(JWorkBook.this); DesignerContext.getDesignerFrame().resetToolkitByPlus(JWorkBook.this);
EastRegionContainerPane.getInstance().removeParameterPane();
if (delegate4ToolbarMenuAdapter() instanceof PolyDesigner) { if (delegate4ToolbarMenuAdapter() instanceof PolyDesigner) {
PolyDesigner polyDesigner = (PolyDesigner) delegate4ToolbarMenuAdapter(); PolyDesigner polyDesigner = (PolyDesigner) delegate4ToolbarMenuAdapter();
if (polyDesigner.getSelectionType() == PolyDesigner.SelectionType.NONE || polyDesigner.getSelection() == null) { if (polyDesigner.getSelectionType() == PolyDesigner.SelectionType.NONE || polyDesigner.getSelection() == null) {
@ -752,6 +753,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
EastRegionContainerPane.getInstance().replaceUpPane(allowAuthorityUpPane()); EastRegionContainerPane.getInstance().replaceUpPane(allowAuthorityUpPane());
EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance());
} }
centerPane.needToShowCoverAndHidPane(); centerPane.needToShowCoverAndHidPane();
} }

4
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.gui.ibutton.UIButtonGroup;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.AuthorityToolBarPane; import com.fr.design.mainframe.AuthorityToolBarPane;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.JWorkBook; import com.fr.design.mainframe.JWorkBook;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.menu.*; import com.fr.design.menu.*;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
@ -244,7 +246,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
isdelayItem.setSelected(reportParameterAttr.isDelayPlaying()); isdelayItem.setSelected(reportParameterAttr.isDelayPlaying());
isshowWindowItem.setSelected(reportParameterAttr.isShowWindow()); isshowWindowItem.setSelected(reportParameterAttr.isShowWindow());
isEditing = true; isEditing = true;
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance().getPreferredSize().height);
ParameterBridge bridge = paraDesignEditor.getParaComponent(); ParameterBridge bridge = paraDesignEditor.getParaComponent();
if (parameterUI != null) { if (parameterUI != null) {
bridge.setDelayDisplayContent(reportParameterAttr.isDelayPlaying()); bridge.setDelayDisplayContent(reportParameterAttr.isDelayPlaying());

18
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)) { if (StringUtils.isBlank(tempName)) {
nPanel.setShowText(Inter.getLocText(new String[]{"DS-TableData", "ISEMPTY", "PLEASE", "GIVE-NAME"}, new String[]{"", ",", "", "!"})); nPanel.setShowText(Inter.getLocText(new String[]{"DS-TableData", "ISEMPTY", "PLEASE", "GIVE-NAME"}, new String[]{"", ",", "", "!"}));
dg.setButtonEnabled(false); 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[] waring = new String[]{"DS-TableData", "Utils-has_been_existed", "PLEASE", "Rename"};
String[] sign = new String[]{tempName, ",", "", "!"}; String[] sign = new String[]{tempName, ",", "", "!"};
nPanel.setShowText(Inter.getLocText(waring, sign)); nPanel.setShowText(Inter.getLocText(waring, sign));
@ -324,20 +324,22 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
private String createDsName(String prefix) { private String createDsName(String prefix) {
int count = 1; int count = 1;
allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook()); allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook());
while (isDsNameRepeaded(prefix + count, allDSNames)) { while (isDsNameRepeaded(prefix + count)) {
count++; count++;
} }
return prefix + count; return prefix + count;
} }
private boolean isDsNameRepeaded(String name, String[] names) { protected boolean isDsNameRepeaded(String name) {
boolean repeat = false; if (allDSNames == null) {
for (int i = 0; i < names.length; i++) { allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook());
if (ComparatorUtils.equals(name, names[i])) { }
repeat = true; 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) { protected KeyAdapter getTableTreeNodeListener(final UpdateAction editAction, final UpdateAction previewTableDataAction, final UpdateAction removeAction, final TableDataSourceOP op, final TableDataTree dataTree) {

3
designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java

@ -276,13 +276,14 @@ public class TableDataTreePane extends BasicTableDataTreePane {
* @param tableDataSource 数据集 * @param tableDataSource 数据集
*/ */
public void addTableData(String srcName, TableDataSource tableDataSource) { public void addTableData(String srcName, TableDataSource tableDataSource) {
allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook());
DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER); DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER);
TableDataSource tds = tc.getBook(); TableDataSource tds = tc.getBook();
Iterator tdIterator = tableDataSource.getTableDataNameIterator(); Iterator tdIterator = tableDataSource.getTableDataNameIterator();
while (tdIterator.hasNext()) { while (tdIterator.hasNext()) {
String tdName = (String) tdIterator.next(); String tdName = (String) tdIterator.next();
TableData td = tableDataSource.getTableData(tdName); TableData td = tableDataSource.getTableData(tdName);
if (tds.getTableData(tdName) != null) {//如果有同名的就拼上来源名称 if (tds.getTableData(tdName) != null || isDsNameRepeaded(tdName)) {//如果有同名的就拼上来源名称
tdName = srcName + tdName; tdName = srcName + tdName;
} }
int i = 0; int i = 0;

37
designer_base/src/com/fr/design/gui/frpane/TreeSettingPane.java

@ -23,6 +23,7 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.Arrays;
public class TreeSettingPane extends BasicPane implements DataCreatorUI { public class TreeSettingPane extends BasicPane implements DataCreatorUI {
private JTreeControlPane controlPane; private JTreeControlPane controlPane;
@ -133,7 +134,7 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
for (LayerConfig layerConfig : layerConfigList) { for (LayerConfig layerConfig : layerConfigList) {
layerConfigs[i++] = layerConfig; layerConfigs[i++] = layerConfig;
} }
this.layerDataControlPane.populate(new NameObject("tree", layerConfigs)); this.layerDataControlPane.populate(new NameObject("Tree Layer Data", layerConfigs));
} else { } else {
buildBox.setSelectedIndex(2); buildBox.setSelectedIndex(2);
} }
@ -154,10 +155,12 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
if (buildBox.getSelectedIndex() == 1) { if (buildBox.getSelectedIndex() == 1) {
TableDataDictionary dictionary = this.autoBuildPane.update(); TableDataDictionary dictionary = this.autoBuildPane.update();
te.setAutoBuild(true); te.setAutoBuild(true);
te.setLayerBuild(false);
te.setDictionary(dictionary); te.setDictionary(dictionary);
te.setNodeOrDict(dictionary); te.setNodeOrDict(dictionary);
} else if (buildBox.getSelectedIndex() == 2) { } else if (buildBox.getSelectedIndex() == 2) {
te.setAutoBuild(false); te.setAutoBuild(false);
te.setLayerBuild(false);
NameObject no = this.controlPane.update(); NameObject no = this.controlPane.update();
if (no != null) { if (no != null) {
TreeEditor editor = (TreeEditor) no.getObject(); TreeEditor editor = (TreeEditor) no.getObject();
@ -174,6 +177,11 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
te.setNodeOrDict(editor.getTreeNodeAttr()); te.setNodeOrDict(editor.getTreeNodeAttr());
te.setPerformanceFirst(editor.isPerformanceFirst()); te.setPerformanceFirst(editor.isPerformanceFirst());
} }
} else {
LayerConfig[] configs = (LayerConfig[]) layerDataControlPane.update().getObject();
te.setAutoBuild(false);
te.setLayerBuild(true);
te.setLayerConfigs(Arrays.asList(configs));
} }
return te; return te;
} }
@ -206,15 +214,17 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
if (buildBox.getSelectedIndex() == 1) { if (buildBox.getSelectedIndex() == 1) {
TableDataDictionary dictionary = this.autoBuildPane.update(); TableDataDictionary dictionary = this.autoBuildPane.update();
tcb.setAutoBuild(true); tcb.setAutoBuild(true);
tcb.setDictionary(dictionary); tcb.setLayerBuild(false);
tcb.setNodeOrDict(dictionary); tcb.setDictionary(dictionary);
} else if (buildBox.getSelectedIndex() == 2) { tcb.setNodeOrDict(dictionary);
tcb.setAutoBuild(false); } else if (buildBox.getSelectedIndex() == 2) {
NameObject no = this.controlPane.update(); tcb.setAutoBuild(false);
if (no != null) { tcb.setLayerBuild(false);
if (no.getObject() instanceof TreeComboBoxEditor) { NameObject no = this.controlPane.update();
return (TreeComboBoxEditor) no.getObject(); if (no != null) {
} if (no.getObject() instanceof TreeComboBoxEditor) {
return (TreeComboBoxEditor) no.getObject();
}
TreeEditor editor = (TreeEditor) no.getObject(); TreeEditor editor = (TreeEditor) no.getObject();
tcb.setAllowBlank(editor.isAllowBlank()); tcb.setAllowBlank(editor.isAllowBlank());
@ -230,7 +240,12 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
tcb.setNodeOrDict(editor.getTreeNodeAttr()); tcb.setNodeOrDict(editor.getTreeNodeAttr());
tcb.setPerformanceFirst(editor.isPerformanceFirst()); tcb.setPerformanceFirst(editor.isPerformanceFirst());
} }
} }else {
LayerConfig[] configs = (LayerConfig[]) layerDataControlPane.update().getObject();
tcb.setAutoBuild(false);
tcb.setLayerBuild(true);
tcb.setLayerConfigs(Arrays.asList(configs));
}
return tcb; return tcb;
} }

8
designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -29,6 +29,7 @@ public class UIResizableContainer extends JPanel {
private VerticalToolPane verticalToolPane; private VerticalToolPane verticalToolPane;
private int direction; private int direction;
private boolean hasParameterPane;
private static final int MAX_WIDTH = 300; private static final int MAX_WIDTH = 300;
private static final int MIN_WIDTH = 165; private static final int MIN_WIDTH = 165;
@ -89,7 +90,6 @@ public class UIResizableContainer extends JPanel {
add(horizontToolPane); add(horizontToolPane);
add(downPane); add(downPane);
add(verticalToolPane); add(verticalToolPane);
add(parameterPane);
} }
public UIResizableContainer(JComponent upPane, int direction) { public UIResizableContainer(JComponent upPane, int direction) {
@ -102,7 +102,6 @@ public class UIResizableContainer extends JPanel {
setLayout(containerLayout); setLayout(containerLayout);
add(upPane); add(upPane);
add(horizontToolPane); add(horizontToolPane);
add(parameterPane);
} }
@ -141,7 +140,7 @@ public class UIResizableContainer extends JPanel {
* @param height * @param height
*/ */
public void setParameterHeight(int height) { public void setParameterHeight(int height) {
paraHeight = height; paraHeight = hasParameterPane? height : 0;
refreshContainer(); refreshContainer();
} }
@ -274,13 +273,16 @@ public class UIResizableContainer extends JPanel {
public void addParameterPane(JComponent pane) { public void addParameterPane(JComponent pane) {
add(this.parameterPane = pane); add(this.parameterPane = pane);
hasParameterPane = true;
refreshContainer(); refreshContainer();
} }
public void removeParameterPane() { public void removeParameterPane() {
remove(this.parameterPane); remove(this.parameterPane);
setParameterHeight(0); setParameterHeight(0);
hasParameterPane = false;
refreshContainer(); refreshContainer();
} }
/** /**

3
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.XWFitLayout;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.creator.cardlayout.XWCardLayout; import com.fr.design.designer.creator.cardlayout.XWCardLayout;
import com.fr.general.ComparatorUtils;
public class WidgetPropertyTable extends AbstractPropertyTable { public class WidgetPropertyTable extends AbstractPropertyTable {
@ -71,7 +72,7 @@ public class WidgetPropertyTable extends AbstractPropertyTable {
if (size == 0 || size == 1) { if (size == 0 || size == 1) {
XCreator creator = size == 0 ? designer.getRootComponent() : designer.getSelectionModel().getSelection() XCreator creator = size == 0 ? designer.getRootComponent() : designer.getSelectionModel().getSelection()
.getSelectedCreator(); .getSelectedCreator();
if (designer.isRoot(creator)) { if (ComparatorUtils.equals(creator, designer.getRootComponent())) {
groups = designer.getDesignerMode().createRootDesignerPropertyGroup(); groups = designer.getDesignerMode().createRootDesignerPropertyGroup();
} else { } else {
groups = getCreatorPropertyGroup(designer, creator); groups = getCreatorPropertyGroup(designer, creator);

1
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( ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean(
p.getParameterArray() == null ? new Parameter[0] : p.getParameterArray()); p.getParameterArray() == null ? new Parameter[0] : p.getParameterArray());
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance().getPreferredSize().height);
} }

18
designer_form/src/com/fr/design/mainframe/FormDesigner.java

@ -186,14 +186,14 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
public void refreshParameter(){ public void refreshParameter(){
XLayoutContainer rootContainer = this.getParaComponent(); XLayoutContainer rootContainer = this.getParaComponent();
if (rootContainer != null){ if (rootContainer != null){
java.util.List<String> namelist = new ArrayList<String>(); java.util.List<String> namelist = new ArrayList<String>();
rootContainer.getAllXCreatorNameList(rootContainer,namelist); rootContainer.getAllXCreatorNameList(rootContainer,namelist);
// parameterArray是报表的所有参数, nameList是已经在参数面板添加过控件的参数名 // parameterArray是报表的所有参数, nameList是已经在参数面板添加过控件的参数名
// 与已有的参数列表比较 如果已经存在 就除去 // 与已有的参数列表比较 如果已经存在 就除去
Parameter[] ps = getParameterArray(); Parameter[] ps = getParameterArray();
if (ps != null) { if (ps != null) {
removeSame(ps, namelist); removeSame(ps, namelist);
} }
} }
ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean( ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean(
getParameterArray() == null ? new Parameter[0] : getParameterArray()); getParameterArray() == null ? new Parameter[0] : getParameterArray());
@ -853,7 +853,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* @return 是则返回true * @return 是则返回true
*/ */
public boolean isRoot(XCreator comp) { public boolean isRoot(XCreator comp) {
return comp == rootComponent; return comp == rootComponent || comp.acceptType(XWAbsoluteBodyLayout.class);
} }
// 计算鼠标事件e所发生的位置相对根组件的位置关系 // 计算鼠标事件e所发生的位置相对根组件的位置关系

1
designer_form/src/com/fr/design/mainframe/JForm.java

@ -621,6 +621,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
EastRegionContainerPane.getInstance().replaceUpPane(WidgetPropertyPane.getInstance(formDesign)); EastRegionContainerPane.getInstance().replaceUpPane(WidgetPropertyPane.getInstance(formDesign));
EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(formDesign)); EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(formDesign));
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(formDesign).getPreferredSize().height);
if (EastRegionContainerPane.getInstance().getDownPane() == null) { if (EastRegionContainerPane.getInstance().getDownPane() == null) {
new Thread() { new Thread() {
public void run() { public void run() {

25
designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java

@ -124,15 +124,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
} }
componentTree = new ComponentTree(designer); 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<AbstractPropertyTable>(); widgetPropertyTables = new ArrayList<AbstractPropertyTable>();
propertyTable = new WidgetPropertyTable(designer); propertyTable = new WidgetPropertyTable(designer);
designer.addDesignerEditListener(new WidgetPropertyDesignerAdapter(propertyTable)); designer.addDesignerEditListener(new WidgetPropertyDesignerAdapter(propertyTable));
@ -198,22 +189,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
isrefresh = false; 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);
}
// //
/** /**
* 选中的组件是否在参数面板里 * 选中的组件是否在参数面板里

3
designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

@ -33,6 +33,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
private static final int GAP_H = 4; private static final int GAP_H = 4;
private static final int GAP_V = 6; private static final int GAP_V = 6;
private static final int GAP_BV = 4; private static final int GAP_BV = 4;
private static final int WIDTH = 225;
private static final int L_H = 18; private static final int L_H = 18;
@ -140,7 +141,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
} }
public void layoutContainer(Container parent) { public void layoutContainer(Container parent) {
int width = parent.getWidth(); int width = parent.getWidth() == 0 ? WIDTH : parent.getWidth();
int x = 0; int x = 0;
int y = L_H + GAP_H; int y = L_H + GAP_H;

Loading…
Cancel
Save