All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.text.JIconView

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

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


Constructor Index

 o JIconView(Element, Icon, ViewFactory)

Method Index

 o changedUpdate(DocumentEvent, Shape, ViewFactory)
 o getPreferredShape(Shape, ViewFactory)
Calculates the desired shape of the icon.
 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 icon has with it's parent container (the same container hosting this view), so this simply allows us to position the icon properly relative to the view.
 o removeUpdate(DocumentEvent, Shape, ViewFactory)
 o viewToModel(Point, Shape, ViewFactory)

Constructors

 o JIconView
 public JIconView(Element elem,
                  Icon 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 icon has with it's parent container (the same container hosting this view), so this simply allows us to position the icon properly relative to the view. Since the coordinate system for the view is simply the parent containers, positioning the child icon 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 icon. The preferred size of the icon is used unless it doesn't fit within the parents constraints. If it doesn't fit, it shrinks the icon 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