private boolean canBeMoved(Box box) { IdentValue vAlign = box.getStyle().getIdent(CSSName.VERTICAL_ALIGN); return box == _root || ! (vAlign == IdentValue.TOP || vAlign == IdentValue.BOTTOM); }
private boolean canBeMoved(Box box) { IdentValue vAlign = box.getStyle().getIdent(CSSName.VERTICAL_ALIGN); return box == _root || ! (vAlign == IdentValue.TOP || vAlign == IdentValue.BOTTOM); }
private void applyLineHeightHack(CssContext cssCtx, Box line, Rectangle bounds) { // this is a hack to deal with lines w/o width or height. is this valid? // possibly, since the line doesn't know how long it should be until it's already // done float adjustments if (line.getHeight() == 0) { bounds.height = (int)line.getStyle().getLineHeight(cssCtx); } }
/** * {@inheritDoc} */ public void onMouseOver(BasicPanel panel, Box box) { Cursor c = box.getStyle().getCursor(); if (!panel.getCursor().equals(c)) { panel.setCursor(c); } } }
/** * {@inheritDoc} */ public void onMouseOver(BasicPanel panel, Box box) { Cursor c = box.getStyle().getCursor(); if (!panel.getCursor().equals(c)) { panel.setCursor(c); } } }
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); }
public void paintBorder(RenderingContext c, Box box) { if (! box.getStyle().isVisible()) { return; } Rectangle borderBounds = box.getPaintingBorderEdge(c); BorderPainter.paint(borderBounds, box.getBorderSides(), box.getBorder(c), c, 0, true); }
public void paintRootElementBackground(RenderingContext c) { PaintingInfo pI = getPaintingInfo(); if (pI != null) { if (getStyle().isHasBackground()) { paintRootElementBackground(c, pI); } else if (getChildCount() > 0) { Box body = getChild(0); body.paintRootElementBackground(c, pI); } } }
public static StrutMetrics createDefaultStrutMetrics(LayoutContext c, Box container) { FSFontMetrics strutM = container.getStyle().getFSFontMetrics(c); InlineBoxMeasurements measurements = getInitialMeasurements(c, container, strutM); return new StrutMetrics( strutM.getAscent(), measurements.getBaseline(), strutM.getDescent()); }
public static StrutMetrics createDefaultStrutMetrics(LayoutContext c, Box container) { FSFontMetrics strutM = container.getStyle().getFSFontMetrics(c); InlineBoxMeasurements measurements = getInitialMeasurements(c, container, strutM); return new StrutMetrics( strutM.getAscent(), measurements.getBaseline(), strutM.getDescent()); }
private static LineBox newLine(LayoutContext c, int y, Box box) { LineBox result = new LineBox(); result.setStyle(box.getStyle().createAnonymousStyle(IdentValue.BLOCK)); result.setParent(box); result.initContainingLayer(c); result.setY(y); result.calcCanvasLocation(); return result; }
private static LineBox newLine(LayoutContext c, int y, Box box) { LineBox result = new LineBox(); result.setStyle(box.getStyle().createAnonymousStyle(IdentValue.BLOCK)); result.setParent(box); result.initContainingLayer(c); result.setY(y); result.calcCanvasLocation(); return result; }
if (getMaster().getStyle().isAbsolute() && ! c.isPrint()) { ((BlockBox)getMaster()).positionAbsolute(c, BlockBox.POSITION_BOTH); } else if (getMaster().getStyle().isRelative() && (isInline() || ((BlockBox)getMaster()).isInline())) { getMaster().positionRelative(c); if (! isInline()) { getMaster().calcCanvasLocation(); getMaster().calcChildLocations(); } } } private boolean containsFixedLayer() {
private void position(LayoutContext c) { if (getMaster().getStyle().isAbsolute() && ! c.isPrint()) { ((BlockBox)getMaster()).positionAbsolute(c, BlockBox.POSITION_BOTH); } else if (getMaster().getStyle().isRelative() && (isInline() || ((BlockBox)getMaster()).isInline())) { getMaster().positionRelative(c); if (! isInline()) { getMaster().calcCanvasLocation(); getMaster().calcChildLocations(); } } }