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
Fields Modifier and Type Field Description const System.String
HORIZONTAL_ALIGNMENT_CENTER
A constant indicating a horizontal text alignment on center.const System.String
HORIZONTAL_ALIGNMENT_CENTER_MIDDLE
A constant indicating a horizontal text alignment on center middle.const System.String
HORIZONTAL_ALIGNMENT_LEFT
A constant indicating a horizontal text alignment on left.const System.String
HORIZONTAL_ALIGNMENT_LEFT_MIDDLE
A constant indicating a horizontal text alignment on left middle.const System.String
HORIZONTAL_ALIGNMENT_RIGHT
A constant indicating a horizontal text alignment on right.const System.String
HORIZONTAL_ALIGNMENT_RIGHT_MIDDLE
A constant indicating a horizontal text alignment on right middle.const System.String
VERTICAL_ALIGNMENT_BOTTOM
A constant indicating a vertical text alignment on bottom.const System.String
VERTICAL_ALIGNMENT_BOTTOM_CENTER
A constant indicating a vertical text alignment on bottom center.const System.String
VERTICAL_ALIGNMENT_MIDDLE
A constant indicating a vertical text alignment on middle.const System.String
VERTICAL_ALIGNMENT_MIDDLE_CENTER
A constant indicating a vertical text alignment on middle center.const System.String
VERTICAL_ALIGNMENT_TOP
A constant indicating a vertical text alignment on top.const System.String
VERTICAL_ALIGNMENT_TOP_CENTER
A constant indicating a vertical text alignment on top center.
-
Constructor Summary
Constructors Constructor Description AlignmentFormat()
Defines an instance of the alignment format.
-
Method Summary
Modifier and Type Method Description AlignmentFormat
Clone()
Creates and returns a copy of this object.System.String
getHorizontalAlignment()
Returns the horizontal alignment of the text.int
getTextAngle()
Returns the rotation of the text.System.String
getVerticalAlignment()
Returns the vertical alignment of the text.bool
IsLeftToRight()
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.
-
-
-
Field Detail
-
VERTICAL_ALIGNMENT_TOP
public const System.String VERTICAL_ALIGNMENT_TOP
A constant indicating a vertical text alignment on top. Embedded value is "top".- See Also:
- Constant Values
-
VERTICAL_ALIGNMENT_MIDDLE
public const System.String VERTICAL_ALIGNMENT_MIDDLE
A constant indicating a vertical text alignment on middle. Embedded value is "middle".- See Also:
- Constant Values
-
VERTICAL_ALIGNMENT_BOTTOM
public const System.String VERTICAL_ALIGNMENT_BOTTOM
A constant indicating a vertical text alignment on bottom. Embedded value is "bottom".- See Also:
- Constant Values
-
VERTICAL_ALIGNMENT_TOP_CENTER
public const System.String VERTICAL_ALIGNMENT_TOP_CENTER
A constant indicating a vertical text alignment on top center. Embedded value is "topcenter".- See Also:
- Constant Values
-
VERTICAL_ALIGNMENT_MIDDLE_CENTER
public const System.String VERTICAL_ALIGNMENT_MIDDLE_CENTER
A constant indicating a vertical text alignment on middle center. Embedded value is "middlecenter".- See Also:
- Constant Values
-
VERTICAL_ALIGNMENT_BOTTOM_CENTER
public const System.String VERTICAL_ALIGNMENT_BOTTOM_CENTER
A constant indicating a vertical text alignment on bottom center. Embedded value is "bottomcenter".- See Also:
- Constant Values
-
HORIZONTAL_ALIGNMENT_LEFT
public const System.String HORIZONTAL_ALIGNMENT_LEFT
A constant indicating a horizontal text alignment on left. Embedded value is "left".- See Also:
- Constant Values
-
HORIZONTAL_ALIGNMENT_CENTER
public const System.String HORIZONTAL_ALIGNMENT_CENTER
A constant indicating a horizontal text alignment on center. Embedded value is "center".- See Also:
- Constant Values
-
HORIZONTAL_ALIGNMENT_RIGHT
public const System.String HORIZONTAL_ALIGNMENT_RIGHT
A constant indicating a horizontal text alignment on right. Embedded value is "right".- See Also:
- Constant Values
-
HORIZONTAL_ALIGNMENT_LEFT_MIDDLE
public const System.String HORIZONTAL_ALIGNMENT_LEFT_MIDDLE
A constant indicating a horizontal text alignment on left middle. Embedded value is "leftmiddle".- See Also:
- Constant Values
-
HORIZONTAL_ALIGNMENT_CENTER_MIDDLE
public const System.String HORIZONTAL_ALIGNMENT_CENTER_MIDDLE
A constant indicating a horizontal text alignment on center middle. Embedded value is "centermiddle".- See Also:
- Constant Values
-
HORIZONTAL_ALIGNMENT_RIGHT_MIDDLE
public const System.String HORIZONTAL_ALIGNMENT_RIGHT_MIDDLE
A constant indicating a horizontal text alignment on right middle. Embedded value is "rightmiddle".- See Also:
- Constant Values
-
-
Method Detail
-
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
public AlignmentFormat Clone()
Creates and returns a copy of this object.- Returns:
- a clone of this instance.
-
-