use of java.awt.font.ImageGraphicAttribute in project hid-serial by rayshobby.
the class StyledString method getParagraghSpacer.
/**
* Create a graphic image character to simulate paragraph breaks
*
* @param ww
* @return a blank image to manage paragraph ends.
*/
private ImageGraphicAttribute getParagraghSpacer(int ww) {
if (ww == Integer.MAX_VALUE)
ww = 1;
BufferedImage img = new BufferedImage(ww, 10, BufferedImage.TYPE_INT_ARGB);
Graphics g = img.getGraphics();
g.setColor(new Color(255, 255, 255, 0));
g.fillRect(0, 0, img.getWidth(), img.getHeight());
return new ImageGraphicAttribute(img, GraphicAttribute.TOP_ALIGNMENT);
}
Aggregations