Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/bdgp/apps/dagedit/datamodel/TermRelationshipHistoryItem.java


1   package org.bdgp.apps.dagedit.datamodel;
2   
3   import java.util.*;
4   import javax.swing.tree.*;
5   
6   public class TermRelationshipHistoryItem extends HistoryItem {
7   
8       Vector rels;
9       TermRelationshipType relType;
10  
11      public TermRelationshipHistoryItem(Vector rels) {
12    this(rels, null);
13      }
14  
15      public TermRelationshipHistoryItem(Vector rels, TermRelationshipType relType) {
16    this.rels = rels;
17    this.target = null;
18    this.type = REL_CHANGE;
19    setRelType(relType);
20      }
21  
22      public TermRelationshipHistoryItem(TreePath [] paths) {
23    this(paths, null);
24      }
25  
26      public TermRelationshipHistoryItem(TreePath [] paths, TermRelationshipType relType) {
27    this(new Vector(), relType);
28    for(int i=0; i < paths.length; i++) {
29        TermRelationship tr = (TermRelationship) paths[i].
30      getLastPathComponent();
31        tr = (TermRelationship) tr.clone();      
32        rels.addElement(tr);
33    }
34      }
35  
36      public Vector getTouchedNodes() {
37    return new Vector();
38      }
39  
40      public void setRelType(TermRelationshipType type) {
41    relType = type;
42      }
43  
44      public TermRelationshipType getRelationshipType() {
45    return relType;
46      }
47  
48      public Vector getRelationships() {
49    return rels;
50      }
51  
52      public String toString() {
53    if (rels.size() == 1)
54        return "Changed relationship of "+rels.elementAt(0)+" to "+relType;
55    else
56        return "Changed relationships of multiple terms to "+relType;
57      }
58  }