gzz.view
Class CellMagnifier

java.lang.Object
  |
  +--gzz.view.CellView
        |
        +--gzz.view.CellMagnifier

public class CellMagnifier
extends CellView

A CellView that delegates all calls to another CellView, except that it multiplies the results of getSize() calls with a constant factor. Used for showing cells larger or smaller than the normal CellView would.

Note that this does not work by wrapping the body in a scaling coordinate set. It only provides different cell size values to the view, so that the view will give the cell view a larger (or smaller) box to place each cell into; for example the text size may not change at all (depending on the cell view), thus causing more (or less) text to be shown. With LinebreakingCellView, magnifying the cells may allow multiple lines of text to be shown.


Field Summary
protected  CellView sub
           
protected  float xfactor
           
protected  float yfactor
           
 
Fields inherited from class gzz.view.CellView
rcsid
 
Constructor Summary
CellMagnifier(CellView sub, float factor)
           
CellMagnifier(CellView sub, float xfactor, float yfactor)
           
 
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.
 void place(Cell c, VobScene sc, 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

sub

protected CellView sub

xfactor

protected float xfactor

yfactor

protected float yfactor
Constructor Detail

CellMagnifier

public CellMagnifier(CellView sub,
                     float factor)

CellMagnifier

public CellMagnifier(CellView sub,
                     float xfactor,
                     float yfactor)
Method Detail

place

public void place(Cell c,
                  VobScene sc,
                  int box,
                  ViewContext context)
Description copied from class: CellView
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.

Specified by:
place in class CellView
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)
Description copied from class: CellView
Get the default size of the cell.

Overrides:
getSize in class CellView
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)
Description copied from class: CellView
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.

Overrides:
getSize in class CellView
Parameters:
c - The cell to get size for, or null for a default size.