Style Intelligence v12.0

inetsoft.report
Class StyleFont

java.lang.Object
  extended by java.awt.Font
      extended by inetsoft.report.StyleFont
All Implemented Interfaces:
StyleConstants, XConstants, Serializable, Cloneable

public class StyleFont
extends Font
implements StyleConstants, Cloneable

StyleFont is an extended font class. It supported some additional features such as: underline, strikethrough, small caps, all caps.

A font can be created using the styles defined in java.awt.Font and in this class:

    StyleFont font = new StyleFont("Serif", Font.BOLD | StyleFont.UNDERLINE,
                                   10, StyleConstants.THIN_LINE);
 

See Also:
Serialized Form

Field Summary
static int ALLCAPS
          All caps font style draw all characters in upper case.
static int AWT_FONT_MASK
          Bit mask to get the AWT font style.
static int SHADOW
          Shadow font style.
static int SMALLCAPS
          Small caps font style draw lower case characters in a smaller capital letter.
static int STRIKETHROUGH
          Strikethrough font style.
static int STYLE_FONT_MASK
          Bit mask to get the StyleFont extended style.
static int SUBSCRIPT
          Subscript font style.
static int SUPERSCRIPT
          Superscript font style.
static int UNDERLINE
          Underline font style.
 
Fields inherited from class java.awt.Font
BOLD, CENTER_BASELINE, DIALOG, DIALOG_INPUT, HANGING_BASELINE, ITALIC, LAYOUT_LEFT_TO_RIGHT, LAYOUT_NO_LIMIT_CONTEXT, LAYOUT_NO_START_CONTEXT, LAYOUT_RIGHT_TO_LEFT, MONOSPACED, name, PLAIN, pointSize, ROMAN_BASELINE, SANS_SERIF, SERIF, size, style, TRUETYPE_FONT, TYPE1_FONT
 
