API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.text. ParagraphView View Source
Author(s)
Timothy Prinzing
Scott Violet
Igor Kushnirskiy
Since
Version
1.97 04/07/06
Serial
Hierarchy
 Object
      View
          CompositeView
              BoxView
                  FlowView
                      ParagraphView
Implements
 TabExpander
Subclasses
Description
public class ParagraphView
  View of a simple line-wrapping paragraph that supports multiple fonts, colors, components, icons, etc.
See also:    View
Constructors
public ParagraphView (Element elem)
  Constructs a ParagraphView for the given element.
Methods
Hide/Show inherited methods
protected void adjustRow (Row r, int desiredSpan, int x)
  Adjusts the given row if possible to fit within the layout span.
public void append (View v) [Inherited From View]
  Appends a single child view.
protected void baselineLayout (int targetSpan, int axis, int[] offsets, int[] spans) [Inherited From BoxView]
  Computes the location and extent of each child view in this BoxView given the targetSpan, which is the width (or height) of the region we have to work with.
protected SizeRequirements baselineRequirements (int axis, SizeRequirements r) [Inherited From BoxView]
  Calculates the size requirements for this BoxView by examining the size of each child view.
public View breakView (int axis, float len, Shape a)
  Breaks this view on the given axis at the given length.
public View breakView (int axis, int offset, float pos, float len) [Inherited From View]
  Tries to break this view on the given axis.
protected SizeRequirements calculateMajorAxisRequirements (int axis, SizeRequirements r) [Inherited From BoxView]
  Calculates the size requirements for the major axis axis.
protected SizeRequirements calculateMinorAxisRequirements (int axis, SizeRequirements r) [Inherited From FlowView]
  Calculate equirements along the minor axis.
public void changedUpdate (DocumentEvent changes, Shape a, ViewFactory f) [Overrides FlowView]
  Gives notification from the document that attributes were changed in a location that this view is responsible for.
pack-private void checkRequests (int axis) [Inherited From BoxView]
  Checks the request cache and update if needed.
protected void childAllocation (int index, Rectangle alloc) [Inherited From BoxView] [Specified in CompositeView]
  Allocates a region for a child view.
public View createFragment (int p0, int p1) [Inherited From View]
  Creates a view that represents a portion of the element.
protected View createRow () [Specified in FlowView]
  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 in string, starting at offset start.
protected boolean flipEastAndWestAtEnds (int position, Bias bias) [Overrides BoxView]
  Determines in which direction the next view lays.
protected void forwardUpdate (ElementChange ec, DocumentEvent e, Shape a, ViewFactory f) [Inherited From BoxView]
  Forwards the given DocumentEvent to the child views that need to be notified of the change to the model.
protected void forwardUpdateToView (View v, DocumentEvent e, Shape a, ViewFactory f) [Inherited From View]
  Forwards the DocumentEvent to the give child view.
public float getAlignment (int axis) [Overrides BoxView]
  Determines the desired alignment for this view along an axis.
public AttributeSet getAttributes () [Inherited From View]
  Fetches the attributes to use when rendering.
public int getAxis () [Inherited From BoxView]
  Fetches the tile axis property.
protected short getBottomInset () [Inherited From CompositeView]
  Gets the bottom inset.
public int getBreakWeight (int axis, float len)
  Gets the break weight for a given location.
public int getBreakWeight (int axis, float pos, float len) [Inherited From View]
  Determines how attractive a break opportunity in this view is.
public Shape getChildAllocation (int index, Shape a) [Inherited From BoxView]
  Fetches the allocation for the given child view.
protected int getClosestPositionTo (int pos, Bias b, Shape a, int direction, Bias biasRet, int rowIndex, int x) throws BadLocationException
  Returns the closest model position to x.
public Container getContainer () [Inherited From View]
  Fetches the container hosting the view.
public Document getDocument () [Inherited From View]
  Fetches the model associated with the view.
public Element getElement () [Inherited From View]
  Fetches the structural portion of the subject that this view is mapped to.
