public class PrintableText extends Object implements PrintableReportItem
título: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
| Modifier and Type | Field and Description |
|---|---|
static String |
ALIGN_CENTER
Alinhamento central
|
protected Point2D |
pt
Ponto para uso temporário
|
protected Rectangle2D |
rect
Retângulo para uso temporário
|
protected TextTool |
textTool
Ferramenta de impressão de texto
|
CM_TO_INCH| Constructor and Description |
|---|
PrintableText(String text,
Font textFont)
Construtor de textos sem título.
|
PrintableText(String text,
Font textFont,
boolean changeFont)
Construtor de textos sem título.
|
PrintableText(String title,
Font titleFont,
String text,
Font textFont)
Construtor de textos com título.
|
PrintableText(String title,
Font titleFont,
String text,
Font textFont,
boolean changeFont)
Construtor de textos com título.
|
| Modifier and Type | Method and Description |
|---|---|
float |
getHeight()
Obtém a altura do item impresso na página.
|
String |
getText()
Obtém o texto da área.
|
String |
getTitle()
Obtém o título do texto.
|
float |
getWidth()
Obtém a largura do item impresso na página.
|
void |
initPrinting(PrintConfiguration configuration)
Prepara a impressão com determinada configuração de impressão.
|
boolean |
print(Graphics2D g2,
PageFormat format,
int pageIndex)
Imprime o item.
|
void |
setAlignment(String alignment)
Indica o alinhamento do texto.
|
void |
setLeftInset(float leftInset)
Indica o espaçamento do texto à esquerda em centímetros.
|
boolean |
simulatePrint(Graphics2D g2,
PageFormat format,
int pageIndex)
Simula a impressão do item, isto é, gera a impressão no componente gráfico
como se estivesse imprimindo, mas sem imprimir de fato.
|
public static final String ALIGN_CENTER
protected TextTool textTool
protected Rectangle2D rect
protected Point2D pt
public PrintableText(String text, Font textFont)
text - texto da área.textFont - fonte do texto.public PrintableText(String text, Font textFont, boolean changeFont)
text - texto da área.textFont - fonte do texto.changeFont - indica se a fonte pode ser alterada pela configuração.public PrintableText(String title, Font titleFont, String text, Font textFont)
title - título.titleFont - fonte do título.text - texto.textFont - fonte do texto.public PrintableText(String title, Font titleFont, String text, Font textFont, boolean changeFont)
title - título.titleFont - fonte do título.text - texto.textFont - fonte do texto.changeFont - indica se a fonte pode ser alterada pela proporção.public boolean simulatePrint(Graphics2D g2, PageFormat format, int pageIndex)
simulatePrint in interface PrintableReportItemg2 - componente gráfico.format - formato da página a ser impressa.pageIndex - índice da página a ser impressa.public boolean print(Graphics2D g2, PageFormat format, int pageIndex)
print in interface PrintableReportItemg2 - componente gráfico.format - formato da página a ser impressa.pageIndex - índice da página a ser impressa.public float getHeight()
getHeight in interface PrintableReportItempublic String getText()
public String getTitle()
public void setAlignment(String alignment)
alignment - alinhamento do texto.public void setLeftInset(float leftInset)
leftInset - espaçamento à esquerda em centímetros.public void initPrinting(PrintConfiguration configuration)
initPrinting in interface PrintableReportItemconfiguration - configuração de impressão.public float getWidth()
getWidth in interface PrintableReportItemCopyright © 2020 Tecgraf/PUC-Rio. All rights reserved.