Guest User

Untitled

a guest
May 13th, 2014
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. public void draw(Graphics2D g)
  2.     {
  3.         g.setColor(getColor());
  4.         g.transform(myTranslation);
  5.         g.transform(myRotation);
  6.         //This shape is a square.. I just rotated it.
  7.         int[] xs = new int[]{width/2, 0, -width/2, 0};
  8.         int[] ys = new int[]{0, height/2, 0, -height/2};
  9.         g.fillPolygon(xs, ys, 4);
  10.         try {
  11.             g.transform(myRotation.createInverse());
  12.             g.transform(myTranslation.createInverse());
  13.         } catch (NoninvertibleTransformException e) {
  14.             // TODO Auto-generated catch block
  15.             e.printStackTrace();
  16.         }
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment