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

public abstract Class FlowView

extends BoxView
Class Inheritance
Known Direct Subclasses
javax.swing.text.ParagraphView
Imports
java.awt.*, java.util.Vector, javax.swing.event.*, javax.swing.SizeRequirements

A View that tries to flow it's children into some partially constrained space. This can be used to build things like paragraphs, pages, etc. The flow is made up of the following pieces of functionality.
Author
Timothy Prinzing
Since
1.3
See Also
View

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
FlowView.FlowStrategy

Strategy for maintaining the physical form of the flow.

pack-priv static class
FlowView.LogicalView

This class can be used to represent a logical view for a flow.

Field Summary

Modifier and TypeField and Description
protected View
layoutPool

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

Default constraint against which the flow is created against.

protected FlowView.FlowStrategy
strategy

The behavior for keeping the flow updated.

Inherited from javax.swing.text.BoxView:
majorAllocValidmajorAxismajorOffsetsmajorRequestmajorReqValidmajorSpanmajorSpansminorAllocValidminorOffsetsminorRequestminorReqValidminorSpanminorSpanstempRect

Constructor Summary

AccessConstructor and Description
public
FlowView(Element
the element that this view is responsible for
elem
,
int
may be either View.X_AXIS or View.Y_AXIS
axis
)

Constructs a FlowView for the given element.

Method Summary

Modifier and TypeMethod and Description
protected SizeRequirements
calculateMinorAxisRequirements(int axis, SizeRequirements r)

Overrides javax.swing.text.BoxView.calculateMinorAxisRequirements.

Calculate requirements along the minor axis.

public void
changedUpdate(DocumentEvent
the change information from the associated document
changes
,
Shape
the current allocation of the view
a
,
ViewFactory
the factory to use to rebuild if the view has children
f
)

Overrides javax.swing.text.View.changedUpdate.

Gives notification from the document that attributes were changed in a location that this view is responsible for.

protected abstract View

Returns:

a View that should be used to hold a a rows worth of children in a flow
createRow
()

Create a View that should be used to hold a a rows worth of children in a flow.

public int

Returns:

the axis along which views should be flowed
getFlowAxis
()

Fetches the axis along which views should be flowed.

public int

Returns:

the constraining span to flow against for the given child index
getFlowSpan
(int
the index of the row being updated. This should be a value >= 0 and < getViewCount().
index
)

Fetch the constraining span to flow against for the given child index.

public int

Returns:

the location along the flow axis that the flow span will start at
getFlowStart
(int
the index of the row being updated. This should be a value >= 0 and < getViewCount().
index
)

Fetch the location along the flow axis that the flow span will start at.

protected int

Returns:

index of the view representing the given position, or -1 if no view represents that position
getViewIndexAtPosition
(int
the position >= 0
pos
)

Overrides javax.swing.text.CompositeView.getViewIndexAtPosition.

Fetches the child view index representing the given position in the model.

public void
insertUpdate(DocumentEvent
the change information from the associated document
changes
,
Shape
the current allocation of the view
a
,
ViewFactory
the factory to use to rebuild if the view has children
f
)

Overrides javax.swing.text.View.insertUpdate.

Gives notification that something was inserted into the document in a location that this view is responsible for.

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 This is the height inside of the inset area.
height
)

Overrides javax.swing.text.BoxView.layout.

Lays out the children.

protected void
loadChildren(ViewFactory
the view factory
f
)

Overrides javax.swing.text.CompositeView.loadChildren.

Loads all of the children to initialize the view.

public void
removeUpdate(DocumentEvent
the change information from the associated document
changes
,
Shape
the current allocation of the view
a
,
ViewFactory
the factory to use to rebuild if the view has children
f
)

Overrides javax.swing.text.View.removeUpdate.

Gives notification that something was removed from the document in a location that this view is responsible for.

public void
setParent(View parent)

Overrides javax.swing.text.CompositeView.setParent.

Sets the parent of the view.

