javax.swing.text.html

Class InlineView

public class InlineView extends LabelView

Renders HTML content (identified by {@link HTML.Tag#CONTENT}). This is basically a {@link LabelView} that is adjusted to understand styles defined by stylesheets.
Constructor Summary
InlineView(Element element)
Creates a new InlineView that renders the specified element.
Method Summary
ViewbreakView(int axis, int offset, float pos, float len)
voidchangedUpdate(DocumentEvent e, Shape a, ViewFactory f)
Receives notification that attributes have changed in the document in a location that this view is responsible for.
AttributeSetgetAttributes()
Returns the attributes that are used for rendering.
intgetBreakWeight(int axis, float pos, float len)
floatgetMinimumSpan(int axis)
Returns the minimum span for the specified axis.
protected StyleSheetgetStyleSheet()
Returns the stylesheet used by this view.
voidinsertUpdate(DocumentEvent e, Shape a, ViewFactory f)
Receives notification that something was inserted into the document in a location that this view is responsible for.
voidremoveUpdate(DocumentEvent e, Shape a, ViewFactory f)
Receives notification that something was removed from the document in a location that this view is responsible for.
protected voidsetPropertiesFromAttributes()
Loads the character style properties from the stylesheet.

Constructor Detail

InlineView

public InlineView(Element element)
Creates a new InlineView that renders the specified element.

Parameters: element the element for this view

Method Detail

breakView

public View breakView(int axis, int offset, float pos, float len)

changedUpdate

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 calls {@link #setPropertiesFromAttributes}.

Parameters: e the document event a the current allocation of this view f the view factory for creating new views

Since: 1.5

getAttributes

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.

Returns: the attributes that are used for rendering

getBreakWeight

public int getBreakWeight(int axis, float pos, float len)

getMinimumSpan

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.

getStyleSheet

protected StyleSheet getStyleSheet()
Returns the stylesheet used by this view. This returns the stylesheet of the HTMLDocument that is rendered by this view.

Returns: the stylesheet used by this view

insertUpdate

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.

Parameters: e the document event a the current allocation of this view f the view factory for creating new views

Since: 1.5

removeUpdate

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.

Parameters: e the document event a the current allocation of this view f the view factory for creating new views

Since: 1.5

setPropertiesFromAttributes

protected void setPropertiesFromAttributes()
Loads the character style properties from the stylesheet.