\name{grid.box}
\alias{grid.box}
\alias{boxGrob}
\title{ Draw a Box }
\description{
  Draws a box representing the schema for a database table.
}
\usage{
boxGrob(tname, cnames,
        x = 0.5, y = 0.5, default.units = "npc",
        just = "centre",
        gap = 1.5 * stringWidth(" "),
        primary = NULL, foreign = NULL,
        gp = NULL, vp = NULL, name = tname)
grid.box(...)
}
\arguments{
  \item{\dots}{ Arguments passed to \code{boxGrob} function. }
  \item{tname}{ The name of the table. }
  \item{cnames}{ The names of the table columns. }
  \item{x, y}{ The location to draw the box. }
  \item{default.units}{A string indicating the default units to use
    if \code{x} or \code{y}
    are only given as numeric values.}  
  \item{just}{The justification of the box relative to its location. }
  \item{gap}{ The horizontal space between the column names and
    the edge of the box. }
  \item{primary}{ The names of the columns that are part of
    the primary key for the table. }
  \item{foreign}{ The names of foreign key columns in the table. }
  \item{name}{ A character identifier for the grob. }
  \item{gp}{An object of class \code{gpar}, as produced by 
    the function \code{gpar}. }
  \item{vp}{A viewport (or NULL).}

}
\details{
  The name of the table is drawn at the top of the box
  with a gery background.
  Every second row of column names has a light grey background.
  
  The columns involved in the primary key are drawn bold.
  Foreign key columns are drawn italic.
}
\value{
  \code{boxGrob} returns a grob.
}
\author{ Paul Murrell }
\keyword{ dplot }
