javax.swing.text.html
public class BlockView extends BoxView
Constructor Summary | |
---|---|
BlockView(Element elem, int axis)
Creates a new view that represents an html box.
|
Method Summary | |
---|---|
protected SizeRequirements | calculateMajorAxisRequirements(int axis, SizeRequirements r)
Calculates the requirements along the major axis.
|
protected SizeRequirements | calculateMinorAxisRequirements(int axis, SizeRequirements r)
Calculates the requirements along the minor axis.
|
void | changedUpdate(DocumentEvent ev, Shape a, ViewFactory f)
Gives notification from the document that attributes were
changed in a location that this view is responsible for.
|
float | getAlignment(int axis)
Gets the alignment.
|
AttributeSet | getAttributes()
Fetches the attributes to use when painting.
|
float | getMaximumSpan(int axis)
Determines the maximum span along the axis.
|
float | getMinimumSpan(int axis)
Determines the minimum span along the axis.
|
float | getPreferredSpan(int axis)
Determines the preferred span along the axis.
|
int | getResizeWeight(int axis)
Gets the resize weight.
|
protected StyleSheet | getStyleSheet()
Gets the default style sheet.
|
protected void | layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans)
Overridden to perform additional CSS layout (absolute/relative
positioning). |
protected void | layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans)
Lays out the box along the minor axis (the axis that is
perpendicular to the axis that it represents). |
void | paint(Graphics g, Shape a)
Paints using the given graphics configuration and shape.
|
void | replace(int offset, int length, View[] views)
Overridden to fetch additional CSS layout information. |
void | setParent(View parent)
Creates the parent view for this. |
protected void | setPropertiesFromAttributes()
Updates any cached values that come from attributes. |
Parameters: elem - the element to create a view for axis - either View.X_AXIS or View.Y_AXIS
Parameters: axis - the axis to check the requirements for. r - the SizeRequirements. If null, one is created.
Returns: the new SizeRequirements object.
Parameters: axis - the axis to check the requirements for. r - the SizeRequirements. If null, one is created.
Returns: the new SizeRequirements object.
Parameters: ev - the change information a - the current shape of the view f - the factory to use to rebuild if the view has children.
Parameters: axis - the axis to get the alignment for.
Returns: the alignment.
Returns: the attributes of this model.
Parameters: axis - the axis to get the maximum span for.
Returns: the span the view would like to be painted into >=0/ The view is usually told to paint into the span that is returned, although the parent may choose to resize or break the view.
Throws: IllegalArgumentException - for an invalid axis
Parameters: axis - the axis to get the minimum span for.
Returns: the span the view would like to be painted into >=0/ The view is usually told to paint into the span that is returned, although the parent may choose to resize or break the view.
Throws: IllegalArgumentException - for an invalid axis
Parameters: axis - the view to get the preferred span for.
Returns: the span the view would like to be painted into >=0/ The view is usually told to paint into the span that is returned, although the parent may choose to resize or break the view.
Throws: IllegalArgumentException - for an invalid axis
Parameters: axis - the axis to get the resize weight for.
Returns: the resize weight.
Throws: IllegalArgumentException - for an invalid axis
Returns: the style sheet
Parameters: targetSpan - the total span given to the view, also used to layout the children. axis - the minor axis offsets - the offsets from the origin of the view for all the child views. This is a return value and is filled in by this function. spans - the span of each child view. This is a return value and is filled in by this function.
Parameters: g - Graphics configuration a - the Shape to render into.
Parameters: parent - the new parent, or null if the view is being removed from a parent it was added to.