@@ -46,7 +46,7 @@ public abstract class Graph
46
46
private transient ArrayList <Edge > aEdgesToBeRemoved ;
47
47
private transient boolean aNeedsLayout ;
48
48
private transient Rectangle2D aMinBounds ;
49
- private GraphModificationListener aModListener ;
49
+ protected GraphModificationListener aModListener ;
50
50
51
51
/**
52
52
* Constructs a graph with no nodes or edges.
@@ -126,8 +126,6 @@ public boolean add(Node pNode, Point2D pPoint)
126
126
boolean accepted = false ;
127
127
/* A variable commented out during testing. @JoelChev */
128
128
//boolean insideANode = false;
129
- aModListener .startCompoundListening ();
130
- aModListener .nodeAdded (this , pNode );
131
129
for (int i = aNodes .size () - 1 ; i >= 0 && !accepted ; i --)
132
130
{
133
131
Node parent = aNodes .get (i );
@@ -144,7 +142,7 @@ public boolean add(Node pNode, Point2D pPoint)
144
142
// System.out.println("FALSE!");
145
143
// return false;
146
144
// }
147
- aModListener .endCompoundListening ( );
145
+ aModListener .nodeAdded ( this , pNode );
148
146
aNodes .add (pNode );
149
147
aNeedsLayout = true ;
150
148
return true ;
@@ -239,7 +237,6 @@ public void removeNode(Node pNode)
239
237
}
240
238
aModListener .startCompoundListening ();
241
239
aNodesToBeRemoved .add (pNode );
242
- aModListener .nodeRemoved (this , pNode );
243
240
// notify nodes of removals
244
241
for (int i = 0 ; i < aNodes .size (); i ++)
245
242
{
@@ -263,6 +260,7 @@ public void removeNode(Node pNode)
263
260
{
264
261
removeNode (childNode );
265
262
}
263
+ aModListener .nodeRemoved (this , pNode );
266
264
aModListener .endCompoundListening ();
267
265
aNeedsLayout = true ;
268
266
}
0 commit comments