, scale(-1,1), x = 0. , (300 100), (-300, 100).
" " (.. x ),
( ) ββ AffineTransform, AffineTransforms, . , ,
private static Shape mirrorAlongX(double x, Shape shape)
{
AffineTransform at = new AffineTransform();
at.translate(x, 0);
at.scale(-1, 1);
at.translate(-x, 0);
return at.createTransformedShape(shape);
}
, (.. ) ,
g.fill(mirrorAlongX(shape.getBounds2D().getCenterX(), shape));
: Exceptions, ! . . , " node" -
String text = nodes.get(i).getText();
if (text != null)
{
g2.drawString(text, ...);
}
else
{
System.err.println("No text found at node");
}