de.erichseifert.gral.util
Class GraphicsUtils

java.lang.Object
  extended by de.erichseifert.gral.util.GraphicsUtils

public abstract class GraphicsUtils
extends Object

Abstract class that contains utility functions for working with graphics. For example, this includes font handling.


Constructor Summary
GraphicsUtils()
           
 
Method Summary
static void drawPaintedShape(Graphics2D graphics, Shape shape, Paint paint, Rectangle2D paintBounds, Stroke stroke)
          Draws a filled Shape with the specified Paint object.
static void fillPaintedShape(Graphics2D graphics, Shape shape, Paint paint, Rectangle2D paintBounds)
          Fills a Shape with the specified Paint object.
static TextLayout getLayout(String text, Font font)
          Returns the layout for the specified text with the specified font.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphicsUtils

public GraphicsUtils()
Method Detail

getLayout

public static TextLayout getLayout(String text,
                                   Font font)
Returns the layout for the specified text with the specified font.

Parameters:
text - Text to be displayed.
font - Font of the Text.
Returns:
TextLayout.

fillPaintedShape

public static void fillPaintedShape(Graphics2D graphics,
                                    Shape shape,
                                    Paint paint,
                                    Rectangle2D paintBounds)
Fills a Shape with the specified Paint object.

Parameters:
graphics - Graphics to be painted into.
shape - Shape to be filled.
paint - Paint to be used.
paintBounds - Optional bounds describing the painted area.

drawPaintedShape

public static void drawPaintedShape(Graphics2D graphics,
                                    Shape shape,
                                    Paint paint,
                                    Rectangle2D paintBounds,
                                    Stroke stroke)
Draws a filled Shape with the specified Paint object.

Parameters:
graphics - Graphics to be painted into.
shape - Shape to be filled.
paint - Paint to be used.
paintBounds - Optional bounds describing the painted area.
stroke - Stroke to be used for outlines.


Copyright © 2009-2010. All Rights Reserved.