Most objects in Draw2D are compared by reference. Granted, this is a lot faster, but in some cases unwanted. For some reason {@link VertexFigure#getSourceAnchor(Edge,Connection)} is called severaltimes per connection. We want to set bendpoints on a connection only once, because otherwise Draw2D messes up if the same bendpoints occur several times.
So basically this class holds all the information we need (we want bendpoint after the start or before the end and not both) and it has an {@link Object#equals(Object)} method which allows us to check whether aconnection constraint list contains this. We have to store the association connection -> list of concrete bendpoints in a map, namely the {@link VertexFigure#bendpoints} field.
TODO: I suppose that if guys use the editor for a long time adding and removing a lot of connections, there might be a problem with this bendpoints thing...
@author Matthieu Wipliez
|
|
|
|