All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.micronova.mnfc.IGridPane

java.lang.Object
   |
   +----netscape.application.View
           |
           +----com.micronova.mnfc.IView
                   |
                   +----com.micronova.mnfc.IGridPane

public class IGridPane
extends IView
An IGridPane displays one grid pane defined by IGridDef.

An IGridPane has a pane index (IGridView defines 9 pane indices: TOPLEFT, TOPCENTER, TOPRIGHT, MIDDLELEFT, MIDDLECENTER, MIDDLERIGHT, BOTTOMLEFT, BOTTOMCENTER, BOTTOMRIGHT) and displays the pane defined by IGridDef's getPaneSubGrid(paneIndex).

IGridPane inherits from IView. It self-delegates DRAW_VIEW and calls IGridDef's drawCell() for each cell after setting up the delegate variables __subGrid, __index, __cellRect, and __cellView. It re-delegates others to IGridDef's delegatePane(). For MOUSE_XXX, it sets up __index to the cell index under mouse (possibly out of range) before calling delegatePane().

Version:
1.01
Author:
Makoto Nagata, MicroNova

Variable Index

 o __cellRect
Delegate variable: current cell (pixel) rectangle.
 o __cellView
Delegate variable: current cell view.
 o __index
Delegate variable: current index.
 o __subGrid
Delegate variable: current subgrid.
 o cellUnderMouse
Last cell index under mouse.
 o cellViewTable
Hashtable that maps index points to cellviews.
 o hasCellViews
Must be set to true if this IGridPane has cellviews.
 o iGridDef
IGridDef this IGridPane displays.
 o iGridView
 o indexTable
Hashtable that maps cellviews to index points.
 o paneIndex
Pane Index (IGridView.MIDDLELEFT, etc.)
 o paneSubGrid
Cached pane subgrid.
 o xBase
