Class sgraphics.layout.Viewport
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sgraphics.layout.Viewport

java.lang.Object
   |
   +----sgraphics.GlyphImpl
           |
           +----sgraphics.MonoGlyph
                   |
                   +----sgraphics.layout.Viewport

public class Viewport
extends MonoGlyph
implements Axis
A viewport allows adjustment of the view of a glyph.

Variable Index

 o GIVEN
 o NATURAL

Constructor Index

 o Viewport(Glyph)

Method Index

 o allocate(Allocation)
 o currentLength(int)
 o currentLower(int)
 o getAllocationMode(int)
Get the allcoation mode.
 o getScrollAdjustment(int)
Get the adjustment for an axis.
 o length(int)
 o lower(int)
 o needResize()
This calls up the parent chain which leads to resizing and redrawing all the glyphs under the Viewer.
 o requirements()
Ask for the glyph's geometry requirements.
 o scrollTo(int, float)
 o setAllocationMode(int, int)
By default, a viewport allocates the natural span requested by its child in bot the X and Y dimensions.

Variables

 o NATURAL
  public final static int NATURAL
 o GIVEN
  public final static int GIVEN

Constructors

 o Viewport
  public Viewport(Glyph child)

Methods

 o requirements
  public Requirements requirements()
Ask for the glyph's geometry requirements.
Overrides:
requirements in class MonoGlyph
 o needResize
  public void needResize()
This calls up the parent chain which leads to resizing and redrawing all the glyphs under the Viewer.
Overrides:
needResize in class GlyphImpl
 o setAllocationMode
  public void setAllocationMode(int mode,
                                int axis)
By default, a viewport allocates the natural span requested by its child in bot the X and Y dimensions. This method changes the mode for a given dimension.
Parameters:
mode - NATURAL or GIVEN.
axis - the axis.
 o getAllocationMode
  public int getAllocationMode(int axis)
Get the allcoation mode.
Returns:
NATURAL or GIVEN.
 o getScrollAdjustment
  public Adjustment getScrollAdjustment(int axis)
Get the adjustment for an axis. This can be used to change the scroll position and it is observable.
Parameters:
axis - the axis of the adjustment.
Returns:
the adjustment.
 o scrollTo
  protected void scrollTo(int axis,
                          float lower)
 o lower
  protected float lower(int axis)
 o length
  protected float length(int axis)
 o currentLower
  protected float currentLower(int axis)
 o currentLength
  protected float currentLength(int axis)
 o allocate
  public void allocate(Allocation a)
Overrides:
allocate in class MonoGlyph

All Packages  Class Hierarchy  This Package  Previous  Next  Index