1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
protected Map setArrow(ArrowType type, int width, Color color) {
int beginType, endType;
Map attrs = new Hashtable();
switch (type) {
case UP:
beginType = GraphConstants.ARROW_TECHNICAL;
endType = GraphConstants.ARROW_NONE;
break;
case DOWN:
beginType = GraphConstants.ARROW_NONE;
endType = GraphConstants.ARROW_TECHNICAL;
break;
case LINK:
beginType = GraphConstants.ARROW_NONE;
endType = GraphConstants.ARROW_NONE;
break;
default:
beginType = GraphConstants.ARROW_NONE;
endType = GraphConstants.ARROW_NONE;
break;
}
GraphConstants.setLineWidth(attrs, width);
GraphConstants.setLineColor(attrs, color);
GraphConstants.setLineBegin(attrs, beginType);
GraphConstants.setLineEnd(attrs, endType);
GraphConstants.setBeginFill(attrs, true);
GraphConstants.setEndFill(attrs, true);
GraphConstants.setLabelEnabled(attrs, true);
return attrs;
} |