public void pushClipRegion(RenderingContext c, int contentIndex) { while (_current != null && _current.getRange().getStart() == contentIndex) { _current.setClip(_outputDevice.getClip()); _clipRegionStack.add(_current); _outputDevice.clip(_current.getBox().getChildrenClipEdge(c)); if (_rangeIndex == _rangeList.size() - 1) { _current = null; } else { _current = (BoxRangeData)_rangeList.get(++_rangeIndex); } } }
final BorderPropertySet color, final float[] pattern, final int sides, final int currentSide, int xOffset) { Stroke old_stroke = outputDevice.getStroke(); outputDevice.setColor(color.topColor()); outputDevice.setStroke(new BasicStroke((int) border.top(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset)); outputDevice.drawBorderLine( bounds, BorderPainter.TOP, (int)border.top(), false); } else if (currentSide == BorderPainter.LEFT) { outputDevice.setColor(color.leftColor()); outputDevice.setStroke(new BasicStroke((int) border.left(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0)); outputDevice.drawBorderLine( bounds, BorderPainter.LEFT, (int)border.left(), false); } else if (currentSide == BorderPainter.RIGHT) { outputDevice.setColor(color.rightColor()); outputDevice.setStroke(new BasicStroke((int) border.right(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0)); outputDevice.drawBorderLine( bounds, BorderPainter.RIGHT, (int)border.right(), false); } else if (currentSide == BorderPainter.BOTTOM) { outputDevice.setColor(color.bottomColor()); outputDevice.setStroke(new BasicStroke((int) border.bottom(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset)); outputDevice.drawBorderLine( bounds, BorderPainter.BOTTOM, (int)border.bottom(), false); outputDevice.setStroke(old_stroke);
public void paintDebugOutline(RenderingContext c) { c.getOutputDevice().drawDebugOutline(c, this, FSRGBColor.BLUE); }
outputDevice.setColor(bcolor.topColor()); outputDevice.drawBorderLine(bounds, BorderPainter.TOP, (int)border.top(), true); } else { outputDevice.fill(poly); outputDevice.setColor(bcolor.bottomColor()); if ((int) border.bottom() == 1) { outputDevice.drawBorderLine(bounds, BorderPainter.BOTTOM, (int)border.bottom(), true); } else { outputDevice.fill(poly); outputDevice.setColor(bcolor.rightColor()); if ((int) border.right() == 1) { outputDevice.drawBorderLine(bounds, BorderPainter.RIGHT, (int)border.right(), true); } else { outputDevice.fill(poly); outputDevice.setColor(bcolor.leftColor()); if ((int) border.left() == 1) { outputDevice.drawBorderLine(bounds, BorderPainter.LEFT, (int)border.left(), true); } else { outputDevice.fill(poly);
private static void drawGlyph(RenderingContext c, BlockBox box, CalculatedStyle style, IdentValue listStyle) { // save the old AntiAliasing setting, then force it on Object aa_key = c.getOutputDevice().getRenderingHint(RenderingHints.KEY_ANTIALIASING); c.getOutputDevice().setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); // calculations for bullets StrutMetrics strutMetrics = box.getMarkerData().getStructMetrics(); MarkerData.GlyphMarker marker = box.getMarkerData().getGlyphMarker(); int x = getReferenceX(c, box); x += -marker.getLayoutWidth(); int y = getReferenceBaseline(c, box) - (int)strutMetrics.getAscent() / 2 - marker.getDiameter() / 2; if (listStyle == IdentValue.DISC) { c.getOutputDevice().fillOval(x, y, marker.getDiameter(), marker.getDiameter()); } else if (listStyle == IdentValue.SQUARE) { c.getOutputDevice().fillRect(x, y, marker.getDiameter(), marker.getDiameter()); } else if (listStyle == IdentValue.CIRCLE) { c.getOutputDevice().drawOval(x, y, marker.getDiameter(), marker.getDiameter()); } // restore the old AntiAliasing setting c.getOutputDevice().setRenderingHint(RenderingHints.KEY_ANTIALIASING, aa_key == null ? RenderingHints.VALUE_ANTIALIAS_DEFAULT : aa_key); }
public void paintInline(RenderingContext c) { if (! getParent().getStyle().isVisible()) { return; } if (isContainsDynamicFunction()) { lookForDynamicFunctions(c); int totalLineWidth = InlineBoxing.positionHorizontally(c, this, 0); setContentWidth(totalLineWidth); calcChildLocations(); align(true); calcPaintingInfo(c, false); } if (_textDecorations != null) { c.getOutputDevice().drawTextDecoration(c, this); } if (c.debugDrawLineBoxes()) { c.getOutputDevice().drawDebugOutline(c, this, FSRGBColor.GREEN); } }
public void paint(RenderingContext c) { c.getOutputDevice().drawText(c, this); }
public void paintSelection(RenderingContext c) { c.getOutputDevice().drawSelection(c, this); }
private static void drawImage(RenderingContext c, BlockBox box, MarkerData markerData) { FSImage img = null; MarkerData.ImageMarker marker = markerData.getImageMarker(); img = marker.getImage(); if (img != null) { StrutMetrics strutMetrics = box.getMarkerData().getStructMetrics(); int x = getReferenceX(c, box); // FIXME: findbugs possible loss of precision, cf. int / (float)2 x += -marker.getLayoutWidth() + (marker.getLayoutWidth() / 2 - img.getWidth() / 2); c.getOutputDevice().drawImage(img, x, (int)(getReferenceBaseline(c, box) - strutMetrics.getAscent() / 2 - img.getHeight() / 2)); } }
IdentValue ident = tD.getIdentValue(); if (ident == IdentValue.UNDERLINE || ident == IdentValue.OVERLINE) { c.getOutputDevice().drawTextDecoration(c, this, tD); IdentValue ident = tD.getIdentValue(); if (ident == IdentValue.LINE_THROUGH) { c.getOutputDevice().drawTextDecoration(c, this, tD);
private static void drawGlyph(RenderingContext c, BlockBox box, CalculatedStyle style, IdentValue listStyle) { // save the old AntiAliasing setting, then force it on Object aa_key = c.getOutputDevice().getRenderingHint(RenderingHints.KEY_ANTIALIASING); c.getOutputDevice().setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); // calculations for bullets StrutMetrics strutMetrics = box.getMarkerData().getStructMetrics(); MarkerData.GlyphMarker marker = box.getMarkerData().getGlyphMarker(); int x = getReferenceX(c, box); x += -marker.getLayoutWidth(); int y = getReferenceBaseline(c, box) - (int)strutMetrics.getAscent() / 2 - marker.getDiameter() / 2; if (listStyle == IdentValue.DISC) { c.getOutputDevice().fillOval(x, y, marker.getDiameter(), marker.getDiameter()); } else if (listStyle == IdentValue.SQUARE) { c.getOutputDevice().fillRect(x, y, marker.getDiameter(), marker.getDiameter()); } else if (listStyle == IdentValue.CIRCLE) { c.getOutputDevice().drawOval(x, y, marker.getDiameter(), marker.getDiameter()); } // restore the old AntiAliasing setting c.getOutputDevice().setRenderingHint(RenderingHints.KEY_ANTIALIASING, aa_key == null ? RenderingHints.VALUE_ANTIALIAS_DEFAULT : aa_key); }
outputDevice.setColor(bcolor.topColor()); outputDevice.drawBorderLine(bounds, BorderPainter.TOP, (int)border.top(), true); } else { outputDevice.fill(poly); outputDevice.setColor(bcolor.bottomColor()); if ((int) border.bottom() == 1) { outputDevice.drawBorderLine(bounds, BorderPainter.BOTTOM, (int)border.bottom(), true); } else { outputDevice.fill(poly); outputDevice.setColor(bcolor.rightColor()); if ((int) border.right() == 1) { outputDevice.drawBorderLine(bounds, BorderPainter.RIGHT, (int)border.right(), true); } else { outputDevice.fill(poly); outputDevice.setColor(bcolor.leftColor()); if ((int) border.left() == 1) { outputDevice.drawBorderLine(bounds, BorderPainter.LEFT, (int)border.left(), true); } else { outputDevice.fill(poly);
public void paintInline(RenderingContext c) { if (! getParent().getStyle().isVisible()) { return; } if (isContainsDynamicFunction()) { lookForDynamicFunctions(c); int totalLineWidth = InlineBoxing.positionHorizontally(c, this, 0); setContentWidth(totalLineWidth); calcChildLocations(); align(true); calcPaintingInfo(c, false); } if (_textDecorations != null) { c.getOutputDevice().drawTextDecoration(c, this); } if (c.debugDrawLineBoxes()) { c.getOutputDevice().drawDebugOutline(c, this, FSRGBColor.GREEN); } }
public void paint(RenderingContext c) { c.getOutputDevice().drawText(c, this); }
public void paintSelection(RenderingContext c) { c.getOutputDevice().drawSelection(c, this); }
private static void drawImage(RenderingContext c, BlockBox box, MarkerData markerData) { FSImage img = null; MarkerData.ImageMarker marker = markerData.getImageMarker(); img = marker.getImage(); if (img != null) { StrutMetrics strutMetrics = box.getMarkerData().getStructMetrics(); int x = getReferenceX(c, box); x += -marker.getLayoutWidth() + (marker.getLayoutWidth() / 2 - img.getWidth() / 2); c.getOutputDevice().drawImage(img, x, (int)(getReferenceBaseline(c, box) - strutMetrics.getAscent() / 2 - img.getHeight() / 2)); } }
IdentValue ident = tD.getIdentValue(); if (ident == IdentValue.UNDERLINE || ident == IdentValue.OVERLINE) { c.getOutputDevice().drawTextDecoration(c, this, tD); IdentValue ident = tD.getIdentValue(); if (ident == IdentValue.LINE_THROUGH) { c.getOutputDevice().drawTextDecoration(c, this, tD);
final BorderPropertySet color, final float[] pattern, final int sides, final int currentSide, int xOffset) { Stroke old_stroke = outputDevice.getStroke(); outputDevice.setColor(color.topColor()); outputDevice.setStroke(new BasicStroke((int) border.top(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset)); outputDevice.drawBorderLine( bounds, BorderPainter.TOP, (int)border.top(), false); } else if (currentSide == BorderPainter.LEFT) { outputDevice.setColor(color.leftColor()); outputDevice.setStroke(new BasicStroke((int) border.left(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0)); outputDevice.drawBorderLine( bounds, BorderPainter.LEFT, (int)border.left(), false); } else if (currentSide == BorderPainter.RIGHT) { outputDevice.setColor(color.rightColor()); outputDevice.setStroke(new BasicStroke((int) border.right(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0)); outputDevice.drawBorderLine( bounds, BorderPainter.RIGHT, (int)border.right(), false); } else if (currentSide == BorderPainter.BOTTOM) { outputDevice.setColor(color.bottomColor()); outputDevice.setStroke(new BasicStroke((int) border.bottom(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset)); outputDevice.drawBorderLine( bounds, BorderPainter.BOTTOM, (int)border.bottom(), false); outputDevice.setStroke(old_stroke);
public void pushClipRegion(RenderingContext c, int contentIndex) { while (_current != null && _current.getRange().getStart() == contentIndex) { _current.setClip(_outputDevice.getClip()); _clipRegionStack.add(_current); _outputDevice.clip(_current.getBox().getChildrenClipEdge(c)); if (_rangeIndex == _rangeList.size() - 1) { _current = null; } else { _current = (BoxRangeData)_rangeList.get(++_rangeIndex); } } }