javax.swing.text
public class AsyncBoxView.ChildLocator extends Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
AsyncBoxView.ChildLocator()
Creates a new ChildLocator.
|
Modifier and Type | Method and Description |
---|---|
void |
childChanged(AsyncBoxView.ChildState cs)
Receives notification that a child has changed.
|
protected Shape |
getChildAllocation(int index)
Returns the current allocation of the child view with the specified
index.
|
Shape |
getChildAllocation(int index,
Shape a)
Returns the current allocation for a child view.
|
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.
|
protected AsyncBoxView.ChildState lastValidOffset
protected Rectangle childAlloc
public AsyncBoxView.ChildLocator()
public void childChanged(AsyncBoxView.ChildState cs)
lastValidOffset
field to 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
.cs
- the child state object that has changedpublic int getViewIndexAtPoint(float x, float y, Shape a)
-1
if there is no such child view.x
- the x coordinate (relative to a
)y
- the y coordinate (relative to a
)a
- the current allocation of this view-1
if there is no such child viewpublic Shape getChildAllocation(int index, Shape a)
index
- the index of the child viewa
- the current allocation of this viewpublic void paintChildren(Graphics g)
g
- the graphics context to useprotected Shape getChildAllocation(int index)
index
- the index of the requested child viewprotected void setAllocation(Shape a)
a
- the allocation to setprotected int getViewIndexAtVisualOffset(float targetOffset)
targetOffset
- the requested offset