net.sourceforge.olduvai.accordiondrawer
Class GridCell

java.lang.Object
  extended by net.sourceforge.olduvai.accordiondrawer.GridCell

public class GridCell
extends java.lang.Object

A class representing a cell, which is a rectangular region between 2 pairs of split lines in an Accordion Drawer. A GridCell contains information about split lines on four sides of it.

Author:
Tamara Munzner, Serdar Tasiran,
See Also:
AccordionDrawer, GridCell

Field Summary
 AccordionDrawer drawer
          The accordoin drawer for this grid cell.
protected  int drawnFrame
          Cache the last drawn frame for detecting determining when this cell was last drawn in.
protected  SplitLine[] maxLine
          Split Lines below [ AccordionDrawer.X ] or to the right [ AccordionDrawer.Y ] of me.
protected  SplitLine[] minLine
          Split Lines above [ AccordionDrawer.X ] or to the left [ AccordionDrawer.Y ] of me.
 
Constructor Summary
GridCell(AccordionDrawer drawer)
          Default constructor for grid cells, sets the min and max lines to null and initializes drawer.
 
Method Summary
 int getDrawnFrame()
          Accessor for the last drawn frame for this cell.
 SplitLine getMaxLine(int xy)
          Return the minimum split line in the given dimension.
 double getMaxSplitAbsolute(int xy)
          Gets the world-space position of the maximum split line for this cell, in X or Y.
 SplitLine getMinLine(int xy)
          Return the minimum split line in the given dimension.
 double getMinSplitAbsolute(int xy)
          Gets the world-space position of the minimum split line for this cell, in X or Y.
 double getSize(int xy)
          Returns the world-space size in X or Y for this cell.
 void setDrawBackground(boolean on)
          Sets the value of AccordionDrawer.drawBackground to the parameter value.
 void setDrawnFrame(int i)
          Updates the drawn frame drawnFrame to the given value.
 void setMaxLine(SplitLine maxline, int xy)
          Sets the maximum split line in the given dimension.
 void setMinLine(SplitLine minline, int xy)
          Sets the minimum split line in the given dimension.
 java.lang.String toString()
          Returns a string representation for objects of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

drawer

public AccordionDrawer drawer
The accordoin drawer for this grid cell.


minLine

protected SplitLine[] minLine
Split Lines above [ AccordionDrawer.X ] or to the left [ AccordionDrawer.Y ] of me.


maxLine

protected SplitLine[] maxLine
Split Lines below [ AccordionDrawer.X ] or to the right [ AccordionDrawer.Y ] of me.


drawnFrame

protected int drawnFrame
Cache the last drawn frame for detecting determining when this cell was last drawn in.

Constructor Detail

GridCell

public GridCell(AccordionDrawer drawer)
Default constructor for grid cells, sets the min and max lines to null and initializes drawer.

Parameters:
drawer - The drawer for this grid cell.
Method Detail

setDrawBackground

public void setDrawBackground(boolean on)
Sets the value of AccordionDrawer.drawBackground to the parameter value.

Parameters:
on - The new value of AccordionDrawer.drawBackground

getMinSplitAbsolute

public double getMinSplitAbsolute(int xy)
Gets the world-space position of the minimum split line for this cell, in X or Y.

Parameters:
xy - Either AccordionDrawer.X or AccordionDrawer.Y.
Returns:
The world-space position of the minimum split line in the given dimension.

getMaxSplitAbsolute

public double getMaxSplitAbsolute(int xy)
Gets the world-space position of the maximum split line for this cell, in X or Y.

Parameters:
xy - Either AccordionDrawer.X or AccordionDrawer.Y.
Returns:
The world-space position of the maximum split line in the given dimension.

getSize

public double getSize(int xy)
Returns the world-space size in X or Y for this cell.

Parameters:
xy - Either AccordionDrawer.X or AccordionDrawer.Y.
Returns:
The world-space difference in position between the minimum and maximum sides for the given dimension.

getMinLine

public SplitLine getMinLine(int xy)
Return the minimum split line in the given dimension.

Parameters:
xy - Either AccordionDrawer.X or AccordionDrawer.Y.
Returns:
The minimum split line in the given dimension.

getMaxLine

public SplitLine getMaxLine(int xy)
Return the minimum split line in the given dimension.

Parameters:
xy - Either AccordionDrawer.X or AccordionDrawer.Y.
Returns:
The maximum split line in the given dimension.

setMaxLine

public void setMaxLine(SplitLine maxline,
                       int xy)
Sets the maximum split line in the given dimension.

Parameters:
maxline - The new split line for maxLine in xy
xy - Either AccordionDrawer.X or AccordionDrawer.Y.

setMinLine

public void setMinLine(SplitLine minline,
                       int xy)
Sets the minimum split line in the given dimension.

Parameters:
minline - The new split line for minLine in xy
xy - Either AccordionDrawer.X or AccordionDrawer.Y.

getDrawnFrame

public int getDrawnFrame()
Accessor for the last drawn frame for this cell.

Returns:
The value of drawnFrame, the last known drawn frame for this cell.

setDrawnFrame

public void setDrawnFrame(int i)
Updates the drawn frame drawnFrame to the given value.

Parameters:
i - The new value for drawnFrame

toString

public java.lang.String toString()
Returns a string representation for objects of this class.

Overrides:
toString in class java.lang.Object
Returns:
String that represents the bounds for this grid cell (X: min -> max, Y: min -> max).