|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmars.util.EditorFont
public class EditorFont
Specialized Font class designed to be used by both the settings menu methods and the Settings class.
Field Summary | |
---|---|
static int |
DEFAULT_SIZE
|
static int |
DEFAULT_STYLE_INT
|
static String |
DEFAULT_STYLE_STRING
|
static int |
MAX_SIZE
|
static int |
MIN_SIZE
|
Constructor Summary | |
---|---|
EditorFont()
|
Method Summary | |
---|---|
static Font |
createFontFromStringValues(String family,
String style,
String size)
Creates a new Font object based on the given String specifications. |
static String[] |
getAllFamilies()
Obtain an array of all available font family names. |
static String[] |
getCommonFamilies()
Obtain an array of common font family names. |
static String[] |
getFontStyleStrings()
Get array containing String values for font style names. |
static String |
sizeIntToSizeString(int size)
Given an int representing font size, returns corresponding string. |
static int |
sizeStringToSizeInt(String size)
Given a String representing font size, returns corresponding int. |
static String |
styleIntToStyleString(int style)
Given an int that represents a font style from the Font class, returns the corresponding String. |
static int |
styleStringToStyleInt(String style)
Given a string that represents a font style, returns the corresponding final int defined in Font: PLAIN, BOLD, ITALIC. |
static String |
substituteSpacesForTabs(String string)
|
static String |
substituteSpacesForTabs(String string,
int tabSize)
Handy utility to produce a string that substitutes spaces for all tab characters in the given string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_STYLE_STRING
public static final int DEFAULT_STYLE_INT
public static final int MIN_SIZE
public static final int MAX_SIZE
public static final int DEFAULT_SIZE
Constructor Detail |
---|
public EditorFont()
Method Detail |
---|
public static String[] getCommonFamilies()
public static String[] getAllFamilies()
public static String[] getFontStyleStrings()
public static int styleStringToStyleInt(String style)
style
- String representing the font style name
public static String styleIntToStyleString(int style)
style
- Must be one of Font.PLAIN, Font.BOLD, Font.ITALIC.
public static String sizeIntToSizeString(int size)
size
- Int representing size.
public static int sizeStringToSizeInt(String size)
size
- String representing size.
public static Font createFontFromStringValues(String family, String style, String size)
family
- String containing font family.style
- String containing font style. A list of available styles can
be obtained from getFontStyleStrings(). The default of styleStringToStyleInt()
is substituted if necessary.size
- String containing font size. The defaults and limits of
sizeStringToSizeInt() are substituted if necessary.public static String substituteSpacesForTabs(String string)
public static String substituteSpacesForTabs(String string, int tabSize)
string
- The original stringtabSize
- The number of spaces each tab character represents
NullPointerException
- if string is null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |