Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.swing.text.View
javax.swing.text.CompositeView
javax.swing.text.BoxView
javax.swing.text.html.BlockView
Field Summary |
Fields inherited from class javax.swing.text.View | |
BadBreakWeight , ExcellentBreakWeight , ForcedBreakWeight , GoodBreakWeight , X_AXIS , Y_AXIS |
Fields inherited from interface javax.swing.SwingConstants | |
BOTTOM , CENTER , EAST , HORIZONTAL , LEADING , LEFT , NEXT , NORTH , NORTH_EAST , NORTH_WEST , PREVIOUS , RIGHT , SOUTH , SOUTH_EAST , SOUTH_WEST , TOP , TRAILING , VERTICAL , WEST |
Constructor Summary | |
Method Summary | |
protected SizeRequirements |
|
protected SizeRequirements |
|
void |
|
float |
|
AttributeSet |
|
float |
|
float |
|
float |
|
int |
|
protected StyleSheet |
|
protected void |
|
protected void |
|
void | |
void | |
void | |
protected void |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements r)
Calculates the requirements along the major axis. This is implemented to call the superclass and then adjust it if the CSS width or height attribute is specified and applicable.
- Overrides:
- calculateMajorAxisRequirements in interface BoxView
- Parameters:
axis
- - the axis to check the requirements for.r
- - the SizeRequirements. If null, one is created.
- Returns:
- the new SizeRequirements object.
protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r)
Calculates the requirements along the minor axis. This is implemented to call the superclass and then adjust it if the CSS width or height attribute is specified and applicable.
- Overrides:
- calculateMinorAxisRequirements in interface BoxView
- Parameters:
axis
- - the axis to check the requirements for.r
- - the SizeRequirements. If null, one is created.
- Returns:
- the new SizeRequirements object.
public 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.
- Overrides:
- changedUpdate in interface View
- Parameters:
ev
- - the change informationa
- - the current shape of the viewf
- - the factory to use to rebuild if the view has children.
public float getAlignment(int axis)
Gets the alignment.
- Overrides:
- getAlignment in interface BoxView
- Parameters:
axis
- - the axis to get the alignment for.
- Returns:
- the alignment.
public AttributeSet getAttributes()
Fetches the attributes to use when painting.
- Overrides:
- getAttributes in interface View
- Returns:
- the attributes of this model.
public float getMaximumSpan(int axis) throws IllegalArgumentException
Determines the maximum span along the axis.
- Overrides:
- getMaximumSpan in interface BoxView
- 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
public float getMinimumSpan(int axis) throws IllegalArgumentException
Determines the minimum span along the axis.
- Overrides:
- getMinimumSpan in interface BoxView
- 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
public float getPreferredSpan(int axis) throws IllegalArgumentException
Determines the preferred span along the axis.
- Overrides:
- getPreferredSpan in interface BoxView
- 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
public int getResizeWeight(int axis) throws IllegalArgumentException
Gets the resize weight.
- Overrides:
- getResizeWeight in interface BoxView
- Parameters:
axis
- - the axis to get the resize weight for.
- Returns:
- the resize weight.
- Throws:
IllegalArgumentException
- - for an invalid axis
protected StyleSheet getStyleSheet()
Gets the default style sheet.
- Returns:
- the style sheet
protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans)
Overridden to perform additional CSS layout (absolute/relative positioning).
- Overrides:
- layoutMajorAxis in interface BoxView
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). The results of the layout are placed in the given arrays which are the allocations to the children along the minor axis.
- Overrides:
- layoutMinorAxis in interface BoxView
- Parameters:
targetSpan
- - the total span given to the view, also used to layout the children.axis
- - the minor axisoffsets
- - 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.
public void paint(Graphics g, Shape a)
Paints using the given graphics configuration and shape. This delegates to the css box painter to paint the border and background prior to the interior.
- Parameters:
g
- - Graphics configurationa
- - the Shape to render into.
public void replace(int offset, int length, View[] views)
Overridden to fetch additional CSS layout information.
public void setParent(View parent)
Creates the parent view for this. It is called before any other methods, if the parent view is working properly. Implemented to forward to the superclass and call setPropertiesFromAttributes to set the paragraph properties.
- Overrides:
- setParent in interface CompositeView
- Parameters:
parent
- - the new parent, or null if the view is being removed from a parent it was added to.
protected void setPropertiesFromAttributes()
Updates any cached values that come from attributes.