Inherited from javax.swing.text.BoxView:
baselineLayoutbaselineRequirementscalculateMajorAxisRequirementscheckRequestschildAllocationflipEastAndWestAtEndsforwardUpdategetAlignmentgetAxisgetChildAllocationgetHeightgetMaximumSpangetMinimumSpangetOffsetgetPreferredSpangetResizeWeightgetSpangetSpanOnAxisgetViewAtPointgetWidthisAfterisAllocationValidisBeforeisLayoutValidlayoutChangedlayoutMajorAxislayoutMinorAxismodelToViewpaintpaintChildpreferenceChangedreplacesetAxissetSizesetSpanOnAxisupdateChildSizesupdateLayoutArrayviewToModel

Field Detail

layoutPoolback to summary
protected View layoutPool

These are the views that represent the child elements of the element this view represents (The logical view to translate to a physical view). These are not directly children of this view. These are either placed into the rows directly or used for the purpose of breaking into smaller chunks, to form the physical view.

layoutSpanback to summary
protected int layoutSpan

Default constraint against which the flow is created against.

strategyback to summary
protected FlowView.FlowStrategy strategy

The behavior for keeping the flow updated. By default this is a singleton shared by all instances of FlowView (FlowStrategy is stateless). Subclasses can create an alternative strategy, which might keep state.

Constructor Detail

FlowViewback to summary
public FlowView(Element elem, int axis)

Constructs a FlowView for the given element.

Parameters
elem:Element

the element that this view is responsible for

axis:int

may be either View.X_AXIS or View.Y_AXIS

Method Detail

calculateMinorAxisRequirementsback to summary
protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r)

Overrides javax.swing.text.BoxView.calculateMinorAxisRequirements.

Calculate requirements along the minor axis. This is implemented to forward the request to the logical view by calling getMinimumSpan, getPreferredSpan, and getMaximumSpan on it.

changedUpdateback to summary
public void changedUpdate(DocumentEvent changes, Shape a, ViewFactory f)

Overrides javax.swing.text.View.changedUpdate.

Gives notification from the document that attributes were changed in a location that this view is responsible for.

Parameters
changes:DocumentEvent

the change information from the associated document

a:Shape

the current allocation of the view

f:ViewFactory

the factory to use to rebuild if the view has children

See Also
View#changedUpdate
createRowback to summary
protected abstract View createRow()

Create a View that should be used to hold a a rows worth of children in a flow. This is called by the FlowStrategy when new children are added or removed (i.e. rows are added or removed) in the process of updating the flow.

Returns:View

a View that should be used to hold a a rows worth of children in a flow

getFlowAxisback to summary
public int getFlowAxis()

Fetches the axis along which views should be flowed. By default, this will be the axis orthogonal to the axis along which the flow rows are tiled (the axis of the default flow rows themselves). This is typically used by the FlowStrategy.

Returns:int

the axis along which views should be flowed

getFlowSpanback to summary
public int getFlowSpan(int index)

Fetch the constraining span to flow against for the given child index. This is called by the FlowStrategy while it is updating the flow. A flow can be shaped by providing different values for the row constraints. By default, the entire span inside of the insets along the flow axis is returned.

Parameters
index:int

the index of the row being updated. This should be a value >= 0 and < getViewCount().

Returns:int

the constraining span to flow against for the given child index

See Also
getFlowStart
getFlowStartback to summary
public int getFlowStart(int index)

Fetch the location along the flow axis that the flow span will start at. This is called by the FlowStrategy while it is updating the flow. A flow can be shaped by providing different values for the row constraints.

Parameters
index:int

the index of the row being updated. This should be a value >= 0 and < getViewCount().

Returns:int

the location along the flow axis that the flow span will start at

See Also
getFlowSpan
getViewIndexAtPositionback to summary
protected int getViewIndexAtPosition(int pos)

Overrides javax.swing.text.CompositeView.getViewIndexAtPosition.

Fetches the child view index representing the given position in the model.

Parameters
pos:int

the position >= 0

Returns:int

index of the view representing the given position, or -1 if no view represents that position

insertUpdateback to summary
public void insertUpdate(DocumentEvent changes, Shape a, ViewFactory f)

Overrides javax.swing.text.View.insertUpdate.

Gives notification that something was inserted into the document in a location that this view is responsible for.

Parameters
changes:DocumentEvent

the change information from the associated document

a:Shape

the current allocation of the view

f:ViewFactory

the factory to use to rebuild if the view has children

See Also
View#insertUpdate
layoutback to summary
protected void layout(int width, int height)

