|
|
@ -1,21 +1,21 @@ |
|
|
|
package com.fr.design.data.datapane; |
|
|
|
package com.fr.design.data.datapane; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.design.data.DesignTableDataManager; |
|
|
|
|
|
|
|
import com.fr.data.impl.RecursionTableData; |
|
|
|
import com.fr.data.impl.RecursionTableData; |
|
|
|
|
|
|
|
import com.fr.design.data.DesignTableDataManager; |
|
|
|
import com.fr.design.data.datapane.preview.PreviewLabel; |
|
|
|
import com.fr.design.data.datapane.preview.PreviewLabel; |
|
|
|
import com.fr.design.data.datapane.preview.PreviewLabel.Previewable; |
|
|
|
import com.fr.design.data.datapane.preview.PreviewLabel.Previewable; |
|
|
|
import com.fr.design.data.datapane.preview.PreviewTablePane; |
|
|
|
import com.fr.design.data.datapane.preview.PreviewTablePane; |
|
|
|
import com.fr.design.data.tabledata.wrapper.TableDataWrapper; |
|
|
|
import com.fr.design.data.tabledata.wrapper.TableDataWrapper; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
|
|
|
import com.fr.design.gui.ibutton.UIRadioButton; |
|
|
|
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.editor.ValueEditorPane; |
|
|
|
import com.fr.design.editor.ValueEditorPane; |
|
|
|
import com.fr.design.editor.ValueEditorPaneFactory; |
|
|
|
import com.fr.design.editor.ValueEditorPaneFactory; |
|
|
|
import com.fr.design.editor.editor.ColumnIndexEditor; |
|
|
|
import com.fr.design.editor.editor.ColumnIndexEditor; |
|
|
|
import com.fr.design.editor.editor.ColumnNameEditor; |
|
|
|
import com.fr.design.editor.editor.ColumnNameEditor; |
|
|
|
import com.fr.design.editor.editor.Editor; |
|
|
|
import com.fr.design.editor.editor.Editor; |
|
|
|
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
|
|
|
import com.fr.design.gui.ibutton.UIRadioButton; |
|
|
|
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.script.Calculator; |
|
|
|
import com.fr.script.Calculator; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
@ -30,270 +30,280 @@ import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
public class TreeTableDataDictPane extends BasicPane implements Previewable { |
|
|
|
public class TreeTableDataDictPane extends BasicPane implements Previewable { |
|
|
|
|
|
|
|
|
|
|
|
private UILabel selectTableDataLabel; |
|
|
|
private UILabel selectTableDataLabel; |
|
|
|
protected TableDataComboBox tableDataNameComboBox; |
|
|
|
protected TableDataComboBox tableDataNameComboBox; |
|
|
|
private UIRadioButton parentMarkRadio; |
|
|
|
private UIRadioButton parentMarkRadio; |
|
|
|
private UIRadioButton lengthMarkRadio; |
|
|
|
private UIRadioButton lengthMarkRadio; |
|
|
|
private ButtonGroup markButtonGroup; |
|
|
|
private ButtonGroup markButtonGroup; |
|
|
|
|
|
|
|
|
|
|
|
UILabel originalMarkedFieldLabel1; |
|
|
|
private UILabel originFieldDependsOnParentLabel; |
|
|
|
UILabel parentMarkedFieldLabel1; |
|
|
|
private UILabel parentFieldLabel; |
|
|
|
UILabel treeDataFieldLabel1; |
|
|
|
private UILabel treeDataFieldLabel1; |
|
|
|
UILabel originalMarkedFieldLabel2; |
|
|
|
private UILabel originFieldDependsOnLengthLabel; |
|
|
|
UILabel treeDataFieldLabel2; |
|
|
|
private UILabel treeDataFieldLabel2; |
|
|
|
|
|
|
|
|
|
|
|
private ValueEditorPane originalMarkedFieldPane1; |
|
|
|
private ValueEditorPane originFieldDependsOnParentPane; |
|
|
|
private ValueEditorPane parentMarkedFieldPane1; |
|
|
|
private ValueEditorPane parentFieldPane; |
|
|
|
private ValueEditorPane originalMarkedFieldPane2; |
|
|
|
private ValueEditorPane originFieldDependsOnLengthPane; |
|
|
|
|
|
|
|
|
|
|
|
public TreeTableDataDictPane(){ |
|
|
|
public TreeTableDataDictPane() { |
|
|
|
this(StringUtils.EMPTY); |
|
|
|
this(StringUtils.EMPTY); |
|
|
|
} |
|
|
|
} |
|
|
|
public TreeTableDataDictPane(String treeName) { |
|
|
|
|
|
|
|
this.setLayout(new BorderLayout(5,30)); |
|
|
|
|
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(20, 20, 0, 0)); |
|
|
|
|
|
|
|
selectTableDataLabel = new UILabel(Inter.getLocText(new String[]{"Please_Select","Single", "DS-TableData"}) + " :"); |
|
|
|
|
|
|
|
setTableDataNameComboBox(treeName); |
|
|
|
|
|
|
|
tableDataNameComboBox.setPreferredSize(new Dimension(180, 20)); |
|
|
|
|
|
|
|
JPanel tableFlowPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); |
|
|
|
|
|
|
|
tableFlowPane.add(selectTableDataLabel); |
|
|
|
|
|
|
|
tableFlowPane.add(tableDataNameComboBox); |
|
|
|
|
|
|
|
tableDataNameComboBox.addItemListener(new ItemListener(){ |
|
|
|
|
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
|
|
|
tdChange(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
tableFlowPane.add(new PreviewLabel(this)); |
|
|
|
|
|
|
|
this.add(tableFlowPane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
|
|
|
this.add(centerPane,BorderLayout.CENTER); |
|
|
|
|
|
|
|
parentMarkRadio = new UIRadioButton(Inter.getLocText("Build_Tree_Accord_Parent_Marked_Filed"), true); |
|
|
|
|
|
|
|
lengthMarkRadio = new UIRadioButton(Inter.getLocText("Build_Tree_Accord_Marked_Filed_Length")); |
|
|
|
|
|
|
|
parentMarkRadio.addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
if(isBuildByParentFiled()) { |
|
|
|
|
|
|
|
makeParentEnable(); |
|
|
|
|
|
|
|
tdChange(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
lengthMarkRadio.addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
if(!isBuildByParentFiled()) { |
|
|
|
|
|
|
|
makeLengthEnable(); |
|
|
|
|
|
|
|
tdChange(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
markButtonGroup = new ButtonGroup(); |
|
|
|
|
|
|
|
markButtonGroup.add(parentMarkRadio); |
|
|
|
|
|
|
|
markButtonGroup.add(lengthMarkRadio); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
originalMarkedFieldLabel1 = new UILabel(Inter.getLocText("Original_Marked_Filed") + " :", SwingConstants.RIGHT); |
|
|
|
public TreeTableDataDictPane(String treeName) { |
|
|
|
parentMarkedFieldLabel1 = new UILabel(" " + Inter.getLocText("Parent_Marked_Field") + " :", SwingConstants.RIGHT); |
|
|
|
this.setLayout(new BorderLayout(5, 30)); |
|
|
|
treeDataFieldLabel1 = new UILabel(" " + Inter.getLocText("Tree_Data_Field") + " :", SwingConstants.RIGHT); |
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(20, 20, 0, 0)); |
|
|
|
originalMarkedFieldLabel2 = new UILabel(Inter.getLocText("Original_Marked_Filed") + " :", SwingConstants.RIGHT); |
|
|
|
selectTableDataLabel = new UILabel(Inter.getLocText(new String[]{"Please_Select", "Single", "DS-TableData"}) + " :"); |
|
|
|
treeDataFieldLabel2 = new UILabel(" " + Inter.getLocText("Tree_Data_Field") + " :", SwingConstants.RIGHT); |
|
|
|
setTableDataNameComboBox(treeName); |
|
|
|
|
|
|
|
tableDataNameComboBox.setPreferredSize(new Dimension(180, 20)); |
|
|
|
|
|
|
|
JPanel tableFlowPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); |
|
|
|
|
|
|
|
tableFlowPane.add(selectTableDataLabel); |
|
|
|
|
|
|
|
tableFlowPane.add(tableDataNameComboBox); |
|
|
|
|
|
|
|
tableDataNameComboBox.addItemListener(new ItemListener() { |
|
|
|
|
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
|
|
|
tdChange(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
tableFlowPane.add(new PreviewLabel(this)); |
|
|
|
|
|
|
|
this.add(tableFlowPane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
|
|
|
this.add(centerPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
parentMarkRadio = new UIRadioButton(Inter.getLocText("FR-Designer_Build_Tree_Accord_Parent_Marked_Filed"), true); |
|
|
|
|
|
|
|
lengthMarkRadio = new UIRadioButton(Inter.getLocText("FR-Designer_Build_Tree_Accord_Marked_Filed_Length")); |
|
|
|
|
|
|
|
parentMarkRadio.addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
if (isBuildByParentFiled()) { |
|
|
|
|
|
|
|
makeParentEnable(); |
|
|
|
|
|
|
|
tdChange(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
lengthMarkRadio.addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
if (!isBuildByParentFiled()) { |
|
|
|
|
|
|
|
makeLengthEnable(); |
|
|
|
|
|
|
|
tdChange(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
markButtonGroup = new ButtonGroup(); |
|
|
|
|
|
|
|
markButtonGroup.add(parentMarkRadio); |
|
|
|
|
|
|
|
markButtonGroup.add(lengthMarkRadio); |
|
|
|
|
|
|
|
|
|
|
|
// originalMarkedFieldPane1 = ValueEditorPaneFactory.createValueEditorPane(new Editor[] {new OldColumnIndexEditor(Inter.getLocText("Columns"))});
|
|
|
|
originFieldDependsOnParentLabel = new UILabel(Inter.getLocText("FR-Designer_Original_Marked_Filed") + " :", SwingConstants.RIGHT); |
|
|
|
// parentMarkedFieldPane1 = ValueEditorPaneFactory.createValueEditorPane(new Editor[] {new OldColumnIndexEditor(Inter.getLocText("Columns"))});
|
|
|
|
parentFieldLabel = new UILabel(" " + Inter.getLocText("FR-Designer_Parent_Marked_Field") + " :", SwingConstants.RIGHT); |
|
|
|
// originalMarkedFieldPane2 = ValueEditorPaneFactory.createValueEditorPane(new Editor[] {new OldColumnIndexEditor(Inter.getLocText("Columns"))});
|
|
|
|
treeDataFieldLabel1 = new UILabel(" " + Inter.getLocText("FR-Designer_Tree_Data_Field") + " :", SwingConstants.RIGHT); |
|
|
|
originalMarkedFieldPane1 = ValueEditorPaneFactory.createValueEditorPane(new Editor[] { new ColumnNameEditor(), new ColumnIndexEditor() }); |
|
|
|
originFieldDependsOnLengthLabel = new UILabel(Inter.getLocText("FR-Designer_Original_Marked_Filed") + " :", SwingConstants.RIGHT); |
|
|
|
parentMarkedFieldPane1 = ValueEditorPaneFactory.createValueEditorPane(new Editor[] { new ColumnNameEditor(), new ColumnIndexEditor() }); |
|
|
|
treeDataFieldLabel2 = new UILabel(" " + Inter.getLocText("FR-Designer_Tree_Data_Field") + " :", SwingConstants.RIGHT); |
|
|
|
originalMarkedFieldPane2 = ValueEditorPaneFactory.createValueEditorPane(new Editor[] { new ColumnNameEditor(), new ColumnIndexEditor() }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
makeParentEnable(); |
|
|
|
// originFieldDependsOnParentPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[] {new OldColumnIndexEditor(Inter.getLocText("Columns"))});
|
|
|
|
|
|
|
|
// parentFieldPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[] {new OldColumnIndexEditor(Inter.getLocText("Columns"))});
|
|
|
|
|
|
|
|
// originFieldDependsOnLengthPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[] {new OldColumnIndexEditor(Inter.getLocText("Columns"))});
|
|
|
|
|
|
|
|
originFieldDependsOnParentPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}); |
|
|
|
|
|
|
|
parentFieldPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}); |
|
|
|
|
|
|
|
originFieldDependsOnLengthPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}); |
|
|
|
|
|
|
|
|
|
|
|
JPanel p1 = createCenterFlowZeroGapBorderPane(originalMarkedFieldLabel1, originalMarkedFieldPane1); |
|
|
|
makeParentEnable(); |
|
|
|
JPanel p2 = createCenterFlowZeroGapBorderPane(parentMarkedFieldLabel1, parentMarkedFieldPane1); |
|
|
|
|
|
|
|
JPanel border1 = new JPanel(); |
|
|
|
|
|
|
|
border1.setLayout(new BorderLayout(0, 10)); |
|
|
|
|
|
|
|
border1.add(p1, BorderLayout.NORTH); |
|
|
|
|
|
|
|
border1.add(p2, BorderLayout.CENTER); |
|
|
|
|
|
|
|
JPanel p4 = createCenterFlowZeroGapBorderPane(originalMarkedFieldLabel2, originalMarkedFieldPane2); |
|
|
|
|
|
|
|
JPanel border2 = new JPanel(); |
|
|
|
|
|
|
|
border2.setLayout(new BorderLayout(0, 20)); |
|
|
|
|
|
|
|
border2.add(p4, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel xx = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
JPanel p1 = createCenterFlowZeroGapBorderPane(originFieldDependsOnParentLabel, originFieldDependsOnParentPane); |
|
|
|
xx.add(parentMarkRadio,BorderLayout.NORTH); |
|
|
|
JPanel p2 = createCenterFlowZeroGapBorderPane(parentFieldLabel, parentFieldPane); |
|
|
|
xx.add(border1,BorderLayout.CENTER); |
|
|
|
JPanel border1 = new JPanel(); |
|
|
|
JPanel xxx = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
border1.setLayout(new BorderLayout(0, 10)); |
|
|
|
xxx.add(lengthMarkRadio,BorderLayout.NORTH); |
|
|
|
border1.add(p1, BorderLayout.NORTH); |
|
|
|
xxx.add(border2,BorderLayout.CENTER); |
|
|
|
border1.add(p2, BorderLayout.CENTER); |
|
|
|
JPanel buildTreePanel = new JPanel(new BorderLayout(5, 30)); |
|
|
|
JPanel p4 = createCenterFlowZeroGapBorderPane(originFieldDependsOnLengthLabel, originFieldDependsOnLengthPane); |
|
|
|
buildTreePanel.add(xx,BorderLayout.NORTH); |
|
|
|
JPanel border2 = new JPanel(); |
|
|
|
buildTreePanel.add(xxx,BorderLayout.CENTER); |
|
|
|
border2.setLayout(new BorderLayout(0, 20)); |
|
|
|
centerPane.add(buildTreePanel, BorderLayout.NORTH); |
|
|
|
border2.add(p4, BorderLayout.NORTH); |
|
|
|
JPanel previewPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); |
|
|
|
|
|
|
|
UIButton treeDataPreviewButton = new UIButton(Inter.getLocText("Preview")); |
|
|
|
JPanel xx = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
previewPanel.add(treeDataPreviewButton); |
|
|
|
xx.add(parentMarkRadio, BorderLayout.NORTH); |
|
|
|
treeDataPreviewButton.addActionListener(new ActionListener() { |
|
|
|
xx.add(border1, BorderLayout.CENTER); |
|
|
|
@Override |
|
|
|
JPanel xxx = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
xxx.add(lengthMarkRadio, BorderLayout.NORTH); |
|
|
|
TableDataWrapper tableDataWrappe = tableDataNameComboBox.getSelectedItem(); |
|
|
|
xxx.add(border2, BorderLayout.CENTER); |
|
|
|
if(tableDataWrappe == null) { |
|
|
|
JPanel buildTreePanel = new JPanel(new BorderLayout(5, 30)); |
|
|
|
return; |
|
|
|
buildTreePanel.add(xx, BorderLayout.NORTH); |
|
|
|
} |
|
|
|
buildTreePanel.add(xxx, BorderLayout.CENTER); |
|
|
|
RecursionTableData rtd = new RecursionTableData(); |
|
|
|
centerPane.add(buildTreePanel, BorderLayout.NORTH); |
|
|
|
rtd.setOriginalTableDataName(tableDataWrappe.getTableDataName()); |
|
|
|
JPanel previewPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); |
|
|
|
if(isBuildByParentFiled()) { |
|
|
|
UIButton treeDataPreviewButton = new UIButton(Inter.getLocText("FR-Designer_Preview")); |
|
|
|
rtd.setMarkFields((Integer.parseInt(originalMarkedFieldPane1.update().toString()) - 1) + ""); |
|
|
|
previewPanel.add(treeDataPreviewButton); |
|
|
|
rtd.setParentmarkFields(Integer.parseInt(parentMarkedFieldPane1.update().toString()) - 1 + ""); |
|
|
|
treeDataPreviewButton.addActionListener(new ActionListener() { |
|
|
|
} else { |
|
|
|
@Override |
|
|
|
rtd.setMarkFields(Integer.parseInt(originalMarkedFieldPane2.update().toString()) - 1 + ""); |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
rtd.setParentmarkFields("-1"); |
|
|
|
TableDataWrapper tableDataWrappe = tableDataNameComboBox.getSelectedItem(); |
|
|
|
} |
|
|
|
if (tableDataWrappe == null) { |
|
|
|
rtd.setTableDataSource(DesignTableDataManager.getEditingTableDataSource()); |
|
|
|
return; |
|
|
|
rtd.createDataModel(Calculator.createCalculator()); |
|
|
|
} |
|
|
|
PreviewTablePane.previewTableData(rtd); |
|
|
|
RecursionTableData rtd = new RecursionTableData(); |
|
|
|
} |
|
|
|
rtd.setOriginalTableDataName(tableDataWrappe.getTableDataName()); |
|
|
|
}); |
|
|
|
if (isBuildByParentFiled()) { |
|
|
|
centerPane.add(previewPanel, BorderLayout.CENTER); |
|
|
|
Object o = parentFieldPane.update(); |
|
|
|
} |
|
|
|
rtd.setParentmarkFields((Integer) o - 1 + ""); |
|
|
|
|
|
|
|
rtd.setParentmarkFieldName("" + o); |
|
|
|
|
|
|
|
Object o2 = originFieldDependsOnParentPane.update(); |
|
|
|
|
|
|
|
rtd.setMarkFields((Integer) o2 - 1 + ""); |
|
|
|
|
|
|
|
rtd.setMarkFieldName("" + o2); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
Object o = originFieldDependsOnLengthPane.update(); |
|
|
|
|
|
|
|
if (o == null) { |
|
|
|
|
|
|
|
rtd.setMarkFields("-1"); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
rtd.setMarkFields((Integer) o - 1 + ""); |
|
|
|
|
|
|
|
rtd.setMarkFieldName("" + o); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
rtd.setTableDataSource(DesignTableDataManager.getEditingTableDataSource()); |
|
|
|
|
|
|
|
rtd.createDataModel(Calculator.createCalculator()); |
|
|
|
|
|
|
|
PreviewTablePane.previewTableData(rtd); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
centerPane.add(previewPanel, BorderLayout.CENTER); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void setTableDataNameComboBox(String treeName) { |
|
|
|
protected void setTableDataNameComboBox(String treeName) { |
|
|
|
tableDataNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource(),treeName); |
|
|
|
tableDataNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource(), treeName); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void tdChange(){ |
|
|
|
private void tdChange() { |
|
|
|
TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem(); |
|
|
|
TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem(); |
|
|
|
if (tableDataWrappe == null) { |
|
|
|
if (tableDataWrappe == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
ValueEditorPane[] valueEditorPanes; |
|
|
|
ValueEditorPane[] valueEditorPanes; |
|
|
|
if(isBuildByParentFiled()) { |
|
|
|
if (isBuildByParentFiled()) { |
|
|
|
valueEditorPanes = new ValueEditorPane[]{originalMarkedFieldPane1, parentMarkedFieldPane1}; |
|
|
|
valueEditorPanes = new ValueEditorPane[]{originFieldDependsOnParentPane, parentFieldPane}; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
valueEditorPanes = new ValueEditorPane[]{originalMarkedFieldPane2}; |
|
|
|
valueEditorPanes = new ValueEditorPane[]{originFieldDependsOnLengthPane}; |
|
|
|
} |
|
|
|
} |
|
|
|
try { |
|
|
|
try { |
|
|
|
List<String> namelist = tableDataWrappe.calculateColumnNameList(); |
|
|
|
List<String> namelist = tableDataWrappe.calculateColumnNameList(); |
|
|
|
int len = namelist.size(); |
|
|
|
int len = namelist.size(); |
|
|
|
String[] columnNames = new String[len]; |
|
|
|
String[] columnNames = new String[len]; |
|
|
|
namelist.toArray(columnNames); |
|
|
|
namelist.toArray(columnNames); |
|
|
|
for(int i = 0; i < valueEditorPanes.length; i ++) { |
|
|
|
for (int i = 0; i < valueEditorPanes.length; i++) { |
|
|
|
valueEditorPanes[i].setEditors(new Editor[] { new ColumnNameEditor(columnNames), new ColumnIndexEditor(len) }, columnNames[0]); |
|
|
|
valueEditorPanes[i].setEditors(new Editor[]{new ColumnNameEditor(columnNames), new ColumnIndexEditor(len)}, columnNames[0]); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
for(int i = 0; i < valueEditorPanes.length; i ++) { |
|
|
|
for (int i = 0; i < valueEditorPanes.length; i++) { |
|
|
|
valueEditorPanes[i].setEditors(new Editor[] { new ColumnNameEditor(), new ColumnIndexEditor() }, 1); |
|
|
|
valueEditorPanes[i].setEditors(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
valueEditorPanes = null; |
|
|
|
valueEditorPanes = null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected String title4PopupWindow() { |
|
|
|
protected String title4PopupWindow() { |
|
|
|
return "TreeTableDataDictionay"; |
|
|
|
return "TreeTableDataDictionay"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public RecursionTableData update() { |
|
|
|
public RecursionTableData update() { |
|
|
|
RecursionTableData td = new RecursionTableData(); |
|
|
|
RecursionTableData td = new RecursionTableData(); |
|
|
|
if(tableDataNameComboBox.getSelectedItem()==null){ |
|
|
|
if (tableDataNameComboBox.getSelectedItem() == null) { |
|
|
|
td.setOriginalTableDataName(null); |
|
|
|
td.setOriginalTableDataName(null); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
td.setOriginalTableDataName(tableDataNameComboBox.getSelectedItem().getTableDataName()); |
|
|
|
td.setOriginalTableDataName(tableDataNameComboBox.getSelectedItem().getTableDataName()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(isBuildByParentFiled()) { |
|
|
|
if (isBuildByParentFiled()) { |
|
|
|
Object o = parentMarkedFieldPane1.update(StringUtils.EMPTY); |
|
|
|
Object o = parentFieldPane.update(StringUtils.EMPTY); |
|
|
|
if(o instanceof Object[]){ |
|
|
|
if (o instanceof Object[]) { |
|
|
|
Object[] temp = (Object[]) o; |
|
|
|
Object[] temp = (Object[]) o; |
|
|
|
td.setParentmarkFields(((Integer)temp[0]).intValue() - 1 + ""); |
|
|
|
td.setParentmarkFields((Integer) temp[0] - 1 + ""); |
|
|
|
td.setParentmarkFieldName((String) temp[1]); |
|
|
|
td.setParentmarkFieldName((String) temp[1]); |
|
|
|
} |
|
|
|
} |
|
|
|
Object o2 = originalMarkedFieldPane1.update(StringUtils.EMPTY); |
|
|
|
Object o2 = originFieldDependsOnParentPane.update(StringUtils.EMPTY); |
|
|
|
if(o2 instanceof Object[]){ |
|
|
|
if (o2 instanceof Object[]) { |
|
|
|
Object[] temp = (Object[]) o2; |
|
|
|
Object[] temp = (Object[]) o2; |
|
|
|
td.setMarkFields(((Integer)temp[0]).intValue() - 1 + ""); |
|
|
|
td.setMarkFields((Integer) temp[0] - 1 + ""); |
|
|
|
td.setMarkFieldName((String) temp[1]); |
|
|
|
td.setMarkFieldName((String) temp[1]); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Object o = originalMarkedFieldPane2.update(StringUtils.EMPTY); |
|
|
|
Object o = originFieldDependsOnLengthPane.update(StringUtils.EMPTY); |
|
|
|
if(o == null || !(o instanceof Object[])){ |
|
|
|
if (o == null || !(o instanceof Object[])) { |
|
|
|
td.setMarkFields("-1"); |
|
|
|
td.setMarkFields("-1"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Object[] temp = (Object[]) o; |
|
|
|
Object[] temp = (Object[]) o; |
|
|
|
td.setMarkFields(((Integer)temp[0]).intValue() - 1 + ""); |
|
|
|
td.setMarkFields((Integer) temp[0] - 1 + ""); |
|
|
|
td.setMarkFieldName((String) temp[1]); |
|
|
|
td.setMarkFieldName((String) temp[1]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
td.setTableDataSource(DesignTableDataManager.getEditingTableDataSource()); |
|
|
|
td.setTableDataSource(DesignTableDataManager.getEditingTableDataSource()); |
|
|
|
return td; |
|
|
|
return td; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void populate(RecursionTableData rtb) { |
|
|
|
public void populate(RecursionTableData rtb) { |
|
|
|
if(StringUtils.isNotEmpty(rtb.getParentmarkFields())) { |
|
|
|
if (StringUtils.isNotEmpty(rtb.getParentmarkFields())) { |
|
|
|
makeParentEnable(); |
|
|
|
makeParentEnable(); |
|
|
|
parentMarkRadio.setSelected(true); |
|
|
|
parentMarkRadio.setSelected(true); |
|
|
|
lengthMarkRadio.setSelected(false); |
|
|
|
lengthMarkRadio.setSelected(false); |
|
|
|
tableDataNameComboBox.setSelectedTableDataByName(rtb.getOriginalTableDataName()); |
|
|
|
tableDataNameComboBox.setSelectedTableDataByName(rtb.getOriginalTableDataName()); |
|
|
|
if(StringUtils.isNotEmpty(rtb.getMarkFieldName())){ |
|
|
|
if (StringUtils.isNotEmpty(rtb.getMarkFieldName())) { |
|
|
|
originalMarkedFieldPane1.populate(rtb.getMarkFieldName()); |
|
|
|
originFieldDependsOnParentPane.populate(rtb.getMarkFieldName()); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
originalMarkedFieldPane1.populate(rtb.getMarkFieldIndex() + 1); |
|
|
|
originFieldDependsOnParentPane.populate(rtb.getMarkFieldIndex() + 1); |
|
|
|
} |
|
|
|
} |
|
|
|
if(StringUtils.isNotEmpty(rtb.getParentmarkFieldName())){ |
|
|
|
if (StringUtils.isNotEmpty(rtb.getParentmarkFieldName())) { |
|
|
|
parentMarkedFieldPane1.populate(rtb.getParentmarkFieldName()); |
|
|
|
parentFieldPane.populate(rtb.getParentmarkFieldName()); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
parentMarkedFieldPane1.populate(rtb.getParentmarkFieldIndex() + 1); |
|
|
|
parentFieldPane.populate(rtb.getParentmarkFieldIndex() + 1); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
makeLengthEnable(); |
|
|
|
makeLengthEnable(); |
|
|
|
lengthMarkRadio.setSelected(true); |
|
|
|
lengthMarkRadio.setSelected(true); |
|
|
|
parentMarkRadio.setSelected(false); |
|
|
|
parentMarkRadio.setSelected(false); |
|
|
|
tableDataNameComboBox.setSelectedTableDataByName(rtb.getOriginalTableDataName()); |
|
|
|
tableDataNameComboBox.setSelectedTableDataByName(rtb.getOriginalTableDataName()); |
|
|
|
if(StringUtils.isNotEmpty(rtb.getMarkFieldName())){ |
|
|
|
if (StringUtils.isNotEmpty(rtb.getMarkFieldName())) { |
|
|
|
originalMarkedFieldPane2.populate(rtb.getMarkFieldName()); |
|
|
|
originFieldDependsOnLengthPane.populate(rtb.getMarkFieldName()); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
originalMarkedFieldPane2.populate(rtb.getMarkFieldIndex() + 1); |
|
|
|
originFieldDependsOnLengthPane.populate(rtb.getMarkFieldIndex() + 1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* |
|
|
|
* |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void preview() { |
|
|
|
public void preview() { |
|
|
|
TableDataWrapper tableDataWrappe = tableDataNameComboBox.getSelectedItem(); |
|
|
|
TableDataWrapper tableDataWrappe = tableDataNameComboBox.getSelectedItem(); |
|
|
|
if (tableDataWrappe == null) { |
|
|
|
if (tableDataWrappe == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
tableDataWrappe.previewData(); |
|
|
|
tableDataWrappe.previewData(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createCenterFlowZeroGapBorderPane(Component p1, Component p2) { |
|
|
|
private JPanel createCenterFlowZeroGapBorderPane(Component p1, Component p2) { |
|
|
|
JPanel p = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
JPanel p = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
p.add(p1); |
|
|
|
p.add(p1); |
|
|
|
p.add(p2); |
|
|
|
p.add(p2); |
|
|
|
return p; |
|
|
|
return p; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private boolean isBuildByParentFiled() { |
|
|
|
private boolean isBuildByParentFiled() { |
|
|
|
return parentMarkRadio.isSelected(); |
|
|
|
return parentMarkRadio.isSelected(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void makeParentEnable() { |
|
|
|
private void makeParentEnable() { |
|
|
|
originalMarkedFieldPane1.setEnabled(true); |
|
|
|
originFieldDependsOnParentPane.setEnabled(true); |
|
|
|
parentMarkedFieldPane1.setEnabled(true); |
|
|
|
parentFieldPane.setEnabled(true); |
|
|
|
originalMarkedFieldLabel1.setEnabled(true); |
|
|
|
originFieldDependsOnParentLabel.setEnabled(true); |
|
|
|
parentMarkedFieldLabel1.setEnabled(true); |
|
|
|
parentFieldLabel.setEnabled(true); |
|
|
|
treeDataFieldLabel1.setEnabled(true); |
|
|
|
treeDataFieldLabel1.setEnabled(true); |
|
|
|
originalMarkedFieldLabel2.setEnabled(false); |
|
|
|
originFieldDependsOnLengthLabel.setEnabled(false); |
|
|
|
treeDataFieldLabel2.setEnabled(false); |
|
|
|
treeDataFieldLabel2.setEnabled(false); |
|
|
|
originalMarkedFieldPane2.setEnabled(false); |
|
|
|
originFieldDependsOnLengthPane.setEnabled(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void makeLengthEnable() { |
|
|
|
private void makeLengthEnable() { |
|
|
|
originalMarkedFieldPane1.setEnabled(false); |
|
|
|
originFieldDependsOnParentPane.setEnabled(false); |
|
|
|
parentMarkedFieldPane1.setEnabled(false); |
|
|
|
parentFieldPane.setEnabled(false); |
|
|
|
originalMarkedFieldLabel1.setEnabled(false); |
|
|
|
originFieldDependsOnParentLabel.setEnabled(false); |
|
|
|
parentMarkedFieldLabel1.setEnabled(false); |
|
|
|
parentFieldLabel.setEnabled(false); |
|
|
|
treeDataFieldLabel1.setEnabled(false); |
|
|
|
treeDataFieldLabel1.setEnabled(false); |
|
|
|
originalMarkedFieldLabel2.setEnabled(true); |
|
|
|
originFieldDependsOnLengthLabel.setEnabled(true); |
|
|
|
treeDataFieldLabel2.setEnabled(true); |
|
|
|
treeDataFieldLabel2.setEnabled(true); |
|
|
|
originalMarkedFieldPane2.setEnabled(true); |
|
|
|
originFieldDependsOnLengthPane.setEnabled(true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |