public String toString() { StringBuffer sb = new StringBuffer(); sb.append("Box: "); sb.append(" (" + getAbsX() + "," + getAbsY() + ")->(" + getWidth() + " x " + getHeight() + ")"); return sb.toString(); }
public String toString() { StringBuffer sb = new StringBuffer(); sb.append("Box: "); sb.append(" (" + getAbsX() + "," + getAbsY() + ")->(" + getWidth() + " x " + getHeight() + ")"); return sb.toString(); }
public Rectangle getPaintingBorderEdge(CssContext cssCtx) { return getBorderEdge(getAbsX(), getAbsY(), cssCtx); }
public Rectangle getPaintingBorderEdge(CssContext cssCtx) { return getBorderEdge(getAbsX(), getAbsY(), cssCtx); }
public Rectangle getPaintingPaddingEdge(CssContext cssCtx) { return getPaddingEdge(getAbsX(), getAbsY(), cssCtx); }
public Rectangle getPaintingPaddingEdge(CssContext cssCtx) { return getPaddingEdge(getAbsX(), getAbsY(), cssCtx); }
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; }
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; }
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; }
public void drawDebugOutline(RenderingContext c, Box box, FSColor color) { setColor(color); Rectangle rect = box.getMarginEdge(box.getAbsX(), box.getAbsY(), c, 0, 0); rect.height -= 1; rect.width -= 1; drawRect(rect.x, rect.y, rect.width, rect.height); }
public void drawDebugOutline(RenderingContext c, Box box, FSColor color) { setColor(color); Rectangle rect = box.getMarginEdge(box.getAbsX(), box.getAbsY(), c, 0, 0); rect.height -= 1; rect.width -= 1; drawRect(rect.x, rect.y, rect.width, rect.height); }
private void performFloatOperation(FloatOperation op, List floats) { for (Iterator i = floats.iterator(); i.hasNext();) { BoxOffset boxOffset = (BoxOffset) i.next(); BlockBox box = boxOffset.getBox(); box.setAbsX(box.getX() + getMaster().getAbsX() - boxOffset.getX()); box.setAbsY(box.getY() + getMaster().getAbsY() - boxOffset.getY()); op.operate(box); } }
private void performFloatOperation(FloatOperation op, List floats) { for (Iterator i = floats.iterator(); i.hasNext();) { BoxOffset boxOffset = (BoxOffset) i.next(); BlockBox box = boxOffset.getBox(); box.setAbsX(box.getX() + getMaster().getAbsX() - boxOffset.getX()); box.setAbsY(box.getY() + getMaster().getAbsY() - boxOffset.getY()); op.operate(box); } }
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 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 void calcCanvasLocation() { Box parent = getParent(); if (parent == null) { throw new XRRuntimeException("calcCanvasLocation() called with no parent"); } setAbsX(parent.getAbsX() + parent.getTx() + getX()); setAbsY(parent.getAbsY() + parent.getTy() + getY()); }
public void calcCanvasLocation() { Box parent = getParent(); if (parent == null) { XRLog.layout(Level.WARNING, "calcCanvasLocation() called with no parent"); } setAbsX(parent.getAbsX() + parent.getTx() + getX()); setAbsY(parent.getAbsY() + parent.getTy() + getY()); }
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; }
public void calcInitialFloatedCanvasLocation(LayoutContext c) { Point offset = c.getBlockFormattingContext().getOffset(); FloatManager manager = c.getBlockFormattingContext().getFloatManager(); setAbsX(manager.getMaster().getAbsX() + getX() - offset.x); setAbsY(manager.getMaster().getAbsY() + getY() - offset.y); }
public void calcInitialFloatedCanvasLocation(LayoutContext c) { Point offset = c.getBlockFormattingContext().getOffset(); FloatManager manager = c.getBlockFormattingContext().getFloatManager(); setAbsX(manager.getMaster().getAbsX() + getX() - offset.x); setAbsY(manager.getMaster().getAbsY() + getY() - offset.y); }