org.grinvin.graphs
Class DefaultEmbeddingModel
- Embedding, EmbeddingModel, EmbeddingView, MutableEmbeddingModel
public class DefaultEmbeddingModel
Implementation of
Embedding
that at the same time functions as a model
in a model-view-controller triple. An
EmbeddingListener
may
register itself with this model to be informed about various changes:
- Vertex coordinate changes.
- Dimension changes of the embedding.
Note that changes to the peer of this embedding (vertices being added or removed)
should be listened to by a separate
EmbeddingListener
registered with the peer.
DefaultEmbeddingModel
public DefaultEmbeddingModel(GraphView peer,
int dimension)
Create an embedding of the given dimension for the given peer graph.
setCoordinates
public void setCoordinates(Vertex[] vertices,
double[][] coordinates)
Perform a bulk change to the coordinates. Listeners are informed
once using an 'embedding changed' after all coordinates have been changed.
- setCoordinates in interface MutableEmbeddingModel
vertices
- Array of vertices whose coordinates are to be changedcoordinates
- Array of corresponding new coordinates.
void setCoordinates
public @Override void setCoordinates(Vertex vertex,
double[] coordinates)
void setDimension
public @Override void setDimension(int dimension)