I'm using jung library to draw my grap, so I was wondering if there is any way to create vertex in a different shape rather than creating an ellipse. For instance, I want octagon. This is how I set the shape:
Transformer<String,Shape> vertexSize = new Transformer<String,Shape>(){
@Override
public Shape transform(String str) {
Ellipse2D circle = new Ellipse2D.Double(-5, -5, 10, 10);
if(drugnames.contains(str)){
return AffineTransform.getScaleInstance(3,3).createTransformedShape(circle);
}
else{
return AffineTransform.getScaleInstance(1,1).createTransformedShape(circle);
}
// TODO Auto-generated method stub
}
};