Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.java.swing.text.View | +--com.sun.java.swing.text.CompositeView
Fields inherited from class com.sun.java.swing.text.View | |
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS |
Constructor Summary | |
CompositeView(Element elem)
Constructs a CompositeView for the given element. |
Method Summary | |
void | append(View v)
Appends a single child view. |
void | childAllocation(int index,
java.awt.Rectangle a)
Returns the allocation for a given child. |
short | getBottomInset()
Gets the bottom inset. |
java.awt.Shape | getChildAllocation(int index,
java.awt.Shape a)
Fetches the allocation for the given child view. |
java.awt.Rectangle | getInsideAllocation(java.awt.Shape a)
Translates the allocation given to the view to the allocation used for composing the interior. |
short | getLeftInset()
Gets the left inset. |
short | getRightInset()
Gets the right inset. |
short | getTopInset()
Gets the top inset. |
View | getViewAtPoint(int x,
int y,
java.awt.Rectangle alloc)
Fetches the child view at the given point. |
View | getViewAtPosition(int pos,
java.awt.Rectangle a)
Fetches the child view that represents the given position in the model. |
View | getView(int n)
Gets the n-th view in this container. |
int | getViewCount()
Returns the number of views in this view. |
void | insert(int offs,
View v)
Inserts a single child view. |
boolean | isAfter(int x,
int y,
java.awt.Rectangle alloc)
Tests whether a point lies after the rectangle range. |
boolean | isBefore(int x,
int y,
java.awt.Rectangle alloc)
Tests whether a point lies before the rectangle range. |
void | loadChildren(ViewFactory f)
Loads all of the children to initialize the view. |
java.awt.Shape | modelToView(int pos,
java.awt.Shape a)
Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it. |
void | removeAll()
Removes all of the children. |
void | replace(int offset,
int length,
View[] views)
Invalidates the layout and resizes the cache of requests/allocations, allowing for the replacement of child views. |
void | setInsets(short top,
short left,
short bottom,
short right)
Sets the insets for the view. |
void | setParagraphInsets(AttributeSet attr)
Sets the insets from the paragraph attributes specified in the given attributes. |
void | setParent(View parent)
Sets the parent of the view. |
int | viewToModel(float x,
float y,
java.awt.Shape a)
Provides a mapping from the view coordinate space to the logical coordinate space of the model. |
Methods inherited from class com.sun.java.swing.text.View | |
breakView, changedUpdate, createFragment, getAlignment, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getParent, getPreferredSpan, getResizeWeight, getStartOffset, getViewCount, getViewFactory, getView, insertUpdate, modelToView, paint, preferenceChanged, removeUpdate, setParent, setSize, viewToModel |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Constructor Detail |
public CompositeView(Element elem)
elem
- the element this view is responsible forMethod Detail |
protected void loadChildren(ViewFactory f)
setParent
method.
Subclasses can reimplement this to initialize their
child views in a different manner. The default
implementation creates a child view for each
child element.
f
- the view factorypublic void removeAll()
public void insert(int offs, View v)
offs
- the offset of the view to insert before >= 0
v
- the viewpublic void append(View v)
v
- the viewpublic void replace(int offset, int length, View[] views)
offset
- the starting offset into the child views to insert
before >= 0
length
- the number of existing child views affected >= 0
views
- the child views to use as replacementspublic void setParent(View parent)
loadChildren
method. The children should not be loaded in the
constructor because the act of setting the parent
may cause them to try to search up the hierarchy
(to get the hosting Container for example).
parent
- the parent of the view, null if nonepublic int getViewCount()
public View getView(int n)
n
- the number of the view to get, >= 0 && < getViewCount()public java.awt.Shape getChildAllocation(int index, java.awt.Shape a)
index
- the index of the child, >= 0 && < getViewCount()
a
- the allocation to this view.public java.awt.Shape modelToView(int pos, java.awt.Shape a) throws BadLocationException
pos
- the position to convert >= 0
a
- the allocated region to render intopublic int viewToModel(float x, float y, java.awt.Shape a)
x
- x coordinate of the view location to convert >= 0
y
- y coordinate of the view location to convert >= 0
a
- the allocated region to render intoprotected abstract boolean isBefore(int x, int y, java.awt.Rectangle alloc)
x
- the X coordinate >= 0
y
- the Y coordinate >= 0
alloc
- the rectangleprotected abstract boolean isAfter(int x, int y, java.awt.Rectangle alloc)
x
- the X coordinate >= 0
y
- the Y coordinate >= 0
alloc
- the rectangleprotected abstract View getViewAtPoint(int x, int y, java.awt.Rectangle alloc)
x
- the X coordinate >= 0
y
- the Y coordinate >= 0
alloc
- the parent's allocation on entry, which should
be changed to the child's allocation on exitprotected abstract void childAllocation(int index, java.awt.Rectangle a)
index
- the index of the child, >= 0 && < getViewCount()
a
- the allocation to the interior of the box on entry,
and the allocation of the view containing the position on exitprotected View getViewAtPosition(int pos, java.awt.Rectangle a)
pos
- the position >= 0
a
- the allocation to the interior of the box on entry,
and the allocation of the view containing the position on exitprotected java.awt.Rectangle getInsideAllocation(java.awt.Shape a)
a
- The allocation given to the view.protected final void setParagraphInsets(AttributeSet attr)
attr
- the attributesprotected final void setInsets(short top, short left, short bottom, short right)
top
- the top inset >= 0
left
- the left inset >= 0
bottom
- the bottom inset >= 0
right
- the right inset >= 0protected final short getLeftInset()
protected final short getRightInset()
protected final short getTopInset()
protected final short getBottomInset()
Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |