@Override public void drawTOBEREMOVED(ColorMapper colorMapper, Graphics2D g2d, double x, double y) { final StringBounder stringBounder = StringBounderUtils.asStringBounder(g2d); final double heightNum = numText.calculateDimension(stringBounder).getHeight(); final double deltaY = calculateDimension(stringBounder).getHeight() - heightNum; numText.drawTOBEREMOVED(colorMapper, g2d, x, y + deltaY / 2.0); super.drawTOBEREMOVED(colorMapper, g2d, x + getNumberWithAndMargin(stringBounder), y); }
public void drawTOBEREMOVED(ColorMapper colorMapper, Graphics2D g2d, double x, double y) { // TO be removed g2d.setFont(fontConfiguration.getFont().getFont()); g2d.setPaint(colorMapper.getMappedColor(fontConfiguration.getColor())); g2d.drawString(text, (float) x, (float) y); if (fontConfiguration.containsStyle(FontStyle.UNDERLINE)) { final Dimension2D dim = calculateDimension(StringBounderUtils.asStringBounder(g2d)); final int ypos = (int) (y + 2.5); g2d.setStroke(new BasicStroke((float) 1.3)); g2d.drawLine((int) x, ypos, (int) (x + dim.getWidth()), ypos); g2d.setStroke(new BasicStroke()); } if (fontConfiguration.containsStyle(FontStyle.STRIKE)) { final Dimension2D dim = calculateDimension(StringBounderUtils.asStringBounder(g2d)); final FontMetrics fm = g2d.getFontMetrics(fontConfiguration.getFont().getFont()); final int ypos = (int) (y - fm.getDescent() - 0.5); g2d.setStroke(new BasicStroke((float) 1.5)); g2d.drawLine((int) x, ypos, (int) (x + dim.getWidth()), ypos); g2d.setStroke(new BasicStroke()); } }