ewcs =
new EdgeWeightStrokeFunction<Number>(edge_weight);
vsh = new VertexStrokeHighlight<Integer,Number>(g, picked_state);
vff = new VertexFontTransformer<Integer>();
eff = new EdgeFontTransformer<Number>();
vs_none = new ConstantTransformer(null);
es_none = new ConstantTransformer(null);
vssa = new VertexShapeSizeAspect<Integer,Number>(g, voltages);
show_edge = new DirectionDisplayPredicate<Integer,Number>(true, true);
show_arrow = new DirectionDisplayPredicate<Integer,Number>(true, false);
show_vertex = new VertexDisplayPredicate<Integer,Number>(false);
// uses a gradient edge if unpicked, otherwise uses picked selection
edgeDrawPaint =
new GradientPickedEdgePaintFunction<Integer,Number>(
new PickableEdgePaintTransformer<Number>(
vv.getPickedEdgeState(),Color.black,Color.cyan), vv);
edgeFillPaint =
new GradientPickedEdgePaintFunction<Integer,Number>(
new PickableEdgePaintTransformer<Number>(
vv.getPickedEdgeState(),Color.black,Color.cyan), vv);
vv.getRenderContext().setVertexFillPaintTransformer(seedFillColor);
vv.getRenderContext().setVertexDrawPaintTransformer(seedDrawColor);
vv.getRenderContext().setVertexStrokeTransformer(vsh);
vv.getRenderContext().setVertexLabelTransformer(vs_none);
vv.getRenderContext().setVertexFontTransformer(vff);
vv.getRenderContext().setVertexShapeTransformer(vssa);
vv.getRenderContext().setVertexIncludePredicate(show_vertex);
vv.getRenderContext().setEdgeDrawPaintTransformer( edgeDrawPaint );
vv.getRenderContext().setEdgeLabelTransformer(es_none);
vv.getRenderContext().setEdgeFontTransformer(eff);
vv.getRenderContext().setEdgeStrokeTransformer(ewcs);
vv.getRenderContext().setEdgeIncludePredicate(show_edge);
vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line<Integer,Number>());
vv.getRenderContext().setEdgeArrowPredicate(show_arrow);
vv.getRenderContext().setArrowFillPaintTransformer(new ConstantTransformer(Color.lightGray));
vv.getRenderContext().setArrowDrawPaintTransformer(new ConstantTransformer(Color.black));
JPanel jp = new JPanel();
jp.setLayout(new BorderLayout());
vv.setBackground(Color.white);
GraphZoomScrollPane scrollPane = new GraphZoomScrollPane(vv);