| java.lang.Object org.netbeans.modules.visualweb.css2.FormatContext
FormatContext | public class FormatContext (Code) | | FormatContext used during layout/formatting of CSS2 boxes
author: Tor Norbye |
Method Summary | |
public void | addFloat(int x, int y, CssBox box, boolean leftSide) | int | adjustY(int y, CssBox yBox, CssBox floatParent) Given a coordinate in yBox, convert it to a coordinate
in floatParent. | public int | clear(CssValue cssSide, CssBox ignoreChildren) Compute the clearance for a particular y position (compute how much
we have to add to it to clear all the floating boxes on the given
side(s)), as well as removing floats from the list.
Parameters: side - The side to be cleared Parameters: ignoreChildren - If not null, ignore any floats that are children of thisgiven box the absolute y position of the cleared area. | int | getLeftEdge(CssBox cssBox, CssBox parent, int y, int height) Return the minimum x coordinate available - this is the left edge
of the containing block, plus the widths of any floats overlapping
this line. | CssBox | getLowestFloatingForFloat(CssBox box) | int | getMaxWidth(CssBox parent, int y) Return the maximum x coordinate available - this is the right edge
of the containing block, minus the widths of any floats overlapping
this line. | int | getMaxWidth(CssBox cssBox, CssBox parent, int y, int height) Return the maximum x coordinate available - this is the right edge
of the containing block, minus the widths of any floats overlapping
this line. | CssBox | getPrevFloatingForClear(CssBox box) Depending on "clear" property of the box, looks for a previous floating box
on either or both sides of the containing block.
left
The top margin of the generated box is increased enough that the top border edge
is below the bottom outer edge of any left-floating boxes
that resulted from elements earlier in the source document. | CssBox | getPrevFloatingForFloat(CssBox box) | int | getRightEdge(CssBox cssBox, CssBox parent, int y, int height) Return the maximum x coordinate available - this is the right edge
of the containing block, minus the widths of any floats overlapping
this line. |
floating | public boolean floating(Code) | | |
initialHeight | public int initialHeight(Code) | | |
initialWidth | public int initialWidth(Code) | | |
addFloat | public void addFloat(int x, int y, CssBox box, boolean leftSide)(Code) | | |
adjustY | int adjustY(int y, CssBox yBox, CssBox floatParent)(Code) | | Given a coordinate in yBox, convert it to a coordinate
in floatParent. Remember that each coordinate is relative to
its parent, so this method essentially finds the nearest
common ancestor box, computes the y coordinate value relative
to that ancestor, it also computes the y coordinate of
the floatParent, and subtracts the yBox from the floatParent
y to compute the y value relative to the floatParent.
(It would be conceptually easier to just call getAbsoluteY()
on both boxes, subtract the difference and add y. But we cannot
call getAbsoluteY() on these boxes here because we are in the
middle of the layout and beyond the float parent the boxes may
not yet be positioned so we'll include UNINITIALIZED constants
in the computation and get wrong results.
|
clear | public int clear(CssValue cssSide, CssBox ignoreChildren)(Code) | | Compute the clearance for a particular y position (compute how much
we have to add to it to clear all the floating boxes on the given
side(s)), as well as removing floats from the list.
Parameters: side - The side to be cleared Parameters: ignoreChildren - If not null, ignore any floats that are children of thisgiven box the absolute y position of the cleared area. Will return Integer.MIN_VALUEif nothing had to be cleared. |
getLeftEdge | int getLeftEdge(CssBox cssBox, CssBox parent, int y, int height)(Code) | | Return the minimum x coordinate available - this is the left edge
of the containing block, plus the widths of any floats overlapping
this line.
(Actually, since floats could overlap, it returns the
rightmost coordinate of any float overlapping this line that is
floated to the left.
|
getMaxWidth | int getMaxWidth(CssBox parent, int y)(Code) | | Return the maximum x coordinate available - this is the right edge
of the containing block, minus the widths of any floats overlapping
this line.
(Actually, since floats could overlap, it returns the
leftmost coordinate of any float overlapping this line that is
floated to the right, minus the rightmost coordinate of any
float overlapping this line that is floated to the left...)
|
getMaxWidth | int getMaxWidth(CssBox cssBox, CssBox parent, int y, int height)(Code) | | Return the maximum x coordinate available - this is the right edge
of the containing block, minus the widths of any floats overlapping
this line.
Parameters: y - - lineBox top. Parameters: height - - linebox height |
getPrevFloatingForClear | CssBox getPrevFloatingForClear(CssBox box)(Code) | | Depending on "clear" property of the box, looks for a previous floating box
on either or both sides of the containing block.
left
The top margin of the generated box is increased enough that the top border edge
is below the bottom outer edge of any left-floating boxes
that resulted from elements earlier in the source document.
This is not the most efficient algorithm perhaps. We can instead look for a lowest
line box containing a float and then took a longer float within it.
However, this algorithm looks right.
|
getPrevFloatingForFloat | CssBox getPrevFloatingForFloat(CssBox box)(Code) | | Looks for a previous floating box
|
getRightEdge | int getRightEdge(CssBox cssBox, CssBox parent, int y, int height)(Code) | | Return the maximum x coordinate available - this is the right edge
of the containing block, minus the widths of any floats overlapping
this line.
(Actually, since floats could overlap, it returns the
leftmost coordinate of any float overlapping this line that is
floated to the right.
|
|
|