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.


Constructor Index

 o JCompositeView(Element)
Construct a JCompositeView for the given element.

Method Index

 o calculateSize(Rectangle, ViewFactory)
 o changedUpdate(DocumentEvent, Shape, ViewFactory)
 o childAllocation(int, Shape, ViewFactory)
 o getPreferredShape(Shape, ViewFactory)
 o getView(int)
Gets the nth view in this container.
 o getViewAtPoint(Point, Rectangle, ViewFactory)
Fetch the child view at the given point.
 o getViewAtPosition(Position, Rectangle, ViewFactory)
 o getViewCount()
Returns the number of views in this view.
 o insertUpdate(DocumentEvent, Shape, ViewFactory)
 o insertView(int, View)
 o invalidate()
Note that the desired size has changed
 o isAfter(Point, Rectangle)
 o isBefore(Point, Rectangle)
 o loadChildren(ViewFactory)
Convenience method to load all of the children for the case where children are created for each element.
 o modelToView(Position, Shape, ViewFactory)
 o paint(Graphics, Shape, ViewFactory)
This doesn't actually render anything, but it invalidates if the allocation has changed.
 o removeAllViews()
 o removeUpdate(DocumentEvent, Shape, ViewFactory)
 o removeView(int)
 o shouldNotHappen()
 o viewToModel(Point, Shape, ViewFactory)

Constructors

 o 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.

Methods

 o 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.

 o getViewCount
 public int getViewCount()
Returns the number of views in this view.

See Also:
getView
 o invalidate
 public void invalidate()
Note that the desired size has changed

 o getView
 public View getView(int n)
Gets the nth view in this container.

Parameters:
n - the number of the view to get
 o removeView
 public void removeView(int n)
 o insertView
 public void insertView(int n,
                        View v)
 o removeAllViews
 public void removeAllViews()
 o getPreferredShape
 public Shape getPreferredShape(Shape candidate,
                                ViewFactory f)
Overrides:
getPreferredShape in class JView
See Also:
getPreferredShape
 o 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
 o 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
 o viewToModel
 public Position viewToModel(Point pt,
                             Shape a,
                             ViewFactory f)
Overrides:
viewToModel in class JView
See Also:
viewToModel
 o insertUpdate
 public void insertUpdate(DocumentEvent e,
                          Shape a,
                          ViewFactory f)
Overrides:
insertUpdate in class JView
See Also:
insertUpdate
 o removeUpdate
 public void removeUpdate(DocumentEvent e,
                          Shape a,
                          ViewFactory f)
Overrides:
removeUpdate in class JView
See Also:
removeUpdate
 o changedUpdate
 public void changedUpdate(DocumentEvent e,
                           Shape a,
                           ViewFactory f)
Overrides:
changedUpdate in class JView
See Also:
changedUpdate
 o calculateSize
 protected abstract Dimension calculateSize(Rectangle alloc,
                                            ViewFactory f)
 o isBefore
 protected abstract boolean isBefore(Point p,
                                     Rectangle alloc)
 o isAfter
 protected abstract boolean isAfter(Point p,
                                    Rectangle alloc)
 o 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.
 o childAllocation
 protected abstract Rectangle childAllocation(int index,
                                              Shape allocation,
                                              ViewFactory f)
 o getViewAtPosition
 protected View getViewAtPosition(Position pos,
                                  Rectangle a,
                                  ViewFactory f)
 o shouldNotHappen
 protected void shouldNotHappen()

All Packages  Class Hierarchy  This Package  Previous  Next  Index