}
return rc.getMultiLayerTransformer().getTransformer(Layer.VIEW).transform(s).intersects(deviceRectangle);
}
protected void paintShapeForVertex(RenderContext<V, E> rc, V v, Shape shape) {
GraphicsDecorator g = rc.getGraphicsContext();
Paint oldPaint = g.getPaint();
Rectangle r = shape.getBounds();
float y2 = (float) r.getMaxY();
if (cyclic) {
y2 = (float) (r.getMinY() + r.getHeight() / 2);
}
Paint fillPaint = null;
if (pickedState != null && pickedState.isPicked(v)) {
fillPaint = new GradientPaint((float) r.getMinX(), (float) r.getMinY(), backFillColor, (float) r.getMinX(),
y2, pickedColor, cyclic);
} else if (v instanceof Graph) {
fillPaint = new GradientPaint((float) r.getMinX(), (float) r.getMinY(), backFillColor, (float) r.getMinX(),
y2, graphColor, cyclic);
} else if (v instanceof VertexInfo) {
VertexInfo vert = (VertexInfo) v;
if (vert.getIsFailedVertex()) {
fillPaint = new GradientPaint((float) r.getMinX(), (float) r.getMinY(), backFillColor, (float) r
.getMinX(), y2, Color.red, cyclic);
} else if (vert.isStartState()) {
fillPaint = new GradientPaint((float) r.getMinX(), (float) r.getMinY(), backFillColor, (float) r
.getMinX(), y2, firstStateColor, cyclic);
} else if (vert.getIsVisited()) {
if (vert.getIsCurrSeq()) {
fillPaint = new GradientPaint((float) r.getMinX(), (float) r.getMinY(), backFillColor, (float) r
.getMinX(), y2, visColor, cyclic);
} else {
fillPaint = new GradientPaint((float) r.getMinX(), (float) r.getMinY(), backFillColor, (float) r
.getMinX(), y2, dispColor, cyclic);
}
} else if (vert.getIsDisplayed()) {
fillPaint = new GradientPaint((float) r.getMinX(), (float) r.getMinY(), backFillColor, (float) r
.getMinX(), y2, dispColor, cyclic);
} else {
fillPaint = new GradientPaint((float) r.getMinX(), (float) r.getMinY(), backFillColor, (float) r
.getMinX(), y2, stanColor, cyclic);
}
}
if (fillPaint != null) {
g.setPaint(fillPaint);
g.fill(shape);
g.setPaint(oldPaint);
}
Paint drawPaint = rc.getVertexDrawPaintTransformer().transform(v);
if (drawPaint != null) {
g.setPaint(drawPaint);
}
Stroke oldStroke = g.getStroke();
Stroke stroke = rc.getVertexStrokeTransformer().transform(v);
if (stroke != null) {
g.setStroke(stroke);
}
g.draw(shape);
g.setPaint(oldPaint);
g.setStroke(oldStroke);
}