gzz.view
Class CellView

gzz.client Gzz_Frontend_Vobs.gen.html gzz.view gzz.view.ViewContext gzz.view.View gzz.view.CellView ../../../pegboard/1018/PEG_1018.gen.html#viewclasses ../../../Gzz_Frontend_View.gen.html#viewclasses viewclasses_small
java.lang.Object
  |
  +--gzz.view.CellView
Direct Known Subclasses:
BoxCellView, CellMagnifier, CellViewPlugin, ImageCellContentView, LinebrokenCellContentView, MultitypeCellContentView, PageSpanCellView, TextCellContentView

public abstract class CellView
extends java.lang.Object

A view that shows a cell in a box. Whether it draws a box or not is not defined by this interface. A common pattern is that a CellView drawing a box calls a sub-cellview to draw the actual content.

When subclassing, you must override one of the getSize() methods; the others will work. If you don't, you'll get an infinite loop: the default implementations call each other.


Field Summary
static java.lang.String rcsid
           
 
Constructor Summary
CellView()
           
 
Method Summary
 void getSize(Cell c, float scale, ViewContext context, float[] out)
          Get the default size of the cell at a given scale.
 void getSize(Cell c, ViewContext context, float[] out)
          Get the default size of the cell.
abstract  void place(Cell c, VobScene vs, int box, ViewContext context)
          Place the contents of one cell into the given coord system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rcsid

public static final java.lang.String rcsid
See Also:
Constant Field Values
Constructor Detail

CellView

public CellView()
Method Detail

place

public abstract void place(Cell c,
                           VobScene vs,
                           int box,
                           ViewContext context)
Place the contents of one cell into the given coord system. The coordsys given shall be a mapping from the rectangle (0,w)x(0,h) onto the screen.

Parameters:
box - A coordinate system, into whose "unit square" the cell will be placed. Note that some coordinate systems (box, orthoBox) set their "unit square" not to be 0..1 x 0..1.

getSize

public void getSize(Cell c,
                    ViewContext context,
                    float[] out)
Get the default size of the cell.

Parameters:
c - The cell to get size for, or null for a default size.

getSize

public void getSize(Cell c,
                    float scale,
                    ViewContext context,
                    float[] out)
Get the default size of the cell at a given scale. This method exists for the benefit of AWT, where fonts cannot be scaled accurately.

Note that the returned width and height are in Box scale: they are not multiplied by the scale parameter.

Parameters:
c - The cell to get size for, or null for a default size.