All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.text.JLabelView

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

public class JLabelView
extends JView
Styled chunk of text that represents a view mapped over a text model.


Constructor Index

 o JLabelView(Element)
 o JLabelView(Element, Range)

Method Index

 o breakView(int, float, Shape)
 o changedUpdate(DocumentEvent, Shape, ViewFactory)
 o getBreakPenalty(int, float)
 o getPreferredShape(Shape, ViewFactory)
Calculates the shape of the paragraph.
 o getRange()
 o insertUpdate(DocumentEvent, Shape, ViewFactory)
 o modelToView(Position, Shape, ViewFactory)
 o nextTabStop(int, FontMetrics)
Returns the next tab stop position given a reference position
 o paint(Graphics, Shape, ViewFactory)
Render a portion of a text style run
 o removeUpdate(DocumentEvent, Shape, ViewFactory)
 o shouldNotHappen(String)
 o viewToModel(Point, Shape, ViewFactory)

Constructors

 o JLabelView
 public JLabelView(Element elem,
                   Range rng)
 o JLabelView
 public JLabelView(Element elem)

Methods

 o paint
 public void paint(Graphics g,
                   Shape a,
                   ViewFactory f)
Render a portion of a text style run

Overrides:
paint in class JView
 o getPreferredShape
 public Shape getPreferredShape(Shape candidate,
                                ViewFactory f)
Calculates the shape of the paragraph. The width is basically whatever was given, but the height is calculated based upon the width. If the width has changed, a new height is calculated, otherwise the answer to the size request is cheap as it is simply whatever the last layout produced.

Overrides:
getPreferredShape in class JView
See Also:
getPreferredShape
 o getRange
 public Range getRange()
Overrides:
getRange in class JView
See Also:
getRange
 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
See Also:
insertUpdate
 o removeUpdate
 public void removeUpdate(DocumentEvent evnt,
                          Shape a,
                          ViewFactory f)
Overrides:
removeUpdate in class JView
See Also:
removeUpdate
 o changedUpdate
 public void changedUpdate(DocumentEvent e,
                           Shape a,
                           ViewFactory f)
Overrides:
changedUpdate in class JView
See Also:
changedUpdate
 o getBreakPenalty
 public int getBreakPenalty(int axis,
                            float len)
Overrides:
getBreakPenalty in class JView
See Also:
getBreakPenalty
 o breakView
 public View breakView(int axis,
                       float span,
                       Shape a)
Overrides:
breakView in class JView
See Also:
breakView
 o nextTabStop
 protected int nextTabStop(int x,
                           FontMetrics metrics)
Returns the next tab stop position given a reference position

 o shouldNotHappen
 protected void shouldNotHappen(String msg)

All Packages  Class Hierarchy  This Package  Previous  Next  Index