javax.swing.text
public class AsyncBoxView.ChildLocator extends Object
| Field Summary | |
|---|---|
| protected Rectangle | childAlloc
A Rectangle used for child allocation calculation to avoid creation
of lots of garbage Rectangle objects. |
| protected Rectangle | lastAlloc
The last allocation. |
| protected AsyncBoxView.ChildState | lastValidOffset
The last valid location. |
| Constructor Summary | |
|---|---|
| ChildLocator()
Creates a new ChildLocator. | |
| Method Summary | |
|---|---|
| void | childChanged(AsyncBoxView.ChildState cs)
Receives notification that a child has changed. |
| Shape | getChildAllocation(int index, Shape a)
Returns the current allocation for a child view. |
| protected Shape | getChildAllocation(int index)
Returns the current allocation of the child view with the specified
index. |
| int | getViewIndexAtPoint(float x, float y, Shape a)
Returns the view index of the view that occupies the specified area, or
-1 if there is no such child view.
|
| protected int | getViewIndexAtVisualOffset(float targetOffset)
Returns the index of the view at the specified offset along the major
layout axis.
|
| void | paintChildren(Graphics g)
Paints all child views.
|
| protected void | setAllocation(Shape a)
Sets the current allocation for this view.
|
cs if
the new child state's view start offset is smaller than the start offset
of the current child state's view or when lastValidOffset
is null.
Parameters: cs the child state object that has changed
Parameters: index the index of the child view a the current allocation of this view
Returns: the current allocation for a child view
Parameters: index the index of the requested child view
Returns: the current allocation of the child view with the specified index
-1 if there is no such child view.
Parameters: x the x coordinate (relative to a) y the y coordinate (relative to a) a the current allocation of this view
Returns: the view index of the view that occupies the specified area, or
-1 if there is no such child view
Parameters: targetOffset the requested offset
Returns: the index of the view at the specified offset along the major layout axis
Parameters: g the graphics context to use
Parameters: a the allocation to set