APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.text.html

pack-priv Class LineView

extends ParagraphView
Class Inheritance
Imports
java.util.Enumeration, java.awt.*, javax.swing.*, javax.swing.border.*, javax.swing.event.*, javax.swing.text.*

A view implementation to display an unwrapped preformatted line.

This subclasses ParagraphView, but this really only contains one Row of text.

Author
Timothy Prinzing

Field Summary

Modifier and TypeField and Description
pack-priv int
tabBase

Hides javax.swing.text.ParagraphView.tabBase.

Last place painted at.

Constructor Summary

AccessConstructor and Description
public
LineView(Element
the element to wrap in a view
elem
)

Creates a LineView object.

Method Summary

Modifier and TypeMethod and Description
public float

Returns:

the alignment
getAlignment
(int
may be either X_AXIS or Y_AXIS
axis
)

Overrides javax.swing.text.ParagraphView.getAlignment.

Gets the alignment for an axis.

protected int
getCharactersPerTab()

Returns: number of characters per tab, 8.

public float

Returns:

the minimum span the view can be rendered into
getMinimumSpan
(int
may be either View.X_AXIS or View.Y_AXIS
axis
)

Overrides javax.swing.text.html.ParagraphView.getMinimumSpan.

Determines the minimum span for this view along an axis.

protected float
getPreTab(float x, int tabOffset)

Returns the location for the tab.

public int

Returns:

the weight
getResizeWeight
(int
may be either X_AXIS or Y_AXIS
axis
)

Overrides javax.swing.text.BoxView.getResizeWeight.

Gets the resize weight for the specified axis.

public boolean
isVisible()

Overrides javax.swing.text.html.ParagraphView.isVisible.

Preformatted lines are not suppressed if they have only whitespace, so they are always visible.

protected void
layout(int
the width to lay out against >= 0. This is the width inside of the inset area.
width
,
int
the height to lay out against >= 0 (not used by paragraph, but used by the superclass). This is the height inside of the inset area.
height
)

Overrides javax.swing.text.FlowView.layout.

Lays out the children.

public float

Returns:

the trailing end of the tab expansion >= 0
nextTabStop
(float
the X reference position
x
,
int
the position within the text stream that the tab occurred at >= 0.
tabOffset
)

Overrides javax.swing.text.ParagraphView.nextTabStop.

Implements javax.swing.text.TabExpander.nextTabStop.

Returns the next tab stop position given a reference position.

Inherited from javax.swing.text.html.ParagraphView:
calculateMinorAxisRequirementsgetAttributesgetMaximumSpangetPreferredSpangetStyleSheetpaintsetParentsetPropertiesFromAttributes

Field Detail

tabBaseback to summary
pack-priv int tabBase

Hides javax.swing.text.ParagraphView.tabBase.

Last place painted at.

Constructor Detail

LineViewback to summary
public LineView(Element elem)

Creates a LineView object.

Parameters
elem:Element

the element to wrap in a view

Method Detail

getAlignmentback to summary
public float getAlignment(int axis)

Overrides javax.swing.text.ParagraphView.getAlignment.

Gets the alignment for an axis.

Parameters
axis:int

may be either X_AXIS or Y_AXIS

Returns:float

the alignment

getCharactersPerTabback to summary
protected int getCharactersPerTab()
Returns:int

number of characters per tab, 8.

getMinimumSpanback to summary
public float getMinimumSpan(int axis)

Overrides javax.swing.text.html.ParagraphView.getMinimumSpan.

Determines the minimum span for this view along an axis. The preformatted line should refuse to be sized less than the preferred size.

Parameters
axis:int

may be either View.X_AXIS or View.Y_AXIS

Returns:float

the minimum span the view can be rendered into

See Also
View#getPreferredSpan
getPreTabback to summary
protected float getPreTab(float x, int tabOffset)

Returns the location for the tab.

Annotations
@SuppressWarnings:deprecation
getResizeWeightback to summary
public int getResizeWeight(int axis)

Overrides javax.swing.text.BoxView.getResizeWeight.

Gets the resize weight for the specified axis.

Parameters
axis:int

may be either X_AXIS or Y_AXIS

Returns:int

the weight

isVisibleback to summary
public boolean isVisible()

Overrides javax.swing.text.html.ParagraphView.isVisible.

Preformatted lines are not suppressed if they have only whitespace, so they are always visible.

layoutback to summary
protected void layout(int width, int height)

Overrides javax.swing.text.FlowView.layout.

Lays out the children. If the layout span has changed, the rows are rebuilt. The superclass functionality is called after checking and possibly rebuilding the rows. If the height has changed, the preferenceChanged method is called on the parent since the vertical preference is rigid.

Parameters
width:int

the width to lay out against >= 0. This is the width inside of the inset area.

height:int

the height to lay out against >= 0 (not used by paragraph, but used by the superclass). This is the height inside of the inset area.

nextTabStopback to summary
public float nextTabStop(float x, int tabOffset)

Overrides javax.swing.text.ParagraphView.nextTabStop.

Implements javax.swing.text.TabExpander.nextTabStop.

Returns the next tab stop position given a reference position. This view implements the tab coordinate system, and calls getTabbedSpan on the logical children in the process of layout to determine the desired span of the children. The logical children can delegate their tab expansion upward to the paragraph which knows how to expand tabs. LabelView is an example of a view that delegates its tab expansion needs upward to the paragraph.

This is implemented to try and locate a TabSet in the paragraph element's attribute set. If one can be found, its settings will be used, otherwise a default expansion will be provided. The base location for tab expansion is the left inset from the paragraphs most recent allocation (which is what the layout of the children is based upon).

Parameters
x:float

the X reference position

tabOffset:int

the position within the text stream that the tab occurred at >= 0.

Returns:float

the trailing end of the tab expansion >= 0

See Also
TabSet, TabStop, LabelView