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
-
__cellRect
- Delegate variable: current cell (pixel) rectangle.
-
__cellView
- Delegate variable: current cell view.
-
__index
- Delegate variable: current index.
-
__subGrid
- Delegate variable: current subgrid.
-
cellUnderMouse
- Last cell index under mouse.
-
cellViewTable
- Hashtable that maps index points to cellviews.
-
hasCellViews
- Must be set to true if this IGridPane has cellviews.
-
iGridDef
- IGridDef this IGridPane displays.
-
iGridView
-
-
indexTable
- Hashtable that maps cellviews to index points.
-
paneIndex
- Pane Index (IGridView.MIDDLELEFT, etc.)
-
paneSubGrid
- Cached pane subgrid.
-
xBase
- Cached 'base point' in X direction (this pane's relative
position in the whole grid defined by IGridDef).
-
yBase
- Cached 'base point' in Y direction (this pane's relative
position in the whole grid defined by IGridDef).
-
IGridPane(IGridDef, int)
- Constructs an IGridPane with given IGridDef and paneIndex.
-
adjustCellIndex(Point)
-
Adjusts a (possibly out-of-range) index to a valid in-range index.
-
computeCellRect(Rect, Rect)
- Computes cell rectangle for given subGrid.
-
computeClosureSubGrid(Rect, Rect)
- Computes the smallest subgrid that contains given pixel rectangle.
-
computeInteriorSubGrid(Rect, Rect)
- Computes the largest subgrid that is contained in given pixel rectangle.
-
delegate(int, IView)
- IView delegation.
-
drawCell()
- Draws a cell.
-
getCellView(Point)
- Returns the cell view at index p.
-
getCellViewIndex(View)
- Returns the index for a given cell view.
-
getXIndex(int)
- Returns the X index for a position x (requires setup()).
-
getXIndex(int, int, int)
- Returns the X index for a pixel position x0, assuming it is in the range [lowIndex, highIndex].
-
getXPosition(int)
- Returns the x position relative to this IGridPane for an index.
-
getYIndex(int)
- Returns the Y index for a position y (requires setup()).
-
getYIndex(int, int, int)
- Returns the Y index for a position y0, assuming it is in the given range [lowIndex, highIndex]
-
getYPosition(int)
- Returns the y position relative to this IGridPane for an index.
-
setCellView(Point, View)
- Sets cell view at index p.
-
setIGridDef(IGridDef)
- Sets IGridDef.
-
setup()
- Sets up cache variables (and resizes this IGridPane if necessary).
-
updateCells(Rect)
- Updates all the cells in the given subGrid.
-
updateCellsNow(Rect)
- Updates all the cells in the given subGrid immediately.
iGridDef
public IGridDef iGridDef
- IGridDef this IGridPane displays.
paneIndex
public int paneIndex
- Pane Index (IGridView.MIDDLELEFT, etc.)
iGridView
public IGridView iGridView
hasCellViews
public boolean hasCellViews
- Must be set to true if this IGridPane has cellviews.
cellViewTable
public Hashtable cellViewTable
- Hashtable that maps index points to cellviews.
indexTable
public Hashtable indexTable
- Hashtable that maps cellviews to index points. This is not allocated
until getCellViewIndex() is called.
__subGrid
public final Rect __subGrid
- Delegate variable: current subgrid.
__index
public final Point __index
- Delegate variable: current index.
__cellRect
public final Rect __cellRect
- Delegate variable: current cell (pixel) rectangle.
__cellView
public View __cellView
- Delegate variable: current cell view.
cellUnderMouse
public final Point cellUnderMouse
- Last cell index under mouse.
paneSubGrid
protected Rect paneSubGrid
- Cached pane subgrid. Set in setup().
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().
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().
IGridPane
public IGridPane(IGridDef iGridDef,
int paneIndex)
- Constructs an IGridPane with given IGridDef and paneIndex.
getCellView
public View getCellView(Point p)
- Returns the cell view at index p. Returns null if no cell view is defined.
getCellViewIndex
public Point getCellViewIndex(View cellView)
- Returns the index for a given cell view.
setCellView
public void setCellView(Point pIndex,
View cellView)
- Sets cell view at index p. 'cellView' can be null.
setIGridDef
public void setIGridDef(IGridDef iGridDef)
- Sets IGridDef.
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.
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].
getXIndex
public int getXIndex(int x)
- Returns the X index for a position x (requires setup()).
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]
getYIndex
public int getYIndex(int y)
- Returns the Y index for a position y (requires setup()).
getXPosition
public int getXPosition(int xIndex)
- Returns the x position relative to this IGridPane for an index.
getYPosition
public int getYPosition(int yIndex)
- Returns the y position relative to this IGridPane for an index.
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:
- IGridView.TOPLEFT: x too small, y too small
- IGridView.TOPCENTER: x in range, y too small
- IGridView.TOPRIGHT: x too large, y too small
- IGridView.MIDDLELEFT: x too small, y in range
- IGridView.MIDDLECENTER: x in range, y in range
- IGridView.MIDDLERIGHT: x too large, y in range
- IGridView.BOTTOMLEFT: x too small, y too large
- IGridView.BOTTOMCENTER: x in range, y too large
- IGridView.BOTTOMRIGHT: x too large, y too large
computeCellRect
public void computeCellRect(Rect subGrid,
Rect cellRect)
- Computes cell rectangle for given subGrid.
computeClosureSubGrid
public void computeClosureSubGrid(Rect rect,
Rect subGrid)
- Computes the smallest subgrid that contains given pixel rectangle.
computeInteriorSubGrid
public void computeInteriorSubGrid(Rect rect,
Rect subGrid)
- Computes the largest subgrid that is contained in given pixel rectangle.
updateCells
public void updateCells(Rect subGrid)
- Updates all the cells in the given subGrid.
updateCellsNow
public void updateCellsNow(Rect subGrid)
- Updates all the cells in the given subGrid immediately.
drawCell
public void drawCell()
- Draws a cell.
delegate
public void delegate(int flag,
IView iView)
- IView delegation.
- Overrides:
- delegate in class IView
All Packages Class Hierarchy This Package Previous Next Index