|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.text.View
javax.swing.text.CompositeView
javax.swing.text.BoxView
javax.swing.text.html.BlockView
public class 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 | |
|---|---|
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. |
| Methods inherited from class javax.swing.text.BoxView |
|---|
baselineLayout, baselineRequirements, childAllocation, flipEastAndWestAtEnds, forwardUpdate, getAxis, getChildAllocation, getHeight, getOffset, getSpan, getViewAtPoint, getWidth, isAfter, isAllocationValid, isBefore, isLayoutValid, layout, layoutChanged, modelToView, paintChild, preferenceChanged, setAxis, setSize, viewToModel |
| Methods inherited from class javax.swing.text.CompositeView |
|---|
getBottomInset, getInsideAllocation, getLeftInset, getNextEastWestVisualPositionFrom, getNextNorthSouthVisualPositionFrom, getNextVisualPositionFrom, getRightInset, getTopInset, getView, getViewAtPosition, getViewCount, getViewIndex, getViewIndexAtPosition, loadChildren, modelToView, setInsets, setParagraphInsets |
| Methods inherited from class javax.swing.text.View |
|---|
append, breakView, createFragment, dump, forwardUpdateToView, getBreakWeight, getContainer, getDocument, getElement, getEndOffset, getGraphics, getParent, getStartOffset, getToolTipText, getViewFactory, getViewIndex, insert, insertUpdate, isVisible, modelToView, remove, removeAll, removeUpdate, updateChildren, updateLayout, viewToModel |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BlockView(Element elem,
int axis)
elem - - the element to create a view foraxis - - either View.X_AXIS or View.Y_AXIS| Method Detail |
|---|
public void setParent(View parent)
setParent in class CompositeViewparent - - the new parent, or null if the view
is being removed from a parent it was added to.
protected SizeRequirements calculateMajorAxisRequirements(int axis,
SizeRequirements r)
calculateMajorAxisRequirements in class BoxViewaxis - - the axis to check the requirements for.r - - the SizeRequirements. If null, one is created.
protected SizeRequirements calculateMinorAxisRequirements(int axis,
SizeRequirements r)
calculateMinorAxisRequirements in class BoxViewaxis - - the axis to check the requirements for.r - - the SizeRequirements. If null, one is created.
protected void layoutMinorAxis(int targetSpan,
int axis,
int[] offsets,
int[] spans)
layoutMinorAxis in class BoxViewtargetSpan - - 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.
protected void layoutMajorAxis(int targetSpan,
int axis,
int[] offsets,
int[] spans)
layoutMajorAxis in class BoxViewtargetSpan - the (inner) span of the BoxView in which
to layout the childrenaxis - the axis along which the layout is performedoffsets - the array that holds the offsets of the children on exitspans - the array that holds the spans of the children on exit
public void paint(Graphics g,
Shape a)
paint in class BoxViewg - - Graphics configurationa - - the Shape to render into.public AttributeSet getAttributes()
getAttributes in class View
public int getResizeWeight(int axis)
throws IllegalArgumentException
getResizeWeight in class BoxViewaxis - - the axis to get the resize weight for.
IllegalArgumentException - - for an invalid axispublic float getAlignment(int axis)
getAlignment in class BoxViewaxis - - the axis to get the alignment for.
public void changedUpdate(DocumentEvent ev,
Shape a,
ViewFactory f)
changedUpdate in class Viewev - - the change informationa - - the current shape of the viewf - - the factory to use to rebuild if the view has children.
public float getPreferredSpan(int axis)
throws IllegalArgumentException
getPreferredSpan in class BoxViewaxis - - the view to get the preferred span for.
IllegalArgumentException - - for an invalid axis
public float getMinimumSpan(int axis)
throws IllegalArgumentException
getMinimumSpan in class BoxViewaxis - - the axis to get the minimum span for.
IllegalArgumentException - - for an invalid axis
public float getMaximumSpan(int axis)
throws IllegalArgumentException
getMaximumSpan in class BoxViewaxis - - the axis to get the maximum span for.
IllegalArgumentException - - for an invalid axisprotected void setPropertiesFromAttributes()
protected StyleSheet getStyleSheet()
public void replace(int offset,
int length,
View[] views)
replace in class BoxViewoffset - the start offset from where to remove childrenlength - the number of children to removeviews - the views that replace the removed children
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||