Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.swing.text.View
javax.swing.text.GlyphView
javax.swing.text.LabelView
javax.swing.text.html.InlineView
public class InlineView
extends LabelView
HTML.Tag.CONTENT
). This is
basically a LabelView
that is adjusted to understand styles defined
by stylesheets.
Nested Class Summary |
Nested classes/interfaces inherited from class javax.swing.text.GlyphView | |
GlyphView.GlyphPainter |
Field Summary |
Fields inherited from class javax.swing.text.View | |
BadBreakWeight , ExcellentBreakWeight , ForcedBreakWeight , GoodBreakWeight , X_AXIS , Y_AXIS |
Fields inherited from interface javax.swing.SwingConstants | |
BOTTOM , CENTER , EAST , HORIZONTAL , LEADING , LEFT , NEXT , NORTH , NORTH_EAST , NORTH_WEST , PREVIOUS , RIGHT , SOUTH , SOUTH_EAST , SOUTH_WEST , TOP , TRAILING , VERTICAL , WEST |
Constructor Summary | |
|
Method Summary | |
View |
|
void |
|
AttributeSet |
|
int |
|
float |
|
protected StyleSheet |
|
void |
|
void |
|
protected void |
|
Methods inherited from class javax.swing.text.LabelView | |
changedUpdate , getBackground , getFont , getFontMetrics , getForeground , isStrikeThrough , isSubscript , isSuperscript , isUnderline , setBackground , setPropertiesFromAttributes , setStrikeThrough , setSubscript , setSuperscript , setUnderline |
Methods inherited from class javax.swing.text.GlyphView | |
breakView , changedUpdate , checkPainter , clone , createFragment , getAlignment , getBackground , getBreakWeight , getEndOffset , getFont , getForeground , getGlyphPainter , getNextVisualPositionFrom , getPartialSpan , getPreferredSpan , getStartOffset , getTabExpander , getTabbedSpan , getText , insertUpdate , isStrikeThrough , isSubscript , isSuperscript , isUnderline , modelToView , paint , removeUpdate , setGlyphPainter , viewToModel |
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public InlineView(Element element)
Creates a newInlineView
that renders the specified element.
- Parameters:
element
- the element for this view
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f)
Receives notification that attributes have changed in the document in a location that this view is responsible for. This callssetPropertiesFromAttributes()
.
- Overrides:
- changedUpdate in interface LabelView
- Parameters:
e
- the document eventa
- the current allocation of this viewf
- the view factory for creating new views
- Since:
- 1.5
public AttributeSet getAttributes()
Returns the attributes that are used for rendering. This is implemented to multiplex the attributes specified in the model with a stylesheet.
- Overrides:
- getAttributes in interface View
- Returns:
- the attributes that are used for rendering
public int getBreakWeight(int axis, float pos, float len)
- Overrides:
- getBreakWeight in interface GlyphView
public float getMinimumSpan(int axis)
Returns the minimum span for the specified axis. This returns the width of the longest word for the X axis and the super behaviour for the Y axis. This is a slight deviation from the reference implementation. IMO this should improve rendering behaviour so that an InlineView never gets smaller than the longest word in it.
- Overrides:
- getMinimumSpan in interface View
protected StyleSheet getStyleSheet()
Returns the stylesheet used by this view. This returns the stylesheet of theHTMLDocument
that is rendered by this view.
- Returns:
- the stylesheet used by this view
public void insertUpdate(DocumentEvent e, Shape a, ViewFactory f)
Receives notification that something was inserted into the document in a location that this view is responsible for.
- Overrides:
- insertUpdate in interface GlyphView
- Parameters:
e
- the document eventa
- the current allocation of this viewf
- the view factory for creating new views
- Since:
- 1.5
public void removeUpdate(DocumentEvent e, Shape a, ViewFactory f)
Receives notification that something was removed from the document in a location that this view is responsible for.
- Overrides:
- removeUpdate in interface GlyphView
- Parameters:
e
- the document eventa
- the current allocation of this viewf
- the view factory for creating new views
- Since:
- 1.5
protected void setPropertiesFromAttributes()
Loads the character style properties from the stylesheet.
- Overrides:
- setPropertiesFromAttributes in interface LabelView