Overrides javax.swing.text.BoxView.layout.

Lays out the children. If the span along the flow axis has changed, layout is marked as invalid which which will cause the superclass behavior to recalculate the layout along the box axis. The FlowStrategy.layout method will be called to rebuild the flow rows as appropriate. If the height of this view changes (determined by the preferred size along the box axis), a preferenceChanged is called. Following all of that, the normal box layout of the superclass is performed.

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 This is the height inside of the inset area.

loadChildrenback to summary
protected void loadChildren(ViewFactory f)

Overrides javax.swing.text.CompositeView.loadChildren.

Loads all of the children to initialize the view. This is called by the setParent method. This is reimplemented to not load any children directly (as they are created in the process of formatting). If the layoutPool variable is null, an instance of LogicalView is created to represent the logical view that is used in the process of formatting.

Parameters
f:ViewFactory

the view factory

removeUpdateback to summary
public void removeUpdate(DocumentEvent changes, Shape a, ViewFactory f)

Overrides javax.swing.text.View.removeUpdate.

Gives notification that something was removed from the document in a location that this view is responsible for.

Parameters
changes:DocumentEvent

the change information from the associated document

a:Shape

the current allocation of the view

f:ViewFactory

the factory to use to rebuild if the view has children

See Also
View#removeUpdate
setParentback to summary
public void setParent(View parent)

Overrides javax.swing.text.CompositeView.setParent.

Doc from javax.swing.text.CompositeView.setParent.

Sets the parent of the view. This is reimplemented to provide the superclass behavior as well as calling the loadChildren method if this view does not already have children. The children should not be loaded in the constructor because the act of setting the parent may cause them to try to search up the hierarchy (to get the hosting Container for example). If this view has children (the view is being moved from one place in the view hierarchy to another), the loadChildren method will not be called.

javax.swing.text back to summary

public Class FlowView.FlowStrategy

extends Object
Class Inheritance
Known Direct Subclasses
javax.swing.text.TextLayoutStrategy

Strategy for maintaining the physical form of the flow. The default implementation is completely stateless, and recalculates the entire flow if the layout is invalid on the given FlowView. Alternative strategies can be implemented by subclassing, and might perform incremental repair to the layout or alternative breaking behavior.
Since
1.3

Field Summary

Modifier and TypeField and Description
pack-priv Position
pack-priv Vector<View>

Constructor Summary

AccessConstructor and Description
public
FlowStrategy()

Constructs a FlowStrategy.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
addDamage(FlowView fv, int offset)

protected void
adjustRow(FlowView
the flow view
fv
,
int
the row to adjust to the current layout span.
rowIndex
,
int
the current layout span >= 0
desiredSpan
,
int
the location r starts at.
x
)

Adjusts the given row if possible to fit within the layout span.

public void
changedUpdate(FlowView
the FlowView containing the changes
fv
,
DocumentEvent
the DocumentEvent describing the changes done to the Document
e
,
Rectangle
Bounds of the View
alloc
)

Gives notification from the document that attributes were changed in a location that this view is responsible for.

protected View

Returns:

a view that can be used to represent the current piece of the flow
createView
(FlowView
the view holding the flow
fv
,
int
the start location for the view being created
startOffset
,
int
the about of span left to fill in the row
spanLeft
,
int
the row the view will be placed into
rowIndex
)

Creates a view that can be used to represent the current piece of the flow.

protected View

Returns:

the logical view of the FlowView
getLogicalView
(FlowView
the FlowView
fv
)

This method gives flow strategies access to the logical view of the FlowView.

public void
insertUpdate(FlowView
the flow view
fv
,
DocumentEvent
the change information from the associated document
e
,
Rectangle
the current allocation of the view inside of the insets. This value will be null if the view has not yet been displayed.
alloc
)

Gives notification that something was inserted into the document in a location that the given flow view is responsible for.

public void
layout(FlowView
the view to reflow
fv
)

Update the flow on the given FlowView.

protected int

Returns:

the position to start the next row
layoutRow
(FlowView
the flow view
fv
,
int
the index of the row to fill in with views. The row is assumed to be empty on entry.
rowIndex
,
int
The current position in the children of this views element from which to start.
pos
)

Creates a row of views that will fit within the layout span of the row.