Fields inherited from interface inetsoft.report.StyleConstants
ARROW_LINE_1, ARROW_LINE_2, ARROW_LINE_3, BACKGROUND_CENTER, BACKGROUND_TILED, BOX_RECTANGLE, BOX_ROUNDED_RECTANGLE, CENTER, CHART_3D_BAR, CHART_3D_BAR_3D, CHART_3D_PIE, CHART_3D_STACK_BAR, CHART_AREA, CHART_BAR, CHART_BUBBLE, CHART_CANDLE, CHART_CURVE, CHART_FILL_RADAR, CHART_GANTT, CHART_INV_BAR, CHART_INV_CURVE, CHART_INV_LINE, CHART_INV_POINT, CHART_INV_STACK_BAR, CHART_LINE, CHART_MAX_USER, CHART_PARETO, CHART_PIE, CHART_PIE_EXPLODED_ALL, CHART_PIE_EXPLODED_FIRST, CHART_PIE_EXPLODED_NONE, CHART_POINT, CHART_RADAR, CHART_RIBBON, CHART_SCATTER, CHART_SPEEDOMETER, CHART_STACK_AREA, CHART_STACK_BAR, CHART_STICK, CHART_STOCK, CHART_SURFACE, CHART_USER, CHART_VOLUME, CHART_WATERFALL, CHART_XY_LINE, CIRCLE, CROSS, CURRENCY, DASH_LINE, DASH_MASK, DEFAULT_PAGE_SIZE, DIAMOND, DOT_LINE, DOUBLE_3D_LOWERED, DOUBLE_3D_RAISED, DOUBLE_LINE, DOUBLE_MASK, FILL, FILLED_CIRCLE, FILLED_DIAMOND, FILLED_SQUARE, FILLED_TRIANGLE, FRACTION_WIDTH_MASK, H_ALIGN_MASK, H_CENTER, H_CURRENCY, H_LEFT, H_LINE, H_RIGHT, LANDSCAPE, LARGE_DASH, LEFT, LINECAP_BUTT, LINECAP_ROUND, LINECAP_SQUARE, LINEJOIN_BEVEL, LINEJOIN_MITER, LINEJOIN_ROUND, LOWERED_3D, LOWERED_MASK, LT_ANGLE, MEDIUM_DASH, MEDIUM_LINE, NIL, NO_BORDER, NONE, PAPER_10X11, PAPER_10X14, PAPER_11X17, PAPER_15X11, PAPER_9X11, PAPER_A_PLUS, PAPER_A2, PAPER_A3, PAPER_A3_EXTRA, PAPER_A3_EXTRA_TRANSVERSE, PAPER_A3_TRANSVERSE, PAPER_A4, PAPER_A4_EXTRA, PAPER_A4_PLUS, PAPER_A4_TRANSVERSE, PAPER_A4SMALL, PAPER_A5, PAPER_A5_EXTRA, PAPER_A5_TRANSVERSE, PAPER_B_PLUS, PAPER_B4, PAPER_B5, PAPER_B5_EXTRA, PAPER_B5_TRANSVERSE, PAPER_CSHEET, PAPER_DSHEET, PAPER_ENV_10, PAPER_ENV_11, PAPER_ENV_12, PAPER_ENV_14, PAPER_ENV_9, PAPER_ENV_B4, PAPER_ENV_B5, PAPER_ENV_B6, PAPER_ENV_C3, PAPER_ENV_C4, PAPER_ENV_C5, PAPER_ENV_C6, PAPER_ENV_C65, PAPER_ENV_DL, PAPER_ENV_INVITE, PAPER_ENV_ITALY, PAPER_ENV_MONARCH, PAPER_ENV_PERSONAL, PAPER_ESHEET, PAPER_EXECUTIVE, PAPER_FANFOLD_LGL_GERMAN, PAPER_FANFOLD_STD_GERMAN, PAPER_FANFOLD_US, PAPER_FOLIO, PAPER_ISO_B4, PAPER_JAPANESE_POSTCARD, PAPER_LEDGER, PAPER_LEGAL, PAPER_LEGAL_EXTRA, PAPER_LETTER, PAPER_LETTER_EXTRA, PAPER_LETTER_EXTRA_TRANSVERSE, PAPER_LETTER_PLUS, PAPER_LETTER_TRANSVERSE, PAPER_LETTERSMALL, PAPER_NOTE, PAPER_QUARTO, PAPER_STATEMENT, PAPER_TABLOID, PAPER_TABLOID_EXTRA, PATTERN_0, PATTERN_1, PATTERN_10, PATTERN_11, PATTERN_12, PATTERN_13, PATTERN_14, PATTERN_15, PATTERN_16, PATTERN_17, PATTERN_18, PATTERN_19, PATTERN_2, PATTERN_3, PATTERN_4, PATTERN_5, PATTERN_6, PATTERN_7, PATTERN_8, PATTERN_9, PATTERN_NONE, PORTRAIT, RAISED_3D, RAISED_MASK, REMAINDER, RIGHT, RIGHT_ANGLE, SOLID_MASK, SQUARE, STAR, THICK_LINE, THIN_LINE, THIN_THIN_LINE, TRAY_AUTO, TRAY_CASSETTE, TRAY_ENVELOPE, TRAY_ENVMANUAL, TRAY_FORMSOURCE, TRAY_LARGECAPACITY, TRAY_LARGEFMT, TRAY_LOWER, TRAY_MANUAL, TRAY_MIDDLE, TRAY_ONLYONE, TRAY_SMALLFMT, TRAY_TRACTOR, TRAY_UPPER, TRIANGLE, ULTRA_THIN_LINE, V_ALIGN_MASK, V_ANGLE, V_BASELINE, V_BOTTOM, V_CENTER, V_LINE, V_TOP, WIDTH_MASK, X
 
