javax.swing.text
Class CompositeViewjava.lang.Object | +--javax.swing.text.View | +--javax.swing.text.CompositeView
- All Implemented Interfaces:
- SwingConstants
- Direct Known Subclasses:
- BoxView
- public abstract class CompositeView
- extends View
CompositeView is an abstract View implementation which manages one or more child views. (Note that CompositeView is intended for managing relatively small numbers of child views.) CompositeView is intended to be used as a starting point for View implementations, such as BoxView, that will contain child Views. Subclasses that wish to manage the collection of child Views should use the replace(int, int, javax.swing.text.View[]) method. As View invokes replace during DocumentListener notification, you normally won't need to directly invoke replace.
While CompositeView does not impose a layout policy on its child Views, it does allow for inseting the child Views it will contain. The insets can be set by either setInsets(short, short, short, short) or setParagraphInsets(javax.swing.text.AttributeSet).
In addition to the abstract methods of View, subclasses of CompositeView will need to override:
- isBefore(int, int, java.awt.Rectangle) - Used to test if a given View location is before the visual space of the CompositeView.
- isAfter(int, int, java.awt.Rectangle) - Used to test if a given View location is after the visual space of the CompositeView.
- getViewAtPoint(int, int, java.awt.Rectangle) - Returns the view at a given visual location.
- childAllocation(int, java.awt.Rectangle) - Returns the bounds of a particular child View. getChildAllocation will invoke childAllocation after offseting the bounds by the Insets of the CompositeView.
Field Summary