com.jrefinery.report
Class ElementAlignment

java.lang.Object
  |
  +--com.jrefinery.report.ElementAlignment
All Implemented Interfaces:
java.io.Serializable

public class ElementAlignment
extends java.lang.Object
implements java.io.Serializable

Represents the alignment of an element.

Author:
Thomas Morgner
See Also:
Serialized Form

Field Summary
static ElementAlignment BOTTOM
          A constant for bottom alignment.
static ElementAlignment CENTER
          A constant for center alignment (horizontal).
static ElementAlignment LEFT
          A constant for left alignment.
static ElementAlignment MIDDLE
          A constant for middle alignment (vertical).
static ElementAlignment RIGHT
          A constant for right alignment.
static ElementAlignment TOP
          A constant for top alignment.
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns true if this object is equal to the specified object, and false otherwise.
 int getOldAlignment()
          Returns the alignment code, used by the old XML parsing code, that corresponds to this alignment object.
 int hashCode()
          Returns a hash code for the alignment object.
protected  java.lang.Object readResolve()
          Replaces the automatically generated instance with one of the enumeration instances.
 java.lang.String toString()
          Returns the alignment name.
static ElementAlignment translateHorizontalAlignment(int alignment)
          Translates the old alignment (int) constants into the new ElementAlignment objects.
static ElementAlignment translateVerticalAlignment(int alignment)
          Translates the old alignment (int) constants into the new ElementAlignment objects.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LEFT

public static final ElementAlignment LEFT
A constant for left alignment.


CENTER

public static final ElementAlignment CENTER
A constant for center alignment (horizontal).


RIGHT

public static final ElementAlignment RIGHT
A constant for right alignment.


TOP

public static final ElementAlignment TOP
A constant for top alignment.


MIDDLE

public static final ElementAlignment MIDDLE
A constant for middle alignment (vertical).


BOTTOM

public static final ElementAlignment BOTTOM
A constant for bottom alignment.

Method Detail

toString

public java.lang.String toString()
Returns the alignment name.

Overrides:
toString in class java.lang.Object
Returns:
the alignment name.

getOldAlignment

public int getOldAlignment()
Returns the alignment code, used by the old XML parsing code, that corresponds to this alignment object.

Returns:
the alignment code.

equals

public boolean equals(java.lang.Object o)
Returns true if this object is equal to the specified object, and false otherwise.

Overrides:
equals in class java.lang.Object
Parameters:
o - the other object.
Returns:
A boolean.

hashCode

public int hashCode()
Returns a hash code for the alignment object.

Overrides:
hashCode in class java.lang.Object
Returns:
The code.

readResolve

protected java.lang.Object readResolve()
                                throws java.io.ObjectStreamException
Replaces the automatically generated instance with one of the enumeration instances.

Returns:
the resolved element
Throws:
java.io.ObjectStreamException - if the element could not be resolved.

translateHorizontalAlignment

public static ElementAlignment translateHorizontalAlignment(int alignment)
Translates the old alignment (int) constants into the new ElementAlignment objects.

Parameters:
alignment - the alignment code.
Returns:
The corresponding alignment object.
Throws:
java.lang.IllegalArgumentException - if the supplied code does not match one of the predefined constant values.

translateVerticalAlignment

public static ElementAlignment translateVerticalAlignment(int alignment)
Translates the old alignment (int) constants into the new ElementAlignment objects.

Parameters:
alignment - the alignment code.
Returns:
The corresponding alignment object.
Throws:
java.lang.IllegalArgumentException - if the supplied code does not match one of the predefined constant values.