ca.sqlpower.wabit.report
Enum VerticalAlignment

java.lang.Object
  extended by java.lang.Enum<VerticalAlignment>
      extended by ca.sqlpower.wabit.report.VerticalAlignment
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<VerticalAlignment>

public enum VerticalAlignment
extends java.lang.Enum<VerticalAlignment>

Enumeration of the possible vertical alignment rules.

See Also:
HorizontalAlignment

Enum Constant Summary
BOTTOM
          Indicates that the bottom of the content should be aligned with the bottom of the containing box.
MIDDLE
          Indicates that the vertical midpoint of the content should be aligned with the vertical midpoint of the containing box.
TOP
          Indicates that the top of the content should be aligned with the top of the containing box.
 
Method Summary
 int calculateStartY(int containingBoxHeight, int itemHeight)
          Computes the starting Y position within the given box for content that has the given height.
 int calculateStartY(int containingBoxHeight, int itemHeight, java.awt.FontMetrics fm)
          A specialized version of calculateStartY(int, int) which returns the correct Y value for the baseline of the first line of text.
static VerticalAlignment valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static VerticalAlignment[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

TOP

public static final VerticalAlignment TOP
Indicates that the top of the content should be aligned with the top of the containing box.


MIDDLE

public static final VerticalAlignment MIDDLE
Indicates that the vertical midpoint of the content should be aligned with the vertical midpoint of the containing box.


BOTTOM

public static final VerticalAlignment BOTTOM
Indicates that the bottom of the content should be aligned with the bottom of the containing box.

Method Detail

values

public static VerticalAlignment[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (VerticalAlignment c : VerticalAlignment.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static VerticalAlignment valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

calculateStartY

public int calculateStartY(int containingBoxHeight,
                           int itemHeight)
Computes the starting Y position within the given box for content that has the given height.

Parameters:
containingBoxHeight - The height of the containing box
itemHeight - The height of the item to align within the containing box
Returns:
The y-coordinate for the top edge of the item that makes it align according to this alignment rule. The y-coordinate is relative to the containing box's top edge, so a value of 0 is on the box's top edge, negative values are outside the box (above it), positive values less than containingBoxHeight are inside the box, and positive values larger than containingBoxHeight are outside the box (above it).

calculateStartY

public int calculateStartY(int containingBoxHeight,
                           int itemHeight,
                           java.awt.FontMetrics fm)
A specialized version of calculateStartY(int, int) which returns the correct Y value for the baseline of the first line of text.

Parameters:
containingBoxHeight - The height of the containing box
itemHeight - The height of the item to align within the containing box
fm - The font metrics for the font the item will be rendered in
Returns:
The y-coordinate for the baseline of the first line of text in the item. See the documentation for calculateStartY(int, int) for a detailed description of how to interpret the Y value.


Copyright © 2009. All Rights Reserved.