public int getEffectiveWidth() { return getWidth(); } }
public int getEffectiveWidth() { return getWidth(); } }
public String toString() { StringBuffer sb = new StringBuffer(); sb.append("Box: "); sb.append(" (" + getAbsX() + "," + getAbsY() + ")->(" + getWidth() + " x " + getHeight() + ")"); return sb.toString(); }
public Rectangle getMarginEdge(int left, int top, CssContext cssCtx, int tx, int ty) { // Note that negative margins can mean this rectangle is inside the border // edge, but that's the way it's supposed to work... Rectangle result = new Rectangle(left, top, getWidth(), getHeight()); result.translate(tx, ty); return result; }
public String toString() { StringBuffer sb = new StringBuffer(); sb.append("Box: "); sb.append(" (" + getAbsX() + "," + getAbsY() + ")->(" + getWidth() + " x " + getHeight() + ")"); return sb.toString(); }
public Rectangle getMarginEdge(int left, int top, CssContext cssCtx, int tx, int ty) { // Note that negative margins can mean this rectangle is inside the border // edge, but that's the way it's supposed to work... Rectangle result = new Rectangle(left, top, getWidth(), getHeight()); result.translate(tx, ty); return result; }
public boolean isContainsVisibleContent() { for (int i = 0; i < getChildCount(); i++) { Box b = getChild(i); if (b instanceof BlockBox) { if (b.getWidth() > 0 || b.getHeight() > 0) { return true; } } else { boolean maybeResult = ((InlineLayoutBox)b).isContainsVisibleContent(); if (maybeResult) { return true; } } } return false; }
public boolean isContainsVisibleContent() { for (int i = 0; i < getChildCount(); i++) { Box b = getChild(i); if (b instanceof BlockBox) { if (b.getWidth() > 0 || b.getHeight() > 0) { return true; } } else { boolean maybeResult = ((InlineLayoutBox)b).isContainsVisibleContent(); if (maybeResult) { return true; } } } return false; }
public Rectangle getBorderEdge(int left, int top, CssContext cssCtx) { RectPropertySet margin = getMargin(cssCtx); Rectangle result = new Rectangle(left + (int) margin.left(), top + (int) margin.top(), getWidth() - (int) margin.left() - (int) margin.right(), getHeight() - (int) margin.top() - (int) margin.bottom()); return result; }
public Rectangle getBorderEdge(int left, int top, CssContext cssCtx) { RectPropertySet margin = getMargin(cssCtx); Rectangle result = new Rectangle(left + (int) margin.left(), top + (int) margin.top(), getWidth() - (int) margin.left() - (int) margin.right(), getHeight() - (int) margin.top() - (int) margin.bottom()); return result; }
public boolean isContainsVisibleContent() { for (int i = 0; i < getInlineChildCount(); i++) { Object child = (Object)getInlineChild(i); if (child instanceof InlineText) { InlineText iT = (InlineText)child; if (! iT.isEmpty()) { return true; } } else if (child instanceof InlineLayoutBox) { InlineLayoutBox iB = (InlineLayoutBox)child; if (iB.isContainsVisibleContent()) { return true; } } else { Box b = (Box)child; if (b.getWidth() > 0 || b.getHeight() > 0) { return true; } } } return false; }
public boolean isContainsVisibleContent() { for (int i = 0; i < getInlineChildCount(); i++) { Object child = (Object)getInlineChild(i); if (child instanceof InlineText) { InlineText iT = (InlineText)child; if (! iT.isEmpty()) { return true; } } else if (child instanceof InlineLayoutBox) { InlineLayoutBox iB = (InlineLayoutBox)child; if (iB.isContainsVisibleContent()) { return true; } } else { Box b = (Box)child; if (b.getWidth() > 0 || b.getHeight() > 0) { return true; } } } return false; }
private ElementBox createElementBox(Styleable styleable, Element element) { if (styleable instanceof InlineLayoutBox) { final InlineLayoutBox box = (InlineLayoutBox) styleable; final int width = Math.max(box.getInlineWidth(), box.getWidth()); return new ElementBox(element, box.getAbsX(), box.getAbsY(), width, box.getHeight()); } if (styleable instanceof Box) { final Box box = (Box) styleable; return new ElementBox(element, box.getAbsX(), box.getAbsY(), box.getWidth(), box.getHeight()); } return null; }
public Rectangle getPaddingEdge(int left, int top, CssContext cssCtx) { RectPropertySet margin = getMargin(cssCtx); RectPropertySet border = getBorder(cssCtx); Rectangle result = new Rectangle(left + (int) margin.left() + (int) border.left(), top + (int) margin.top() + (int) border.top(), getWidth() - (int) margin.width() - (int) border.width(), getHeight() - (int) margin.height() - (int) border.height()); return result; }
public Rectangle getPaddingEdge(int left, int top, CssContext cssCtx) { RectPropertySet margin = getMargin(cssCtx); RectPropertySet border = getBorder(cssCtx); Rectangle result = new Rectangle(left + (int) margin.left() + (int) border.left(), top + (int) margin.top() + (int) border.top(), getWidth() - (int) margin.width() - (int) border.width(), getHeight() - (int) margin.height() - (int) border.height()); return result; }
public Rectangle getContentAreaEdge(int left, int top, CssContext cssCtx) { RectPropertySet margin = getMargin(cssCtx); RectPropertySet border = getBorder(cssCtx); RectPropertySet padding = getPadding(cssCtx); Rectangle result = new Rectangle( left + (int)margin.left() + (int)border.left() + (int)padding.left(), top + (int)margin.top() + (int)border.top() + (int)padding.top(), getWidth() - (int)margin.width() - (int)border.width() - (int)padding.width(), getHeight() - (int) margin.height() - (int) border.height() - (int) padding.height()); return result; }
public Rectangle getContentAreaEdge(int left, int top, CssContext cssCtx) { RectPropertySet margin = getMargin(cssCtx); RectPropertySet border = getBorder(cssCtx); RectPropertySet padding = getPadding(cssCtx); Rectangle result = new Rectangle( left + (int)margin.left() + (int)border.left() + (int)padding.left(), top + (int)margin.top() + (int)border.top() + (int)padding.top(), getWidth() - (int)margin.width() - (int)border.width() - (int)padding.width(), getHeight() - (int) margin.height() - (int) border.height() - (int) padding.height()); return result; }
public static int positionHorizontally(CssContext c, Box current, int start) { int x = start; InlineLayoutBox currentIB = null; if (current instanceof InlineLayoutBox) { currentIB = (InlineLayoutBox)current; x += currentIB.getLeftMarginBorderPadding(c); } for (int i = 0; i < current.getChildCount(); i++) { Box b = current.getChild(i); if (b instanceof InlineLayoutBox) { InlineLayoutBox iB = (InlineLayoutBox) current.getChild(i); iB.setX(x); x += positionHorizontally(c, iB, x); } else { b.setX(x); x += b.getWidth(); } } if (currentIB != null) { x += currentIB.getRightMarginPaddingBorder(c); currentIB.setInlineWidth(x - start); } return x - start; }
public static int positionHorizontally(CssContext c, Box current, int start) { int x = start; InlineLayoutBox currentIB = null; if (current instanceof InlineLayoutBox) { currentIB = (InlineLayoutBox)current; x += currentIB.getLeftMarginBorderPadding(c); } for (int i = 0; i < current.getChildCount(); i++) { Box b = current.getChild(i); if (b instanceof InlineLayoutBox) { InlineLayoutBox iB = (InlineLayoutBox) current.getChild(i); iB.setX(x); x += positionHorizontally(c, iB, x); } else { b.setX(x); x += b.getWidth(); } } if (currentIB != null) { x += currentIB.getRightMarginPaddingBorder(c); currentIB.setInlineWidth(x - start); } return x - start; }