Namespace EasyXLS.Drawings.Formatting
Class AlignmentFormat
System.Object
EasyXLS.Drawings.Formatting.AlignmentFormat
public class AlignmentFormat
extends System.Object
This class stores the text alignment for drawing objects. The alignment is defined by horizonatal and vertical alignment, text rotation
and text direction.
-
Constant Summary
Modifier and TypeFieldDescriptionconst System.String
A constant indicating a horizontal text alignment on center.const System.String
A constant indicating a horizontal text alignment on center middle.const System.String
A constant indicating a horizontal text alignment on left.const System.String
A constant indicating a horizontal text alignment on left middle.const System.String
A constant indicating a horizontal text alignment on right.const System.String
A constant indicating a horizontal text alignment on right middle.const System.String
A constant indicating a vertical text alignment on bottom.const System.String
A constant indicating a vertical text alignment on bottom center.const System.String
A constant indicating a vertical text alignment on middle.const System.String
A constant indicating a vertical text alignment on middle center.const System.String
A constant indicating a vertical text alignment on top.const System.String
A constant indicating a vertical text alignment on top center. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionClone()
Creates and returns a copy of this object.System.String
Returns the horizontal alignment of the text.int
Returns the rotation of the text.System.String
Returns the vertical alignment of the text.bool
Returns true if the order of lines is from left to right, false otherwise.void
setTextDirectionHorizontal(System.String verticalAlignment, int angle)
Sets a horizontal text direction having the specified vertical alignment and text angle.void
setTextDirectionRotate270Degrees(System.String horizontalAlignment)
Sets a rotation of 270 degrees and the horizontal alignment for the text.void
setTextDirectionRotate90Degrees(System.String horizontalAlignment)
Sets a rotation of 90 degrees and the horizontal alignment for the text.void
setTextDirectionStacked(System.String horizontalAlignment, bool isLeftToRight)
Sets a stacked text direction having the specified horizontal alignment.Methods inherited from class System.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
VERTICAL_ALIGNMENT_TOP
public const final System.String VERTICAL_ALIGNMENT_TOPA constant indicating a vertical text alignment on top. Embedded value is "top".- See Also:
- Constant Values
-
VERTICAL_ALIGNMENT_MIDDLE
public const final System.String VERTICAL_ALIGNMENT_MIDDLEA constant indicating a vertical text alignment on middle. Embedded value is "middle".- See Also:
- Constant Values
-
VERTICAL_ALIGNMENT_BOTTOM
public const final System.String VERTICAL_ALIGNMENT_BOTTOMA constant indicating a vertical text alignment on bottom. Embedded value is "bottom".- See Also:
- Constant Values
-
VERTICAL_ALIGNMENT_TOP_CENTER
public const final System.String VERTICAL_ALIGNMENT_TOP_CENTERA constant indicating a vertical text alignment on top center. Embedded value is "topcenter".- See Also:
- Constant Values
-
VERTICAL_ALIGNMENT_MIDDLE_CENTER
public const final System.String VERTICAL_ALIGNMENT_MIDDLE_CENTERA constant indicating a vertical text alignment on middle center. Embedded value is "middlecenter".- See Also:
- Constant Values
-
VERTICAL_ALIGNMENT_BOTTOM_CENTER
public const final System.String VERTICAL_ALIGNMENT_BOTTOM_CENTERA constant indicating a vertical text alignment on bottom center. Embedded value is "bottomcenter".- See Also:
- Constant Values
-
HORIZONTAL_ALIGNMENT_LEFT
public const final System.String HORIZONTAL_ALIGNMENT_LEFTA constant indicating a horizontal text alignment on left. Embedded value is "left".- See Also:
- Constant Values
-
HORIZONTAL_ALIGNMENT_CENTER
public const final System.String HORIZONTAL_ALIGNMENT_CENTERA constant indicating a horizontal text alignment on center. Embedded value is "center".- See Also:
- Constant Values
-
HORIZONTAL_ALIGNMENT_RIGHT
public const final System.String HORIZONTAL_ALIGNMENT_RIGHTA constant indicating a horizontal text alignment on right. Embedded value is "right".- See Also:
- Constant Values
-
HORIZONTAL_ALIGNMENT_LEFT_MIDDLE
public const final System.String HORIZONTAL_ALIGNMENT_LEFT_MIDDLEA constant indicating a horizontal text alignment on left middle. Embedded value is "leftmiddle".- See Also:
- Constant Values
-
HORIZONTAL_ALIGNMENT_CENTER_MIDDLE
public const final System.String HORIZONTAL_ALIGNMENT_CENTER_MIDDLEA constant indicating a horizontal text alignment on center middle. Embedded value is "centermiddle".- See Also:
- Constant Values
-
HORIZONTAL_ALIGNMENT_RIGHT_MIDDLE
public const final System.String HORIZONTAL_ALIGNMENT_RIGHT_MIDDLEA constant indicating a horizontal text alignment on right middle. Embedded value is "rightmiddle".- See Also:
- Constant Values
-
-
Constructor Details
-
AlignmentFormat
public AlignmentFormat()Defines an instance of the alignment format.
-
-
Method Details
-
setTextDirectionHorizontal
public void setTextDirectionHorizontal(System.String verticalAlignment, int angle)Sets a horizontal text direction having the specified vertical alignment and text angle.- Parameters:
verticalAlignment
- the vertical alignment of the text. Possible values are available inAlignmentFormat
class.angle
- the angle of the text. The angle has values between -90 and 90 degrees.- See Also:
setTextDirectionRotate90Degrees(System.String)
,setTextDirectionRotate270Degrees(System.String)
,setTextDirectionStacked(System.String, bool)
,getVerticalAlignment()
,getTextAngle()
-
setTextDirectionRotate90Degrees
public void setTextDirectionRotate90Degrees(System.String horizontalAlignment)Sets a rotation of 90 degrees and the horizontal alignment for the text.- Parameters:
horizontalAlignment
- the horizontal alignment of the text. Possible values are available inAlignmentFormat
class.- See Also:
setTextDirectionHorizontal(System.String, int)
,setTextDirectionRotate270Degrees(System.String)
,setTextDirectionStacked(System.String, bool)
,getHorizontalAlignment()
-
setTextDirectionRotate270Degrees
public void setTextDirectionRotate270Degrees(System.String horizontalAlignment)Sets a rotation of 270 degrees and the horizontal alignment for the text.- Parameters:
horizontalAlignment
- the horizontal alignment of the text. Possible values are available inAlignmentFormat
class.- See Also:
setTextDirectionHorizontal(System.String, int)
,setTextDirectionRotate90Degrees(System.String)
,setTextDirectionStacked(System.String, bool)
,getHorizontalAlignment()
-
setTextDirectionStacked
public void setTextDirectionStacked(System.String horizontalAlignment, bool isLeftToRight)Sets a stacked text direction having the specified horizontal alignment.- Parameters:
horizontalAlignment
- the horizontal alignment of the text. Possible values are available inAlignmentFormat
class.isLeftToRight
- true if the order of lines is from left to right, false otherwise- See Also:
setTextDirectionHorizontal(System.String, int)
,setTextDirectionRotate90Degrees(System.String)
,setTextDirectionRotate270Degrees(System.String)
,getHorizontalAlignment()
-
getHorizontalAlignment
public System.String getHorizontalAlignment()Returns the horizontal alignment of the text. It has no value for horizontal text direction.- Returns:
- the horizontal alignment of the text
- See Also:
setTextDirectionRotate90Degrees(System.String)
,setTextDirectionRotate270Degrees(System.String)
,setTextDirectionStacked(System.String, bool)
-
getVerticalAlignment
public System.String getVerticalAlignment()Returns the vertical alignment of the text. It is valid only for horizontal text direction.- Returns:
- the vertical alignment of the text
- See Also:
setTextDirectionHorizontal(System.String, int)
-
getTextAngle
public int getTextAngle()Returns the rotation of the text.- Returns:
- the rotation of the text
- See Also:
setTextDirectionHorizontal(System.String, int)
,setTextDirectionRotate90Degrees(System.String)
,setTextDirectionRotate270Degrees(System.String)
,setTextDirectionStacked(System.String, bool)
-
IsLeftToRight
public bool IsLeftToRight()Returns true if the order of lines is from left to right, false otherwise. It is valid only for stacked direction of the text.- Returns:
- true if the order of lines is from left to right, false otherwise
- See Also:
setTextDirectionStacked(System.String, bool)
-
Clone
Creates and returns a copy of this object.- Returns:
- a clone of this instance.
-