public int getEndOffset () [Inherited From View]
  Fetches the portion of the model for which this view is responsible.
public int getFlowAxis () [Inherited From FlowView]
  Fetches the axis along which views should be flowed.
public int getFlowSpan (int index) [Overrides FlowView]
  Fetches the constraining span to flow against for the given child index.
public int getFlowStart (int index) [Overrides FlowView]
  Fetches the location along the flow axis that the flow span will start at.
public Graphics getGraphics () [Inherited From View]
  Fetch a Graphics for rendering.
public int getHeight () [Inherited From BoxView]
  Returns the current height of the box.
protected Rectangle getInsideAllocation (Shape a) [Inherited From CompositeView]
  Translates the immutable allocation given to the view to a mutable allocation that represents the interior allocation (i.e.
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 short getLeftInset () [Inherited From CompositeView]
  Gets the left inset.
public float getMaximumSpan (int axis) [Inherited From BoxView]
  Determines the maximum span for this view along an axis.
public float getMinimumSpan (int axis) [Inherited From BoxView]
  Determines the minimum span for this view along an axis.
protected int getNextEastWestVisualPositionFrom (int pos, Bias b, Shape a, int direction, Bias biasRet) throws BadLocationException [Inherited From CompositeView]
  Returns the next visual position for the cursor, in either the east or west direction.
protected int getNextNorthSouthVisualPositionFrom (int pos, Bias b, Shape a, int direction, Bias biasRet) throws BadLocationException [Overrides CompositeView]
  Returns the next visual position for the cursor, in either the east or west direction.
public int getNextVisualPositionFrom (int pos, Bias b, Shape a, int direction, Bias biasRet) throws BadLocationException [Inherited From CompositeView]
  Provides a way to determine the next visually represented model location that one might place a caret.
protected int getOffset (int axis, int childIndex) [Inherited From BoxView]
  Fetches the offset of a particular child's current layout.
public View getParent () [Inherited From View]
  Returns the parent of the view.
protected float getPartialSize (int startOffset, int endOffset)
  Returns the size used by the views between startOffset and endOffset.
public float getPreferredSpan (int axis) [Inherited From BoxView] [Specified in View]
  Determines the preferred span for this view along an axis.
public int getResizeWeight (int axis) [Inherited From BoxView]
  Gets the resize weight.
protected short getRightInset () [Inherited From CompositeView]
  Gets the right inset.
protected int getSpan (int axis, int childIndex) [Inherited From BoxView]
  Fetches the span of a particular childs current layout.
pack-private float getSpanOnAxis (int axis) [Inherited From BoxView]
  Returns the size of the view along an axis.
public int getStartOffset () [Inherited From View]
  Fetches the portion of the model for which this view is responsible.
protected float getTabBase ()
  Returns where the tabs are calculated from.
protected TabSet getTabSet ()
  Gets the Tabset to be used in calculating tabs.
public String getToolTipText (float x, float y, Shape allocation) [Inherited From View]
  Returns the tooltip text at the specified location.
protected short getTopInset () [Inherited From CompositeView]
  Gets the top inset.
public View getView (int n) [Inherited From CompositeView]
  Returns the n-th view in this container.
protected View getViewAtPoint (int x, int y, Rectangle alloc) [Inherited From BoxView] [Specified in CompositeView]
  Fetches the child view at the given coordinates.
protected View getViewAtPosition (int pos, Rectangle a) [Inherited From CompositeView]
  Fetches the child view that represents the given position in the model.
public int getViewCount () [Inherited From CompositeView]
  Returns the number of child views of this view.
public ViewFactory getViewFactory () [Inherited From View]
  Fetches the ViewFactory implementation that is feeding the view hierarchy.
public int getViewIndex (float x, float y, Shape allocation) [Inherited From View]
  Returns the child view index representing the given position in the view.
public int getViewIndex (int pos, Bias b) [Inherited From CompositeView]
  Returns the child view index representing the given position in the model.
protected int getViewIndexAtPosition (int pos) [Inherited From FlowView]
  Fetches the child view index representing the given position in the model.
public int getWidth () [Inherited From BoxView]
  Returns the current width of the box.
public void insert (int offs, View v) [Inherited From View]
  Inserts a single child view.
public void insertUpdate (DocumentEvent changes, Shape a, ViewFactory f) [Inherited From FlowView]
  Gives notification that something was inserted into the document in a location that this view is responsible for.
protected boolean isAfter (int x, int y, Rectangle innerAlloc) [Inherited From BoxView] [Specified in CompositeView]
  Determines if a point falls after an allocated region.
protected boolean isAllocationValid () [Inherited From BoxView]
  Are the allocations for the children still valid?
protected boolean isBefore (int x, int y, Rectangle innerAlloc) [Inherited From BoxView] [Specified in CompositeView]
  Determines if a point falls before an allocated region.
protected boolean isLayoutValid (int axis) [Inherited From BoxView]
  Determines if the layout is valid along the given axis.
public boolean isVisible () [Inherited From View]
  Returns a boolean that indicates whether the view is visible or not.
protected void layout (int width, int height) [Inherited From FlowView]
  Lays out the children.
public void layoutChanged (int axis) [Inherited From BoxView]
  Invalidates the layout along an axis.
protected void layoutMajorAxis (int targetSpan, int axis, int[] offsets, int[] spans) [Inherited From BoxView]
  Performs layout for the major axis of the box (i.e.
protected void layoutMinorAxis (int targetSpan, int axis, int[] offsets, int[] spans) [Inherited From BoxView]
  Performs layout for the minor axis of the box (i.e.
protected void loadChildren (ViewFactory f) [Inherited From FlowView]
  Loads all of the children to initialize the view.
public Shape modelToView (int p0, Bias b0, int p1, Bias b1, Shape a) throws BadLocationException [Inherited From CompositeView]
  Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it.
@Deprecated
public Shape modelToView (int pos, Shape a) throws BadLocationException [Inherited From View]
  Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it.
public Shape modelToView (int pos, Shape a, Bias b) throws BadLocationException [Inherited From BoxView] [Specified in View]
  Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it.
public float nextTabStop (float x, int tabOffset) [Specified in TabExpander]
  Returns the next tab stop position given a reference position.
public void paint (Graphics g, Shape a) [Overrides BoxView] [Specified in View]
  Renders using the given rendering surface and area on that surface.
protected void paintChild (Graphics g, Rectangle alloc, int index) [Inherited From BoxView]
  Paints a child.
public void preferenceChanged (View child, boolean width, boolean height) [Inherited From BoxView]
  This is called by a child to indicate its preferred span has changed.
public void remove (int i) [Inherited From View]
  Removes one of the children at the given position.
public void removeAll () [Inherited From View]
  Removes all of the children.
public void removeUpdate (DocumentEvent changes, Shape a, ViewFactory f) [Inherited From FlowView]
  Gives notification that something was removed from the document in a location that this view is responsible for.
public void replace (int index, int length, View elems) [Inherited From BoxView]
  Invalidates the layout and resizes the cache of requests/allocations.
public void setAxis (int axis) [Inherited From BoxView]
  Sets the tile axis property.
protected void setFirstLineIndent (float fi)
  Sets the indent on the first line.
protected void setInsets (short top, short left, short bottom, short right) [Inherited From CompositeView]
  Sets the insets for the view.
protected void setJustification (int j)
  Sets the type of justification.
protected void setLineSpacing (float ls)
  Sets the line spacing.
protected void setParagraphInsets (AttributeSet attr) [Inherited From CompositeView]
  Sets the insets from the paragraph attributes specified in the given attributes.
public void setParent (View parent) [Inherited From FlowView]
  Sets the parent of the view.
protected void setPropertiesFromAttributes ()
Set the cached properties from the attributes.
public void setSize (float width, float height) [Inherited From BoxView]
  Sets the size of the view.
pack-private void setSpanOnAxis (int axis, float span) [Inherited From BoxView]
  Sets the size of the view along an axis.
protected boolean updateChildren (ElementChange ec, DocumentEvent e, ViewFactory f) [Inherited From View]
  Updates the child views in response to receiving notification that the model changed, and there is change record for the element this view is responsible for.
pack-private void updateChildSizes () [Inherited From BoxView]
Propagates the current allocations to the child views.
protected void updateLayout (ElementChange ec, DocumentEvent e, Shape a) [Inherited From View]
  Updates the layout in response to receiving notification of change from the model.
pack-private int updateLayoutArray (int[] oldArray, int offset, int nInserted) [Inherited From BoxView]
  Resizes the given layout array to match the new number of child views.
@Deprecated
public int viewToModel (float x, float y, Shape a) [Inherited From View]
  Provides a mapping from the view coordinate space to the logical coordinate space of the model.
public int viewToModel (float x, float y, Shape a, Bias bias) [Inherited From BoxView] [Specified in View]
  Provides a mapping from the view coordinate space to the logical coordinate space of the model.
Fields
Hide/Show inherited fields
publicfinalstatic int BadBreakWeight = "0" [Inherited From View]
  The weight to indicate a view is a bad break opportunity for the purpose of formatting.
publicfinalstatic int ExcellentBreakWeight = "2000" [Inherited From View]
  The weight to indicate a view supports breaking, and this represents a very attractive place to break.
protected int firstLineIndent
Indentation for the first line, from the left inset.
publicfinalstatic int ForcedBreakWeight = "3000" [Inherited From View]
  The weight to indicate a view supports breaking, and must be broken to be represented properly when placed in a view that formats its children by breaking them.
publicfinalstatic int GoodBreakWeight = "1000" [Inherited From View]
  The weight to indicate a view supports breaking, but better opportunities probably exist.
pack-privatestatic Class i18nStrategy
Used to create an i18n-based layout strategy
protected View layoutPool [Inherited From FlowView]
  These are the views that represent the child elements of the element this view represents (The logical view to translate to a physical view).
protected int layoutSpan [Inherited From FlowView]
Default constraint against which the flow is created against.
pack-private boolean majorAllocValid [Inherited From BoxView]
pack-private int majorAxis [Inherited From BoxView]
pack-private int majorOffsets [Inherited From BoxView]
pack-private SizeRequirements majorRequest [Inherited From BoxView]
pack-private boolean majorReqValid [Inherited From BoxView]
pack-private int majorSpan [Inherited From BoxView]
pack-private int majorSpans [Inherited From BoxView]
pack-private boolean minorAllocValid [Inherited From BoxView]
pack-private int minorOffsets [Inherited From BoxView]
pack-private SizeRequirements minorRequest [Inherited From BoxView]
pack-private boolean minorReqValid [Inherited From BoxView]
pack-private int minorSpan [Inherited From BoxView]
pack-private int minorSpans [Inherited From BoxView]
pack-privatefinalstatic Bias sharedBiasReturn [Inherited From View]
protected FlowStrategy strategy [Inherited From FlowView]
  The behavior for keeping the flow updated.
pack-privatestatic char tabChars
Used for searching for a tab.
pack-privatestatic char tabDecimalChars
Used for searching for a tab or decimal character.
pack-private Rectangle tempRect [Inherited From BoxView]
used in paint.
publicfinalstatic int X_AXIS = "0" [Inherited From View]
Axis for format/break operations.
publicfinalstatic int Y_AXIS = "1" [Inherited From View]
Axis for format/break operations.
Nested Classes
  ParagraphView.Row
Internally created view that has the purpose of holding the views that represent the children of the paragraph that have been arranged in rows.
  FlowView.FlowStrategy
Strategy for maintaining the physical form of the flow.
  FlowView.LogicalView
This class can be used to represent a logical view for a flow.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar