|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.page.JCTextStyle
JCTextStyle
specifies all attributes controlling
the appearance of text in JClass PageLayout.
Field Summary | |
protected int |
alignment
Horizontal alignment of text to the frame/column edge. |
static int |
ALIGNMENT_CENTER
Text is aligned to the center of the current column. |
static int |
ALIGNMENT_JUSTIFY
Text is aligned to both the left and right margins of the current column. |
static int |
ALIGNMENT_LEFT
Text is aligned to the left margin of the current column. |
static int |
ALIGNMENT_NONE
No horizontal text alignment is performed. |
static int |
ALIGNMENT_RIGHT
Text is aligned to the right margin of the current column. |
protected int |
baselineOffset
Text position relative to the baseline (for super-/subscript). |
static com.klg.jclass.page.JCTextStyle |
BOLD
Bold text style. |
static com.klg.jclass.page.JCTextStyle |
BOLD_ITALIC
Bold/italic text style. |
static com.klg.jclass.page.JCTextStyle |
CODE
A text style designed for printing code samples. |
static com.klg.jclass.page.JCTextStyle |
CODE_INDENTED
An indented text style designed for printing code samples. |
protected Color |
color
Color the text is to be drawn in. |
static com.klg.jclass.page.JCTextStyle |
DEFAULT_HEADER
A default text style for headers. |
static com.klg.jclass.page.JCTextStyle |
DEFAULT_TEXT
A default (standard, unornamented) text style. |
protected Font |
font
The particular font to use to render the text. |
protected String |
fontFamily
The font family to which this font belongs. |
protected int |
fontStyle
The style (Regular, Bold, Italic) to be used in drawing the text. |
static com.klg.jclass.page.JCTextStyle |
HEADING
A heading text style. |
static com.klg.jclass.page.JCTextStyle |
HEADING_BOLD
A bold heading text style. |
static com.klg.jclass.page.JCTextStyle |
HEADING1
A major (top-level) heading text style. |
static com.klg.jclass.page.JCTextStyle |
HEADING2
A secondary (second-level) heading text style. |
static com.klg.jclass.page.JCTextStyle |
HEADING3
Level three heading text style. |
static com.klg.jclass.page.JCTextStyle |
HEADING4
Level four heading text style. |
static com.klg.jclass.page.JCTextStyle |
HEADING5
Level five heading text style. |
static com.klg.jclass.page.JCTextStyle |
HEADING6
Level six heading text style. |
static com.klg.jclass.page.JCTextStyle |
HEADING7
Level seven heading text style. |
protected boolean |
immutable
Flag identifying if the style may be modified. |
protected Map |
immutableTextStyles
|
static com.klg.jclass.page.JCTextStyle |
INDENTED
A text style indented from the column margins. |
protected JCUnit.Measure |
indentLeft
Amount of white space to leave as indentation from the left margin. |
protected JCUnit.Measure |
indentParagraph
The indentation from the left margin for the first line of a paragraph. |
protected JCUnit.Measure |
indentRight
Amount of white space to leave as indentation from the right margin. |
protected static TreeMap |
instanceCollection
A list containing references to all named style instances. |
static com.klg.jclass.page.JCTextStyle |
ITALIC
Italic text style. |
static int |
LINEMODE_NONE
No underlining is done. |
static int |
LINEMODE_UNDERLINE
A single underline is drawn. |
protected double |
lineSpacing
Spacing to leave between lines of text (multiple of line height). |
protected String |
name
The unique name of the style. |
static com.klg.jclass.page.JCTextStyle |
NORMAL
Normal (upright, medium weight) text style. |
static int |
OFFSET_NONE
The text is placed on the text baseline. |
static int |
OFFSET_SUBSCRIPT
The text is placed below the text baseline as a subscript. |
static int |
OFFSET_SUPERSCRIPT
The text is placed above the text baseline as a superscript. |
protected double |
paragraphSpacing
Spacing to leave between paragraphs (multiple of line height). |
static com.klg.jclass.page.JCTextStyle |
PLAIN
Plain (== Normal) text style. |
protected double |
pointSize
The point size of the standard text described by this style. |
protected static int |
styleCount
Count of the number of instances of the class. |
protected double |
subscriptRatio
The point size reduction factor to super-/subscript size. |
protected List |
tabList
All the tabs (in order) maintained by the style. |
protected static String |
UNAMED_STYLE_PREFIX
|
protected int |
underline
Underlining mode (enumerated type). |
static com.klg.jclass.page.JCTextStyle |
WHITE_BOLD
White, Bold text style. |
Constructor Summary | |
JCTextStyle()
Creates a text style with a default name and values. |
|
JCTextStyle(String name)
Creates a text style with the given name and default values. |
|
JCTextStyle(String name,
JCUnit.Measure indent_left,
JCUnit.Measure indent_right,
JCUnit.Measure indent_paragraph,
Color color,
List tablist,
String font_family,
int font_style,
double point_size,
int underline,
int alignment,
double subscript_ratio,
int baseline_offset,
double line_spacing,
double paragraph_spacing,
boolean immutable)
Creates a text style with the given name and values. |
Method Summary | |
void |
addTab(int alignment,
JCUnit.Measure position)
Sets a tab stop in this style. |
void |
addTab(com.klg.jclass.page.JCTab tab)
Sets the given tab as a tab stop in this style. |
Object |
clone()
Returns a style which is a copy of this one. |
void |
deleteTab(JCUnit.Measure position)
Removes the tab at a given position. |
void |
deleteTabs()
Removes all tabs from this style. |
boolean |
equals(Object o)
Text styles with the same properties are considered equal regardless of their names. |
int |
getAlignment()
Gets the text alignment mode within a paragraph. |
int |
getBaselineOffset()
Gets the offset from the normal baseline of the text. |
Color |
getColor()
Gets the color which is used to paint the text. |
Font |
getFont()
Gets the font which is used for rendering text. |
String |
getFontFamily()
Gets the font family to which this the font belongs. |
int |
getFontStyle()
Gets the writing style (italic, bold) of the font. |
com.klg.jclass.page.JCTextStyle |
getImmutable()
Returns this object if it is already immutable; otherwise, checks to see if a style with the same properties already exists in the immutable cache and returns it. |
JCUnit.Measure |
getLeftIndent()
Gets the amount of space to move text in from the left margin. |
double |
getLineSpacing()
Gets the line spacing as a factor of the text height. |
String |
getName()
Gets the name of the style. |
JCUnit.Measure |
getParagraphIndent()
Gets the amount of space to indent the first line of a paragraph. |
double |
getParagraphSpacing()
Gets the paragraph spacing as a factor of the text height. |
double |
getPointSize()
Gets the style's defined point size. |
JCUnit.Measure |
getRightIndent()
Gets the amount of space to move text in from the right margin. |
static Map |
getStyleList()
Returns the entire style Map. |
static Iterator |
getStyles()
Provides an iterator over all immutable styles. |
double |
getSubscriptRatio()
Gets the ratio of sub-/superscript text to normal text. |
List |
getTabs()
Gets the list of tabs from the style. |
int |
getUnderlining()
Gets the underlining mode this style is applying. |
int |
hashCode()
Creates a hash that generates the same value depending on the property values. |
boolean |
isMutable()
Determines if the style can be modified. |
void |
makeImmutable()
Sets the style to immutable so it can no longer be modified. |
void |
setAlignment(int alignment)
Sets the text alignment mode within a paragraph. |
void |
setBaselineOffset(int baseline_offset)
Sets the position of the text relative to the normal baseline. |
void |
setColor(Color color)
Sets the color to be used to paint the text. |
void |
setFont(Font font)
Sets the font which is used for rendering text. |
void |
setFontFamily(String font_family)
Sets the font family from which fonts and styles are selected. |
void |
setFontStyle(int font_style)
Sets the writing style (italic, bold) of the font. |
void |
setLeftIndent(JCUnit.Measure indent_width)
Specifies the amount of space between the left margin and the start of text. |
void |
setLineSpacing(double spacing)
Sets the line spacing (top of line to top) as a multiple of text height. |
void |
setName(String name)
Sets a name for the style. |
void |
setParagraphIndent(JCUnit.Measure indent_width)
Specifies the amount of space before the first line of text in a paragraph. |
void |
setParagraphSpacing(double spacing)
Sets the paragraph spacing (line spacing betweeen paragraphs). |
void |
setPointSize(double point_size)
Sets the point size of text using this style. |
void |
setRightIndent(JCUnit.Measure indent_width)
Specifies the amount of space between the right margin and the start of text. |
void |
setSubscriptRatio(double subscript_ratio)
Sets the ratio of sub-/superscript text to normal text. |
void |
setTabs(int alignment,
JCUnit.Measure spacing,
int count)
Sets a list of regularly-spaced tabs with a common alignment. |
void |
setTabs(int alignment,
JCUnit.Measure first,
JCUnit.Measure spacing,
int count)
Sets a list of regularly-spaced tabs with a common alignment. |
void |
setTabs(int alignment,
List positions)
Sets a list of tabs with a common alignment. |
void |
setUnderlining(int underline)
Sets the underlining mode this style is applying. |
static com.klg.jclass.page.JCTextStyle |
stringToStyle(String name)
Returns the style which matches the given name. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int LINEMODE_NONE
public static final int LINEMODE_UNDERLINE
public static final int OFFSET_NONE
public static final int OFFSET_SUBSCRIPT
public static final int OFFSET_SUPERSCRIPT
public static final int ALIGNMENT_NONE
public static final int ALIGNMENT_LEFT
public static final int ALIGNMENT_RIGHT
public static final int ALIGNMENT_CENTER
public static final int ALIGNMENT_JUSTIFY
protected String name
protected Color color
protected int underline
protected Font font
protected String fontFamily
protected int fontStyle
protected double pointSize
protected double subscriptRatio
protected int baselineOffset
protected int alignment
protected JCUnit.Measure indentLeft
protected JCUnit.Measure indentRight
protected JCUnit.Measure indentParagraph
protected double lineSpacing
protected double paragraphSpacing
protected List tabList
protected boolean immutable
protected static int styleCount
protected static TreeMap instanceCollection
protected Map immutableTextStyles
protected static final String UNAMED_STYLE_PREFIX
public static final com.klg.jclass.page.JCTextStyle NORMAL
name
property for this style is Normal
.
public static final com.klg.jclass.page.JCTextStyle PLAIN
name
property for this style is Plain
.
public static final com.klg.jclass.page.JCTextStyle BOLD
name
property for this style is Bold
.
public static final com.klg.jclass.page.JCTextStyle BOLD_ITALIC
name
property for this style is Bold Italic
.
public static final com.klg.jclass.page.JCTextStyle ITALIC
name
property for this style is Italic
.
public static final com.klg.jclass.page.JCTextStyle INDENTED
name
property for this style is Indented
.
public static final com.klg.jclass.page.JCTextStyle CODE
name
property for this style is Code
.
public static final com.klg.jclass.page.JCTextStyle CODE_INDENTED
name
property for this style is CodeIndented
.
public static final com.klg.jclass.page.JCTextStyle HEADING
name
property for this style is Heading
.
public static final com.klg.jclass.page.JCTextStyle HEADING_BOLD
name
property for this style is HeadingBold
.
public static final com.klg.jclass.page.JCTextStyle HEADING1
name
property for this style is H1
.
public static final com.klg.jclass.page.JCTextStyle HEADING2
name
property for this style is H2
.
public static final com.klg.jclass.page.JCTextStyle HEADING3
name
property for this style is H3
.
public static final com.klg.jclass.page.JCTextStyle HEADING4
name
property for this style is H4
.
public static final com.klg.jclass.page.JCTextStyle HEADING5
name
property for this style is H5
.
public static final com.klg.jclass.page.JCTextStyle HEADING6
name
property for this style is H6
.
public static final com.klg.jclass.page.JCTextStyle HEADING7
name
property for this style is H7
.
public static final com.klg.jclass.page.JCTextStyle WHITE_BOLD
name
property for this style is WhiteBold
.
public static final com.klg.jclass.page.JCTextStyle DEFAULT_TEXT
name
property for this style is default text
.
public static final com.klg.jclass.page.JCTextStyle DEFAULT_HEADER
name
property for this style is default header
.
Constructor Detail |
public JCTextStyle(String name, JCUnit.Measure indent_left, JCUnit.Measure indent_right, JCUnit.Measure indent_paragraph, Color color, List tablist, String font_family, int font_style, double point_size, int underline, int alignment, double subscript_ratio, int baseline_offset, double line_spacing, double paragraph_spacing, boolean immutable)
name
- the name by which the new style will be knownindent_left
- the distance from the left margin to indent textindent_right
- the distance from the right margin to indent textindent_paragraph
- the left indent for the first line of a paragraphcolor
- the color to draw the texttablist
- a list of tabs defined for the stylefont_family
- the font family used to draw textfont_style
- the style (bold, italic) used to draw the textpoint_size
- the size of text (in points)underline
- the style of underlining to usealignment
- the horizontal alignment of text in a columnsubscript_ratio
- the ratio of the size of subscripts to normal textbaseline_offset
- the position of the text (super/subscript)line_spacing
- the distance between lines of textparagraph_spacing
- the distance between lines starting a paragraphimmutable
- indicates if the style may be changed or notpublic JCTextStyle()
public JCTextStyle(String name)
name
- the name to give the new text styleMethod Detail |
public String getName()
public void setName(String name)
name
- the new name for the stylepublic Color getColor()
public void setColor(Color color)
color
- color object to assign to the textpublic int getUnderlining()
public void setUnderlining(int underline)
underline
- type of underlining to be performedpublic double getPointSize()
public void setPointSize(double point_size)
point_size
- the point size to be applied to text using this stylepublic Font getFont()
public void setFont(Font font)
font
- the font to use for displaying textpublic String getFontFamily()
public void setFontFamily(String font_family)
font_family
- the font family that contains the desired fontpublic int getFontStyle()
public void setFontStyle(int font_style)
font_style
- style (angle, weight) used to draw the font
Valid arguments are java.awt.Font.PLAIN, java.awt.Font.BOLD,
java.awt.Font.ITALIC, and java.awt.Font.BOLD | java.awt.Font.ITALIC>public int getBaselineOffset()
public void setBaselineOffset(int baseline_offset)
baseline_offset
- position of text (superscript/subscript) relative to
the normal baseline of the textpublic int getAlignment()
JCTextStyle.ALIGNMENT_NONE
, JCTextStyle.ALIGNMENT_LEFT
,
JCTextStyle.ALIGNMENT_RIGHT
, JCTextStyle.ALIGNMENT_CENTER
,
and JCTextStyle.ALIGNMENT_JUSTIFY
.
public void setAlignment(int alignment)
JCTextStyle.ALIGNMENT_NONE
, JCTextStyle.ALIGNMENT_LEFT
,
JCTextStyle.ALIGNMENT_RIGHT
, JCTextStyle.ALIGNMENT_CENTER
,
and JCTextStyle.ALIGNMENT_JUSTIFY
.
alignment
- alignment of lines of text in a paragraphpublic JCUnit.Measure getLeftIndent()
public void setLeftIndent(JCUnit.Measure indent_width)
indent_width
- space to indent text on the left sidepublic JCUnit.Measure getRightIndent()
public void setRightIndent(JCUnit.Measure indent_width)
indent_width
- space to indent text on the right sidepublic JCUnit.Measure getParagraphIndent()
public void setParagraphIndent(JCUnit.Measure indent_width)
indent_width
- space to indent text for the beginning of a paragraphpublic double getLineSpacing()
public void setLineSpacing(double spacing)
spacing
- the multiple of the text height to advance between linespublic double getParagraphSpacing()
public void setParagraphSpacing(double spacing)
spacing
- text height multiplier for inter-paragraph line spacingpublic List getTabs()
public void addTab(com.klg.jclass.page.JCTab tab)
tab
- the tab object to add to this style's list of tabspublic void addTab(int alignment, JCUnit.Measure position)
alignment
- the behavior of flowed objects aligning to the new tabposition
- the horizontal location of the tab across the linepublic void setTabs(int alignment, List positions)
alignment
- the alignment of flowed objects to the tab locationspositions
- a List of positions for the tabspublic void setTabs(int alignment, JCUnit.Measure spacing, int count)
alignment
- the alignment of flowed objects to the tab locationsspacing
- the spacing between tabscount
- the number of tabs to be addedpublic void setTabs(int alignment, JCUnit.Measure first, JCUnit.Measure spacing, int count)
alignment
- the alignment of flowed objects to the tab locationsfirst
- the location of the first tab on the linespacing
- the spacing between tabscount
- the number of tabs to be addedpublic void deleteTabs()
public void deleteTab(JCUnit.Measure position)
position
- the location of the tab which is to be clearedpublic double getSubscriptRatio()
public void setSubscriptRatio(double subscript_ratio)
subscript_ratio
- the scaling factor to derive subscript text sizepublic boolean isMutable()
true
or false
, depending whether or not the style can be modifiedpublic void makeImmutable()
public Object clone()
clone
in class Object
public static Iterator getStyles()
SortedMap
public static Map getStyleList()
public static com.klg.jclass.page.JCTextStyle stringToStyle(String name)
name
- the name of an existing style
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
o
-
public com.klg.jclass.page.JCTextStyle getImmutable()
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |