Mercurial > hg > graal-compiler
comparison src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/GraphDocument.java @ 4373:e5cc2440f034
Fixed multi-threading issue when changing the model. Fixed regression in folder node deletion.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Fri, 27 Jan 2012 20:36:54 +0100 |
parents | 2e66f6fd4bc9 |
children | c1524c0d538f |
comparison
equal
deleted
inserted
replaced
4372:2e66f6fd4bc9 | 4373:e5cc2440f034 |
---|---|
35 | 35 |
36 private List<FolderElement> elements; | 36 private List<FolderElement> elements; |
37 private ChangedEvent<GraphDocument> changedEvent; | 37 private ChangedEvent<GraphDocument> changedEvent; |
38 | 38 |
39 public GraphDocument() { | 39 public GraphDocument() { |
40 elements = new ArrayList<FolderElement>(); | 40 elements = new ArrayList<>(); |
41 changedEvent = new ChangedEvent<GraphDocument>(this); | 41 changedEvent = new ChangedEvent<>(this); |
42 } | 42 } |
43 | 43 |
44 public void clear() { | 44 public void clear() { |
45 elements.clear(); | 45 elements.clear(); |
46 getChangedEvent().fire(); | 46 getChangedEvent().fire(); |
50 return changedEvent; | 50 return changedEvent; |
51 } | 51 } |
52 | 52 |
53 public void addGraphDocument(GraphDocument document) { | 53 public void addGraphDocument(GraphDocument document) { |
54 for (FolderElement e : document.elements) { | 54 for (FolderElement e : document.elements) { |
55 e.setParent(this); | |
55 this.addElement(e); | 56 this.addElement(e); |
56 } | 57 } |
57 document.clear(); | 58 document.clear(); |
58 getChangedEvent().fire(); | 59 getChangedEvent().fire(); |
59 } | 60 } |
60 | 61 |
61 @Override | 62 @Override |
62 public String toString() { | 63 public String toString() { |
63 StringBuilder sb = new StringBuilder(); | 64 StringBuilder sb = new StringBuilder(); |
64 | 65 |
65 sb.append("GraphDocument: " + getProperties().toString() + " \n\n"); | 66 sb.append("GraphDocument: ").append(getProperties().toString()).append(" \n\n"); |
66 for (FolderElement g : getElements()) { | 67 for (FolderElement g : getElements()) { |
67 sb.append(g.toString()); | 68 sb.append(g.toString()); |
68 sb.append("\n\n"); | 69 sb.append("\n\n"); |
69 } | 70 } |
70 | 71 |