All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.text.JCompositeView
java.lang.Object
|
+----com.sun.java.swing.text.JView
|
+----com.sun.java.swing.text.JCompositeView
- public abstract class JCompositeView
- extends JView
A view of a text model that has children
box. If the box is vertical, it might be useful to represent
something like a collection of lines or paragraphs. If the
box is horizontal, it might be used to represent unwrapped
lines.
-
JCompositeView(Element)
- Construct a JCompositeView for the given element.
-
calculateSize(Rectangle, ViewFactory)
-
-
changedUpdate(DocumentEvent, Shape, ViewFactory)
-
-
childAllocation(int, Shape, ViewFactory)
-
-
getPreferredShape(Shape, ViewFactory)
-
-
getView(int)
-
Gets the nth view in this container.
-
getViewAtPoint(Point, Rectangle, ViewFactory)
- Fetch the child view at the given point.
-
getViewAtPosition(Position, Rectangle, ViewFactory)
-
-
getViewCount()
-
Returns the number of views in this view.
-
insertUpdate(DocumentEvent, Shape, ViewFactory)
-
-
insertView(int, View)
-
-
invalidate()
- Note that the desired size has changed
-
isAfter(Point, Rectangle)
-
-
isBefore(Point, Rectangle)
-
-
loadChildren(ViewFactory)
- Convenience method to load all of the children for the case
where children are created for each element.
-
modelToView(Position, Shape, ViewFactory)
-
-
paint(Graphics, Shape, ViewFactory)
- This doesn't actually render anything, but it invalidates
if the allocation has changed.
-
removeAllViews()
-
-
removeUpdate(DocumentEvent, Shape, ViewFactory)
-
-
removeView(int)
-
-
shouldNotHappen()
-
-
viewToModel(Point, Shape, ViewFactory)
-
JCompositeView
public JCompositeView(Element elem)
- Construct a JCompositeView for the given element.
- Parameters:
- f - The factory to use to create views of the elements
that are children of the element this view is responsible for.
- elem - The element this view is responsible for.
loadChildren
protected void loadChildren(ViewFactory f)
- Convenience method to load all of the children for the case
where children are created for each element. Subclasses can
call this if it's appropriate for their behavior.
getViewCount
public int getViewCount()
- Returns the number of views in this view.
- See Also:
- getView
invalidate
public void invalidate()
- Note that the desired size has changed
getView
public View getView(int n)
- Gets the nth view in this container.
- Parameters:
- n - the number of the view to get
removeView
public void removeView(int n)
insertView
public void insertView(int n,
View v)
removeAllViews
public void removeAllViews()
getPreferredShape
public Shape getPreferredShape(Shape candidate,
ViewFactory f)
- Overrides:
- getPreferredShape in class JView
- See Also:
- getPreferredShape
paint
public void paint(Graphics g,
Shape allocation,
ViewFactory f)
- This doesn't actually render anything, but it invalidates
if the allocation has changed.
- Overrides:
- paint in class JView
- See Also:
- paint
modelToView
public Shape modelToView(Position pos,
Shape a,
ViewFactory f) throws BadLocation
- Throws: BadLocation
- If the given position does not represent a
valid location in the associated document.
- Overrides:
- modelToView in class JView
- See Also:
- modelToView
viewToModel
public Position viewToModel(Point pt,
Shape a,
ViewFactory f)
- Overrides:
- viewToModel in class JView
- See Also:
- viewToModel
insertUpdate
public void insertUpdate(DocumentEvent e,
Shape a,
ViewFactory f)
- Overrides:
- insertUpdate in class JView
- See Also:
- insertUpdate
removeUpdate
public void removeUpdate(DocumentEvent e,
Shape a,
ViewFactory f)
- Overrides:
- removeUpdate in class JView
- See Also:
- removeUpdate
changedUpdate
public void changedUpdate(DocumentEvent e,
Shape a,
ViewFactory f)
- Overrides:
- changedUpdate in class JView
- See Also:
- changedUpdate
calculateSize
protected abstract Dimension calculateSize(Rectangle alloc,
ViewFactory f)
isBefore
protected abstract boolean isBefore(Point p,
Rectangle alloc)
isAfter
protected abstract boolean isAfter(Point p,
Rectangle alloc)
getViewAtPoint
protected abstract View getViewAtPoint(Point p,
Rectangle alloc,
ViewFactory f)
- Fetch the child view at the given point.
- Parameters:
- p - The location of the child to fetch
- alloc - The parents allocation on entry, which should
be changed to the childs allocation on exit.
childAllocation
protected abstract Rectangle childAllocation(int index,
Shape allocation,
ViewFactory f)
getViewAtPosition
protected View getViewAtPosition(Position pos,
Rectangle a,
ViewFactory f)
shouldNotHappen
protected void shouldNotHappen()
All Packages Class Hierarchy This Package Previous Next Index