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.
-
JIconView(Element, Icon, ViewFactory)
-
-
changedUpdate(DocumentEvent, Shape, ViewFactory)
-
-
getPreferredShape(Shape, ViewFactory)
- Calculates the desired shape of the icon.
-
insertUpdate(DocumentEvent, Shape, ViewFactory)
-
-
modelToView(Position, Shape, ViewFactory)
-
-
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.
-
removeUpdate(DocumentEvent, Shape, ViewFactory)
-
-
viewToModel(Point, Shape, ViewFactory)
-
JIconView
public JIconView(Element elem,
Icon c,
ViewFactory f)
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
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
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