|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.text.AsyncBoxView.ChildLocator
public class AsyncBoxView.ChildLocator
Manages the effective position of child views. That keeps the visible layout stable while the AsyncBoxView might be changing until the layout thread decides to publish the new layout.
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 | |
---|---|
AsyncBoxView.ChildLocator()
Creates a new ChildLocator. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected AsyncBoxView.ChildState lastValidOffset
protected Rectangle lastAlloc
protected Rectangle childAlloc
Constructor Detail |
---|
public AsyncBoxView.ChildLocator()
Method Detail |
---|
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 view
public void paintChildren(Graphics g)
g
- the graphics context to useprotected Shape getChildAllocation(int index)
index
- the index of the requested child view
protected void setAllocation(Shape a)
a
- the allocation to setprotected int getViewIndexAtVisualOffset(float targetOffset)
targetOffset
- the requested offset
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |