selectionStroke = new BasicStroke(width, BasicStroke.CAP_BUTT, stroke.getLineJoin());
}
} else {
+ // TODO: support AggregateConnectionStyle
selectionStroke = SELECTION_STROKE;
}
}
if(dynamicColor != null || dynamicStroke != null) {
BasicConnectionStyle baseStyle = (BasicConnectionStyle)tryGetStyle(baseRenderer);
- try {
- Constructor<? extends BasicConnectionStyle> c = baseStyle.getClass().getConstructor(Color.class, Color.class, double.class, Stroke.class, Stroke.class, double.class, double.class);
- renderer = new StyledRouteGraphRenderer(c.newInstance(
- dynamicColor != null ? dynamicColor : baseStyle.getLineColor(),
- baseStyle.getBranchPointColor(), baseStyle.getBranchPointRadius(),
- dynamicStroke != null ? dynamicStroke : baseStyle.getLineStroke(),
- dynamicStroke != null ? dynamicStroke : baseStyle.getRouteLineStroke(),
- baseStyle.getDegeneratedLineLength(), baseStyle.getRounding()));
- } catch (Exception e) {
- renderer = new StyledRouteGraphRenderer(new BasicConnectionStyle(
- dynamicColor != null ? dynamicColor : baseStyle.getLineColor(),
- baseStyle.getBranchPointColor(), baseStyle.getBranchPointRadius(),
- dynamicStroke != null ? dynamicStroke : baseStyle.getLineStroke(),
- dynamicStroke != null ? dynamicStroke : baseStyle.getRouteLineStroke(),
- baseStyle.getDegeneratedLineLength(), baseStyle.getRounding()));
+ if (baseStyle != null) {
+ try {
+ Constructor<? extends BasicConnectionStyle> c = baseStyle.getClass().getConstructor(Color.class, Color.class, double.class, Stroke.class, Stroke.class, double.class, double.class, double.class);
+ renderer = new StyledRouteGraphRenderer(c.newInstance(
+ dynamicColor != null ? dynamicColor : baseStyle.getLineColor(),
+ baseStyle.getBranchPointColor(), baseStyle.getBranchPointRadius(),
+ dynamicStroke != null ? dynamicStroke : baseStyle.getLineStroke(),
+ dynamicStroke != null ? dynamicStroke : baseStyle.getRouteLineStroke(),
+ baseStyle.getDegeneratedLineLength(), baseStyle.getRounding(), baseStyle.getOffset()));
+ } catch (Exception e) {
+ renderer = new StyledRouteGraphRenderer(new BasicConnectionStyle(
+ dynamicColor != null ? dynamicColor : baseStyle.getLineColor(),
+ baseStyle.getBranchPointColor(), baseStyle.getBranchPointRadius(),
+ dynamicStroke != null ? dynamicStroke : baseStyle.getLineStroke(),
+ dynamicStroke != null ? dynamicStroke : baseStyle.getRouteLineStroke(),
+ baseStyle.getDegeneratedLineLength(), baseStyle.getRounding(), baseStyle.getOffset()));
+ }
+ } else {
+ // TODO: support AggregateConnectionStyle
+ renderer = baseRenderer;
}
-
} else {
renderer = baseRenderer;
}
* @param after
* @return <code>true</code> if changes were fired
*/
- private boolean setRouteGraphAndFireChanges(RouteGraph before, RouteGraph after) {
+ public boolean setRouteGraphAndFireChanges(RouteGraph before, RouteGraph after) {
RouteGraphDelta delta = new RouteGraphDelta(before, after);
if (!delta.isEmpty()) {
setRouteGraph(after);