Java Doc for CssBox.java in  » IDE-Netbeans » visualweb.api.designer » org » netbeans » modules » visualweb » css2 » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » visualweb.api.designer » org.netbeans.modules.visualweb.css2 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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



Field Summary
final public static  intAUTO
    
final protected static  booleanDEBUGFORMAT
    
final public static  intUNINITIALIZED
    
final public static  intX_AXIS
     XXX Very suspicious usage, see PageBox, and try to get rid of it.
final public static  intY_AXIS
    
 Colorbg
    
 BackgroundImagePainterbgPainter
    
 CssBorderborder
    
 intbottom
    
 intbottomBorderWidth
    
 intbottomMargin
    
 intbottomPadding
    
 BoxTypeboxType
    
 intcontainingBlockHeight
    
 intcontainingBlockWidth
    
 intcontainingBlockX
     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.
 intcontainingBlockY
    
 intcontentHeight
    
 intcontentWidth
    
 inteffectiveBottomMargin
    
 inteffectiveTopMargin
    
 intextentX
    
 intextentX2
    
 intextentY
    
 intextentY2
    
 intheight
    
 booleanhidden
    
 booleaninline
    
 intleft
    
 intleftBorderWidth
    
 intleftMargin
    
 intleftPadding
    
 CssBoxoriginalInlineContainer
    
static  booleanpaintPositioning
    
static  booleanpaintSpaces
    
static  booleanpaintText
    
 CssBoxpositionedBy
    
 booleanreplaced
    
 intright
    
 intrightBorderWidth
    
 intrightMargin
    
 intrightPadding
    
 HtmlTagtag
    
 inttop
    
 inttopBorderWidth
    
 inttopMargin
    
 inttopPadding
    
final protected  WebFormwebform
    
 intwidth
    
 intx
    
 inty
    
 intz
     Z stacking order.

Constructor Summary
public  CssBox(WebForm webform, Element element, BoxType boxType, boolean inline, boolean replaced)
    

Method Summary
protected  voidclearBottom(FormatContext context, CssValue cssSide)
     Adjust height and contentHeight to clear floating boxes on either (or both) sides within this box.
protected  voidclearTop(FormatContext context, CssValue cssSide)
     Clear previous boxes such that this box is positioned below the clear area.
protected  RectanglecomputeBounds(Element componentRootElement, Rectangle bounds)
    
