FileDocCategorySizeDatePackage
RectArea.javaAPI DocExample939Thu Apr 03 15:19:46 BST 1997None

RectArea

public class RectArea extends MapArea

Fields Summary
Rectangle
r
Constructors Summary
public RectArea(String s)

  
    int x1, y1, x2, y2;
    
    StringTokenizer st = new StringTokenizer(s, " \n\t\r,");
    // throw away the first token 
    // This should be ³rect²
    st.nextToken();
    u = new URL(st.nextToken());
    x1 = Integer.parseInt(st.nextToken());
    y1 = Integer.parseInt(st.nextToken());
    x2 = Integer.parseInt(st.nextToken());
    y2 = Integer.parseInt(st.nextToken());
    r = new Rectangle(x1, y1, x2 - x1, y2 - y1);
  
Methods Summary
public booleancontains(int x, int y)

    return r.inside(x, y);
  
public java.lang.StringtoString()

  
    return "rect " + u + " " + r.x + "," + r.y + " " 
      + (r.x + r.width) + "," + (r.y + r.height);