public void operate(Box floater) { PaintingInfo info = floater.calcPaintingInfo(c, useCache); moveIfGreater( result.getOuterMarginCorner(), info.getOuterMarginCorner()); } });
public void operate(Box floater) { PaintingInfo info = floater.calcPaintingInfo(c, useCache); moveIfGreater( result.getOuterMarginCorner(), info.getOuterMarginCorner()); } });
public Dimension getPaintingDimension(LayoutContext c) { return calcPaintingDimension(c).getOuterMarginCorner(); }
public Dimension getPaintingDimension(LayoutContext c) { return calcPaintingDimension(c).getOuterMarginCorner(); }
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()); } } }
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()); } }
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); }
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()); } } }
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()); } }
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); }
/** * Renders according to scale factor * * @param c the RenderingContext to use * @param root The Layer to render */ protected void doRender(RenderingContext c, Layer root) { Graphics2D g = ((Java2DOutputDevice) c.getOutputDevice()).getGraphics(); if (!(g instanceof PrinterGraphics) && isOpaque()) { g.setColor(getBackground()); g.fillRect(0, 0, getWidth(), getHeight()); } AffineTransform current = g.getTransform(); PaintingInfo pI = root.getMaster().getPaintingInfo(); Dimension layoutSize = pI.getOuterMarginCorner(); calculateScaleAccordingToPolicy(layoutSize); if (lastLayoutSize == null) { lastLayoutSize = layoutSize; setPreferredSize(new Dimension((int) (lastLayoutSize.width * scale), (int) (lastLayoutSize.height * scale))); revalidate(); } g.transform(AffineTransform.getScaleInstance(scale, scale)); super.doRender(c, root); g.setTransform(current); }
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) {
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; }
/** * Renders according to scale factor * * @param c the RenderingContext to use * @param root The Layer to render */ protected void doRender(RenderingContext c, Layer root) { Graphics2D g = ((Java2DOutputDevice) c.getOutputDevice()).getGraphics(); if (!(g instanceof PrinterGraphics) && isOpaque()) { g.setColor(getBackground()); g.fillRect(0, 0, getWidth(), getHeight()); } AffineTransform current = g.getTransform(); PaintingInfo pI = root.getMaster().getPaintingInfo(); Dimension layoutSize = pI.getOuterMarginCorner(); calculateScaleAccordingToPolicy(layoutSize); if (lastLayoutSize == null) { lastLayoutSize = layoutSize; setPreferredSize(new Dimension((int) (lastLayoutSize.width * scale), (int) (lastLayoutSize.height * scale))); revalidate(); } g.transform(AffineTransform.getScaleInstance(scale, scale)); super.doRender(c, root); g.setTransform(current); }