Esempio n. 1
0
 public static void drawRotatedString(string text, Graphics2D g2, float textX, float textY, double angle, float rotateX, float rotateY)
 {
   if (text == null || String.instancehelper_equals(text, (object) ""))
     return;
   AffineTransform transform = g2.getTransform();
   AffineTransform rotateInstance = AffineTransform.getRotateInstance(angle, (double) rotateX, (double) rotateY);
   g2.transform(rotateInstance);
   if (TextUtilities.useDrawRotatedStringWorkaround)
   {
     TextLayout.__\u003Cclinit\u003E();
     new TextLayout(text, ((Graphics) g2).getFont(), g2.getFontRenderContext()).draw(g2, textX, textY);
   }
   else
     g2.drawString(text, textX, textY);
   g2.setTransform(transform);
 }
Esempio n. 2
0
 public static void drawRotatedShape(Graphics2D g2, Shape shape, double angle, float x, float y)
 {
   AffineTransform transform = g2.getTransform();
   AffineTransform rotateInstance = AffineTransform.getRotateInstance(angle, (double) x, (double) y);
   g2.transform(rotateInstance);
   g2.draw(shape);
   g2.setTransform(transform);
 }