View of plain text (text with only one font and color) that does line-wrapping. This view expects that its associated element has child elements that represent the lines it should be wrapping. It is implemented as a vertical box that contains logical line views. The logical line views are nested classes that render the logical line as multiple physical line if the logical line is too wide to fit within the allocation. The line views draw upon the outer class for its state to reduce their memory requirements.
The line views do all of their rendering through the drawLine method which in turn does all of its rendering through the drawSelectedText and drawUnselectedText methods. This enables subclasses to easily specialize the rendering without concern for the layout aspects.
View of plain text (text with only one font and color) that does line-wrapping. This view expects that its associated element has child elements that represent the lines it should be wrapping. It is implemented as a vertical box that contains logical line views. The logical line views are nested classes that render the logical line as multiple physical line if the logical line is too wide to fit within the allocation. The line views draw upon the outer class for its state to reduce their memory requirements. The line views do all of their rendering through the drawLine method which in turn does all of its rendering through the drawSelectedText and drawUnselectedText methods. This enables subclasses to easily specialize the rendering without concern for the layout aspects.
(->wrapped-plain-view elem)
(->wrapped-plain-view elem word-wrap)
Constructor.
Creates a new WrappedPlainView. Lines can be wrapped on either character or word boundaries depending upon the setting of the wordWrap parameter.
elem - the element underlying the view - javax.swing.text.Element
word-wrap - should lines be wrapped on word boundaries? - boolean
Constructor. Creates a new WrappedPlainView. Lines can be wrapped on either character or word boundaries depending upon the setting of the wordWrap parameter. elem - the element underlying the view - `javax.swing.text.Element` word-wrap - should lines be wrapped on word boundaries? - `boolean`
(changed-update this e a f)
Gives notification from the document that attributes were changed in a location that this view is responsible for.
e - the change information from the associated document - javax.swing.event.DocumentEvent
a - the current allocation of the view - java.awt.Shape
f - the factory to use to rebuild if the view has children - javax.swing.text.ViewFactory
Gives notification from the document that attributes were changed in a location that this view is responsible for. e - the change information from the associated document - `javax.swing.event.DocumentEvent` a - the current allocation of the view - `java.awt.Shape` f - the factory to use to rebuild if the view has children - `javax.swing.text.ViewFactory`
(get-maximum-span this axis)
Determines the maximum span for this view along an axis. This is implemented to provide the superclass behavior after first making sure that the current font metrics are cached (for the nested lines which use the metrics to determine the height of the potentially wrapped lines).
axis - may be either View.X_AXIS or View.Y_AXIS - int
returns: the span the view would like to be rendered into.
Typically the view is told to render into the span
that is returned, although there is no guarantee.
The parent may choose to resize or break the view. - float
Determines the maximum span for this view along an axis. This is implemented to provide the superclass behavior after first making sure that the current font metrics are cached (for the nested lines which use the metrics to determine the height of the potentially wrapped lines). axis - may be either View.X_AXIS or View.Y_AXIS - `int` returns: the span the view would like to be rendered into. Typically the view is told to render into the span that is returned, although there is no guarantee. The parent may choose to resize or break the view. - `float`
(get-minimum-span this axis)
Determines the minimum span for this view along an axis. This is implemented to provide the superclass behavior after first making sure that the current font metrics are cached (for the nested lines which use the metrics to determine the height of the potentially wrapped lines).
axis - may be either View.X_AXIS or View.Y_AXIS - int
returns: the span the view would like to be rendered into.
Typically the view is told to render into the span
that is returned, although there is no guarantee.
The parent may choose to resize or break the view. - float
Determines the minimum span for this view along an axis. This is implemented to provide the superclass behavior after first making sure that the current font metrics are cached (for the nested lines which use the metrics to determine the height of the potentially wrapped lines). axis - may be either View.X_AXIS or View.Y_AXIS - `int` returns: the span the view would like to be rendered into. Typically the view is told to render into the span that is returned, although there is no guarantee. The parent may choose to resize or break the view. - `float`
(get-preferred-span this axis)
Determines the preferred span for this view along an axis. This is implemented to provide the superclass behavior after first making sure that the current font metrics are cached (for the nested lines which use the metrics to determine the height of the potentially wrapped lines).
axis - may be either View.X_AXIS or View.Y_AXIS - int
returns: the span the view would like to be rendered into.
Typically the view is told to render into the span
that is returned, although there is no guarantee.
The parent may choose to resize or break the view. - float
Determines the preferred span for this view along an axis. This is implemented to provide the superclass behavior after first making sure that the current font metrics are cached (for the nested lines which use the metrics to determine the height of the potentially wrapped lines). axis - may be either View.X_AXIS or View.Y_AXIS - `int` returns: the span the view would like to be rendered into. Typically the view is told to render into the span that is returned, although there is no guarantee. The parent may choose to resize or break the view. - `float`
(insert-update this e a f)
Gives notification that something was inserted into the document in a location that this view is responsible for. This is implemented to simply update the children.
e - the change information from the associated document - javax.swing.event.DocumentEvent
a - the current allocation of the view - java.awt.Shape
f - the factory to use to rebuild if the view has children - javax.swing.text.ViewFactory
Gives notification that something was inserted into the document in a location that this view is responsible for. This is implemented to simply update the children. e - the change information from the associated document - `javax.swing.event.DocumentEvent` a - the current allocation of the view - `java.awt.Shape` f - the factory to use to rebuild if the view has children - `javax.swing.text.ViewFactory`
(next-tab-stop this x tab-offset)
Returns the next tab stop position after a given reference position. This implementation does not support things like centering so it ignores the tabOffset argument.
x - the current position >= 0 - float
tab-offset - the position within the text stream that the tab occurred at >= 0. - int
returns: the tab stop, measured in points >= 0 - float
Returns the next tab stop position after a given reference position. This implementation does not support things like centering so it ignores the tabOffset argument. x - the current position >= 0 - `float` tab-offset - the position within the text stream that the tab occurred at >= 0. - `int` returns: the tab stop, measured in points >= 0 - `float`
(paint this g a)
Renders using the given rendering surface and area on that surface. This is implemented to stash the selection positions, selection colors, and font metrics for the nested lines to use.
g - the rendering surface to use - java.awt.Graphics
a - the allocated region to render into - java.awt.Shape
Renders using the given rendering surface and area on that surface. This is implemented to stash the selection positions, selection colors, and font metrics for the nested lines to use. g - the rendering surface to use - `java.awt.Graphics` a - the allocated region to render into - `java.awt.Shape`
(remove-update this e a f)
Gives notification that something was removed from the document in a location that this view is responsible for. This is implemented to simply update the children.
e - the change information from the associated document - javax.swing.event.DocumentEvent
a - the current allocation of the view - java.awt.Shape
f - the factory to use to rebuild if the view has children - javax.swing.text.ViewFactory
Gives notification that something was removed from the document in a location that this view is responsible for. This is implemented to simply update the children. e - the change information from the associated document - `javax.swing.event.DocumentEvent` a - the current allocation of the view - `java.awt.Shape` f - the factory to use to rebuild if the view has children - `javax.swing.text.ViewFactory`
(set-size this width height)
Sets the size of the view. This should cause layout of the view along the given axis, if it has any layout duties.
width - the width >= 0 - float
height - the height >= 0 - float
Sets the size of the view. This should cause layout of the view along the given axis, if it has any layout duties. width - the width >= 0 - `float` height - the height >= 0 - `float`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close