private boolean intersectsAggregateBounds(Shape clip, Box box) { if (clip == null) { return true; } PaintingInfo info = box.getPaintingInfo(); if (info == null) { return false; } Rectangle bounds = info.getAggregateBounds(); return clip.intersects(bounds); }
public PaintingInfo copyOf() { PaintingInfo result = new PaintingInfo(); result.setOuterMarginCorner(new Dimension(_outerMarginCorner)); result.setAggregateBounds(new Rectangle(_aggregateBounds)); return result; }
protected void calcChildPaintingInfo( CssContext c, PaintingInfo result, boolean useCache) { for (int i = 0; i < getInlineChildCount(); i++) { Object obj = getInlineChild(i); if (obj instanceof Box) { PaintingInfo info = ((Box)obj).calcPaintingInfo(c, useCache); moveIfGreater(result.getOuterMarginCorner(), info.getOuterMarginCorner()); result.getAggregateBounds().add(info.getAggregateBounds()); } } }
public void operate(Box floater) { PaintingInfo info = floater.calcPaintingInfo(c, useCache); moveIfGreater( result.getOuterMarginCorner(), info.getOuterMarginCorner()); } });
getMaster().calcPaintingInfo(c, true); PaintingInfo result = (PaintingInfo)getMaster().getPaintingInfo().copyOf(); List children = getChildren(); for (int i = 0; i < children.size(); i++) { Layer child = (Layer)children.get(i); if (child.getMaster().getStyle().isFixed()) { continue; } else if (child.getMaster().getStyle().isAbsolute()) { PaintingInfo info = child.calcPaintingDimension(c); moveIfGreater(result.getOuterMarginCorner(), info.getOuterMarginCorner()); } } return result; } public void positionChildren(LayoutContext c) {
public void operate(Box floater) { PaintingInfo info = floater.calcPaintingInfo(c, useCache); moveIfGreater( result.getOuterMarginCorner(), info.getOuterMarginCorner()); } });
private PaintingInfo calcPaintingDimension(LayoutContext c) { getMaster().calcPaintingInfo(c, true); PaintingInfo result = (PaintingInfo)getMaster().getPaintingInfo().copyOf(); List children = getChildren(); for (int i = 0; i < children.size(); i++) { Layer child = (Layer)children.get(i); if (child.getMaster().getStyle().isFixed()) { continue; } else if (child.getMaster().getStyle().isAbsolute()) { PaintingInfo info = child.calcPaintingDimension(c); moveIfGreater(result.getOuterMarginCorner(), info.getOuterMarginCorner()); } } return result; }
private boolean intersectsAggregateBounds(Shape clip, Box box) { if (clip == null) { return true; } PaintingInfo info = box.getPaintingInfo(); if (info == null) { return false; } Rectangle bounds = info.getAggregateBounds(); return clip.intersects(bounds); }
protected void calcChildPaintingInfo( CssContext c, PaintingInfo result, boolean useCache) { for (int i = 0; i < getChildCount(); i++) { Box child = (Box) getChild(i); PaintingInfo info = child.calcPaintingInfo(c, useCache); moveIfGreater(result.getOuterMarginCorner(), info.getOuterMarginCorner()); result.getAggregateBounds().add(info.getAggregateBounds()); } }
public PaintingInfo copyOf() { PaintingInfo result = new PaintingInfo(); result.setOuterMarginCorner(new Dimension(_outerMarginCorner)); result.setAggregateBounds(new Rectangle(_aggregateBounds)); return result; }
public Dimension getPaintingDimension(LayoutContext c) { return calcPaintingDimension(c).getOuterMarginCorner(); }
private com.itextpdf.text.Rectangle createLocalTargetArea(RenderingContext c, Box box, boolean useAggregateBounds) { Rectangle bounds; if (useAggregateBounds && box.getPaintingInfo() != null) { bounds = box.getPaintingInfo().getAggregateBounds(); } else { bounds = box.getContentAreaEdge(box.getAbsX(), box.getAbsY(), c); } Point2D docCorner = new Point2D.Double(bounds.x, bounds.y + bounds.height); Point2D pdfCorner = new Point.Double(); _transform.transform(docCorner, pdfCorner); pdfCorner.setLocation(pdfCorner.getX(), normalizeY((float) pdfCorner.getY())); com.itextpdf.text.Rectangle result = new com.itextpdf.text.Rectangle((float) pdfCorner.getX(), (float) pdfCorner.getY(), (float) pdfCorner.getX() + getDeviceLength(bounds.width), (float) pdfCorner.getY() + getDeviceLength(bounds.height)); return result; }
protected void calcChildPaintingInfo( CssContext c, PaintingInfo result, boolean useCache) { for (int i = 0; i < getInlineChildCount(); i++) { Object obj = getInlineChild(i); if (obj instanceof Box) { PaintingInfo info = ((Box)obj).calcPaintingInfo(c, useCache); moveIfGreater(result.getOuterMarginCorner(), info.getOuterMarginCorner()); result.getAggregateBounds().add(info.getAggregateBounds()); } } }
public PaintingInfo calcPaintingInfo(CssContext c, boolean useCache) { PaintingInfo cached = getPaintingInfo(); if (cached != null && useCache) { return cached; } final PaintingInfo result = new PaintingInfo(); Rectangle bounds = getMarginEdge(getAbsX(), getAbsY(), c, 0, 0); result.setOuterMarginCorner( new Dimension(bounds.x + bounds.width, bounds.y + bounds.height)); result.setAggregateBounds(getPaintingClipEdge(c)); calcChildPaintingInfo(c, result, useCache); setPaintingInfo(result); return result; }
public Dimension getPaintingDimension(LayoutContext c) { return calcPaintingDimension(c).getOuterMarginCorner(); }
private com.lowagie.text.Rectangle createLocalTargetArea(RenderingContext c, Box box, boolean useAggregateBounds) { Rectangle bounds; if (useAggregateBounds && box.getPaintingInfo() != null) { bounds = box.getPaintingInfo().getAggregateBounds(); } else { bounds = box.getContentAreaEdge(box.getAbsX(), box.getAbsY(), c); } Point2D docCorner = new Point2D.Double(bounds.x, bounds.y + bounds.height); Point2D pdfCorner = new Point.Double(); _transform.transform(docCorner, pdfCorner); pdfCorner.setLocation(pdfCorner.getX(), normalizeY((float) pdfCorner.getY())); com.lowagie.text.Rectangle result = new com.lowagie.text.Rectangle((float) pdfCorner.getX(), (float) pdfCorner.getY(), (float) pdfCorner.getX() + getDeviceLength(bounds.width), (float) pdfCorner.getY() + getDeviceLength(bounds.height)); return result; }
protected void calcChildPaintingInfo( CssContext c, PaintingInfo result, boolean useCache) { for (int i = 0; i < getChildCount(); i++) { Box child = getChild(i); PaintingInfo info = child.calcPaintingInfo(c, useCache); moveIfGreater(result.getOuterMarginCorner(), info.getOuterMarginCorner()); result.getAggregateBounds().add(info.getAggregateBounds()); } }
public PaintingInfo calcPaintingInfo(CssContext c, boolean useCache) { PaintingInfo cached = getPaintingInfo(); if (cached != null && useCache) { return cached; } final PaintingInfo result = new PaintingInfo(); Rectangle bounds = getMarginEdge(getAbsX(), getAbsY(), c, 0, 0); result.setOuterMarginCorner( new Dimension(bounds.x + bounds.width, bounds.y + bounds.height)); result.setAggregateBounds(getPaintingClipEdge(c)); if (!getStyle().isOverflowApplies() || getStyle().isOverflowVisible()) { calcChildPaintingInfo(c, result, useCache); } setPaintingInfo(result); return result; }
private void paintRootElementBackground(RenderingContext c, PaintingInfo pI) { Dimension marginCorner = pI.getOuterMarginCorner(); Rectangle canvasBounds = new Rectangle(0, 0, marginCorner.width, marginCorner.height); canvasBounds.add(c.getViewportRectangle()); c.getOutputDevice().paintBackground(c, getStyle(), canvasBounds, canvasBounds, null); }
private com.lowagie.text.Rectangle createLocalTargetArea(RenderingContext c, Box box, boolean useAggregateBounds) { Rectangle bounds; if (useAggregateBounds && box.getPaintingInfo() != null) { bounds = box.getPaintingInfo().getAggregateBounds(); } else { bounds = box.getContentAreaEdge(box.getAbsX(), box.getAbsY(), c); } Point2D docCorner = new Point2D.Double(bounds.x, bounds.y + bounds.height); Point2D pdfCorner = new Point.Double(); _transform.transform(docCorner, pdfCorner); pdfCorner.setLocation(pdfCorner.getX(), normalizeY((float) pdfCorner.getY())); com.lowagie.text.Rectangle result = new com.lowagie.text.Rectangle((float) pdfCorner.getX(), (float) pdfCorner.getY(), (float) pdfCorner.getX() + getDeviceLength(bounds.width), (float) pdfCorner.getY() + getDeviceLength(bounds.height)); return result; }