public class TextStyle
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
TextStyle.Alignment |
Constructor and Description |
---|
TextStyle(float fontSize) |
TextStyle(float fontSize,
boolean bold,
boolean italic) |
TextStyle(java.lang.String fontName,
float fontSize,
boolean bold,
boolean italic)
Creates a text style from its font's name, its size and style.
|
TextStyle(java.lang.String fontName,
float fontSize,
boolean bold,
boolean italic,
TextStyle.Alignment alignment)
Creates a text style from its font's name, its size, style and alignment.
|
Modifier and Type | Method and Description |
---|---|
TextStyle |
deriveBoldStyle(boolean bold)
Returns a derived style of this text style with a given bold style.
|
TextStyle |
deriveItalicStyle(boolean italic)
Returns a derived style of this text style with a given italic style.
|
TextStyle |
deriveStyle(float fontSize)
Returns a derived style of this text style with a given font size.
|
TextStyle |
deriveStyle(java.lang.String fontName)
Returns a derived style of this text style with a given font name.
|
TextStyle |
deriveStyle(TextStyle.Alignment alignment)
Returns a derived style of this text style with a given alignment.
|
boolean |
equals(java.lang.Object object)
Returns
true if this text style is equal to object . |
TextStyle.Alignment |
getAlignment()
Returns the alignment applied on text using this style.
|
java.lang.String |
getFontName()
Returns the font name of this text style.
|
float |
getFontSize()
Returns the font size of this text style.
|
int |
hashCode()
Returns a hash code for this text style.
|
boolean |
isBold()
Returns whether this text style is bold or not.
|
boolean |
isItalic()
Returns whether this text style is italic or not.
|
public TextStyle(float fontSize)
public TextStyle(float fontSize, boolean bold, boolean italic)
public TextStyle(java.lang.String fontName, float fontSize, boolean bold, boolean italic)
public TextStyle(java.lang.String fontName, float fontSize, boolean bold, boolean italic, TextStyle.Alignment alignment)
public java.lang.String getFontName()
public float getFontSize()
public boolean isBold()
public boolean isItalic()
public TextStyle.Alignment getAlignment()
public TextStyle deriveStyle(java.lang.String fontName)
public TextStyle deriveStyle(float fontSize)
public TextStyle deriveStyle(TextStyle.Alignment alignment)
public TextStyle deriveBoldStyle(boolean bold)
public TextStyle deriveItalicStyle(boolean italic)
public boolean equals(java.lang.Object object)
true
if this text style is equal to object
.equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License