summaryrefslogtreecommitdiff
path: root/NET/worlds/console/MoveablePolygon.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-03 16:38:41 -0700
committerFuwn <[email protected]>2021-05-03 16:38:41 -0700
commite1e781bb2135ef78592226f1a3eaba4925702f1f (patch)
tree8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/console/MoveablePolygon.java
downloadworlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.tar.xz
worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/console/MoveablePolygon.java')
-rw-r--r--NET/worlds/console/MoveablePolygon.java420
1 files changed, 420 insertions, 0 deletions
diff --git a/NET/worlds/console/MoveablePolygon.java b/NET/worlds/console/MoveablePolygon.java
new file mode 100644
index 0000000..a44f69d
--- /dev/null
+++ b/NET/worlds/console/MoveablePolygon.java
@@ -0,0 +1,420 @@
+/* */ package NET.worlds.console;
+/* */
+/* */ import java.awt.Graphics;
+/* */ import java.awt.Polygon;
+/* */ import java.awt.Rectangle;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ class MoveablePolygon
+/* */ extends Polygon
+/* */ {
+/* */ private static final long serialVersionUID = 8800634603983512717L;
+/* */ private int xOffset;
+/* */ private int yOffset;
+/* 365 */ private Rectangle boundingBox = new Rectangle();
+/* */
+/* */ public MoveablePolygon() {}
+/* */
+/* */ public MoveablePolygon(int[] xpoints, int[] ypoints)
+/* */ {
+/* 371 */ super(xpoints, ypoints, xpoints.length);
+/* */ }
+/* */
+/* */ public void moveTo(int x, int y) {
+/* 375 */ if ((x != this.xOffset) || (y != this.yOffset)) {
+/* 376 */ int xdelta = x - this.xOffset;
+/* 377 */ int ydelta = y - this.yOffset;
+/* 378 */ this.xOffset = x;
+/* 379 */ this.yOffset = y;
+/* 380 */ for (int i = 0; i < this.npoints; i++) {
+/* 381 */ this.xpoints[i] += xdelta;
+/* 382 */ this.ypoints[i] += ydelta;
+/* */ }
+/* */ }
+/* */ }
+/* */
+/* */ public void drawFilled(Graphics g, int x, int y) {
+/* 388 */ moveTo(x, y);
+/* 389 */ g.fillPolygon(this);
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */ public Rectangle getBoundingBox()
+/* */ {
+/* 397 */ int boundsMinX = Integer.MAX_VALUE;
+/* 398 */ int boundsMinY = Integer.MAX_VALUE;
+/* 399 */ int boundsMaxX = Integer.MIN_VALUE;
+/* 400 */ int boundsMaxY = Integer.MIN_VALUE;
+/* */
+/* 402 */ for (int i = 0; i < this.npoints; i++) {
+/* 403 */ int x = this.xpoints[i];
+/* 404 */ boundsMinX = Math.min(boundsMinX, x);
+/* 405 */ boundsMaxX = Math.max(boundsMaxX, x);
+/* 406 */ int y = this.ypoints[i];
+/* 407 */ boundsMinY = Math.min(boundsMinY, y);
+/* 408 */ boundsMaxY = Math.max(boundsMaxY, y);
+/* */ }
+/* 410 */ this.boundingBox.setBounds(boundsMinX, boundsMinY, boundsMaxX - boundsMinX,
+/* 411 */ boundsMaxY - boundsMinY);
+/* 412 */ return this.boundingBox;
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\MoveablePolygon.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file