public class FlatString extends Object
| Modifier and Type | Field and Description |
|---|---|
protected double |
ascent |
protected double |
descent |
protected Font |
font |
protected double |
height |
protected double |
leading |
protected double |
lineHeight |
protected String |
text
Отображаемый текст
|
protected FlatBlock |
textBlock |
protected double |
width |
protected double |
x |
protected double |
y |
| Constructor and Description |
|---|
FlatString(String text,
Font font,
FontRenderContext ctx,
FlatBlock fblock)
Инициализация своств text, font, width, height, ascent, descent, lineHeight, leading
|
| Modifier and Type | Method and Description |
|---|---|
double |
getAscent()
Возвращает высоту букв от базовой линии до верха
|
double |
getDescent()
Возвращает высоту букв от базовой линии до низа букв с "хвостиками"
|
Font |
getFont()
Возвращает шрифт используемый при рендере строки
|
double |
getHeight()
Возвращает высоту текстровой строки
|
double |
getLeading()
Возвращает растояние между нижней границей и до след строки
|
double |
getLineHeight()
Возвразает высоту строки
|
double |
getMaxX()
Возвращает координаты для рендера строки
|
double |
getMaxY()
Возвращает координаты для рендера строки
|
double |
getMinX()
Возвращает координаты для рендера строки
|
double |
getMinY()
Возвращает координаты для рендера строки
|
String |
getText()
Указывает отображаемый текст
|
FlatBlock |
getTextBlock()
Возвращает текстовый блок, к которому подготовлена строка
|
double |
getWidth()
Возвращает ширину текстровой строки
|
double |
getX()
Возвращает координаты для рендера строки
|
double |
getY()
Возвращает координаты для рендера строки
|
void |
render(Graphics2D gs)
Отображение строки
|
void |
render(Graphics2D gs,
double x,
double y)
Отображение строки
|
void |
setX(double x)
Указывает координаты для рендера строки
|
void |
setY(double y)
Указывает координаты для рендера строки
|
protected transient FlatBlock textBlock
protected String text
protected transient Font font
protected double x
protected double y
protected double width
protected double height
protected double ascent
protected double descent
protected double lineHeight
protected double leading
public FlatString(String text, Font font, FontRenderContext ctx, FlatBlock fblock)
text - текстfont - шрифтctx - контекстfblock - Блок к которому пренадлежит строкаpublic FlatBlock getTextBlock()
public String getText()
public Font getFont()
public double getX()
public void setX(double x)
x - координатыpublic double getY()
public void setY(double y)
y - координатыpublic double getWidth()
public double getHeight()
public double getMinX()
public double getMinY()
public double getMaxX()
public double getMaxY()
public double getAscent()
public double getDescent()
public double getLineHeight()
public double getLeading()
public void render(Graphics2D gs)
gs - контекст отображенияpublic void render(Graphics2D gs, double x, double y)
gs - контекстx - координаты отображения строкиy - координаты отображения строкиCopyright © 2019. All rights reserved.