com.aspose.imaging.shapes
Class TextShape

java.lang.Object
  extended by com.aspose.imaging.ObjectWithBounds
      extended by com.aspose.imaging.Shape
          extended by com.aspose.imaging.shapes.RectangleProjectedShape
              extended by com.aspose.imaging.shapes.TextShape

public final class TextShape
extends RectangleProjectedShape

Represents a text shape.


Constructor Summary
TextShape()
           Initializes a new instance of the TextShape class.
TextShape(java.lang.String text, RectangleF rectangle, Font font, StringFormat stringFormat)
           Initializes a new instance of the TextShape class.
 
Method Summary
 RectangleF getBounds()
           Gets the object's bounds.
 RectangleF getBounds(Matrix matrix)
           Gets the object's bounds.
 RectangleF getBounds(Matrix matrix, Pen pen)
           Gets the object's bounds.
 PointF getCenter()
           Gets the shape's center.
 Font getFont()
           Gets the font used to draw the text.
 ShapeSegment[] getSegments()
           Gets the shape segments.
 java.lang.String getText()
           Gets the drawn text.
 StringFormat getTextFormat()
           Gets the text format.
 boolean hasSegments()
           Gets a value indicating whether shape has segments.
 void setFont(Font value)
           Sets the font used to draw the text.
 void setText(java.lang.String value)
           Sets the drawn text.
 void setTextFormat(StringFormat value)
           Sets the text format.
 void transform(Matrix transform)
           Applies the specified transformation to the shape.
 
Methods inherited from class com.aspose.imaging.shapes.RectangleProjectedShape
getLeftBottom, getLeftTop, getRectangleHeight, getRectangleWidth, getRightBottom, getRightTop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextShape

public TextShape()

Initializes a new instance of the TextShape class.


TextShape

public TextShape(java.lang.String text,
                 RectangleF rectangle,
                 Font font,
                 StringFormat stringFormat)

Initializes a new instance of the TextShape class.

Parameters:
text - The text to draw.
rectangle - The text rectangle.
font - The font to use.
stringFormat - The string format.
Method Detail

getBounds

public RectangleF getBounds()

Gets the object's bounds.

Value: The object's bounds.

Overrides:
getBounds in class RectangleProjectedShape

getBounds

public RectangleF getBounds(Matrix matrix)

Gets the object's bounds.

Overrides:
getBounds in class RectangleProjectedShape
Parameters:
matrix - The matrix to apply before bounds will be calculated.
Returns:
The estimated object's bounds.

getBounds

public RectangleF getBounds(Matrix matrix,
                            Pen pen)

Gets the object's bounds.

Overrides:
getBounds in class RectangleProjectedShape
Parameters:
matrix - The matrix to apply before bounds will be calculated.
pen - The pen to use for object. This can influence the object's bounds size.
Returns:
The estimated object's bounds.

getCenter

public PointF getCenter()

Gets the shape's center.

Value: The shape's center.

Overrides:
getCenter in class RectangleProjectedShape

getFont

public Font getFont()

Gets the font used to draw the text.

Value: The font used to draw the text.


getSegments

public ShapeSegment[] getSegments()

Gets the shape segments.

Value: The shape segments.

Specified by:
getSegments in class Shape

getText

public java.lang.String getText()

Gets the drawn text.

Value: The drawn text.


getTextFormat

public StringFormat getTextFormat()

Gets the text format.

Value: The text format.


hasSegments

public boolean hasSegments()

Gets a value indicating whether shape has segments.

Value: True if shape has segments; otherwise, false.

Overrides:
hasSegments in class RectangleProjectedShape

setFont

public void setFont(Font value)

Sets the font used to draw the text.

Value: The font used to draw the text.


setText

public void setText(java.lang.String value)

Sets the drawn text.

Value: The drawn text.


setTextFormat

public void setTextFormat(StringFormat value)

Sets the text format.

Value: The text format.


transform

public void transform(Matrix transform)

Applies the specified transformation to the shape.

Overrides:
transform in class RectangleProjectedShape
Parameters:
transform - The transformation to apply.