/*******************************************************************************
 * AMS Engineering Project: ZPointCS Project number: 84912700 Documentation:
 ******************************************************************************/

package ams.zpointcs.components;

/**
 * Constraint class for an X-Y layout for custom panels.
 * 
 * @author desa
 * @version 0.0 2001-04-26 desa initial version
 */
public class VarmenuConstraints implements Cloneable, java.io.Serializable
{

  /**
   * 
   */
  private static final long serialVersionUID = -304267304358008776L;
  int x;
  int y;
  int width; // <= 0 means use the components's preferred size
  int height; // <= 0 means use the components's preferred size


  /**
   * Constructor.
   */
  public VarmenuConstraints()
  {
    this(0, 0, 0, 0);
  }


  /**
   * Constructor.
   */
  public VarmenuConstraints(final int x, final int y, final int width,
      final int height)
  {
    this.x = x;
    this.y = y;
    this.width = width;
    this.height = height;
  }


  public int getX()
  {
    return x;
  }


  public void setX(final int x)
  {
    this.x = x;
  }


  public int getY()
  {
    return y;
  }


  public void setY(final int y)
  {
    this.y = y;
  }


  public int getWidth()
  {
    return width;
  }


  public void setWidth(final int width)
  {
    this.width = width;
  }


  public int getHeight()
  {
    return height;
  }


  public void setHeight(final int height)
  {
    this.height = height;
  }


  /**
   * Returns the hashcode for this VarmenuConstraints.
   */
  public int hashCode()
  {
    return x ^ (y * 37) ^ (width * 43) ^ (height * 47);
  }


  /**
   * Checks whether two VarmenuConstraints are equal.
   */
  public boolean equals(final Object that)
  {
    if (that instanceof VarmenuConstraints)
    {
      final VarmenuConstraints other = (VarmenuConstraints) that;
      return other.x == x && other.y == y && other.width == width
          && other.height == height;
    }
    return false;
  }


  /**
   * clone()
   */
  public Object clone()
  {
    return new VarmenuConstraints(x, y, width, height);
  }


  /**
   * toString()
   */
  public String toString()
  {
    return "VarmenuConstraints[" + x + "," + y + "," + width + "," + height
        + "]";
  }
}