package com.c2kernel.collection.gui.model; import com.c2kernel.graph.model.GraphPoint; import com.c2kernel.graph.model.Vertex; import com.c2kernel.graph.model.VertexOutlineCreator; public class AggregationVertexOutlineCreator implements VertexOutlineCreator { public void setOutline(Vertex vertex) { GraphPoint centre = vertex.getCentrePoint(); int height = vertex.getHeight(); int width = vertex.getWidth(); if (height==0 || width==0) vertex.setOutlinePoints ( new GraphPoint[] { new GraphPoint(centre.x-20, centre.y-20), new GraphPoint(centre.x+20, centre.y-20), new GraphPoint(centre.x+20, centre.y+20), new GraphPoint(centre.x-20, centre.y+20) } ); else vertex.setOutlinePoints ( new GraphPoint[] { new GraphPoint(centre.x-width/2, centre.y-height/2), new GraphPoint(centre.x+width/2, centre.y-height/2), new GraphPoint(centre.x+width/2, centre.y+height/2), new GraphPoint(centre.x-width/2, centre.y+height/2) } ); } }