ParagraphView (Java SE 15 & JDK 15) (original) (raw)

All Implemented Interfaces:

[SwingConstants](../SwingConstants.html "interface in javax.swing"), [TabExpander](TabExpander.html "interface in javax.swing.text")

Direct Known Subclasses:

[ParagraphView](html/ParagraphView.html "class in javax.swing.text.html")


public class ParagraphView extends FlowView implements TabExpander

View of a simple line-wrapping paragraph that supports multiple fonts, colors, components, icons, etc. It is basically a vertical box with a margin around it. The contents of the box are a bunch of rows which are special horizontal boxes. This view creates a collection of views that represent the child elements of the paragraph element. Each of these views are placed into a row directly if they will fit, otherwise the breakView method is called to try and carve the view into pieces that fit.

See Also:

View

Fields

Modifier and Type Field Description
protected int firstLineIndent Indentation for the first line, from the left inset.

Fields declared in interface javax.swing.SwingConstants

[BOTTOM](../SwingConstants.html#BOTTOM), [CENTER](../SwingConstants.html#CENTER), [EAST](../SwingConstants.html#EAST), [HORIZONTAL](../SwingConstants.html#HORIZONTAL), [LEADING](../SwingConstants.html#LEADING), [LEFT](../SwingConstants.html#LEFT), [NEXT](../SwingConstants.html#NEXT), [NORTH](../SwingConstants.html#NORTH), [NORTH_EAST](../SwingConstants.html#NORTH%5FEAST), [NORTH_WEST](../SwingConstants.html#NORTH%5FWEST), [PREVIOUS](../SwingConstants.html#PREVIOUS), [RIGHT](../SwingConstants.html#RIGHT), [SOUTH](../SwingConstants.html#SOUTH), [SOUTH_EAST](../SwingConstants.html#SOUTH%5FEAST), [SOUTH_WEST](../SwingConstants.html#SOUTH%5FWEST), [TOP](../SwingConstants.html#TOP), [TRAILING](../SwingConstants.html#TRAILING), [VERTICAL](../SwingConstants.html#VERTICAL), [WEST](../SwingConstants.html#WEST)

Constructors

Constructor Description
ParagraphView​(Element elem) Constructs a ParagraphView for the given element.
Modifier and Type Method Description
View breakView​(int axis, float len,Shape a) Breaks this view on the given axis at the given length.
protected SizeRequirements calculateMinorAxisRequirements​(int axis,SizeRequirements r) Calculate the needs for the paragraph along the minor axis.
void changedUpdate​(DocumentEvent changes,Shape a,ViewFactory f) Gives notification from the document that attributes were changed in a location that this view is responsible for.
protected View createRow() Create a View that should be used to hold a a row's worth of children in a flow.
protected int findOffsetToCharactersInString​(char[] string, int start) Finds the next character in the document with a character instring, starting at offset start.
protected boolean flipEastAndWestAtEnds​(int position,Position.Bias bias) Determines in which direction the next view lays.
float getAlignment​(int axis) Determines the desired alignment for this view along an axis.
int getBreakWeight​(int axis, float len) Gets the break weight for a given location.
protected int getClosestPositionTo​(int pos,Position.Bias b,Shape a, int direction,Position.Bias[] biasRet, int rowIndex, int x) Returns the closest model position to x.
int getFlowSpan​(int index) Fetches the constraining span to flow against for the given child index.
int getFlowStart​(int index) Fetches the location along the flow axis that the flow span will start at.
protected View getLayoutView​(int index) Returns the view at a given index.
protected int getLayoutViewCount() Returns the number of views that this view is responsible for.
protected int getNextNorthSouthVisualPositionFrom​(int pos,Position.Bias b,Shape a, int direction,Position.Bias[] biasRet) Returns the next visual position for the cursor, in either the east or west direction.
protected float getPartialSize​(int startOffset, int endOffset) Returns the size used by the views betweenstartOffset and endOffset.
protected float getTabBase() Returns where the tabs are calculated from.
protected TabSet getTabSet() Gets the Tabset to be used in calculating tabs.
float nextTabStop​(float x, int tabOffset) Returns the next tab stop position given a reference position.
void paint​(Graphics g,Shape a) Renders using the given rendering surface and area on that surface.
protected void setFirstLineIndent​(float fi) Sets the indent on the first line.
protected void setJustification​(int j) Sets the type of justification.
protected void setLineSpacing​(float ls) Sets the line spacing.
protected void setPropertiesFromAttributes() Set the cached properties from the attributes.

Methods declared in class javax.swing.text.BoxView

[baselineLayout](BoxView.html#baselineLayout%28int,int,int%5B%5D,int%5B%5D%29), [baselineRequirements](BoxView.html#baselineRequirements%28int,javax.swing.SizeRequirements%29), [calculateMajorAxisRequirements](BoxView.html#calculateMajorAxisRequirements%28int,javax.swing.SizeRequirements%29), [childAllocation](BoxView.html#childAllocation%28int,java.awt.Rectangle%29), [forwardUpdate](BoxView.html#forwardUpdate%28javax.swing.event.DocumentEvent.ElementChange,javax.swing.event.DocumentEvent,java.awt.Shape,javax.swing.text.ViewFactory%29), [getAxis](BoxView.html#getAxis%28%29), [getChildAllocation](BoxView.html#getChildAllocation%28int,java.awt.Shape%29), [getHeight](BoxView.html#getHeight%28%29), [getMaximumSpan](BoxView.html#getMaximumSpan%28int%29), [getMinimumSpan](BoxView.html#getMinimumSpan%28int%29), [getOffset](BoxView.html#getOffset%28int,int%29), [getPreferredSpan](BoxView.html#getPreferredSpan%28int%29), [getResizeWeight](BoxView.html#getResizeWeight%28int%29), [getSpan](BoxView.html#getSpan%28int,int%29), [getViewAtPoint](BoxView.html#getViewAtPoint%28int,int,java.awt.Rectangle%29), [getWidth](BoxView.html#getWidth%28%29), [isAfter](BoxView.html#isAfter%28int,int,java.awt.Rectangle%29), [isAllocationValid](BoxView.html#isAllocationValid%28%29), [isBefore](BoxView.html#isBefore%28int,int,java.awt.Rectangle%29), [isLayoutValid](BoxView.html#isLayoutValid%28int%29), [layoutChanged](BoxView.html#layoutChanged%28int%29), [layoutMajorAxis](BoxView.html#layoutMajorAxis%28int,int,int%5B%5D,int%5B%5D%29), [layoutMinorAxis](BoxView.html#layoutMinorAxis%28int,int,int%5B%5D,int%5B%5D%29), [modelToView](BoxView.html#modelToView%28int,java.awt.Shape,javax.swing.text.Position.Bias%29), [paintChild](BoxView.html#paintChild%28java.awt.Graphics,java.awt.Rectangle,int%29), [preferenceChanged](BoxView.html#preferenceChanged%28javax.swing.text.View,boolean,boolean%29), [replace](BoxView.html#replace%28int,int,javax.swing.text.View%5B%5D%29), [setAxis](BoxView.html#setAxis%28int%29), [setSize](BoxView.html#setSize%28float,float%29), [viewToModel](BoxView.html#viewToModel%28float,float,java.awt.Shape,javax.swing.text.Position.Bias%5B%5D%29)

Methods declared in class javax.swing.text.CompositeView

[getBottomInset](CompositeView.html#getBottomInset%28%29), [getInsideAllocation](CompositeView.html#getInsideAllocation%28java.awt.Shape%29), [getLeftInset](CompositeView.html#getLeftInset%28%29), [getNextEastWestVisualPositionFrom](CompositeView.html#getNextEastWestVisualPositionFrom%28int,javax.swing.text.Position.Bias,java.awt.Shape,int,javax.swing.text.Position.Bias%5B%5D%29), [getNextVisualPositionFrom](CompositeView.html#getNextVisualPositionFrom%28int,javax.swing.text.Position.Bias,java.awt.Shape,int,javax.swing.text.Position.Bias%5B%5D%29), [getRightInset](CompositeView.html#getRightInset%28%29), [getTopInset](CompositeView.html#getTopInset%28%29), [getView](CompositeView.html#getView%28int%29), [getViewAtPosition](CompositeView.html#getViewAtPosition%28int,java.awt.Rectangle%29), [getViewCount](CompositeView.html#getViewCount%28%29), [getViewIndex](CompositeView.html#getViewIndex%28int,javax.swing.text.Position.Bias%29), [modelToView](CompositeView.html#modelToView%28int,javax.swing.text.Position.Bias,int,javax.swing.text.Position.Bias,java.awt.Shape%29), [setInsets](CompositeView.html#setInsets%28short,short,short,short%29), [setParagraphInsets](CompositeView.html#setParagraphInsets%28javax.swing.text.AttributeSet%29), [setParent](CompositeView.html#setParent%28javax.swing.text.View%29)

Methods declared in class javax.swing.text.View

[append](View.html#append%28javax.swing.text.View%29), [breakView](View.html#breakView%28int,int,float,float%29), [createFragment](View.html#createFragment%28int,int%29), [forwardUpdateToView](View.html#forwardUpdateToView%28javax.swing.text.View,javax.swing.event.DocumentEvent,java.awt.Shape,javax.swing.text.ViewFactory%29), [getAttributes](View.html#getAttributes%28%29), [getBreakWeight](View.html#getBreakWeight%28int,float,float%29), [getContainer](View.html#getContainer%28%29), [getDocument](View.html#getDocument%28%29), [getElement](View.html#getElement%28%29), [getEndOffset](View.html#getEndOffset%28%29), [getGraphics](View.html#getGraphics%28%29), [getParent](View.html#getParent%28%29), [getStartOffset](View.html#getStartOffset%28%29), [getToolTipText](View.html#getToolTipText%28float,float,java.awt.Shape%29), [getViewFactory](View.html#getViewFactory%28%29), [getViewIndex](View.html#getViewIndex%28float,float,java.awt.Shape%29), [insert](View.html#insert%28int,javax.swing.text.View%29), [isVisible](View.html#isVisible%28%29), [modelToView](View.html#modelToView%28int,java.awt.Shape%29), [remove](View.html#remove%28int%29), [removeAll](View.html#removeAll%28%29), [updateChildren](View.html#updateChildren%28javax.swing.event.DocumentEvent.ElementChange,javax.swing.event.DocumentEvent,javax.swing.text.ViewFactory%29), [updateLayout](View.html#updateLayout%28javax.swing.event.DocumentEvent.ElementChange,javax.swing.event.DocumentEvent,java.awt.Shape%29), [viewToModel](View.html#viewToModel%28float,float,java.awt.Shape%29)

Methods declared in class java.lang.Object

[clone](../../../../java.base/java/lang/Object.html#clone%28%29), [equals](../../../../java.base/java/lang/Object.html#equals%28java.lang.Object%29), [finalize](../../../../java.base/java/lang/Object.html#finalize%28%29), [getClass](../../../../java.base/java/lang/Object.html#getClass%28%29), [hashCode](../../../../java.base/java/lang/Object.html#hashCode%28%29), [notify](../../../../java.base/java/lang/Object.html#notify%28%29), [notifyAll](../../../../java.base/java/lang/Object.html#notifyAll%28%29), [toString](../../../../java.base/java/lang/Object.html#toString%28%29), [wait](../../../../java.base/java/lang/Object.html#wait%28%29), [wait](../../../../java.base/java/lang/Object.html#wait%28long%29), [wait](../../../../java.base/java/lang/Object.html#wait%28long,int%29)