|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.paperclips.TextPrint
public class TextPrint
A Print for displaying text.
TextPrints are never greedy with layout space, even with center- or right-alignment. (Greedy prints take up all the available space on the page.) Therefore, when center- or right-alignment is required, it is necessary to wrap the text in a Print which will enforce the same alignment. Usually this is a center:default:grow or right:default:grow column in a GridPrint.
Field Summary | |
---|---|
static int |
DEFAULT_ALIGN
The default alignment for TextPrint. |
static org.eclipse.swt.graphics.FontData |
DEFAULT_FONT_DATA
The default font data for a TextPrint. |
static java.lang.String |
DEFAULT_TEXT
The default text for a TextPrint. |
Constructor Summary | |
---|---|
TextPrint()
Constructs a TextPrint with the default properties. |
|
TextPrint(java.lang.String text)
Constructs a TextPrint with the given text. |
|
TextPrint(java.lang.String text,
org.eclipse.swt.graphics.FontData fontData)
Constructs a TextPrint with the given text and font data. |
|
TextPrint(java.lang.String text,
org.eclipse.swt.graphics.FontData fontData,
int align)
Constructs a TextPrint with the given text, font data, and alignment. |
|
TextPrint(java.lang.String text,
int align)
Constructs a TextPrint with the give text and alignment. |
|
TextPrint(java.lang.String text,
TextStyle style)
Constructs a TextPrint with the given text and style. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
int |
getAlign()
Deprecated. Use getAlignment() instead. |
int |
getAlignment()
Returns the horizontal text alignment. |
org.eclipse.swt.graphics.RGB |
getBackground()
Returns the background color. |
org.eclipse.swt.graphics.FontData |
getFontData()
Returns the font that will be used to print the text. |
org.eclipse.swt.graphics.RGB |
getForeground()
Returns the foreground color. |
org.eclipse.swt.graphics.RGB |
getRGB()
Deprecated. Use getForeground() instead. |
boolean |
getStrikeout()
Returns the strikout flag. |
TextStyle |
getStyle()
Returns the text style. |
java.lang.String |
getText()
Returns the text that will be printed. |
boolean |
getUnderline()
Returns the underline flag. |
boolean |
getWordSplitting()
Returns whether word splitting is enabled. |
int |
hashCode()
|
PrintIterator |
iterator(org.eclipse.swt.graphics.Device device,
org.eclipse.swt.graphics.GC gc)
Returns a PrintIterator for laying out the contents of this Print. |
void |
setAlign(int alignment)
Deprecated. Use setAlignment(int) instead. |
void |
setAlignment(int alignment)
Sets the horizontal text alignment. |
void |
setBackground(org.eclipse.swt.graphics.RGB background)
Sets the background color to the argument. |
void |
setFontData(org.eclipse.swt.graphics.FontData fontData)
Sets the font that will be used to print the text. |
void |
setForeground(org.eclipse.swt.graphics.RGB foreground)
Sets the foreground color to the argument. |
void |
setRGB(org.eclipse.swt.graphics.RGB foreground)
Deprecated. Use setForeground(RGB) instead. |
void |
setStrikeout(boolean strikeout)
Sets the strikeout flag to the argument. |
void |
setStyle(TextStyle style)
Sets the text style to the argument. |
void |
setText(java.lang.String text)
Sets the text that will be printed. |
void |
setUnderline(boolean underline)
Sets the underline flag to the argument. |
void |
setWordSplitting(boolean wordBreaking)
Sets whether word splitting is enabled. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_TEXT
public static final org.eclipse.swt.graphics.FontData DEFAULT_FONT_DATA
public static final int DEFAULT_ALIGN
Constructor Detail |
---|
public TextPrint()
public TextPrint(java.lang.String text)
text
- the text to print.public TextPrint(java.lang.String text, org.eclipse.swt.graphics.FontData fontData)
text
- the text to print.fontData
- the font that will be used to print the text.public TextPrint(java.lang.String text, int align)
text
- the text to print.align
- the horizontal text alignment. Must be one of SWT.LEFT
, SWT.CENTER
or SWT.RIGHT
.public TextPrint(java.lang.String text, org.eclipse.swt.graphics.FontData fontData, int align)
text
- the text to print.fontData
- the font that will be used to print the text.align
- the horizontal text alignment. Must be one of SWT.LEFT
, SWT.CENTER
or SWT.RIGHT
.public TextPrint(java.lang.String text, TextStyle style)
text
- the text to print.style
- the style to apply to the text.Method Detail |
---|
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String getText()
public void setText(java.lang.String text)
text
- the text to print.public TextStyle getStyle()
public void setStyle(TextStyle style)
style
- the new text style.public org.eclipse.swt.graphics.FontData getFontData()
public void setFontData(org.eclipse.swt.graphics.FontData fontData)
fontData
- the font that will be used to print the text.public int getAlign()
getAlignment()
instead.
SWT.LEFT
, SWT.CENTER
or SWT.RIGHT
.
public void setAlign(int alignment)
setAlignment(int)
instead.
alignment
- the horizontal text alignment. Must be one of SWT.LEFT
, SWT.CENTER
or SWT.RIGHT
.public int getAlignment()
SWT.LEFT
, SWT.CENTER
or SWT.RIGHT
.
public void setAlignment(int alignment)
alignment
- the horizontal text alignment. Must be one of SWT.LEFT
, SWT.CENTER
or SWT.RIGHT
.public org.eclipse.swt.graphics.RGB getRGB()
getForeground()
instead.
public void setRGB(org.eclipse.swt.graphics.RGB foreground)
setForeground(RGB)
instead.
foreground
- the new foreground color.public org.eclipse.swt.graphics.RGB getForeground()
public void setForeground(org.eclipse.swt.graphics.RGB foreground)
foreground
- the new foreground color. A null value causes the foreground
color to be inherited.public org.eclipse.swt.graphics.RGB getBackground()
public void setBackground(org.eclipse.swt.graphics.RGB background)
background
- the new background color. A null value causes the background
to be transparent.public boolean getUnderline()
public void setUnderline(boolean underline)
underline
- the underline flag.public boolean getStrikeout()
public void setStrikeout(boolean strikeout)
strikeout
- the strikeout flag.public boolean getWordSplitting()
public void setWordSplitting(boolean wordBreaking)
wordBreaking
- whether to allow word splitting.public PrintIterator iterator(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
Print
iterator
in interface Print
device
- the graphics device this Print will be drawn onto.gc
- the graphics context to be used for calculating layout and
drawing the Print's contents.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |