home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Polygon;
- import java.awt.Rectangle;
- import java.net.URL;
- import java.util.Vector;
-
- class IMapArea {
- private static final int RECT = 1;
- private static final int ELLIPSE = 2;
- private static final int POLY = 3;
- private int shape;
- private Rectangle rect;
- // $FF: renamed from: x int
- private int field_0;
- // $FF: renamed from: y int
- private int field_1;
- // $FF: renamed from: a int
- private int field_2;
- // $FF: renamed from: b int
- private int field_3;
- private Polygon poly;
- public URL url;
- public String target;
- public String status;
- private Vector text = new Vector(10, 5);
- private Vector indent = new Vector(10, 5);
- private int count;
- public int width;
- public int height;
-
- public IMapArea(Rectangle var1) {
- this.shape = 1;
- this.rect = var1;
- }
-
- public IMapArea(int var1, int var2, int var3, int var4) {
- this.shape = 2;
- this.field_0 = var1;
- this.field_1 = var2;
- this.field_2 = Math.abs(var3);
- this.field_3 = Math.abs(var4);
- }
-
- public IMapArea(Polygon var1) {
- this.shape = 3;
- this.poly = var1;
- }
-
- public boolean isRect() {
- return this.shape == 1;
- }
-
- public boolean isEllipse() {
- return this.shape == 2;
- }
-
- public boolean isPoly() {
- return this.shape == 3;
- }
-
- public Rectangle getRect() {
- return this.isRect() ? this.rect : new Rectangle();
- }
-
- public Rectangle getEllipse() {
- return this.isEllipse() ? new Rectangle(this.field_0 - this.field_2, this.field_1 - this.field_3, this.field_2 * 2, this.field_3 * 2) : new Rectangle();
- }
-
- public Polygon getPoly() {
- return this.isPoly() ? this.poly : new Polygon();
- }
-
- public Rectangle getBoundingBox() {
- Rectangle var1 = new Rectangle();
- if (this.isRect()) {
- var1 = this.rect;
- }
-
- if (this.isEllipse()) {
- var1 = this.getEllipse();
- }
-
- if (this.isPoly()) {
- var1 = this.poly.getBoundingBox();
- }
-
- return var1;
- }
-
- public void setURL(URL var1) {
- this.url = var1;
- }
-
- public void setURL(URL var1, String var2) {
- this.url = var1;
- this.target = var2;
- }
-
- public void setStatusMsg(String var1) {
- this.status = var1;
- }
-
- public boolean inside(int var1, int var2) {
- if (this.isRect()) {
- return this.rect.inside(var1, var2);
- } else {
- if (this.isEllipse()) {
- var1 -= this.field_0;
- var2 -= this.field_1;
- if (Math.abs(var1) > this.field_2 || Math.abs(var2) > this.field_3) {
- return false;
- }
-
- double var3 = (double)((int)((double)this.field_3 * Math.sqrt((double)1.0F - (double)(var1 * var1) / (double)(this.field_2 * this.field_2))));
- if ((double)Math.abs(var2) <= var3) {
- return true;
- }
- }
-
- if (this.isPoly()) {
- return this.poly.inside(var1, var2);
- } else {
- return false;
- }
- }
- }
-
- public void addText(int var1, String var2) {
- this.indent.addElement(new Integer(var1));
- this.text.addElement(var2);
- ++this.count;
- }
-
- public String getText(int var1) {
- return var1 >= 0 && var1 < this.count ? (String)this.text.elementAt(var1) : null;
- }
-
- public int getIndent(int var1) {
- return var1 >= 0 && var1 < this.count ? Integer.parseInt(this.indent.elementAt(var1).toString()) : 0;
- }
-
- public int getCount() {
- return this.count;
- }
- }
-