public static void paint(RenderingContext c, BlockBox box) { if (box.getMarkerData() == null) { return; } MarkerData markerData = box.getMarkerData(); if (markerData.getImageMarker() != null) { drawImage(c, box, markerData); } else { CalculatedStyle style = box.getStyle(); IdentValue listStyle = style.getIdent(CSSName.LIST_STYLE_TYPE); c.getOutputDevice().setColor(style.getColor()); if (markerData.getGlyphMarker() != null) { drawGlyph(c, box, style, listStyle); } else if (markerData.getTextMarker() != null){ drawText(c, box, listStyle); } } }
public static void paint(RenderingContext c, BlockBox box) { if (box.getMarkerData() == null) { return; } MarkerData markerData = box.getMarkerData(); if (markerData.getImageMarker() != null) { drawImage(c, box, markerData); } else { CalculatedStyle style = box.getStyle(); IdentValue listStyle = style.getIdent(CSSName.LIST_STYLE_TYPE); c.getOutputDevice().setColor(style.getColor()); if (markerData.getGlyphMarker() != null) { drawGlyph(c, box, style, listStyle); } else if (markerData.getTextMarker() != null){ drawText(c, box, listStyle); } } }
private static void drawText(RenderingContext c, BlockBox box, IdentValue listStyle) { MarkerData.TextMarker text = box.getMarkerData().getTextMarker(); int x = getReferenceX(c, box); x += -text.getLayoutWidth(); int y = getReferenceBaseline(c, box); c.getOutputDevice().setColor(box.getStyle().getColor()); c.getOutputDevice().setFont(box.getStyle().getFSFont(c)); c.getTextRenderer().drawString( c.getOutputDevice(), text.getText(), x, y); } }
private static void drawText(RenderingContext c, BlockBox box, IdentValue listStyle) { MarkerData.TextMarker text = box.getMarkerData().getTextMarker(); int x = getReferenceX(c, box); x += -text.getLayoutWidth(); int y = getReferenceBaseline(c, box); c.getOutputDevice().setColor(box.getStyle().getColor()); c.getOutputDevice().setFont(box.getStyle().getFSFont(c)); c.getTextRenderer().drawString( c.getOutputDevice(), text.getText(), x, y); } }