All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.text.JComponentView

java.lang.Object
   |
   +----com.sun.java.swing.text.JView
           |
           +----com.sun.java.swing.text.JComponentView

public class JComponentView
extends JView
Component decorator that implements the view interface. The entire element is used to represent the component. This acts as a gateway from the display-only View implementations to interactive lightweight components (ie it allows components to be embedded into the View hierarchy. The parent of the component is the container that is handed out by the associated view factory.


Constructor Index

 o JComponentView(Element, Component, ViewFactory)

Method Index

 o changedUpdate(DocumentEvent, Shape, ViewFactory)
 o getPreferredShape(Shape, ViewFactory)
Calculates the desired shape of the component.
 o insertUpdate(DocumentEvent, Shape, ViewFactory)
 o modelToView(Position, Shape, ViewFactory)
 o paint(Graphics, Shape, ViewFactory)
The real paint behavior occurs naturally from the association that the component has with it's parent container (the same container hosting this view), so this simply allows us to position the component properly relative to the view.
 o removeUpdate(DocumentEvent, Shape, ViewFactory)
 o viewToModel(Point, Shape, ViewFactory)

Constructors

 o JComponentView
 public JComponentView(Element elem,
                       Component c,
                       ViewFactory f)

Methods

 o paint
 public void paint(Graphics g,
                   Shape a,
                   ViewFactory f)
The real paint behavior occurs naturally from the association that the component has with it's parent container (the same container hosting this view), so this simply allows us to position the component properly relative to the view. Since the coordinate system for the view is simply the parent containers, positioning the child component is easy.

Overrides:
paint in class JView
See Also:
paint
 o getPreferredShape
 public Shape getPreferredShape(Shape candidate,
                                ViewFactory f)
Calculates the desired shape of the component. The preferred size of the component is used unless it doesn't fit within the parents constraints. If it doesn't fit, it shrinks the component to the maximum of either the constraint or the mimimum size.

Overrides:
getPreferredShape in class JView
See Also:
getPreferredShape
 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 evnt,
                          Shape a,
                          ViewFactory f)
Overrides:
insertUpdate in class JView
 o removeUpdate
 public void removeUpdate(DocumentEvent evnt,
                          Shape a,
                          ViewFactory f)
Overrides:
removeUpdate in class JView
 o changedUpdate
 public void changedUpdate(DocumentEvent e,
                           Shape a,
                           ViewFactory f)
Overrides:
changedUpdate in class JView

All Packages  Class Hierarchy  This Package  Previous  Next  Index