| java.lang.Object java.util.Observable jimm.datavision.field.Format
Format | public class Format extends Observable implements Writeable,Cloneable(Code) | | A format describes how to display a field. It specifies font family name,
size, attributes (bold, italic, underline, wrap), alignment, and print
format.
If a field's value is null , then the getter returns the value
of the report's default field's format (which will never be
null .
author: Jim Menard, jimm@io.com |
Constructor Summary | |
| Format() Constructor. |
ALIGN_CENTER | final public static int ALIGN_CENTER(Code) | | Used to specify center alignment.
|
ALIGN_LEFT | final public static int ALIGN_LEFT(Code) | | Used to specify left alignment.
|
ALIGN_RIGHT | final public static int ALIGN_RIGHT(Code) | | Used to specify right alignment.
|
DEFAULT_COLOR | final protected static Color DEFAULT_COLOR(Code) | | |
DEFAULT_FONT_FAMILY_NAME | final protected static String DEFAULT_FONT_FAMILY_NAME(Code) | | |
DEFAULT_SIZE | final protected static int DEFAULT_SIZE(Code) | | |
Format | Format()(Code) | | Constructor. Creates an empty format.
|
alignFromString | public static int alignFromString(String s)(Code) | | Returns an ALIGN_* constant, given one of "left",
"center", or "right". If the specified string is null or is not one
of these values, ALIGN_LEFT is returned.
Parameters: s - the string "left", "center", or "right" (case is notsignificant) one of ALIGN_LEFT , ALIGN_CENTER ,or ALIGN_RIGHT |
alignToString | public static String alignToString(int align)(Code) | | Given an ALIGN_* constant, return the string used
to represent that value in a report XML file. If align is not
one of those values, returns "left".
Parameters: align - one of "left", "center", or "right" |
clearFontCache | public void clearFontCache()(Code) | | Clears the font we may be holding on to.
|
clone | public Object clone()(Code) | | Returns a clone of this format.
|
createDefaultFormat | public static Format createDefaultFormat()(Code) | | |
createEmptyFormat | public static Format createEmptyFormat()(Code) | | |
fillClonedField | protected void fillClonedField(Format f)(Code) | | |
getAlign | public int getAlign()(Code) | | Returns the alignment.
one of the ALIGN_* values |
getColor | public Color getColor()(Code) | | Returns the color for this format.
the color |
getDefaultFormat | public Format getDefaultFormat()(Code) | | Returns this field's report's default field's format (*whew*).
|
getFont | public Font getFont()(Code) | | Based on our font family name, alignment flags, and size, return a
font. Never returns null .
a font; never null |
getFontFamilyName | public String getFontFamilyName()(Code) | | Returns the font family name for this format.
the font family name |
getFormat | public String getFormat()(Code) | | Returns the format string for this field. May return null .
the format string, possibly null |
getSize | public double getSize()(Code) | | Returns the size for this format.
the size |
hashCode | public int hashCode()(Code) | | |
isBold | public boolean isBold()(Code) | | Returns the bold state.
the bold state |
isItalic | public boolean isItalic()(Code) | | Returns the italic state.
the italic state |
isUnderline | public boolean isUnderline()(Code) | | Returns the underline state.
the underline state |
isWrap | public boolean isWrap()(Code) | | Returns the wrap state.
the wrap state |
setAlign | public void setAlign(int newAlign)(Code) | | Sets the alignment.
Parameters: newAlign - one of the ALIGN_* values |
setBold | public void setBold(boolean newBold)(Code) | | Sets the bold state.
Parameters: newBold - the new value |
setColor | public void setColor(Color newColor)(Code) | | Sets the color
Parameters: newColor - the new color |
setField | void setField(Field f)(Code) | | Normally you don't need to call this, because
Field.setFormat calls this.
Parameters: f - a field |
setFontFamilyName | public void setFontFamilyName(String newFontFamilyName)(Code) | | Sets the font family name
Parameters: newFontFamilyName - the new font family name |
setFormat | public void setFormat(String newFormat)(Code) | | Sets the format string.
Parameters: newFormat - the new format string |
setItalic | public void setItalic(boolean newItalic)(Code) | | Sets the italic state.
Parameters: newItalic - the new value |
setSize | public void setSize(double newSize)(Code) | | Sets the size
Parameters: newSize - the new size |
setUnderline | public void setUnderline(boolean newUnderline)(Code) | | Sets the underline state.
Parameters: newUnderline - the new underline state |
setWrap | public void setWrap(boolean newWrap)(Code) | | Sets the wrap state.
Parameters: newWrap - the new wrap state |
toString | public String toString()(Code) | | Returns a string representation of this format. Mainly used for
debugging.
pretty string, inn't it? |
writeXML | public void writeXML(XMLWriter out)(Code) | | Writes this format as an XML tag. Only writes the differences between this
format and the default one.
Parameters: out - a writer that knows how to write XML |
|
|