// (c) MIT 2003.  All rights reserved.

// -*-Mode: Java -*- 
// Hyperlink.java -- 
// Author: mark a. foltz <mfoltz@ai.mit.edu>
// Maintainer: mark a. foltz <mfoltz@ai.mit.edu>
// Copyright: Copyright (C) 2000 by mark a. foltz
// Created: <Thu Jan  6 11:11:40 2000> 
// Keywords: 

/**
 * 
 * @author mark a. foltz <mfoltz@ai.mit.edu>
 * @version $Id: Hyperlink.java,v 1.2 2003/03/06 00:40:41 moltmans Exp $
 * */

package rec.tinybrowser;

import java.awt.Rectangle;

public class Hyperlink {

  private String anchor;
  private Object reference;
  private String command;
  private Rectangle region = new Rectangle();

  public Hyperlink(String anchor, Object reference, String command) {
    this.anchor = anchor;
    this.reference = reference;
    this.command = command;
  }

  public String getAnchor() { return anchor; }

  public Object getReference() { return reference; }

  public String getCommand() { return command; }

  public Rectangle getRegion() { return region; }
  
  public void setRegion(Rectangle r) {
    region.setBounds(r.x, r.y, r.width, r.height);
  }
  
  public boolean contains(int x, int y) {
    return region.contains(x, y);
  }

  public String toString() {
    return anchor + " --> " + command + " " + reference + " @ " + region;
  } 

}

    
