org.pentaho.reporting.engine.classic.core.util
Class StrokeUtility

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.util.StrokeUtility

public class StrokeUtility
extends Object

This class provides helper methods to work with Strokes and line-styles.

Author:
Thomas Morgner

Field Summary
static int STROKE_DASHED
          A constant defining a stroke-type.
static int STROKE_DOT_DASH
          A constant defining a stroke-type.
static int STROKE_DOT_DOT_DASH
          A constant defining a stroke-type.
static int STROKE_DOTTED
          A constant defining a stroke-type.
static int STROKE_NONE
          A constant defining a stroke-type.
static int STROKE_SOLID
          A constant defining a stroke-type.
 
Method Summary
static Stroke createStroke(int type, float width)
          Creates a new Stroke-Object for the given type and with.
static int getStrokeType(Stroke s)
          Tries to deduct the stroke-type from the given stroke object.
static float getStrokeWidth(Stroke s)
          Tries to extract the stroke-width from the given stroke object.
static BorderStyle translateStrokeStyle(Stroke s)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STROKE_SOLID

public static final int STROKE_SOLID
A constant defining a stroke-type.

See Also:
Constant Field Values

STROKE_DASHED

public static final int STROKE_DASHED
A constant defining a stroke-type.

See Also:
Constant Field Values

STROKE_DOTTED

public static final int STROKE_DOTTED
A constant defining a stroke-type.

See Also:
Constant Field Values

STROKE_DOT_DASH

public static final int STROKE_DOT_DASH
A constant defining a stroke-type.

See Also:
Constant Field Values

STROKE_DOT_DOT_DASH

public static final int STROKE_DOT_DOT_DASH
A constant defining a stroke-type.

See Also:
Constant Field Values

STROKE_NONE

public static final int STROKE_NONE
A constant defining a stroke-type.

See Also:
Constant Field Values
Method Detail

createStroke

public static Stroke createStroke(int type,
                                  float width)
Creates a new Stroke-Object for the given type and with.

Parameters:
type - the stroke-type. (Must be one of the constants defined in this class.)
width - the stroke's width.
Returns:
the stroke, never null.

getStrokeWidth

public static float getStrokeWidth(Stroke s)
Tries to extract the stroke-width from the given stroke object.

Parameters:
s - the stroke.
Returns:
the stroke's width.

getStrokeType

public static int getStrokeType(Stroke s)
Tries to deduct the stroke-type from the given stroke object. This will result in funny return values if the stroke was not created by the createStroke(int, float) method.

Parameters:
s - the stroke.
Returns:
the stroke's width.

translateStrokeStyle

public static BorderStyle translateStrokeStyle(Stroke s)