javax.swing.text
public class WrappedPlainView extends BoxView implements TabExpander
| Constructor Summary | |
|---|---|
| WrappedPlainView(Element elem) | |
| WrappedPlainView(Element elem, boolean wordWrap) | |
| Method Summary | |
|---|---|
| protected int | calculateBreakPosition(int p0, int p1)
Calculates the break position for the text between model positions
p0 and p1. |
| void | changedUpdate(DocumentEvent e, Shape a, ViewFactory f)
Called when the portion of the Document that this View is responsible
for changes. |
| protected void | drawLine(int p0, int p1, Graphics g, int x, int y)
Draws a line of text, suppressing white space at the end and expanding
tabs. |
| protected int | drawSelectedText(Graphics g, int x, int y, int p0, int p1)
Renders the range of text as selected text. |
| protected int | drawUnselectedText(Graphics g, int x, int y, int p0, int p1)
Renders the range of text as normal unhighlighted text. |
| protected Segment | getLineBuffer()
Provides access to the Segment used for retrievals from the Document. |
| float | getMaximumSpan(int axis)
Determines the maximum span along the given axis. |
| float | getMinimumSpan(int axis)
Determines the minimum span along the given axis. |
| float | getPreferredSpan(int axis)
Determines the preferred span along the given axis. |
| protected int | getTabSize()
Returns the tab size for the Document based on
PlainDocument.tabSizeAttribute, defaulting to 8 if this property is
not defined
|
| void | insertUpdate(DocumentEvent e, Shape a, ViewFactory f)
Called when something was inserted. |
| protected void | loadChildren(ViewFactory f)
Loads the children to initiate the view. |
| float | nextTabStop(float x, int tabStop)
Returns the next tab stop position after a given reference position.
|
| void | paint(Graphics g, Shape a)
Renders the Element that is associated with this
View. |
| void | removeUpdate(DocumentEvent e, Shape a, ViewFactory f)
Called when something is removed. |
| void | setSize(float width, float height)
Sets the size of the View. |
Parameters: p0 the start model position p1 the end model position
Returns: the model position at which to break the text
Parameters: p0 starting document position to use p1 ending document position to use g graphics context x starting x position y starting y position
Parameters: g the graphics context x the starting X coordinate y the starting Y coordinate p0 the starting model location p1 the ending model location
Returns: the X coordinate of the end of the text
Throws: BadLocationException if the given range is invalid
Parameters: g the graphics context x the starting X coordinate y the starting Y coordinate p0 the starting model location p1 the end model location
Returns: the X location of the end off the range
Throws: BadLocationException if the range given is invalid
Returns: the Segment.
Returns: the tab size.
tabStop argument.
Parameters: x the current x position in pixels tabStop the position within the text stream that the tab occured at
Element that is associated with this
View. Caches the metrics and then calls
super.paint to paint all the child views.
Parameters: g the Graphics context to render to a the allocated region for the Element