public void
removeUpdate(FlowView
the flow view
fv
,
DocumentEvent
the change information from the associated document
e
,
Rectangle
the current allocation of the view inside of the insets.
alloc
)

Gives notification that something was removed from the document in a location that the given flow view is responsible for.

pack-priv void
reparentViews(View pool, int startPos)

pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

damageStartback to summary
pack-priv Position damageStart
viewBufferback to summary
pack-priv Vector<View> viewBuffer

Constructor Detail

FlowStrategyback to summary
public FlowStrategy()

Constructs a FlowStrategy.

Method Detail

addDamageback to summary
pack-priv void addDamage(FlowView fv, int offset)
adjustRowback to summary
protected void adjustRow(FlowView fv, int rowIndex, int desiredSpan, int x)

Adjusts the given row if possible to fit within the layout span. By default this will try to find the highest break weight possible nearest the end of the row. If a forced break is encountered, the break will be positioned there.

Parameters
fv:FlowView

the flow view

rowIndex:int

the row to adjust to the current layout span.

desiredSpan:int

the current layout span >= 0

x:int

the location r starts at.

changedUpdateback to summary
public void changedUpdate(FlowView fv, DocumentEvent e, Rectangle alloc)

Gives notification from the document that attributes were changed in a location that this view is responsible for.

Parameters
fv:FlowView

the FlowView containing the changes

e:DocumentEvent

the DocumentEvent describing the changes done to the Document

alloc:Rectangle

Bounds of the View

See Also
View#changedUpdate
createViewback to summary
protected View createView(FlowView fv, int startOffset, int spanLeft, int rowIndex)

Creates a view that can be used to represent the current piece of the flow. This can be either an entire view from the logical view, or a fragment of the logical view.

Parameters
fv:FlowView

the view holding the flow

startOffset:int

the start location for the view being created

spanLeft:int

the about of span left to fill in the row

rowIndex:int

the row the view will be placed into

Returns:View

a view that can be used to represent the current piece of the flow

getLogicalViewback to summary
protected View getLogicalView(FlowView fv)

This method gives flow strategies access to the logical view of the FlowView.

Parameters
fv:FlowView

the FlowView

Returns:View

the logical view of the FlowView

insertUpdateback to summary
public void insertUpdate(FlowView fv, DocumentEvent e, Rectangle alloc)

Gives notification that something was inserted into the document in a location that the given flow view is responsible for. The strategy should update the appropriate changed region (which depends upon the strategy used for repair).

Parameters
fv:FlowView

the flow view

e:DocumentEvent

the change information from the associated document

alloc:Rectangle

the current allocation of the view inside of the insets. This value will be null if the view has not yet been displayed.

See Also
View#insertUpdate
layoutback to summary
public void layout(FlowView fv)

Update the flow on the given FlowView. By default, this causes all of the rows (child views) to be rebuilt to match the given constraints for each row. This is called by a FlowView.layout to update the child views in the flow.

Parameters
fv:FlowView

the view to reflow

layoutRowback to summary
protected int layoutRow(FlowView fv, int rowIndex, int pos)

Creates a row of views that will fit within the layout span of the row. This is called by the layout method. This is implemented to fill the row by repeatedly calling the createView method until the available span has been exhausted, a forced break was encountered, or the createView method returned null. If the remaining span was exhausted, the adjustRow method will be called to perform adjustments to the row to try and make it fit into the given span.

Parameters
fv:FlowView

the flow view

rowIndex:int

the index of the row to fill in with views. The row is assumed to be empty on entry.

pos:int

The current position in the children of this views element from which to start.

Returns:int

the position to start the next row

removeUpdateback to summary
public void removeUpdate(FlowView fv, DocumentEvent e, Rectangle alloc)

Gives notification that something was removed from the document in a location that the given flow view is responsible for.

Parameters
fv:FlowView

the flow view

e:DocumentEvent

the change information from the associated document

alloc:Rectangle

the current allocation of the view inside of the insets.

See Also
View#removeUpdate
reparentViewsback to summary
pack-priv void reparentViews(View pool, int startPos)
unsetDamageback to summary
pack-priv void unsetDamage()
javax.swing.text back to summary

pack-priv Class FlowView.LogicalView

extends CompositeView
Class Inheritance

This class can be used to represent a logical view for a flow. It keeps the children updated to reflect the state of the model, gives the logical child views access to the view hierarchy, and calculates a preferred span. It doesn't do any rendering, layout, or model/view translation.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected void
childAllocation(int
the index of the child, >= 0 && < getViewCount()
index
,
Rectangle
the allocation to the interior of the box on entry, and the allocation of the child view at the index on exit.
a
)

Implements abstract javax.swing.text.CompositeView.childAllocation.

Returns the allocation for a given child.

protected void
forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent e, Shape a, ViewFactory f)

Overrides javax.swing.text.View.forwardUpdate.

Forwards the given DocumentEvent to the child views that need to be notified of the change to the model.

protected void
forwardUpdateToView(View
the child view to forward the event to.
v
,
DocumentEvent
the change information from the associated document
e
,
Shape
the current allocation of the view
a
,
ViewFactory
the factory to use to rebuild if the view has children
f
)

Overrides javax.swing.text.View.forwardUpdateToView.

Forward the DocumentEvent to the given child view.

public AttributeSet
getAttributes()

Overrides javax.swing.text.View.getAttributes.

Fetches the attributes to use when rendering.

public float

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.
getMinimumSpan
(int
may be either View.X_AXIS or View.Y_AXIS
axis
)

Overrides javax.swing.text.View.getMinimumSpan.

Determines the minimum span for this view along an axis.

public float

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.
getPreferredSpan
(int
may be either View.X_AXIS or View.Y_AXIS
axis
)

Implements abstract javax.swing.text.View.getPreferredSpan.

Determines the preferred span for this view along an axis.

protected View

Returns:

the child view
getViewAtPoint
(int
the X coordinate >= 0
x
,
int
the Y coordinate >= 0
y
,
Rectangle
the parent's allocation on entry, which should be changed to the child's allocation on exit
alloc
)

Implements abstract javax.swing.text.CompositeView.getViewAtPoint.

Fetches the child view at the given point.

protected int
getViewIndexAtPosition(int pos)

Overrides javax.swing.text.CompositeView.getViewIndexAtPosition.

Fetches the child view index representing the given position in the model.

protected boolean

Returns:

true if the point is after the specified range
isAfter
(int
the X coordinate >= 0
x
,
int
the Y coordinate >= 0
y
,
Rectangle
the rectangle
alloc
)

Implements abstract javax.swing.text.CompositeView.isAfter.

Tests whether a point lies after the rectangle range.

protected boolean

Returns:

true if the point is before the specified range
isBefore
(int
the X coordinate >= 0
x
,
int
the Y coordinate >= 0
y
,
Rectangle
the rectangle
alloc
)

Implements abstract javax.swing.text.CompositeView.isBefore.

Tests whether a point lies before the rectangle range.

protected void
loadChildren(ViewFactory f)

Overrides javax.swing.text.CompositeView.loadChildren.

Loads all of the children to initialize the view.

public void
paint(Graphics
the rendering surface to use
g
,
Shape
the allocated region to render into
allocation
)

Implements abstract javax.swing.text.View.paint.

Renders using the given rendering surface and area on that surface.

Inherited from javax.swing.text.CompositeView:
flipEastAndWestAtEndsgetBottomInsetgetChildAllocationgetInsideAllocationgetLeftInsetgetNextEastWestVisualPositionFromgetNextNorthSouthVisualPositionFromgetNextVisualPositionFromgetRightInsetgetTopInsetgetViewgetViewAtPositiongetViewCountgetViewIndexmodelToViewmodelToViewreplacesetInsetssetParagraphInsetssetParentviewToModel

Constructor Detail

LogicalViewback to summary
pack-priv LogicalView(Element elem)

Method Detail

childAllocationback to summary
protected void childAllocation(int index, Rectangle a)

Implements abstract javax.swing.text.CompositeView.childAllocation.

Returns the allocation for a given child. Implemented to do nothing, as the logical view doesn't perform layout on the children.

Parameters
index:int

the index of the child, >= 0 && < getViewCount()

a:Rectangle

the allocation to the interior of the box on entry, and the allocation of the child view at the index on exit.

forwardUpdateback to summary
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent e, Shape a, ViewFactory f)

Overrides javax.swing.text.View.forwardUpdate.

Doc from javax.swing.text.View.forwardUpdate.

Forwards the given DocumentEvent to the child views that need to be notified of the change to the model. If there were changes to the element this view is responsible for, that should be considered when forwarding (i.e. new child views should not get notified).

Annotations
@Override
forwardUpdateToViewback to summary
protected void forwardUpdateToView(View v, DocumentEvent e, Shape a, ViewFactory f)

Overrides javax.swing.text.View.forwardUpdateToView.

Forward the DocumentEvent to the given child view. This is implemented to reparent the child to the logical view (the children may have been parented by a row in the flow if they fit without breaking) and then execute the superclass behavior.

Parameters
v:View

the child view to forward the event to.

e:DocumentEvent

the change information from the associated document

a:Shape

the current allocation of the view

f:ViewFactory

the factory to use to rebuild if the view has children

Since
1.3
See Also
forwardUpdate
getAttributesback to summary
public AttributeSet getAttributes()

Overrides javax.swing.text.View.getAttributes.

Fetches the attributes to use when rendering. This view isn't directly responsible for an element so it returns the outer classes attributes.

getMinimumSpanback to summary
public float getMinimumSpan(int axis)

Overrides javax.swing.text.View.getMinimumSpan.

Determines the minimum span for this view along an axis. The is implemented to find the minimum unbreakable span.

Parameters
axis:int

may be either View.X_AXIS or View.Y_AXIS

Returns:float

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.

See Also
View#getPreferredSpan
getPreferredSpanback to summary
public float getPreferredSpan(int axis)

Implements abstract javax.swing.text.View.getPreferredSpan.

Determines the preferred span for this view along an axis.

Parameters
axis:int

may be either View.X_AXIS or View.Y_AXIS

Returns:float

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.

See Also
View#getPreferredSpan
getViewAtPointback to summary
protected View getViewAtPoint(int x, int y, Rectangle alloc)

Implements abstract javax.swing.text.CompositeView.getViewAtPoint.

Fetches the child view at the given point. Implemented to return null, as hit detection is not performed on the logical view.

Parameters
x:int

the X coordinate >= 0

y:int

the Y coordinate >= 0

alloc:Rectangle

the parent's allocation on entry, which should be changed to the child's allocation on exit

Returns:View

the child view

getViewIndexAtPositionback to summary
protected int getViewIndexAtPosition(int pos)

Overrides javax.swing.text.CompositeView.getViewIndexAtPosition.

Doc from javax.swing.text.CompositeView.getViewIndexAtPosition.

Fetches the child view index representing the given position in the model. This is implemented to fetch the view in the case where there is a child view for each child element.

isAfterback to summary
protected boolean isAfter(int x, int y, Rectangle alloc)

Implements abstract javax.swing.text.CompositeView.isAfter.

Tests whether a point lies after the rectangle range. Implemented to return false, as hit detection is not performed on the logical view.

Parameters
x:int

the X coordinate >= 0

y:int

the Y coordinate >= 0

alloc:Rectangle

the rectangle

Returns:boolean

true if the point is after the specified range

isBeforeback to summary
protected boolean isBefore(int x, int y, Rectangle alloc)

Implements abstract javax.swing.text.CompositeView.isBefore.

Tests whether a point lies before the rectangle range. Implemented to return false, as hit detection is not performed on the logical view.

Parameters
x:int

the X coordinate >= 0

y:int

the Y coordinate >= 0

alloc:Rectangle

the rectangle

Returns:boolean

true if the point is before the specified range

loadChildrenback to summary
protected void loadChildren(ViewFactory f)

Overrides javax.swing.text.CompositeView.loadChildren.

Doc from javax.swing.text.CompositeView.loadChildren.

Loads all of the children to initialize the view. This is called by the setParent method. Subclasses can reimplement this to initialize their child views in a different manner. The default implementation creates a child view for each child element.

paintback to summary
public void paint(Graphics g, Shape allocation)

Implements abstract javax.swing.text.View.paint.

Renders using the given rendering surface and area on that surface. This is implemented to do nothing, the logical view is never visible.

Parameters
g:Graphics

the rendering surface to use

allocation:Shape

the allocated region to render into

See Also
View#paint