Changeset 115 for trunk/src/org/expeditee/gui/Vector.java
- Timestamp:
- 07/02/08 12:38:54 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/Vector.java
r105 r115 4 4 import java.awt.Point; 5 5 6 public class Vector { 7 public Frame Frame; 6 import org.expeditee.items.Permission; 7 8 public class Vector extends Overlay { 8 9 9 10 public Point Origin; 10 11 11 12 public float Scale; 12 13 13 14 public Color Foreground; 15 14 16 public Color Background; 15 17 16 public Vector(Frame overlay, Point origin, Float scale, Color color, Color background) { 17 Frame = overlay; 18 public Vector(Frame overlay, Permission permission, Point origin, 19 Float scale, Color color, Color background) { 20 super(overlay, permission); 18 21 Origin = origin; 19 22 Scale = scale; … … 26 29 if (o == null || o.getClass() != Vector.class) 27 30 return false; 31 Vector v = (Vector) o; 28 32 29 return ((Vector) o).Frame == Frame; 33 return v.Frame == Frame && Origin.equals(v.Origin) 34 && Scale == v.Scale && Foreground == v.Foreground 35 && Background == v.Background; 30 36 } 31 37 … … 34 40 return 0; 35 41 } 42 43 /** 44 * Converts the given x position to be relative to the overlay frame. 45 * 46 * @param x 47 * @return 48 */ 49 public float getX(int x) { 50 return (x - Origin.x) / Scale; 51 } 52 53 public float getY(int y) { 54 return (y - Origin.y) / Scale; 55 } 36 56 }
Note:
See TracChangeset
for help on using the changeset viewer.