protected  voidcomputeHorizNonInlineNormalFlow(FormatContext context, int parentWidth)
    
 voidcomputeHorizontalLengths(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  voidcomputeRectangles(Element componentRootElement, List<Rectangle> list)
     Compute a list of rectangles for all the boxes that represent the given live bean.
final public  RectanglecomputeRegionBounds(Element regionElement, Rectangle bounds)
    
 voidcomputeVerticalLengths(FormatContext context)
     Compute vertical heights and margins, as discussed in section 10.6 of the CSS2 spec.
protected  CssValuecomputeWidthCssValue()
    
protected  voidconsiderDesignBorder()
     Border Patrol! Make sure there's a border if one is needed.
protected  CssBoxfindCssBox(int x, int y, int px, int py, int depth)
     Return the deepest box containing the given point.
protected  CssBoxfindCssBoxForComponentRootElement(Element componentRootElement)
     Gets the first box matching the given component root element.
public  intgetAbsoluteX()
    

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  intgetAbsoluteY()
    

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  intgetBaseline()
     Return the baseline of this box, if applicable.
public  ColorgetBg()
    
public  intgetBlockHeight()
    
public  intgetBlockWidth()
    
public  RectanglegetBorderWidthRectangle()
    
public  CssBoxgetBox(int index)
     Return the box with the given index.
public  intgetBoxCount()
     Return the list of boxes "managed" by this box.
public  BoxTypegetBoxType()
    
public  StringgetBoxTypeName()
    
public  RectanglegetCBRectangle()
    
public  Box[]getChildren()
    
protected  intgetCollapsedBottomMargin()
     Compute the effective bottom margins for this box.
protected  intgetCollapsedTopMargin()
     Compute the effective top margin for this box.
public  ElementgetComponentRootElement()
    
public static  ElementgetComponentRootElementForCssBox(CssBox cssBox)
     XXX #113773 Find component root element for specified box.
public  StringgetComputedStyles()
    
protected  intgetContentHeight()
     Return the height of the content - the distance between the content edges.
public  DimensiongetContentSize()
    
protected  intgetContentWidth()
     Return the width of the content - the distance between the content edges.
protected  intgetContentX()
    
protected  intgetContentY()
    
protected  intgetContributingBaseline()
     Return the baseline of this box as it contributes to computing the baseline in a linebox.
public  InsetsgetCssSizeInsets()
    

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  DecorationgetDecoration()
     Gets Decoration associated with this box. gets the associated Decoration or null if there is none.
protected  intgetEffectiveBottomMargin()
     Get the effective bottom margin of the box.
public  intgetEffectiveTopMargin()
     Get the effective top margin of the box.
final public  ElementgetElement()
    
public static  ElementgetElementForComponentRootCssBox(CssBox cssBox)
     XXX This will replace the JSF specific above methods. Gets associated element for the css box.
protected  intgetExtentX()
     Return the smallest x coordinate of any children boxes (only for absolutely positioned boxes) in this box hiearchy.
protected  intgetExtentX2()
     Return the largest x coordinate of any children boxes (only for absolutely positioned boxes) in this box hiearchy.
protected  intgetExtentY()
     Return the smallest y coordinate of any children boxes (only for absolutely positioned boxes) in this box hiearchy.
protected  intgetExtentY2()
     Return the largest y coordinate of any children boxes (only for absolutely positioned boxes) in this box hiearchy.
public  RectanglegetExtentsRectangle()
    
 CssBoxgetFirstNormalBox()
    
public  intgetHeight()
     Return the actual height (in pixels) of the box.
public  intgetInternalResizeDirection(int x, int y)
    
public  InteractiongetInternalResizer(int x, int y)
    
protected  intgetIntrinsicHeight()
     Get the intrinsic width of the box.
protected  intgetIntrinsicWidth()
     Get the intrinsic width of the box.
public  intgetLeftMargin()
     Get the left margin of the box.
public  RectanglegetMarginRectangle()
    
protected  CssBoxgetNextNormalBlockBox()
     Get the next normal-flow box after to the current box in the parent's box list that is also a block box.
protected  CssBoxgetNextNormalBox()
    
public  RectanglegetPaddingRectangle()
    
public  booleangetPaintPositions()
    
public  booleangetPaintSpaces()
    
public  booleangetPaintText()
    
final public  ContainerBoxgetParent()
     Return the parent or "container" for this box.
protected  intgetParentIndex()
    
public  PointgetPosition()
    
public  RectanglegetPositionRect()
    
public  CssBoxgetPositionedBy()
     Return the parent responsible for positioning this box.
protected  intgetPrefMinWidth()
     Return the -preferred- minimum width; this is the smallest width that will avoid breaking up content beyond word boundaries, or clipping images, etc.
protected  intgetPrefWidth()
     Return the -preferred- width; this is the largest width that the box can occupy.
protected  CssBoxgetPrevNormalBlockBox()
     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  CssBoxgetPrevNormalBox()
    
public  PointgetRelPosition()
    
public  intgetRightMargin()
    
public  StringgetRules()
    
public  DimensiongetSize()
    
final public  ElementgetSourceElement()
     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  StringgetStyles()
    
public  HtmlTaggetTag()
    
public  WebFormgetWebForm()
     Return the WebForm this box is associated with.
public  intgetWidth()
     Return the actual width (in pixels) of the box.
public  intgetX()
     Return the horizontal position of the box relative to its parent.
public  intgetY()
     Return the vertical position of the box relative to its parent.
public  intgetZ()
     Return the z index of the box for the current stacking context.
final protected  booleanhasInitialFocus()
    
protected  booleanhasNormalBlockLevelChildren()
     Check whether the given box has any block level children that participate in normal flow (e.g.
protected  voidinitialize()
    
protected  voidinitializeBackground()
    
protected  voidinitializeBackgroundColor()
    
protected  voidinitializeBackgroundImage()
    
protected  voidinitializeBorder()
    
protected  voidinitializeContentSize()
    
protected  voidinitializeDesignBean()
    
protected  voidinitializeHorizontalWidths(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  voidinitializeInvariants()
     Initialize the box - but initialize only the properties that do not depend on layout, e.g.
protected  voidinitializeMargins()
    
protected  voidinitializePadding()
    
protected  voidinitializeZOrder()
    
public  booleanisAbsolutelyPositioned()
    
public  booleanisBlockLevel()
    
protected  booleanisBorderSizeIncluded()
     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  booleanisClearBox()
    
public  booleanisGrid()
     Report whether this box is a grid positioning container.
public  booleanisInlineBox()
     Is this box inline-level? If this method returns true, the box is inline level, otherwise it is block level.
protected  booleanisPlaceHolder()
    
public  booleanisPositioned()
    
public  booleanisReplacedBox()
    
public  voidlist(PrintStream out, int indent)
     Prints out the this box.
public  voidlist(PrintWriter out, int indent)
     Prints out the this box.
public  voidpaint(Graphics g, int px, int py)
    
protected  voidpaintBackground(Graphics g, int x, int y)
    
protected  voidpaintBox(Graphics g, int x, int y, int w, int h)
     Paints the CSS box according to the attributes given.
protected  voidpaintDebugPositioning(Graphics g)
    
protected  voidpaintDecoration(Graphics g, int x, int y)
    
final protected  voidpaintFocusWaterMark(Graphics g, int x, int y)
    
protected  StringparamString()
    
 voidputBoxReference(Element element, CssBox box)
    
protected  voidrelayout(FormatContext context)
     Recompute the layout.
protected  voidsetContainingBlock(int x, int y, int width, int height)
     Set the containing block for this box.
final public  voidsetLocation(int x, int y)
     Convenience method to set both x and y in one call.
public  voidsetMargins(int leftMargin, int effectiveTopMargin)
     Set the left margin and effective top margin.
public  voidsetPaintPositions(boolean paintPositioning)
    
public  voidsetPaintSpaces(boolean paintSpaces)
    
public  voidsetPaintText(boolean paintText)
    
final  voidsetParent(ContainerBox parent)
    
 voidsetParentIndex(int idx)
    
 voidsetPositionedBy(CssBox positionedBy)
    
 voidsetX(int x)
     Set the x position of the box.
 voidsetY(int y)
     Set the y position of the box.
protected  intshrinkToFit(int availableWidth, FormatContext context)
    
final public  StringtoString()
    
protected  voiduncomputeWidthCssValue()
    
protected  voidupdateAutoContentSize()
     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  voidupdateExtents(int px, int py, int depth)
    

Field Detail
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)



bg
Color bg(Code)



bgPainter
BackgroundImagePainter bgPainter(Code)



border
CssBorder border(Code)



bottom
int bottom(Code)



bottomBorderWidth
int bottomBorderWidth(Code)



bottomMargin
int bottomMargin(Code)



bottomPadding
int bottomPadding(Code)



boxType
BoxType boxType(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)



extentX
int extentX(Code)



extentX2
int extentX2(Code)



extentY
int extentY(Code)



extentY2
int extentY2(Code)



height
int height(Code)



hidden
boolean hidden(Code)



inline
boolean inline(Code)



left
int left(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)



positionedBy
CssBox positionedBy(Code)



replaced
boolean replaced(Code)



right
int right(Code)



rightBorderWidth
int rightBorderWidth(Code)



rightMargin
int rightMargin(Code)



rightPadding
int rightPadding(Code)



tag
HtmlTag tag(Code)



top
int top(Code)



topBorderWidth
int topBorderWidth(Code)



topMargin
int topMargin(Code)



topPadding
int topPadding(Code)



webform
final protected WebForm webform(Code)



width
int width(Code)



x
int x(Code)



y
int y(Code)



z
int z(Code)
Z stacking order. AUTO means not set




Constructor Detail
CssBox
public CssBox(WebForm webform, Element element, BoxType boxType, boolean inline, boolean replaced)(Code)




Method Detail
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.



computeBounds
protected Rectangle computeBounds(Element componentRootElement, Rectangle bounds)(Code)



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.



computeRegionBounds
final public Rectangle computeRegionBounds(Element regionElement, Rectangle bounds)(Code)



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.



computeWidthCssValue
protected CssValue computeWidthCssValue()(Code)



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".



getBg
public Color getBg()(Code)



getBlockHeight
public int getBlockHeight()(Code)



getBlockWidth
public int getBlockWidth()(Code)



getBorderWidthRectangle
public Rectangle getBorderWidthRectangle()(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



getBoxTypeName
public String getBoxTypeName()(Code)



getCBRectangle
public Rectangle getCBRectangle()(Code)



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.



getComputedStyles
public String getComputedStyles()(Code)



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.



getContentSize
public Dimension getContentSize()(Code)



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



getExtentsRectangle
public Rectangle getExtentsRectangle()(Code)



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



getInternalResizer
public Interaction getInternalResizer(int x, int y)(Code)



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



getMarginRectangle
public Rectangle getMarginRectangle()(Code)



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



getPaddingRectangle
public Rectangle getPaddingRectangle()(Code)



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



getPosition
public Point getPosition()(Code)



getPositionRect
public Rectangle getPositionRect()(Code)



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



getRelPosition
public Point getRelPosition()(Code)



getRightMargin
public int getRightMargin()(Code)
Get the right margin of the box The right side margin of the box



getRules
public String getRules()(Code)



getSize
public Dimension getSize()(Code)



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.



getStyles
public String getStyles()(Code)



getTag
public HtmlTag getTag()(Code)



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?



list
public void list(PrintStream out, int indent)(Code)
Prints out the this box.
See Also:   java.awt.Component.list(java.io.PrintStreamint)
See Also:   



list
public void list(PrintWriter out, int indent)(Code)
Prints out the this box.
See Also:   java.awt.Component.list(java.io.PrintWriterint)
See Also:   



paint
public void paint(Graphics g, int px, int py)(Code)



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)



paramString
protected String paramString()(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)



setParent
final void setParent(ContainerBox parent)(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



shrinkToFit
protected int shrinkToFit(int availableWidth, FormatContext context)(Code)



toString
final public String toString()(Code)



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)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.