Fields inherited from interface inetsoft.uql.XConstants
AM_PM_DATE_GROUP, AM_PM_OF_DAY_DATE_GROUP, AVERAGE_FORMULA, CALC_FORMULA, COLUMN, CONCAT_FORMULA, CONDITION_EMPTY_STRING, CONDITION_NULL_STRING, CONDITION_NULL_VALUE, CONDITION_REAL_NULL, CORRELATION_FORMULA, COUNT_FORMULA, COVARIANCE_FORMULA, CURRENCY_FORMAT, CURRENT_REP_CHANGED, CURRENT_REP_WILL_CHANGE, DATE_FORMAT, DAY_DATE_GROUP, DAY_OF_MONTH_DATE_GROUP, DAY_OF_WEEK_DATE_GROUP, DAY_OF_YEAR_DATE_GROUP, DECIMAL_FORMAT, DISTINCTCOUNT_FORMULA, FIRST_FORMULA, FULL_JOIN, GREATER_EQUAL_JOIN, GREATER_JOIN, GROUP_OTHERS, HOUR_DATE_GROUP, HOUR_OF_DAY_DATE_GROUP, INNER_JOIN, JOIN, LAST_FORMULA, LEAVE_OTHERS, LEFT_JOIN, LESS_EQUAL_JOIN, LESS_JOIN, MAX_FORMULA, MEDIAN_FORMULA, MESSAGE_FORMAT, MILLISECOND_DATE_GROUP, MIN_FORMULA, MINUTE_DATE_GROUP, MODE_FORMULA, MONTH_DATE_GROUP, MONTH_OF_YEAR_DATE_GROUP, NONE_DATE_GROUP, NONE_FORMULA, NOT_EQUAL_JOIN, NTHLARGEST_FORMULA, NTHMOSTFREQUENT_FORMULA, NTHSMALLEST_FORMULA, PARAM_PREFIX, PART_DATE_GROUP, PERCENT_FORMAT, PERCENTAGE_BY_COL, PERCENTAGE_BY_ROW, PERCENTAGE_NONE, PERCENTAGE_OF_COL_GRANDTOTAL, PERCENTAGE_OF_COL_GROUP, PERCENTAGE_OF_GRANDTOTAL, PERCENTAGE_OF_GROUP, PERCENTAGE_OF_ROW_GRANDTOTAL, PERCENTAGE_OF_ROW_GROUP, POPULATIONSTANDARDDEVIATION_FORMULA, POPULATIONVARIANCE_FORMULA, PRODUCT_FORMULA, PTHPERCENTILE_FORMULA, QUARTER_DATE_GROUP, QUARTER_OF_YEAR_DATE_GROUP, RIGHT_JOIN, SECOND_DATE_GROUP, SET_FORMULA, SORT_ASC, SORT_DESC, SORT_NONE, SORT_ORIGINAL, SORT_SPECIFIC, SORT_VALUE_ASC, SORT_VALUE_DESC, STANDARDDEVIATION_FORMULA, SUB_QUERY_PARAM, SUM_FORMULA, SUMSQ_FORMULA, SUMWT_FORMULA, VARIANCE_FORMULA, WEEK_DATE_GROUP, WEEK_OF_MONTH_DATE_GROUP, WEEK_OF_YEAR_DATE_GROUP, WEIGHTEDAVERAGE_FORMULA, YEAR_DATE_GROUP
 
Constructor Summary
StyleFont(Font font)
          Create a StyleFont from a font.
StyleFont(String name, int style, int size)
          Creates a new font with the specified name, style and point size.
StyleFont(String name, int style, int size, int linestyle)
          Creates a new font with the specified name, style and point size.
StyleFont(String name, int style, int size, int underline, int strikeline)
          Creates a new font with the specified name, style and point size.
 
Method Summary
 Object clone()
          Make a copy of this font.
static Font decode(String val)
          Gets the specified font using the name passed in.
static int decodeLineStyle(String val)
          Return the line style constant for the line style name.
 boolean equals(Object obj)
          Compare if the font object describes the same font.
static String getDisplayText(Font font)
          Get display text.
 int getLineStyle()
          Deprecated. Use getUnderlineStyle or getStrikelineStyle instead.
 int getStrikelineStyle()
          Get the line style used for underline.
 int getStyle()
          Get the style of the font.
 int getUnderlineStyle()
          Get the line style used for underline.
 void setStyle(int style)
          Set the style of the font.
static String toString(Font font)
          Convert a font object to its string representation.
 
