TextShape
Inheritance: java.lang.Object, com.aspose.imaging.ObjectWithBounds, com.aspose.imaging.Shape, com.aspose.imaging.shapes.RectangleProjectedShape
public final class TextShape extends RectangleProjectedShape
Representa una forma de texto.
Constructores
| Constructor | Descripción |
|---|---|
| TextShape() | Inicializa una nueva instancia de la clase TextShape. |
| TextShape(String text, RectangleF rectangle, Font font, StringFormat stringFormat) | Inicializa una nueva instancia de la clase TextShape. |
Métodos
| Método | Descripción |
|---|---|
| getText() | Obtiene o establece el texto dibujado. |
| setText(String value) | Obtiene o establece el texto dibujado. |
| getFont() | Obtiene o establece la fuente utilizada para dibujar el texto. |
| setFont(Font value) | Obtiene o establece la fuente utilizada para dibujar el texto. |
| getTextFormat() | Obtiene o establece el formato del texto. |
| setTextFormat(StringFormat value) | Obtiene o establece el formato del texto. |
| getCenter() | Obtiene el centro de la forma. |
| getBounds() | Obtiene los límites del objeto. |
| getSegments() | Obtiene los segmentos de la forma. |
| hasSegments() | Obtiene un valor que indica si la forma tiene segmentos. |
| getBounds(Matrix matrix) | Obtiene los límites del objeto. |
| getBounds(Matrix matrix, Pen pen) | Obtiene los límites del objeto. |
| transform(Matrix transform) | Aplica la transformación especificada a la forma. |
| equals(Object o) | Comprueba si los objetos son iguales. |
| hashCode() | Obtiene el código hash del objeto actual. |
TextShape()
public TextShape()
Inicializa una nueva instancia de la clase TextShape.
TextShape(String text, RectangleF rectangle, Font font, StringFormat stringFormat)
public TextShape(String text, RectangleF rectangle, Font font, StringFormat stringFormat)
Inicializa una nueva instancia de la clase TextShape.
Parameters:
| Parámetro | Tipo | Descripción |
|---|---|---|
| text | java.lang.String | El texto a dibujar. |
| rectangle | RectangleF | El rectángulo de texto. |
| font | Font | La fuente a usar. |
| stringFormat | StringFormat | El formato de cadena. |
getText()
public String getText()
Obtiene o establece el texto dibujado.
Valor: El texto dibujado.
Returns: java.lang.String
setText(String value)
public void setText(String value)
Obtiene o establece el texto dibujado.
Valor: El texto dibujado.
Parameters:
| Parámetro | Tipo | Descripción |
|---|---|---|
| valor | java.lang.String |
getFont()
public Font getFont()
Obtiene o establece la fuente utilizada para dibujar el texto.
Valor: La fuente utilizada para dibujar el texto.
Returns: Font
setFont(Font value)
public void setFont(Font value)
Obtiene o establece la fuente utilizada para dibujar el texto.
Valor: La fuente utilizada para dibujar el texto.
Parameters:
| Parámetro | Tipo | Descripción |
|---|---|---|
| value | Font |
getTextFormat()
public StringFormat getTextFormat()
Obtiene o establece el formato del texto.
Valor: El formato de texto.
Returns: StringFormat
setTextFormat(StringFormat value)
public void setTextFormat(StringFormat value)
Obtiene o establece el formato del texto.
Valor: El formato de texto.
Parameters:
| Parámetro | Tipo | Descripción |
|---|---|---|
| value | StringFormat |
getCenter()
public PointF getCenter()
Obtiene el centro de la forma.
Valor: El centro de la forma.
Returns: PointF
getBounds()
public RectangleF getBounds()
Obtiene los límites del objeto.
Valor: Los límites del objeto.
Returns: RectangleF
getSegments()
public ShapeSegment[] getSegments()
Obtiene los segmentos de la forma.
Valor: Los segmentos de la forma.
Returns: com.aspose.imaging.ShapeSegment[]
hasSegments()
public boolean hasSegments()
Obtiene un valor que indica si la forma tiene segmentos.
Valor: True si la forma tiene segmentos; de lo contrario, false.
Returns: boolean
getBounds(Matrix matrix)
public RectangleF getBounds(Matrix matrix)
Obtiene los límites del objeto.
Parameters:
| Parámetro | Tipo | Descripción |
|---|---|---|
| matrix | Matrix | La matriz a aplicar antes de que se calculen los límites. |
Returns: RectangleF - The estimated object’s bounds.
getBounds(Matrix matrix, Pen pen)
public RectangleF getBounds(Matrix matrix, Pen pen)
Obtiene los límites del objeto.
Parameters:
| Parámetro | Tipo | Descripción |
|---|---|---|
| matrix | Matrix | La matriz a aplicar antes de que se calculen los límites. |
| pen | Pen | El lápiz a usar para el objeto. Esto puede influir en el tamaño de los límites del objeto. |
Returns: RectangleF - The estimated object’s bounds.
transform(Matrix transform)
public void transform(Matrix transform)
Aplica la transformación especificada a la forma.
Parameters:
| Parámetro | Tipo | Descripción |
|---|---|---|
| transform | Matrix | La transformación a aplicar. |
equals(Object o)
public boolean equals(Object o)
Comprueba si los objetos son iguales.
Parameters:
| Parámetro | Tipo | Descripción |
|---|---|---|
| o | java.lang.Object | El otro objeto. |
Returns: boolean - El resultado de la comparación de igualdad.
hashCode()
public int hashCode()
Obtiene el código hash del objeto actual.
Returns: int - El código hash.