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.
-
JComponentView(Element, Component, ViewFactory)
-
-
changedUpdate(DocumentEvent, Shape, ViewFactory)
-
-
getPreferredShape(Shape, ViewFactory)
- Calculates the desired shape of the component.
-
insertUpdate(DocumentEvent, Shape, ViewFactory)
-
-
modelToView(Position, Shape, ViewFactory)
-
-
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.
-
removeUpdate(DocumentEvent, Shape, ViewFactory)
-
-
viewToModel(Point, Shape, ViewFactory)
-
JComponentView
public JComponentView(Element elem,
Component c,
ViewFactory f)
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
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
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 evnt,
Shape a,
ViewFactory f)
- Overrides:
- insertUpdate in class JView
removeUpdate
public void removeUpdate(DocumentEvent evnt,
Shape a,
ViewFactory f)
- Overrides:
- removeUpdate in class JView
changedUpdate
public void changedUpdate(DocumentEvent e,
Shape a,
ViewFactory f)
- Overrides:
- changedUpdate in class JView
All Packages Class Hierarchy This Package Previous Next Index