Methods inherited from class java.awt.Font
canDisplay, canDisplay, canDisplayUpTo, canDisplayUpTo, canDisplayUpTo, createFont, createFont, createGlyphVector, createGlyphVector, createGlyphVector, createGlyphVector, deriveFont, deriveFont, deriveFont, deriveFont, deriveFont, deriveFont, finalize, getAttributes, getAvailableAttributes, getBaselineFor, getFamily, getFamily, getFont, getFont, getFont, getFontName, getFontName, getItalicAngle, getLineMetrics, getLineMetrics, getLineMetrics, getLineMetrics, getMaxCharBounds, getMissingGlyphCode, getName, getNumGlyphs, getPeer, getPSName, getSize, getSize2D, getStringBounds, getStringBounds, getStringBounds, getStringBounds, getTransform, hashCode, hasLayoutAttributes, hasUniformLineMetrics, isBold, isItalic, isPlain, isTransformed, layoutGlyphVector, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

AWT_FONT_MASK

public static final int AWT_FONT_MASK
Bit mask to get the AWT font style.

See Also:
Constant Field Values

STYLE_FONT_MASK

public static final int STYLE_FONT_MASK
Bit mask to get the StyleFont extended style.

See Also:
Constant Field Values

UNDERLINE

public static final int UNDERLINE
Underline font style. An optional line style can be specified.

See Also:
Constant Field Values

STRIKETHROUGH

public static final int STRIKETHROUGH
Strikethrough font style. An optional line style can be specified.

See Also:
Constant Field Values

SUPERSCRIPT

public static final int SUPERSCRIPT
Superscript font style. Draw string at upper corner in small font.

See Also:
Constant Field Values

SUBSCRIPT

public static final int SUBSCRIPT
Subscript font style. Draw string at lower corner in small font.

See Also:
Constant Field Values

SHADOW

public static final int SHADOW
Shadow font style.

See Also:
Constant Field Values

SMALLCAPS

public static final int SMALLCAPS
Small caps font style draw lower case characters in a smaller capital letter.

See Also:
Constant Field Values

ALLCAPS

public static final int ALLCAPS
All caps font style draw all characters in upper case.

See Also:
Constant Field Values
Constructor Detail

StyleFont

public StyleFont(String name,
                 int style,
                 int size)
Creates a new font with the specified name, style and point size.

Parameters:
name - the font name
style - the constant style used
size - the point size of the font

StyleFont

public StyleFont(String name,
                 int style,
                 int size,
                 int linestyle)
Creates a new font with the specified name, style and point size. The line style specifies the line used in UNDERLINE and STRIKETHROUGH styles. It defaults to THIN_LINE.

Parameters:
name - the font name
style - the constant style used
size - the point size of the font
linestyle - line styles defined in StyleConstants.

StyleFont

public StyleFont(String name,
                 int style,
                 int size,
                 int underline,
                 int strikeline)
Creates a new font with the specified name, style and point size. The line style specifies the line used in UNDERLINE and STRIKETHROUGH styles. It defaults to THIN_LINE.

Parameters:
name - the font name
style - the constant style used
size - the point size of the font
underline - line styles defined in StyleConstants.
strikeline - line styles defined in StyleConstants.

StyleFont

public StyleFont(Font font)
Create a StyleFont from a font.

Method Detail

getStyle

public int getStyle()
Get the style of the font.

Overrides:
getStyle in class Font

setStyle

public void setStyle(int style)
Set the style of the font.

Parameters:
style - the specified font style.

getLineStyle

public int getLineStyle()
Deprecated. Use getUnderlineStyle or getStrikelineStyle instead.

Get the line style used for underline.


getUnderlineStyle

public int getUnderlineStyle()
Get the line style used for underline.


getStrikelineStyle

public int getStrikelineStyle()
Get the line style used for underline.


decode

public static Font decode(String val)
Gets the specified font using the name passed in.

Parameters:
val - the font name
Returns:
font.

toString

public static String toString(Font font)
Convert a font object to its string representation.

Parameters:
font - font object.
Returns:
string representation, which can be converted back to a font by using the decode() method.

decodeLineStyle

public static int decodeLineStyle(String val)
Return the line style constant for the line style name.


equals

public boolean equals(Object obj)
Compare if the font object describes the same font.

Overrides:
equals in class Font
Returns:
true if the two fonts are equivalent.

clone

public Object clone()
Make a copy of this font.

Overrides:
clone in class Object

getDisplayText

public static String getDisplayText(Font font)
Get display text.

Returns:
the text of the label display.

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.