private boolean containsEnd(List result) { for (int i = 0; i < result.size(); i++) { Box b = (Box)result.get(i); if (b instanceof InlineLayoutBox) { InlineLayoutBox iB = (InlineLayoutBox)b; if (getElement() == iB.getElement() && iB.isEndsHere()) { return true; } } } return false; }
private boolean containsEnd(List result) { for (int i = 0; i < result.size(); i++) { Box b = (Box)result.get(i); if (b instanceof InlineLayoutBox) { InlineLayoutBox iB = (InlineLayoutBox)b; if (getElement() == iB.getElement() && iB.isEndsHere()) { return true; } } } return false; }
public String toString() { StringBuffer result = new StringBuffer(); result.append("InlineLayoutBox: "); if (getElement() != null) { result.append("<"); result.append(getElement().getNodeName()); result.append("> "); } else { result.append("(anonymous) "); } if (isStartsHere() || isEndsHere()) { result.append("("); if (isStartsHere()) { result.append("S"); } if (isEndsHere()) { result.append("E"); } result.append(") "); } result.append("(baseline="); result.append(_baseline); result.append(") "); result.append("(" + getAbsX() + "," + getAbsY() + ")->(" + getInlineWidth() + " x " + getHeight() + ")"); return result.toString(); }
public String toString() { StringBuffer result = new StringBuffer(); result.append("InlineLayoutBox: "); if (getElement() != null) { result.append("<"); result.append(getElement().getNodeName()); result.append("> "); } else { result.append("(anonymous) "); } if (isStartsHere() || isEndsHere()) { result.append("("); if (isStartsHere()) { result.append("S"); } if (isEndsHere()) { result.append("E"); } result.append(") "); } result.append("(baseline="); result.append(_baseline); result.append(") "); result.append("(" + getAbsX() + "," + getAbsY() + ")->(" + getInlineWidth() + " x " + getHeight() + ")"); return result.toString(); }
public String calculate(RenderingContext c, FSFunction function, InlineText text) { String uri = text.getParent().getElement().getAttribute("href"); if (uri != null && uri.startsWith("#")) { String anchor = uri.substring(1); Box target = c.getBoxById(anchor); if (target != null) { PageBox targetPage = c.getRootLayer().getPage(c, target.getAbsY()); return CounterFunction.createCounterText(IdentValue.DECIMAL, targetPage.getPageNo()+1); } } return ""; }
public String calculate(RenderingContext c, FSFunction function, InlineText text) { String uri = text.getParent().getElement().getAttribute("href"); if (uri != null && uri.startsWith("#")) { String anchor = uri.substring(1); Box target = c.getBoxById(anchor); if (target != null) { PageBox targetPage = c.getRootLayer().getPage(c, target.getAbsY()); return CounterFunction.createCounterText(IdentValue.DECIMAL, targetPage.getPageNo()+1); } } return ""; }
public List getElementWithContent() { // inefficient, but the lists in question shouldn't be very long List result = new ArrayList(); BlockBox container = (BlockBox)getLineBox().getParent(); while (true) { List elementBoxes = container.getElementBoxes(getElement()); for (int i = 0; i < elementBoxes.size(); i++) { InlineLayoutBox iB = (InlineLayoutBox)elementBoxes.get(i); iB.addToContentList(result); } if ( ! (container instanceof AnonymousBlockBox) || containsEnd(result)) { break; } container = addFollowingBlockBoxes(container, result); if (container == null) { break; } } return result; }
public List getElementWithContent() { // inefficient, but the lists in question shouldn't be very long List result = new ArrayList(); BlockBox container = (BlockBox)getLineBox().getParent(); while (true) { List elementBoxes = container.getElementBoxes(getElement()); for (int i = 0; i < elementBoxes.size(); i++) { InlineLayoutBox iB = (InlineLayoutBox)elementBoxes.get(i); iB.addToContentList(result); } if ( ! (container instanceof AnonymousBlockBox) || containsEnd(result)) { break; } container = addFollowingBlockBoxes(container, result); if (container == null) { break; } } return result; }
public InlineLayoutBox copyOf() { InlineLayoutBox result = new InlineLayoutBox(); result.setElement(getElement()); result.setStyle(getStyle()); result.setHeight(getHeight()); result._pending = _pending; result.setContainingLayer(getContainingLayer()); return result; }
public InlineLayoutBox copyOf() { InlineLayoutBox result = new InlineLayoutBox(); result.setElement(getElement()); result.setStyle(getStyle()); result.setHeight(getHeight()); result._pending = _pending; result.setContainingLayer(getContainingLayer()); return result; }
public Box find(CssContext cssCtx, int absX, int absY, boolean findAnonymous) { PaintingInfo pI = getPaintingInfo(); if (pI != null && ! pI.getAggregateBounds().contains(absX, absY)) { return null; } Box result = null; for (int i = 0; i < getInlineChildCount(); i++) { Object child = getInlineChild(i); if (child instanceof Box) { result = ((Box)child).find(cssCtx, absX, absY, findAnonymous); if (result != null) { return result; } } } Rectangle edge = getContentAreaEdge(getAbsX(), getAbsY(), cssCtx); result = edge.contains(absX, absY) && getStyle().isVisible() ? this : null; if (! findAnonymous && result != null && getElement() == null) { return getParent().getParent(); } else { return result; } }
public Box find(CssContext cssCtx, int absX, int absY, boolean findAnonymous) { PaintingInfo pI = getPaintingInfo(); if (pI != null && ! pI.getAggregateBounds().contains(absX, absY)) { return null; } Box result = null; for (int i = 0; i < getInlineChildCount(); i++) { Object child = getInlineChild(i); if (child instanceof Box) { result = ((Box)child).find(cssCtx, absX, absY, findAnonymous); if (result != null) { return result; } } } Rectangle edge = getContentAreaEdge(getAbsX(), getAbsY(), cssCtx); result = edge.contains(absX, absY) && getStyle().isVisible() ? this : null; if (! findAnonymous && result != null && getElement() == null) { return getParent().getParent(); } else { return result; } }
if (currentIB.getElement() != null) { String name = c.getNamespaceHandler().getAnchorName(currentIB.getElement()); if (name != null) { c.addBoxId(name, currentIB); String id = c.getNamespaceHandler().getID(currentIB.getElement()); if (id != null) { c.addBoxId(id, currentIB); if (! currentIB.isPending() && (currentIB.getElement() == null || currentIB.getElement() != c.getLayer().getMaster().getElement())) { throw new RuntimeException("internal error");
if (currentIB.getElement() != null) { String name = c.getNamespaceHandler().getAnchorName(currentIB.getElement()); if (name != null) { c.addBoxId(name, currentIB); String id = c.getNamespaceHandler().getID(currentIB.getElement()); if (id != null) { c.addBoxId(id, currentIB); if (! currentIB.isPending() && (currentIB.getElement() == null || currentIB.getElement() != c.getLayer().getMaster().getElement())) { throw new RuntimeException("internal error");