All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.text.VBoxView

java.lang.Object
   |
   +----com.sun.java.swing.text.AbstractView
           |
           +----com.sun.java.swing.text.CompositeView
                   |
                   +----com.sun.java.swing.text.VBoxView

public class VBoxView
extends CompositeView
A view of a text model that arranges its children into a vertical box. It might be useful to represent something like a collection of lines or paragraphs.


Constructor Index

 o VBoxView(Element)
Constructs a JVBoxView that does not load children.
 o VBoxView(Element, ViewFactory)
Constructs a JVBoxView for the given element that automatically loads the child elements, one view for each child element.

Method Index

 o calculateSize(Rectangle, ViewFactory)
Calculates the maximum size of all the child views.
 o childAllocation(int, Shape, ViewFactory)
Allocates a region for a child view.
 o getViewAtPoint(Point, Rectangle, ViewFactory)
Fetches the child view at the given point.
 o isAfter(Point, Rectangle)
Determines if a point falls after an allocated region.
 o isBefore(Point, Rectangle)
Determines if a point falls before an allocated region.
 o paint(Graphics, Shape, ViewFactory)
Renders using the given rendering surface and area on that surface.

Constructors

 o VBoxView
 public VBoxView(Element elem,
                 ViewFactory f)
Constructs a JVBoxView for the given element that automatically loads the child elements, one view for each child element. Each child is tiled vertically.

Parameters:
elem - the element this view is responsible for
f - the factory to use to create views of the elements that are children of the element this view is responsible for
 o VBoxView
 public VBoxView(Element elem)
Constructs a JVBoxView that does not load children. This is useful for subclasses that want to tile their children vertically but do something special for their child view creation.

Parameters:
elem - the element this view is responsible for

Methods

 o paint
 public void paint(Graphics g,
                   Shape allocation,
                   ViewFactory f)
Renders using the given rendering surface and area on that surface.

Parameters:
g - the rendering surface to use
allocation - the allocated region to render into
f - the factory to use if children need to be created
Overrides:
paint in class CompositeView
See Also:
paint
 o calculateSize
 protected Dimension calculateSize(Rectangle alloc,
                                   ViewFactory f)
Calculates the maximum size of all the child views.

Parameters:
alloc - the allocated region
f - the view factory
Returns:
the size
Overrides:
calculateSize in class CompositeView
 o isBefore
 protected boolean isBefore(Point pt,
                            Rectangle alloc)
Determines if a point falls before an allocated region.

Parameters:
pt - the point
alloc - the allocated region
Returns:
true if the point lies before the region else false
Overrides:
isBefore in class CompositeView
 o isAfter
 protected boolean isAfter(Point pt,
                           Rectangle alloc)
Determines if a point falls after an allocated region.

Parameters:
pt - the point
alloc - the allocated region
Returns:
true if the point lies after the region else false
Overrides:
isAfter in class CompositeView
 o getViewAtPoint
 protected View getViewAtPoint(Point pt,
                               Rectangle alloc,
                               ViewFactory f)
Fetches the child view at the given point.

Parameters:
p - the location of the child to fetch
alloc - the parents allocation on entry, which should be changed to the childs allocation on exit
f - the view factory
Returns:
the view
Overrides:
getViewAtPoint in class CompositeView
 o childAllocation
 protected Rectangle childAllocation(int index,
                                     Shape allocation,
                                     ViewFactory f)
Allocates a region for a child view.

Parameters:
index - the index
allocation - the allocated region
f - the view factory to use
Returns:
the region
Overrides:
childAllocation in class CompositeView

All Packages  Class Hierarchy  This Package  Previous  Next  Index