|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcdox.edit.TextElementGenerator
This class provides some useful methods for generation of text elements. See the description of the various static methods how they work.
Field Summary |
Fields inherited from interface cdox.edit.CDCoverStandards |
ALL, CDBACK_SIDE, CDBACK_SIDE_SIZE, CDBACK_SIZE, CDBOOKLET, CDBOOKLET_SIZE, CDFRONT, CDFRONT_SIZE, CDSIDE_SIZE, CDX, GIF, JPG, PNG |
Constructor Summary | |
TextElementGenerator()
|
Method Summary | |
static TextElement[] |
createMultipleStrings(Cover c,
java.lang.String[] s,
java.awt.Font f,
int size,
int yPos,
boolean left,
boolean bold,
boolean italic,
boolean underline)
Creates a text element from multiple strings. |
static void |
createSideString(Cover c,
java.lang.String s)
This method creates two text elements as side strings. |
static TextElement |
createSingleString(Cover c,
java.lang.String s,
java.awt.Font f,
int size,
int yPos,
boolean left,
boolean bold,
boolean italic,
boolean underline)
Creates a text element from a single string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TextElementGenerator()
Method Detail |
public static TextElement createSingleString(Cover c, java.lang.String s, java.awt.Font f, int size, int yPos, boolean left, boolean bold, boolean italic, boolean underline)
Creates a text element from a single string. The element will be centered on the cover according to the following rules:
If the string is empty, this method inserts no element at all. The font may be null, in which case new JLabel().getFont() will be used. If the size is lower than 6, 10 will be used.
c
- the cover where the element will be added.s
- the string.f
- the desired font.size
- the desired font size.yPos
- the y starting position.left
- the mode (only relevant with booklets, see above).bold
- whether the text should be bold.italic
- whether the text should be italic.underline
- whether the text should be underlined.
public static TextElement[] createMultipleStrings(Cover c, java.lang.String[] s, java.awt.Font f, int size, int yPos, boolean left, boolean bold, boolean italic, boolean underline)
Creates a text element from multiple strings. The elements will be centered on the cover according to the following rules:
If the strings are empty, this method inserts no element at all. The font may be null, in which case new JLabel().getFont() will be used. If the size is lower than 6, 10 will be used.
c
- the cover where the element will be added.s
- the strings.f
- the desired font.size
- the desired font size.yPos
- the y starting position.left
- the mode (only relevant with booklets, see above).bold
- whether the text should be bold.italic
- whether the text should be italic.underline
- whether the text should be underlined.
public static void createSideString(Cover c, java.lang.String s)
c
- the Cover. Must be a CDBACK_SIDE.s
- the string to add.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |