All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class picture.Gallery

java.lang.Object
   |
   +----picture.PicPipe
           |
           +----picture.Gallery

public class Gallery
extends PicPipe
A gallery combines multiple PicPipe pictures into one tiling.

This code is (c) 1996 Leemon Baird <leemon@cs.cmu.edu>, http://www.cs.cmu.edu/~baird
The source and object code may be redistributed freely. If the code is modified, please state so in the comments.

Version:
1.0, 28 March 96
Author:
Leemon Baird

Variable Index

 o border
 o currPict
 o expand
 o maxX
 o maxY
 o minX
 o minY
 o numRows
 o pic
 o pipes

Constructor Index

 o Gallery()

Method Index

 o BNF(int)
Return a BNF describing how this object parses its parameters.
 o get(PicPipeList, Colors, double, double, double, double, double, double, double, double)
Return the color of a point (x,y) in the gallery where pixels are size (dx,dy).
 o getDescription(PicPipeList)
Return the description string that tells what this picture is.
 o getGallery()
If this shows multiple pictures, return this as the first visible gallery.
 o maxX(double, double)
return max x coordinate of the picture containing point (x,y) This tells where on the screen the corners of this little picture lie.
 o maxY(double, double)
return max y coordinate of the picture containing point (x,y) This tells where on the screen the corners of this little picture lie.
 o minX(double, double)
Return min x coordinate of the picture containing point (x,y).
 o minY(double, double)
return min y coordinate of the picture containing point (x,y) This tells where on the screen the corners of this little picture lie.
 o mod(double, double)
Calculates a modulo b for doubles.
 o parse(Parser, int)
parse a series of pictures and combine into a tiled gallery.
 o picNum(double, double)
return the number of the picture in the gallery containing point (x,y)
 o regionMaxX(PicPipeList)
Return max x coordinate of region this pipeline looks at
 o regionMaxY(PicPipeList)
Return max y coordinate of region this pipeline looks at
 o regionMinX(PicPipeList)
Return min x coordinate of region this pipeline looks at
 o regionMinY(PicPipeList)
Return min y coordinate of region this pipeline looks at
 o resetGalleries()
Reset all Galleries to show all their pictures, not just one.
 o select(double, double)
In the future, show just one picture, not a collection.
 o unparse(Unparser, int)
Output a description of this object that can be parsed with parse().
 o whichPic(double, double)
return the picture in the gallery containing point (x,y)

Variables

 o numRows
 protected int numRows
 o border
 protected double border
 o expand
 protected double expand
 o pic
 protected PicPipeList pic[]
 o pipes
 protected PicPipePipeline pipes[]
 o minX
 protected double minX[]
 o maxX
 protected double maxX[]
 o minY
 protected double minY[]
 o maxY
 protected double maxY[]
 o currPict
 protected int currPict

Constructors

 o Gallery
 public Gallery()

Methods

 o mod
 public static final double mod(double a,
                                double b)
Calculates a modulo b for doubles. Same as % if a and b are positive

 o whichPic
 public PicPipeList whichPic(double x,
                             double y)
return the picture in the gallery containing point (x,y)

 o picNum
 public int picNum(double x,
                   double y)
return the number of the picture in the gallery containing point (x,y)

 o minX
 public double minX(double x,
                    double y)
Return min x coordinate of the picture containing point (x,y). This tells where on the screen the corners of this little picture lie. This can be used to highlight the little picture when clicked on.

 o maxX
 public double maxX(double x,
                    double y)
return max x coordinate of the picture containing point (x,y) This tells where on the screen the corners of this little picture lie. This can be used to highlight the little picture when clicked on.

 o minY
 public double minY(double x,
                    double y)
return min y coordinate of the picture containing point (x,y) This tells where on the screen the corners of this little picture lie. This can be used to highlight the little picture when clicked on.

 o maxY
 public double maxY(double x,
                    double y)
return max y coordinate of the picture containing point (x,y) This tells where on the screen the corners of this little picture lie. This can be used to highlight the little picture when clicked on.

 o get
 public void get(PicPipeList source,
                 Colors color,
                 double x,
                 double y,
                 double z,
                 double t,
                 double dx,
                 double dy,
                 double dz,
                 double dt)
Return the color of a point (x,y) in the gallery where pixels are size (dx,dy). The gallery has (x,y) going from (-1,-1) to (1,1). The subpicture at slot (gx,gy) has a local frame of reference going from (-1,-1) to (1,1) within that picture, and (x,y) in that coordinate system is (px,py). The subpictures can be changed to show a region other than (-1,-1)-(1,1). The 4 functions such as regionMinX() define the region to show.

Overrides:
get in class PicPipe
 o BNF
 public String BNF(int lang)
Return a BNF describing how this object parses its parameters.

Overrides:
BNF in class PicPipe
 o unparse
 public void unparse(Unparser u,
                     int lang)
Output a description of this object that can be parsed with parse().

Overrides:
unparse in class PicPipe
See Also:
Parsable
 o parse
 public Object parse(Parser p,
                     int lang) throws ParserException
parse a series of pictures and combine into a tiled gallery.

Throws: ParserException
parser didn't find the required token
Overrides:
parse in class PicPipe
 o getGallery
 public Gallery getGallery()
If this shows multiple pictures, return this as the first visible gallery. If this shows only one picture, then start following the list for that picture to see if it is a gallery (possible preceded by various filters). This is used by the ViewApplet to know which object to ask various gallery-specific questions such as "which picture did the mouse click on?".

 o resetGalleries
 public void resetGalleries()
Reset all Galleries to show all their pictures, not just one.

 o select
 public void select(double x,
                    double y)
In the future, show just one picture, not a collection. The one picture should be the one selected by the mouse click at location (x,y).

 o regionMinX
 public double regionMinX(PicPipeList source)
Return min x coordinate of region this pipeline looks at

Overrides:
regionMinX in class PicPipe
 o regionMaxX
 public double regionMaxX(PicPipeList source)
Return max x coordinate of region this pipeline looks at

Overrides:
regionMaxX in class PicPipe
 o regionMinY
 public double regionMinY(PicPipeList source)
Return min y coordinate of region this pipeline looks at

Overrides:
regionMinY in class PicPipe
 o regionMaxY
 public double regionMaxY(PicPipeList source)
Return max y coordinate of region this pipeline looks at

Overrides:
regionMaxY in class PicPipe
 o getDescription
 public String getDescription(PicPipeList source)
Return the description string that tells what this picture is. If multiple pictures are showing, return this gallery's description, else return the description for the single picture that's showing.

Overrides:
getDescription in class PicPipe

All Packages  Class Hierarchy  This Package  Previous  Next  Index