田源
2024-03-07 4b4083fd73dc27ece42f4835483565eef0e4f608
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
package com.vci.client.uif.engine.client.compare.dialog.treenode;
 
import java.util.List;
import java.util.Map;
import java.util.Set;
 
import javax.swing.tree.DefaultMutableTreeNode;
 
import com.vci.client.uif.engine.client.compare.enumeration.CompareState;
 
/**
 * Compare树节点对象接口
 * @author VCI-STGK006
 *
 */
public interface TreeNodeObject {
    
    /**
     * 主对象
     */
    public final static int MAINOBJECT = 0;
    
    /**
     * 关系对象
     */
    public final static int RELATIONOBJECT = 1;
    
    /**
     * 得到主对象或关系对象所有属性
     */
    public Map<String, String> attributes(int type);
    
    /**
     * 得到主对象或关系对象属性
     * 
     * @param key
     * @return
     */
    public String getAttribute(String key, int type);
    
    /**
     * 是否是根节点
     * 1、控制树节点显示
     * @return
     */
    public boolean isRoot();
    
    /**
     * 得到节点对象标识
     * @return
     */
    public String getKey();
    
    /**
     * 返回主对象
     * @return
     */
    public Object getMainObject();
    
    /**
     * 得到主对象标识
     * @return 不存在时返回 null
     */
    public String getMainObjectKey();
    
    /**
     * 返回关系对象
     * @return 不存在时返回 null
     */
    public Object getRelationObject();
    
    /**
     * 得到关系对象标识
     * @return
     */
    public String getRelationObjectKey();
    
    /**
     * 得到节点比较状态
     * 1、控制树节点的显示
     * @return
     */
    public CompareState getCompareState();
    
    /**
     * 设置节点的比较状态
     * @param cs
     */
    public void setCompareState(CompareState cs);
 
    /**
     * 设置对象所属树节点
     * @param dmtn
     */
    public void setOwnedTreeNode(DefaultMutableTreeNode dmtn);
    
    /**
     * 得到所有使用当前对象的树节点
     * @return
     */
    public Set<DefaultMutableTreeNode> getOwnedTreeNode();
    
    /**
     * 删除所属树节点
     * @param dmtn
     */
    public void removeOwnedTreeNode(DefaultMutableTreeNode dmtn);
    
    /**
     * 与当前节点对应的节点
     * @param tno
     * @return
     */
    public void setRelativeTreeNodeObject(TreeNodeObject tno);
    
    /**
     * 设置当前节点的子节点
     * @param tno
     */
    public void setChildNodeList(TreeNodeObject tno);
    
    /**
     * 移除当前节点的子节点对象
     * @param tno
     */
    public void removeChildNode(TreeNodeObject tno);
    
    /**
     * 得到当前节点的子几点对象
     * @return
     */
    public List<TreeNodeObject> getChildNodeList();
}