Advertisement
Guest User

Untitled

a guest
Aug 30th, 2014
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. package dvonn.codebundle;
  2.  
  3. import java.awt.Polygon;
  4. import java.awt.Color;
  5. import java.util.Arrays;
  6. import java.awt.Graphics;
  7. import java.awt.Graphics2D;
  8. import java.awt.BasicStroke;
  9. import java.awt.RenderingHints;
  10.  
  11. /**
  12. * @author 43822835 - Farren Esman
  13. * @version 1.0
  14. * @since 25/08/2014
  15. */
  16.  
  17. public class VisibleSpace extends Space{
  18.  
  19. private static final long serialVersionUID = -5912276405248473057L;
  20. /**
  21. *
  22. * @param x
  23. * @param y
  24. *
  25. * public static int size = 40;
  26. public static int xjump = (int)Math.sin(1.04719755) * size;
  27. public static int yjump = (int)Math.cos(1.04719755) * size;
  28. public static int xgap = xjump;
  29. public static int ygap = size + yjump;
  30. */
  31.  
  32. int xPoints[] = new int[]{pointAx, pointBx, pointCx, pointDx, pointEx, pointFx};
  33. int yPoints[] = new int[]{pointAy, pointBy, pointCy, pointDy, pointEy, pointFy};
  34. int nPoints = xPoints.length;
  35.  
  36. public VisibleSpace(int x, int y) {
  37. super(x, y);
  38. }
  39. /**
  40. * Define draw method
  41. * @param g
  42. *
  43. */
  44. @Override
  45. public void paint(Graphics g) {
  46. Graphics2D g2 = (Graphics2D) g;
  47. g.setColor(Color.BLACK);
  48. g2.setStroke(new BasicStroke(5));
  49. g.drawPolygon(xPoints, yPoints, nPoints);
  50. }
  51.  
  52.  
  53.  
  54.  
  55.  
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement