View
| Modifier and Type | Class and Description |
|---|---|
| public static class | FlowView.
Strategy for maintaining the physical form of the flow. |
| pack-priv static class | FlowView.
This class can be used to represent a logical view for a flow. |
| Modifier and Type | Field 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. | strategy
The behavior for keeping the flow updated. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected SizeRequirements | calculateMinorAxisRequirements(int axis, SizeRequirements r)
Overrides javax. 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. 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 flowCreate 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 flowedFetches the axis along which views should be flowed. |
| public int | Returns: the constraining span to flow against for the given child indexthe 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 atthe 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 positionthe position >= 0 pos)Overrides javax. 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. 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. Lays out the children. |
| protected void | loadChildren(ViewFactory
the view factory f)Overrides javax. 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. 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. Sets the parent of the view. |
| layoutPool | back 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. | |
| layoutSpan | back to summary |
|---|---|
| protected int layoutSpan Default constraint against which the flow is created against. | |
| strategy | back to summary |
|---|---|
| protected FlowView. 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. | |
| FlowView | back to summary |
|---|---|
| public FlowView(Element elem, int axis) Constructs a FlowView for the given element.
| |
| calculateMinorAxisRequirements | back to summary |
|---|---|
| protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r) Overrides javax. 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. | |
| changedUpdate | back to summary |
|---|---|
| public void changedUpdate(DocumentEvent changes, Shape a, ViewFactory f) Overrides javax. Gives notification from the document that attributes were changed in a location that this view is responsible for.
| |
| createRow | back 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.
| |
| getFlowAxis | back 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
| |
| getFlowSpan | back 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.
| |
| getFlowStart | back 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.
| |
| getViewIndexAtPosition | back to summary |
|---|---|
| protected int getViewIndexAtPosition(int pos) Overrides javax. Fetches the child view index representing the given position in the model.
| |
| insertUpdate | back to summary |
|---|---|
| public void insertUpdate(DocumentEvent changes, Shape a, ViewFactory f) Overrides javax. Gives notification that something was inserted into the document in a location that this view is responsible for.
| |
| layout | back to summary |
|---|---|
| protected void layout(int width, int height) Overrides javax. 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.
| |
| loadChildren | back to summary |
|---|---|
| protected void loadChildren(ViewFactory f) Overrides javax. Loads all of the children to initialize the view.
This is called by the
| |
| removeUpdate | back to summary |
|---|---|
| public void removeUpdate(DocumentEvent changes, Shape a, ViewFactory f) Overrides javax. Gives notification that something was removed from the document in a location that this view is responsible for.
| |
| setParent | back to summary |
|---|---|
| public void setParent(View parent) Overrides javax. Doc from javax. Sets the parent of the view.
This is reimplemented to provide the superclass
behavior as well as calling the | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| protected void | |
| public void | changedUpdate(FlowView
the fv, DocumentEvent FlowView containing the changesthe e, Rectangle DocumentEvent describing the changes
done to the DocumentBounds 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 flowthe 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 FlowViewthe 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 | |
| protected int | Returns: the position to start the next rowthe 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 | |
| pack-priv void |
| damageStart | back to summary |
|---|---|
| pack-priv Position damageStart | |
| viewBuffer | back to summary |
|---|---|
| pack-priv Vector<View> viewBuffer | |
| FlowStrategy | back to summary |
|---|---|
| public FlowStrategy() Constructs a | |
| addDamage | back to summary |
|---|---|
| pack-priv void addDamage(FlowView fv, int offset) | |
| adjustRow | back 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.
| |
| changedUpdate | back 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.
| |
| createView | back 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. | |
| getLogicalView | back to summary |
|---|---|
| protected View getLogicalView(FlowView fv) This method gives flow strategies access to the logical view of the FlowView. | |
| insertUpdate | back 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).
| |
| layout | back 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.
| |
| layoutRow | back 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.
| |
| removeUpdate | back 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.
| |
| reparentViews | back to summary |
|---|---|
| pack-priv void reparentViews(View pool, int startPos) | |
| unsetDamage | back to summary |
|---|---|
| pack-priv void unsetDamage() | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method 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. Returns the allocation for a given child. |
| protected void | forwardUpdate(DocumentEvent.
Overrides javax. Forwards the given |
| 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. Forward the DocumentEvent to the given child view. |
| public AttributeSet | getAttributes()
Overrides javax. 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.may be either View.X_AXIS or View.Y_AXIS axis)Overrides javax. 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.may be either View.X_AXIS or View.Y_AXIS axis)Implements abstract javax. Determines the preferred span for this view along an axis. |
| protected View | Returns: the child viewthe 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. Fetches the child view at the given point. |
| protected int | getViewIndexAtPosition(int pos)
Overrides javax. Fetches the child view index representing the given position in the model. |
| protected boolean | Returns: true if the point is after the specified rangethe X coordinate >= 0 x, int the Y coordinate >= 0 y, Rectangle the rectangle alloc)Implements abstract javax. Tests whether a point lies after the rectangle range. |
| protected boolean | Returns: true if the point is before the specified rangethe X coordinate >= 0 x, int the Y coordinate >= 0 y, Rectangle the rectangle alloc)Implements abstract javax. Tests whether a point lies before the rectangle range. |
| protected void | loadChildren(ViewFactory f)
Overrides javax. 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. Renders using the given rendering surface and area on that surface. |
| LogicalView | back to summary |
|---|---|
| pack-priv LogicalView(Element elem) | |
| childAllocation | back to summary |
|---|---|
| protected void childAllocation(int index, Rectangle a) Implements abstract javax. Returns the allocation for a given child. Implemented to do nothing, as the logical view doesn't perform layout on the children.
| |
| forwardUpdate | back to summary |
|---|---|
| protected void forwardUpdate(DocumentEvent. Overrides javax. Doc from javax. Forwards the given
| |
| forwardUpdateToView | back to summary |
|---|---|
| protected void forwardUpdateToView(View v, DocumentEvent e, Shape a, ViewFactory f) Overrides javax. 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.
| |
| getAttributes | back to summary |
|---|---|
| public AttributeSet getAttributes() Overrides javax. Fetches the attributes to use when rendering. This view isn't directly responsible for an element so it returns the outer classes attributes. | |
| getMinimumSpan | back to summary |
|---|---|
| public float getMinimumSpan(int axis) Overrides javax. Determines the minimum span for this view along an axis. The is implemented to find the minimum unbreakable span.
| |
| getPreferredSpan | back to summary |
|---|---|
| public float getPreferredSpan(int axis) Implements abstract javax. Determines the preferred span for this view along an axis.
| |
| getViewAtPoint | back to summary |
|---|---|
| protected View getViewAtPoint(int x, int y, Rectangle alloc) Implements abstract javax. Fetches the child view at the given point. Implemented to return null, as hit detection is not performed on the logical view. | |
| getViewIndexAtPosition | back to summary |
|---|---|
| protected int getViewIndexAtPosition(int pos) Overrides javax. Doc from javax. 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. | |
| isAfter | back to summary |
|---|---|
| protected boolean isAfter(int x, int y, Rectangle alloc) Implements abstract javax. Tests whether a point lies after the rectangle range. Implemented to return false, as hit detection is not performed on the logical view.
| |
| isBefore | back to summary |
|---|---|
| protected boolean isBefore(int x, int y, Rectangle alloc) Implements abstract javax. Tests whether a point lies before the rectangle range. Implemented to return false, as hit detection is not performed on the logical view.
| |
| loadChildren | back to summary |
|---|---|
| protected void loadChildren(ViewFactory f) Overrides javax. Doc from javax. Loads all of the children to initialize the view.
This is called by the | |
| paint | back to summary |
|---|---|
| public void paint(Graphics g, Shape allocation) Implements abstract javax. Renders using the given rendering surface and area on that surface. This is implemented to do nothing, the logical view is never visible.
| |