All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.text.HBoxView

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

public class HBoxView
extends CompositeView
A view of a text model that arranges it's children into a horizontal box. It might be used to represent unwrapped lines, a piece of a flow, etc.


Constructor Index

 o HBoxView(Element)
Constructs a JHBoxView that does not load children.
 o HBoxView(Element, ViewFactory)
Constructs an JHBoxView for the given element.

Method Index

 o calculateSize(Rectangle, ViewFactory)
Calculates the total size of all child views.
 o childAllocation(int, Shape, ViewFactory)
Allocate a region for child views.
 o getViewAtPoint(Point, Rectangle, ViewFactory)
Fetches the child view at the given point.
 o isAfter(Point, Rectangle)
Checks whether a point is after a specified range.
 o isBefore(Point, Rectangle)
Checks whether a point is before a specified range.
 o paint(Graphics, Shape, ViewFactory)
Renders using the given rendering surface and area on that surface.

Constructors

 o HBoxView
 public HBoxView(Element elem,
                 ViewFactory f)
Constructs an JHBoxView for the given element.

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 HBoxView
 public HBoxView(Element elem)
Constructs a JHBoxView that does not load children. This is useful for subclasses that want to tile their children horizontally but do something special to arrange 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 total size of all 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)
Checks whether a point is before a specified range.

Parameters:
pt - the point
alloc - the range
Returns:
true if the point is before the range
Overrides:
isBefore in class CompositeView
 o isAfter
 protected boolean isAfter(Point pt,
                           Rectangle alloc)
Checks whether a point is after a specified range.

Parameters:
pt - the point
alloc - the range
Returns:
true if the point is after the range
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:
pt - 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
Overrides:
getViewAtPoint in class CompositeView
 o childAllocation
 protected Rectangle childAllocation(int index,
                                     Shape allocation,
                                     ViewFactory f)
Allocate a region for child views.

Parameters:
index - the ending index of a child view
allocation - the allocated region
f - the view factory
Overrides:
childAllocation in class CompositeView

All Packages  Class Hierarchy  This Package  Previous  Next  Index