Cached 'base point' in X direction (this pane's relative position in the whole grid defined by IGridDef).
 o yBase
Cached 'base point' in Y direction (this pane's relative position in the whole grid defined by IGridDef).

Constructor Index

 o IGridPane(IGridDef, int)
Constructs an IGridPane with given IGridDef and paneIndex.

Method Index

 o adjustCellIndex(Point)
Adjusts a (possibly out-of-range) index to a valid in-range index.
 o computeCellRect(Rect, Rect)
Computes cell rectangle for given subGrid.
 o computeClosureSubGrid(Rect, Rect)
Computes the smallest subgrid that contains given pixel rectangle.
 o computeInteriorSubGrid(Rect, Rect)
Computes the largest subgrid that is contained in given pixel rectangle.
 o delegate(int, IView)
IView delegation.
 o drawCell()
Draws a cell.
 o getCellView(Point)
Returns the cell view at index p.
 o getCellViewIndex(View)
Returns the index for a given cell view.
 o getXIndex(int)
Returns the X index for a position x (requires setup()).
 o getXIndex(int, int, int)
Returns the X index for a pixel position x0, assuming it is in the range [lowIndex, highIndex].
 o getXPosition(int)
Returns the x position relative to this IGridPane for an index.
 o getYIndex(int)
Returns the Y index for a position y (requires setup()).
 o getYIndex(int, int, int)
Returns the Y index for a position y0, assuming it is in the given range [lowIndex, highIndex]
 o getYPosition(int)
Returns the y position relative to this IGridPane for an index.
 o setCellView(Point, View)
Sets cell view at index p.
 o setIGridDef(IGridDef)
Sets IGridDef.
 o setup()
Sets up cache variables (and resizes this IGridPane if necessary).
 o updateCells(Rect)
Updates all the cells in the given subGrid.
 o updateCellsNow(Rect)
Updates all the cells in the given subGrid immediately.

Variables

 o iGridDef
 public IGridDef iGridDef
IGridDef this IGridPane displays.

 o paneIndex
 public int paneIndex
Pane Index (IGridView.MIDDLELEFT, etc.)

 o iGridView
 public IGridView iGridView
 o hasCellViews
 public boolean hasCellViews
Must be set to true if this IGridPane has cellviews.

 o cellViewTable
 public Hashtable cellViewTable
Hashtable that maps index points to cellviews.

 o indexTable
 public Hashtable indexTable
Hashtable that maps cellviews to index points. This is not allocated until getCellViewIndex() is called.

 o __subGrid
 public final Rect __subGrid
Delegate variable: current subgrid.

 o __index
 public final Point __index
Delegate variable: current index.

 o __cellRect
 public final Rect __cellRect
Delegate variable: current cell (pixel) rectangle.

 o __cellView
 public View __cellView
Delegate variable: current cell view.

 o cellUnderMouse
 public final Point cellUnderMouse
Last cell index under mouse.

 o paneSubGrid
 protected Rect paneSubGrid
Cached pane subgrid. Set in setup().

 o xBase
 protected int xBase
Cached 'base point' in X direction (this pane's relative position in the whole grid defined by IGridDef). Set in setup().

 o yBase
 protected int yBase
Cached 'base point' in Y direction (this pane's relative position in the whole grid defined by IGridDef). Set in setup().

Constructors

 o IGridPane
 public IGridPane(IGridDef iGridDef,
                  int paneIndex)
Constructs an IGridPane with given IGridDef and paneIndex.

Methods

 o getCellView
 public View getCellView(Point p)
Returns the cell view at index p. Returns null if no cell view is defined.

 o getCellViewIndex
 public Point getCellViewIndex(View cellView)
Returns the index for a given cell view.

 o setCellView
 public void setCellView(Point pIndex,
                         View cellView)
Sets cell view at index p. 'cellView' can be null.

 o setIGridDef
 public void setIGridDef(IGridDef iGridDef)
Sets IGridDef.

 o setup
 public void setup()
Sets up cache variables (and resizes this IGridPane if necessary). An IGridPane's size is always equal to that of the pane it is displaying. This is automatically called in drawView() and updateCells() so it is sually not necessary to call this yourself.

 o getXIndex
 public int getXIndex(int x0,
                      int lowIndex,
                      int highIndex)
Returns the X index for a pixel position x0, assuming it is in the range [lowIndex, highIndex].

 o getXIndex
 public int getXIndex(int x)
Returns the X index for a position x (requires setup()).

 o getYIndex
 public int getYIndex(int y0,
                      int lowIndex,
                      int highIndex)
Returns the Y index for a position y0, assuming it is in the given range [lowIndex, highIndex]

 o getYIndex
 public int getYIndex(int y)
Returns the Y index for a position y (requires setup()).

 o getXPosition
 public int getXPosition(int xIndex)
Returns the x position relative to this IGridPane for an index.

 o getYPosition
 public int getYPosition(int yIndex)
Returns the y position relative to this IGridPane for an index.

 o adjustCellIndex
 public int adjustCellIndex(Point indexPoint)
Adjusts a (possibly out-of-range) index to a valid in-range index. Also returns an integer flag to indicate whether the original index was in-range or not as follows:

 o computeCellRect
 public void computeCellRect(Rect subGrid,
                             Rect cellRect)
Computes cell rectangle for given subGrid.

 o computeClosureSubGrid
 public void computeClosureSubGrid(Rect rect,
                                   Rect subGrid)
Computes the smallest subgrid that contains given pixel rectangle.

 o computeInteriorSubGrid
 public void computeInteriorSubGrid(Rect rect,
                                    Rect subGrid)
Computes the largest subgrid that is contained in given pixel rectangle.

 o updateCells
 public void updateCells(Rect subGrid)
Updates all the cells in the given subGrid.

 o updateCellsNow
 public void updateCellsNow(Rect subGrid)
Updates all the cells in the given subGrid immediately.

 o drawCell
 public void drawCell()
Draws a cell.

 o delegate
 public void delegate(int flag,
                      IView iView)
IView delegation.

Overrides:
delegate in class IView

All Packages  Class Hierarchy  This Package  Previous  Next  Index