if (currentSide == BorderPainter.LEFT) thickness = (int) border.left(); if (borderSideStyle == IdentValue.DASHED) { outputDevice.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); paintPatternedRect(outputDevice, bounds, border, border, new float[]{8.0f + thickness * 2, 4.0f + thickness}, sides, currentSide, xOffset); outputDevice.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); outputDevice.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); paintPatternedRect(outputDevice, bounds, border, border, new float[]{thickness, thickness}, sides, currentSide, xOffset); outputDevice.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
if (currentSide == BorderPainter.LEFT) thickness = (int) border.left(); if (borderSideStyle == IdentValue.DASHED) { outputDevice.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); paintPatternedRect(outputDevice, bounds, border, border, new float[]{8.0f + thickness * 2, 4.0f + thickness}, sides, currentSide, xOffset); outputDevice.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); outputDevice.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); paintPatternedRect(outputDevice, bounds, border, border, new float[]{thickness, thickness}, sides, currentSide, xOffset); outputDevice.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
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); }
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); }