javax.swing.text.html
Class FrameSetView
java.lang.Object
javax.swing.text.View
javax.swing.text.CompositeView
javax.swing.text.BoxView
javax.swing.text.html.FrameSetView
- All Implemented Interfaces:
- SwingConstants
- class FrameSetView
- extends BoxView
Implements a FrameSetView, intended to support the HTML
<FRAMESET> tag. Supports the ROWS and COLS attributes.
- Author:
- Sunita Mani
Credit also to the hotjava browser engineers that
worked on making the allocation of space algorithms
conform to the HTML 4.0 standard and also be netscape
compatible.
Fields inherited from class javax.swing.text.BoxView |
|
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 |
FrameSetView(Element elem,
int axis)
Constructs a FrameSetView for the given element. |
Method Summary |
protected SizeRequirements[] |
getChildRequests(int targetSpan,
int axis)
|
private void |
init()
Initializes a number of internal state variables
that store information about space allocation
for the frames contained within the frameset. |
protected void |
layoutMajorAxis(int targetSpan,
int axis,
int[] offsets,
int[] spans)
Perform layout for the major axis of the box (i.e. the
axis that it represents). |
private int |
parseDigits(String mixedStr)
|
private String[] |
parseRowColSpec(HTML.Attribute key)
Parses the ROW or COL attributes and returns
an array of strings that represent the space
distribution. |
private void |
spread(int targetSpan,
int[] span)
This method is responsible for returning in span[] the
span for each child view along the major axis. |
Methods inherited from class javax.swing.text.BoxView |
baselineLayout, baselineRequirements, calculateMajorAxisRequirements, calculateMinorAxisRequirements, childAllocation, flipEastAndWestAtEnds, forwardUpdate, getAlignment, getAxis, getChildAllocation, getHeight, getMaximumSpan, getMinimumSpan, getOffset, getPreferredSpan, getResizeWeight, getSpan, getViewAtPoint, getWidth, isAfter, isAllocationValid, isBefore, isLayoutValid, layout, layoutChanged, layoutMinorAxis, modelToView, paint, paintChild, preferenceChanged, replace, 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, setParent |
Methods inherited from class javax.swing.text.View |
append, breakView, changedUpdate, createFragment, forwardUpdateToView, getAttributes, 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 |
children
String[] children
percentChildren
int[] percentChildren
absoluteChildren
int[] absoluteChildren
relativeChildren
int[] relativeChildren
percentTotals
int percentTotals
absoluteTotals
int absoluteTotals
relativeTotals
int relativeTotals
FrameSetView
public FrameSetView(Element elem,
int axis)
- Constructs a FrameSetView for the given element.
- Parameters:
elem
- the element that this view is responsible for
parseRowColSpec
private String[] parseRowColSpec(HTML.Attribute key)
- Parses the ROW or COL attributes and returns
an array of strings that represent the space
distribution.
init
private void init()
- Initializes a number of internal state variables
that store information about space allocation
for the frames contained within the frameset.
layoutMajorAxis
protected void layoutMajorAxis(int targetSpan,
int axis,
int[] offsets,
int[] spans)
- Perform layout for the major axis of the box (i.e. the
axis that it represents). The results of the layout should
be placed in the given arrays which represent the allocations
to the children along the major axis.
- Overrides:
layoutMajorAxis
in class BoxView
- Parameters:
targetSpan
- the total span given to the view, which
whould be used to layout the childrenaxis
- the axis being layed outoffsets
- 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 methodspans
- the span of each child view; this is a return
value and is filled in by the implementation of this method
- Returns:
- the offset and span for each child view in the
offsets and spans parameters
getChildRequests
protected SizeRequirements[] getChildRequests(int targetSpan,
int axis)
spread
private void spread(int targetSpan,
int[] span)
- This method is responsible for returning in span[] the
span for each child view along the major axis. it
computes this based on the information that extracted
from the value of the ROW/COL attribute.
parseDigits
private int parseDigits(String mixedStr)