| java.lang.Object org.netbeans.modules.visualweb.css2.CssBox
All known Subclasses: org.netbeans.modules.visualweb.css2.SpaceBox, org.netbeans.modules.visualweb.css2.ImageBox, org.netbeans.modules.visualweb.css2.ViewportBox, org.netbeans.modules.visualweb.css2.LineBreakBox, org.netbeans.modules.visualweb.css2.CustomButtonBox, org.netbeans.modules.visualweb.css2.ContainerBox, org.netbeans.modules.visualweb.css2.TextBox,
CssBox | public class CssBox implements Box(Code) | | Represents a CSS2 Box. I chose to call it CssBox instead of Box since
that would conflict with a JDK class.
See http://www.w3.org/TR/REC-CSS2/box.html
author: Tor Norbye |
Method Summary | |
protected void | clearBottom(FormatContext context, CssValue cssSide) Adjust height and contentHeight to clear floating
boxes on either (or both) sides within this box. | protected void | clearTop(FormatContext context, CssValue cssSide) Clear previous boxes such that this box is positioned below the
clear area. | protected Rectangle | computeBounds(Element componentRootElement, Rectangle bounds) | protected void | computeHorizNonInlineNormalFlow(FormatContext context, int parentWidth) | void | computeHorizontalLengths(FormatContext context) Compute widths and margins, as discussed in section
10.3 of the CSS2 spec:
http://www.w3.org/TR/CSS21/visudet.html#Computing_widths_and_margins
NOTE: This may have the side effect of setting
contentHEIGHT for replaced elements. | protected void | computeRectangles(Element componentRootElement, List<Rectangle> list) Compute a list of rectangles for all the boxes that represent
the given live bean. | final public Rectangle | computeRegionBounds(Element regionElement, Rectangle bounds) | void | computeVerticalLengths(FormatContext context) Compute vertical heights and margins, as discussed in section
10.6 of the CSS2 spec. | protected CssValue | computeWidthCssValue() | protected void | considerDesignBorder() Border Patrol! Make sure there's a border if one is needed. | protected CssBox | findCssBox(int x, int y, int px, int py, int depth) Return the deepest box containing the given point. | protected CssBox | findCssBoxForComponentRootElement(Element componentRootElement) Gets the first box matching the given component root element. | public int | getAbsoluteX()
Return the horizontal actual position of the visual portion of this box (the
border edge in the CSS 2 model) from the outermost viewport.
This is the actual screen pixel where the visual part of the component
will be painted.
Note that the name "getAbsoluteX" has "absolute" in it because unlike
getX(), which returns the -relative- position of this box (relative to
its parents border edge), this method computes the absolute, or actual,
screen coordinate. | public int | getAbsoluteY()
Return the actual vertical position of the visual portion of this box (the
border edge in the CSS 2 model) from the outermost viewport.
This is the actual screen pixel where the visual part of the component
will be painted.
Note that the name "getAbsoluteY" has "absolute" in it because unlike
getY(), which returns the -relative- position of this box (relative to
its parents border edge), this method computes the absolute, or actual,
screen coordinate. | protected int | getBaseline() Return the baseline of this box, if applicable. | public Color | getBg() | public int | getBlockHeight() | public int | getBlockWidth() | public Rectangle | getBorderWidthRectangle() | public CssBox | getBox(int index) Return the box with the given index. | public int | getBoxCount() Return the list of boxes "managed" by this box. | public BoxType | getBoxType() | public String | getBoxTypeName() | public Rectangle | getCBRectangle() | public Box[] | getChildren() | protected int | getCollapsedBottomMargin() Compute the effective bottom margins for this box. | protected int | getCollapsedTopMargin() Compute the effective top margin for this box. | public Element | getComponentRootElement() | public static Element | getComponentRootElementForCssBox(CssBox cssBox) XXX #113773 Find component root element for specified box. | public String | getComputedStyles() | protected int | getContentHeight() Return the height of the content - the distance between the
content edges. | public Dimension | getContentSize() | protected int | getContentWidth() Return the width of the content - the distance between the
content edges. | protected int | getContentX() | protected int | getContentY() | protected int | getContributingBaseline() Return the baseline of this box as it contributes to computing the baseline in a
linebox. | public Insets | getCssSizeInsets()
Return the insets from the border box to the actual content area of the box.
This is normally the border width plus the padding, but for boxes like
buttons (which include their own borders, see
CssBox.isBorderSizeIncluded )
and tables (which may include a caption) it will be something different.
You can also think of this method as returning the difference in size between
the visual size of the box (the border box) and the content box (e.g. | public Decoration | getDecoration() Gets Decoration associated with this box.
gets the associated Decoration or null if there is none. | protected int | getEffectiveBottomMargin() Get the effective bottom margin of the box. | public int | getEffectiveTopMargin() Get the effective top margin of the box. | final public Element | getElement() | public static Element | getElementForComponentRootCssBox(CssBox cssBox) XXX This will replace the JSF specific above methods.
Gets associated element for the css box. | protected int | getExtentX() Return the smallest x coordinate of any children boxes (only for
absolutely positioned boxes) in this box hiearchy. | protected int | getExtentX2() Return the largest x coordinate of any children boxes (only for
absolutely positioned boxes) in this box hiearchy. | protected int | getExtentY() Return the smallest y coordinate of any children boxes (only for
absolutely positioned boxes) in this box hiearchy. | protected int | getExtentY2() Return the largest y coordinate of any children boxes (only for
absolutely positioned boxes) in this box hiearchy. | public Rectangle | getExtentsRectangle() | CssBox | getFirstNormalBox() | public int | getHeight() Return the actual height (in pixels) of the box. | public int | getInternalResizeDirection(int x, int y) | public Interaction | getInternalResizer(int x, int y) | protected int | getIntrinsicHeight() Get the intrinsic width of the box. | protected int | getIntrinsicWidth() Get the intrinsic width of the box. | public int | getLeftMargin() Get the left margin of the box. | public Rectangle | getMarginRectangle() | protected CssBox | getNextNormalBlockBox() Get the next normal-flow box after to the current box
in the parent's box list that is also a block box. | protected CssBox | getNextNormalBox() | public Rectangle | getPaddingRectangle() | public boolean | getPaintPositions() | public boolean | getPaintSpaces() | public boolean | getPaintText() | final public ContainerBox | getParent() Return the parent or "container" for this box. | protected int | getParentIndex() | public Point | getPosition() | public Rectangle | getPositionRect() | public CssBox | getPositionedBy() Return the parent responsible for positioning this box. | protected int | getPrefMinWidth() Return the -preferred- minimum width; this is the smallest
width that will avoid breaking up content beyond word boundaries,
or clipping images, etc. | protected int | getPrefWidth() Return the -preferred- width; this is the largest
width that the box can occupy. | protected CssBox | getPrevNormalBlockBox() Get the most recent normal-flow box prior to the current box
in the parent's box list that is also a block box. | protected CssBox | getPrevNormalBox() | public Point | getRelPosition() | public int | getRightMargin() | public String | getRules() | public Dimension | getSize() | final public Element | getSourceElement() Return the element representing this box in the source; for jsf
this will be the actual jsf element, not an html rendered element
for it.
XXX Heavy hack!! This method cheats, if there is not corresponding source element,
it returns its rendered element (#getElement). | public String | getStyles() | public HtmlTag | getTag() | public WebForm | getWebForm() Return the WebForm this box is associated with. | public int | getWidth() Return the actual width (in pixels) of the box. | public int | getX() Return the horizontal position of the box relative to its parent. | public int | getY() Return the vertical position of the box relative to its parent. | public int | getZ() Return the z index of the box for the current stacking context. | final protected boolean | hasInitialFocus() | protected boolean | hasNormalBlockLevelChildren() Check whether the given box has any block level children that
participate in normal flow (e.g. | protected void | initialize() | protected void | initializeBackground() | protected void | initializeBackgroundColor() | protected void | initializeBackgroundImage() | protected void | initializeBorder() | protected void | initializeContentSize() | protected void | initializeDesignBean() | protected void | initializeHorizontalWidths(FormatContext context) Very similar to relayout(context) but does not compute
vertical dimensions, and does not position the boxes.
Used to initialize box dimensions for computation
of minimum widths when we're computing minimum widths
for table cells, etc.
NOTE: It's very important for CSS computations of values that
are percentages to be "cleared" if we "pre-compute" them using
getPrefWidth and getPrefMinWidth before a containing block
has been computed (as is the case when we're calling getPrefWidth
to compute dimensions for table layout), since otherwise the
computed width value is cached for later, even when a real containing
block is available. | protected void | initializeInvariants() Initialize the box - but initialize only the properties that do not depend on
layout, e.g. | protected void | initializeMargins() | protected void | initializePadding() | protected void | initializeZOrder() | public boolean | isAbsolutelyPositioned() | public boolean | isBlockLevel() | protected boolean | isBorderSizeIncluded() Return true for boxes where the size of border and padding is included
in the width assigned the element.
For example, if you have
then the actual visual size of the box (not including the invisible margins) is going
to be 140 pixels. | public boolean | isClearBox() | public boolean | isGrid() Report whether this box is a grid positioning container. | public boolean | isInlineBox() Is this box inline-level? If this method returns true, the box
is inline level, otherwise it is block level. | protected boolean | isPlaceHolder() | public boolean | isPositioned() | public boolean | isReplacedBox() | public void | list(PrintStream out, int indent) Prints out the this box. | public void | list(PrintWriter out, int indent) Prints out the this box. | public void | paint(Graphics g, int px, int py) | protected void | paintBackground(Graphics g, int x, int y) | protected void | paintBox(Graphics g, int x, int y, int w, int h) Paints the CSS box according to the attributes
given. | protected void | paintDebugPositioning(Graphics g) | protected void | paintDecoration(Graphics g, int x, int y) | final protected void | paintFocusWaterMark(Graphics g, int x, int y) | protected String | paramString() | void | putBoxReference(Element element, CssBox box) | protected void | relayout(FormatContext context) Recompute the layout. | protected void | setContainingBlock(int x, int y, int width, int height) Set the containing block for this box. | final public void | setLocation(int x, int y) Convenience method to set both x and y in one call. | public void | setMargins(int leftMargin, int effectiveTopMargin) Set the left margin and effective top margin. | public void | setPaintPositions(boolean paintPositioning) | public void | setPaintSpaces(boolean paintSpaces) | public void | setPaintText(boolean paintText) | final void | setParent(ContainerBox parent) | void | setParentIndex(int idx) | void | setPositionedBy(CssBox positionedBy) | void | setX(int x) Set the x position of the box. | void | setY(int y) Set the y position of the box. | protected int | shrinkToFit(int availableWidth, FormatContext context) | final public String | toString() | protected void | uncomputeWidthCssValue() | protected void | updateAutoContentSize() Compute the content width/height settings for a replaced
This will do nothing if the content width or height are
already set to something other than AUTO; however, if set to
AUTO it will compute a size which preserves the aspect
ratio. | protected void | updateExtents(int px, int py, int depth) |
AUTO | final public static int AUTO(Code) | | |
DEBUGFORMAT | final protected static boolean DEBUGFORMAT(Code) | | |
UNINITIALIZED | final public static int UNINITIALIZED(Code) | | |
X_AXIS | final public static int X_AXIS(Code) | | XXX Very suspicious usage, see PageBox, and try to get rid of it.
What a name? What it has to do with persistence?
|
Y_AXIS | final public static int Y_AXIS(Code) | | |
bottomBorderWidth | int bottomBorderWidth(Code) | | |
bottomMargin | int bottomMargin(Code) | | |
bottomPadding | int bottomPadding(Code) | | |
containingBlockHeight | int containingBlockHeight(Code) | | |
containingBlockWidth | int containingBlockWidth(Code) | | |
containingBlockX | int containingBlockX(Code) | | The containing block extents associated with a box is the
size it has been allocated by its parent - in other words, it's
NOT the block it exposes to its children! The containing block
exposed to its children is the content edge - e.g.
x+leftBorderWidth+leftPadding, to x+width-rightBorderWidth-rightPadding.
|
containingBlockY | int containingBlockY(Code) | | |
contentHeight | int contentHeight(Code) | | |
contentWidth | int contentWidth(Code) | | |
effectiveBottomMargin | int effectiveBottomMargin(Code) | | |
effectiveTopMargin | int effectiveTopMargin(Code) | | |
leftBorderWidth | int leftBorderWidth(Code) | | |
leftMargin | int leftMargin(Code) | | |
leftPadding | int leftPadding(Code) | | |
originalInlineContainer | CssBox originalInlineContainer(Code) | | |
paintPositioning | static boolean paintPositioning(Code) | | |
paintSpaces | static boolean paintSpaces(Code) | | |
paintText | static boolean paintText(Code) | | |
replaced | boolean replaced(Code) | | |
rightBorderWidth | int rightBorderWidth(Code) | | |
rightMargin | int rightMargin(Code) | | |
rightPadding | int rightPadding(Code) | | |
topBorderWidth | int topBorderWidth(Code) | | |
topPadding | int topPadding(Code) | | |
z | int z(Code) | | Z stacking order. AUTO means not set
|
clearBottom | protected void clearBottom(FormatContext context, CssValue cssSide)(Code) | | Adjust height and contentHeight to clear floating
boxes on either (or both) sides within this box.
|
clearTop | protected void clearTop(FormatContext context, CssValue cssSide)(Code) | | Clear previous boxes such that this box is positioned below the
clear area.
|
computeHorizNonInlineNormalFlow | protected void computeHorizNonInlineNormalFlow(FormatContext context, int parentWidth)(Code) | | |
computeHorizontalLengths | void computeHorizontalLengths(FormatContext context)(Code) | | Compute widths and margins, as discussed in section
10.3 of the CSS2 spec:
http://www.w3.org/TR/CSS21/visudet.html#Computing_widths_and_margins
NOTE: This may have the side effect of setting
contentHEIGHT for replaced elements. This is because
the spec calls for special treatment of width and height
for replaced elements, in order to preserve the aspect ratio
of the intrinsic size of the replaced elements. If we first
solve the content width without looking at the height, we end
up having to compute the aspect ratio in the vertical computation
method since it will no longer be the case that both width and
height are auto (which initially tells us that we should use
the intrinsic size for both).
Note: While this method computes horizontal dimensions,
it also initializes box.contentHeight from its css property!
It may not compute the value (and will happily leave it AUTO)
but it is properly initialized for use by computeVerticalLengths.
Note: I changed the implementation of 10.3.8 since the
rules seemed a bit incorrect; see details in the relevant method.
Parameters: parentWidth - the width of the containing block establishedby the parent. |
computeRectangles | protected void computeRectangles(Element componentRootElement, List<Rectangle> list)(Code) | | Compute a list of rectangles for all the boxes that represent
the given live bean. Inline spans are added as a single bounding
rectangle, not as individual rectangles for each inline text, image,
form or iframe box.
|
computeVerticalLengths | void computeVerticalLengths(FormatContext context)(Code) | | Compute vertical heights and margins, as discussed in section
10.6 of the CSS2 spec.
Parameters: parentHeight - the height of the containing block establishedby the parent. |
considerDesignBorder | protected void considerDesignBorder()(Code) | | Border Patrol! Make sure there's a border if one is needed.
|
findCssBox | protected CssBox findCssBox(int x, int y, int px, int py, int depth)(Code) | | Return the deepest box containing the given point.
|
findCssBoxForComponentRootElement | protected CssBox findCssBoxForComponentRootElement(Element componentRootElement)(Code) | | Gets the first box matching the given component root element.
|
getAbsoluteX | public int getAbsoluteX()(Code) | |
Return the horizontal actual position of the visual portion of this box (the
border edge in the CSS 2 model) from the outermost viewport.
This is the actual screen pixel where the visual part of the component
will be painted.
Note that the name "getAbsoluteX" has "absolute" in it because unlike
getX(), which returns the -relative- position of this box (relative to
its parents border edge), this method computes the absolute, or actual,
screen coordinate. Note also that it's a recursive call, unlike getX()
which is a plain field accessor.
The actual horizontal position of the beginning of the lefthand side borderof this box (or if no border, the padding edge, and if no padding, thecontent edge). |
getAbsoluteY | public int getAbsoluteY()(Code) | |
Return the actual vertical position of the visual portion of this box (the
border edge in the CSS 2 model) from the outermost viewport.
This is the actual screen pixel where the visual part of the component
will be painted.
Note that the name "getAbsoluteY" has "absolute" in it because unlike
getY(), which returns the -relative- position of this box (relative to
its parents border edge), this method computes the absolute, or actual,
screen coordinate. Note also that it's a recursive call, unlike getY()
which is a plain field accessor.
The actual vertical position of the beginning of the lefthand side borderof this box (or if no border, the padding edge, and if no padding, thecontent edge). |
getBaseline | protected int getBaseline()(Code) | | Return the baseline of this box, if applicable. The baseline is the distance from
the top of the box to the baseline of the content in the box. This method has no
meaning for block-formatted boxes. For inline boxes, the box will be aligned with
the linebox baseline along its own baseline, when the vertical alignment is set to
"baseline".
|
getBlockHeight | public int getBlockHeight()(Code) | | |
getBlockWidth | public int getBlockWidth()(Code) | | |
getBox | public CssBox getBox(int index)(Code) | | Return the box with the given index. There is no particular
significance to the index other than identifying a box; in particular
boxes with adjacent indices may not be adjacent visually.
|
getBoxCount | public int getBoxCount()(Code) | | Return the list of boxes "managed" by this box. Managed simply
means that the coordinates in the boxes are all relative to this
one.
|
getBoxType | public BoxType getBoxType()(Code) | | Get the BoxType for this box
|
getChildren | public Box[] getChildren()(Code) | | |
getCollapsedBottomMargin | protected int getCollapsedBottomMargin()(Code) | | Compute the effective bottom margins for this box.
Collapsing vertical margins: specified in 8.3.1.
|
getCollapsedTopMargin | protected int getCollapsedTopMargin()(Code) | | Compute the effective top margin for this box.
Collapsing vertical margins: specified in 8.3.1
|
getComponentRootElement | public Element getComponentRootElement()(Code) | | |
getComponentRootElementForCssBox | public static Element getComponentRootElementForCssBox(CssBox cssBox)(Code) | | XXX #113773 Find component root element for specified box.
|
getContentHeight | protected int getContentHeight()(Code) | | Return the height of the content - the distance between the
content edges. This can be set by the "height" CSS2 property.
This height, plus the top and bottom padding, constitutes the
height of the containing block established by this box for its
descendants.
|
getContentWidth | protected int getContentWidth()(Code) | | Return the width of the content - the distance between the
content edges. This can be set by the "width" CSS2 property.
This width, plus the left and right padding, constitutes the
width of the containing block established by this box for its
descendants.
|
getContentX | protected int getContentX()(Code) | | Return the x position of the content box, relative to the parent box
|
getContentY | protected int getContentY()(Code) | | Return the y position of the content box, relative to the parent box
|
getContributingBaseline | protected int getContributingBaseline()(Code) | | Return the baseline of this box as it contributes to computing the baseline in a
linebox. For most boxes, this is the same as their normal baseline. Images however
act a bit differently; normally their baseline are at the bottom of the image;
thus the image bottom will be aligned in a linebox along with the text baseline.
However, a really tall image will NOT push the baseline down like other boxes do.
This method captures the baseline that should be used for computing the overall
baseline before laying out the boxes along the baseline.
|
getCssSizeInsets | public Insets getCssSizeInsets()(Code) | |
Return the insets from the border box to the actual content area of the box.
This is normally the border width plus the padding, but for boxes like
buttons (which include their own borders, see
CssBox.isBorderSizeIncluded )
and tables (which may include a caption) it will be something different.
You can also think of this method as returning the difference in size between
the visual size of the box (the border box) and the content box (e.g. the
CSS width and height).
Note: to be more accurate, this method should return the insets from
the outermost box generated for the element for this box, to the area covered
by the CSS width and height dimensions.
Thus, in the case of a captioned table, where the caption is above the table,
the offset will be the size of the caption (and for the table, NOT the border
or padding since tables include their borders in the CSS width size.
The insets from outside the borders of the box to the box covered bythe CSS width and height properties for this element |
getDecoration | public Decoration getDecoration()(Code) | | Gets Decoration associated with this box.
gets the associated Decoration or null if there is none. |
getEffectiveBottomMargin | protected int getEffectiveBottomMargin()(Code) | | Get the effective bottom margin of the box. This is
the collapsed margin of this box (e.g. the max of its margin
and any last children, modulo some scenarios with negative margins.)
The bottom margin of the box |
getEffectiveTopMargin | public int getEffectiveTopMargin()(Code) | | Get the effective top margin of the box. This is
the collapsed margin of this box (e.g. the max of its margin
and any first children, modulo some scenarios with negative margins.)
The top margin of the box |
getElement | final public Element getElement()(Code) | | Return the element being rendered by this box; for jsf components
this means it will be a rendered html element, not a jsf element
|
getElementForComponentRootCssBox | public static Element getElementForComponentRootCssBox(CssBox cssBox)(Code) | | XXX This will replace the JSF specific above methods.
Gets associated element for the css box. It returns the element only if the specified box
represents component top level element except lines, texts and spaces.
|
getExtentX | protected int getExtentX()(Code) | | Return the smallest x coordinate of any children boxes (only for
absolutely positioned boxes) in this box hiearchy.
the absolute x coordinate in pixels |
getExtentX2 | protected int getExtentX2()(Code) | | Return the largest x coordinate of any children boxes (only for
absolutely positioned boxes) in this box hiearchy.
the x coordinate in pixels |
getExtentY | protected int getExtentY()(Code) | | Return the smallest y coordinate of any children boxes (only for
absolutely positioned boxes) in this box hiearchy.
the y coordinate in pixels |
getExtentY2 | protected int getExtentY2()(Code) | | Return the largest y coordinate of any children boxes (only for
absolutely positioned boxes) in this box hiearchy.
the y coordinate in pixels |
getFirstNormalBox | CssBox getFirstNormalBox()(Code) | | Get the first normal-flow child box
|
getHeight | public int getHeight()(Code) | | Return the actual height (in pixels) of the box.
This refers to the distance between the top and bottom
border edges - in other words the "visual" height of
the box, since it includes padding, borders and content,
and is therefore different than the containing block's
height.
(See CSS2 spec section 8.1).
the actual width of the box |
getInternalResizeDirection | public int getInternalResizeDirection(int x, int y)(Code) | | If this box supports internal resizing, return the Cursor to be
shown over the given coordinate
|
getIntrinsicHeight | protected int getIntrinsicHeight()(Code) | | Get the intrinsic width of the box. This is only defined for boxes
representing replaced elements as well as text boxes
|
getIntrinsicWidth | protected int getIntrinsicWidth()(Code) | | Get the intrinsic width of the box. This is only defined for boxes
representing replaced elements as well as text boxes
|
getLeftMargin | public int getLeftMargin()(Code) | | Get the left margin of the box.
The left side margin of the box |
getNextNormalBlockBox | protected CssBox getNextNormalBlockBox()(Code) | | Get the next normal-flow box after to the current box
in the parent's box list that is also a block box. Lineboxes
are considered block level for this purpose. Same as getNextNormalBox
except we also include LineBoxes.
|
getNextNormalBox | protected CssBox getNextNormalBox()(Code) | | Get the next normal-flow box after to the current box
in the parent's box list
|
getPaintPositions | public boolean getPaintPositions()(Code) | | |
getPaintSpaces | public boolean getPaintSpaces()(Code) | | |
getPaintText | public boolean getPaintText()(Code) | | |
getParent | final public ContainerBox getParent()(Code) | | Return the parent or "container" for this box.
|
getParentIndex | protected int getParentIndex()(Code) | | Get the index of this box in the parent's box list
|
getPositionedBy | public CssBox getPositionedBy()(Code) | | Return the parent responsible for positioning this box.
This is typically the same as the container parent, but
in the case of "positioned" elements such as absolutely
positioned boxes, it will be some other ancestor.
The important aspect of this is that the coordinates
will be relative to this positioned-by parent, not
the container parent!
|
getPrefMinWidth | protected int getPrefMinWidth()(Code) | | Return the -preferred- minimum width; this is the smallest
width that will avoid breaking up content beyond word boundaries,
or clipping images, etc.
|
getPrefWidth | protected int getPrefWidth()(Code) | | Return the -preferred- width; this is the largest
width that the box can occupy.
|
getPrevNormalBlockBox | protected CssBox getPrevNormalBlockBox()(Code) | | Get the most recent normal-flow box prior to the current box
in the parent's box list that is also a block box. Lineboxes
are considered block level for this purpose. Same as getPrevNormalBox
except we also include LineBoxes.
|
getPrevNormalBox | protected CssBox getPrevNormalBox()(Code) | | Get the most recent normal-flow box prior to the current box
in the parent's box list
|
getRightMargin | public int getRightMargin()(Code) | | Get the right margin of the box
The right side margin of the box |
getSourceElement | final public Element getSourceElement()(Code) | | Return the element representing this box in the source; for jsf
this will be the actual jsf element, not an html rendered element
for it.
XXX Heavy hack!! This method cheats, if there is not corresponding source element,
it returns its rendered element (#getElement). Get rid of this.
|
getWebForm | public WebForm getWebForm()(Code) | | Return the WebForm this box is associated with.
|
getWidth | public int getWidth()(Code) | | Return the actual width (in pixels) of the box.
This refers to the distance between the left and right
border edges - in other words the "visual" width of
the box, since it includes padding, borders and content,
and is therefore different than the containing block's
width.
(See CSS2 spec section 8.1).
the actual width of the box |
getX | public int getX()(Code) | | Return the horizontal position of the box relative to its parent.
This points to the -border edge- of the box - not the margin edge,
not the padding edge (aka the containing block edge).
In other words, the x attribute tells you where visually the box
begins, relative to where its parent's border edge is located.
the border x position of the box |
getY | public int getY()(Code) | | Return the vertical position of the box relative to its parent.
This points to the -border edge- of the box - not the margin edge,
not the padding edge (aka the containing block edge).
In other words, the y attribute tells you where visually the box
begins, relative to where its parent's border edge is located.
the border y position of the box |
getZ | public int getZ()(Code) | | Return the z index of the box for the current stacking context.
Will be AUTO if not set using the z-index CSS property.
the z index of the box. |
hasInitialFocus | final protected boolean hasInitialFocus()(Code) | | |
hasNormalBlockLevelChildren | protected boolean hasNormalBlockLevelChildren()(Code) | | Check whether the given box has any block level children that
participate in normal flow (e.g. not floating boxes or
absolutely positioned boxes).
|
initialize | protected void initialize()(Code) | | |
initializeBackground | protected void initializeBackground()(Code) | | |
initializeBackgroundColor | protected void initializeBackgroundColor()(Code) | | |
initializeBackgroundImage | protected void initializeBackgroundImage()(Code) | | |
initializeBorder | protected void initializeBorder()(Code) | | |
initializeContentSize | protected void initializeContentSize()(Code) | | |
initializeDesignBean | protected void initializeDesignBean()(Code) | | |
initializeHorizontalWidths | protected void initializeHorizontalWidths(FormatContext context)(Code) | | Very similar to relayout(context) but does not compute
vertical dimensions, and does not position the boxes.
Used to initialize box dimensions for computation
of minimum widths when we're computing minimum widths
for table cells, etc.
NOTE: It's very important for CSS computations of values that
are percentages to be "cleared" if we "pre-compute" them using
getPrefWidth and getPrefMinWidth before a containing block
has been computed (as is the case when we're calling getPrefWidth
to compute dimensions for table layout), since otherwise the
computed width value is cached for later, even when a real containing
block is available. If you put a table widht a div inside it, and
set the width of the div to 100%, the div will show up with zero
width without this caveat since otherwise during the outer table
layout, we're calling initializeHorizontalWidths and getPrefMinWidth
on the div, with a 0 containing block, so the computed value for
the div is 0*100%=0, and when we subsequently lay out the table,
even though the containing block may now be 600px the CSS lookup
for the width attribute will return the previously computed 0-value
rather than 600.
|
initializeInvariants | protected void initializeInvariants()(Code) | | Initialize the box - but initialize only the properties that do not depend on
layout, e.g. the containing block.
|
initializeMargins | protected void initializeMargins()(Code) | | |
initializePadding | protected void initializePadding()(Code) | | |
initializeZOrder | protected void initializeZOrder()(Code) | | Set the box type for this box
|
isAbsolutelyPositioned | public boolean isAbsolutelyPositioned()(Code) | | |
isBlockLevel | public boolean isBlockLevel()(Code) | | |
isBorderSizeIncluded | protected boolean isBorderSizeIncluded()(Code) | | Return true for boxes where the size of border and padding is included
in the width assigned the element.
For example, if you have
then the actual visual size of the box (not including the invisible margins) is going
to be 140 pixels. On the other hand, if you have
then
the actual width is 100 pixels. Thus, to distinguish the different kinds of
formatting behaviors (I haven't found details in the CSS spec regarding
this, but I'm sure it's there) this method lets you query what kind of
border/padding computation this box is performing. For the normal case (div
in the above example), this method will return false. For table, and buttons,
it will return true.
True iff this box will subtract the border and padding widths from theassigned content width and content height to make the component fit in exactlythe allocated size See Also: getContentInsets |
isClearBox | public boolean isClearBox()(Code) | | |
isGrid | public boolean isGrid()(Code) | | Report whether this box is a grid positioning container.
|
isInlineBox | public boolean isInlineBox()(Code) | | Is this box inline-level? If this method returns true, the box
is inline level, otherwise it is block level.
|
isPlaceHolder | protected boolean isPlaceHolder()(Code) | | |
isPositioned | public boolean isPositioned()(Code) | | |
isReplacedBox | public boolean isReplacedBox()(Code) | | Is this box replaced?
|
paintBackground | protected void paintBackground(Graphics g, int x, int y)(Code) | | |
paintBox | protected void paintBox(Graphics g, int x, int y, int w, int h)(Code) | | Paints the CSS box according to the attributes
given. This should paint the border, padding,
and background.
Parameters: g - the rendering surface. Parameters: x - the x coordinate of the allocated area torender into. Parameters: y - the y coordinate of the allocated area torender into. Parameters: w - the width of the allocated area to render into. Parameters: h - the height of the allocated area to render into. Parameters: v - the view making the request. This isused to get the AttributeSet, and may be used toresolve percentage arguments. |
paintDebugPositioning | protected void paintDebugPositioning(Graphics g)(Code) | | |
paintDecoration | protected void paintDecoration(Graphics g, int x, int y)(Code) | | |
paintFocusWaterMark | final protected void paintFocusWaterMark(Graphics g, int x, int y)(Code) | | |
putBoxReference | void putBoxReference(Element element, CssBox box)(Code) | | Stash a reference to this box on the element
So we can quickly look up a Box for an element
|
relayout | protected void relayout(FormatContext context)(Code) | | Recompute the layout. Once the layout routine gets to a point
where the child layout matches the computed layout, it will leave
that tree alone. Thus, only the portions of the layout below
this box that need to be recomputed are updated
|
setContainingBlock | protected void setContainingBlock(int x, int y, int width, int height)(Code) | | Set the containing block for this box.
|
setLocation | final public void setLocation(int x, int y)(Code) | | Convenience method to set both x and y in one call.
See Also: setX See Also: setY |
setMargins | public void setMargins(int leftMargin, int effectiveTopMargin)(Code) | | Set the left margin and effective top margin.
Parameters: leftMargin - The new left margin Parameters: effectiveTopMargin - The new effective top margin |
setPaintPositions | public void setPaintPositions(boolean paintPositioning)(Code) | | |
setPaintSpaces | public void setPaintSpaces(boolean paintSpaces)(Code) | | |
setPaintText | public void setPaintText(boolean paintText)(Code) | | |
setParentIndex | void setParentIndex(int idx)(Code) | | Set the index of this box in the parent's box list
|
setPositionedBy | void setPositionedBy(CssBox positionedBy)(Code) | | |
setX | void setX(int x)(Code) | | Set the x position of the box. This referers to the location of
the border edge - in other words where the box visually begins.
For use by the formatter only.
Parameters: x - the new x coordinate |
setY | void setY(int y)(Code) | | Set the y position of the box. This referers to the location of
the border edge - in other words where the box visually begins.
For use by the formatter only.
Parameters: y - the new y coordinate |
uncomputeWidthCssValue | protected void uncomputeWidthCssValue()(Code) | | |
updateAutoContentSize | protected void updateAutoContentSize()(Code) | | Compute the content width/height settings for a replaced
This will do nothing if the content width or height are
already set to something other than AUTO; however, if set to
AUTO it will compute a size which preserves the aspect
ratio. If both width and height are set to auto, it returns the
intrinsic size. See the errata since this was incorrect in
the spec.
http://www.w3.org/Style/css2-updates/REC-CSS2-19980512-errata.html
specifically section 10.3.2 (which also applies to 10.3.4,
10.3.6, and 10.3.8).
|
updateExtents | protected void updateExtents(int px, int py, int depth)(Code) | | Update the extents for this box (which involves the extents
of any of its children)
|
|
|