java.lang.Object | ||||
↳ | javax.swing.text.View | |||
↳ | javax.swing.text.CompositeView | |||
↳ | javax.swing.text.BoxView | |||
↳ | javax.swing.text.html.BlockView |
![]() |
A view implementation to display a block (as a box) with CSS specifications.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new view that represents an
html box.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gives notification from the document that attributes were changed
in a location that this view is responsible for.
| |||||||||||
Gets the alignment.
| |||||||||||
Fetches the attributes to use when rendering.
| |||||||||||
Determines the maximum span for this view along an
axis.
| |||||||||||
Determines the minimum span for this view along an
axis.
| |||||||||||
Determines the preferred span for this view along an
axis.
| |||||||||||
Gets the resize weight.
| |||||||||||
Renders using the given rendering surface and area on that
surface.
| |||||||||||
Establishes the parent view for this view.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Calculate the requirements of the block along the major
axis (i.e.
| |||||||||||
Calculate the requirements of the block along the minor
axis (i.e.
| |||||||||||
Performs layout for the minor axis of the box (i.e.
| |||||||||||
Update any cached values that come from attributes.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Creates a new view that represents an html box. This can be used for a number of elements.
elem | the element to create a view for |
---|---|
axis | either View.X_AXIS or View.Y_AXIS |
Gives notification from the document that attributes were changed in a location that this view is responsible for. To reduce the burden to subclasses, this functionality is spread out into the following calls that subclasses can reimplement:
changes | the change information from the associated document |
---|---|
a | the current allocation of the view |
f | the factory to use to rebuild if the view has children |
Gets the alignment.
axis | may be either X_AXIS or Y_AXIS |
---|
Fetches the attributes to use when rendering. This is implemented to multiplex the attributes specified in the model with a StyleSheet.
Determines the maximum span for this view along an axis.
axis | may be either View.X_AXIS
or View.Y_AXIS |
---|
IllegalArgumentException | for an invalid axis type |
---|
Determines the minimum span for this view along an axis.
axis | may be either View.X_AXIS
or View.Y_AXIS |
---|
IllegalArgumentException | for an invalid axis type |
---|
Determines the preferred span for this view along an axis.
axis | may be either View.X_AXIS
or View.Y_AXIS |
---|
IllegalArgumentException | for an invalid axis type |
---|
Gets the resize weight.
axis | may be either X_AXIS or Y_AXIS |
---|
IllegalArgumentException | for an invalid axis |
---|
Renders using the given rendering surface and area on that surface. This is implemented to delegate to the css box painter to paint the border and background prior to the interior.
g | the rendering surface to use |
---|---|
allocation | the allocated region to render into |
Establishes the parent view for this view. This is guaranteed to be called before any other methods if the parent view is functioning properly.
This is implemented
to forward to the superclass as well as call the
setPropertiesFromAttributes()
method to set the paragraph properties from the css
attributes. The call is made at this time to ensure
the ability to resolve upward through the parents
view attributes.
parent | the new parent, or null if the view is being removed from a parent it was previously added to |
---|
Calculate the requirements of the block along the major axis (i.e. the axis along with it tiles). This is implemented to provide the superclass behavior and then adjust it if the CSS width or height attribute is specified and applicable to the axis.
axis | the axis being studied |
---|---|
r | the SizeRequirements object;
if null one will be created |
SizeRequirements
objectCalculate the requirements of the block along the minor axis (i.e. the axis orthoginal to the axis along with it tiles). This is implemented to provide the superclass behavior and then adjust it if the CSS width or height attribute is specified and applicable to the axis.
axis | the axis being studied |
---|---|
r | the SizeRequirements object;
if null one will be created |
SizeRequirements
objectPerforms layout for the minor axis of the box (i.e. the axis orthoginal to the axis that it represents). The results of the layout (the offset and span for each children) are placed in the given arrays which represent the allocations to the children along the minor axis.
targetSpan | the total span given to the view, which whould be used to layout the childre. |
---|---|
axis | the axis being layed out |
offsets | the offsets from the origin of the view for each of the child views; this is a return value and is filled in by the implementation of this method |
spans | the span of each child view; this is a return value and is filled in by the implementation of this method |
Update any cached values that come from attributes.