|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Observable jimm.datavision.field.Format
public class Format
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
.
Field Summary | |
---|---|
protected java.lang.Integer |
align
|
static int |
ALIGN_CENTER
Used to specify center alignment. |
static int |
ALIGN_LEFT
Used to specify left alignment. |
static int |
ALIGN_RIGHT
Used to specify right alignment. |
protected java.lang.Boolean |
bold
|
protected java.awt.Color |
color
|
protected static java.awt.Color |
DEFAULT_COLOR
|
protected static java.lang.String |
DEFAULT_FONT_FAMILY_NAME
|
protected static int |
DEFAULT_SIZE
|
protected Field |
field
|
protected java.awt.Font |
font
|
protected java.lang.String |
fontFamilyName
|
protected java.lang.String |
format
|
protected java.lang.Boolean |
italic
|
protected java.lang.Double |
size
|
protected java.lang.Boolean |
underline
|
protected java.lang.Boolean |
wrap
|
Constructor Summary | |
---|---|
Format()
Constructor. |
Method Summary | |
---|---|
static int |
alignFromString(java.lang.String s)
Returns an ALIGN_* constant, given one of "left",
"center", or "right". |
static java.lang.String |
alignToString(int align)
Given an ALIGN_* constant, return the string used
to represent that value in a report XML file. |
void |
clearFontCache()
Clears the font we may be holding on to. |
java.lang.Object |
clone()
Returns a clone of this format. |
static Format |
createDefaultFormat()
|
static Format |
createEmptyFormat()
|
boolean |
equals(java.lang.Object obj)
|
protected void |
fillClonedField(Format f)
|
int |
getAlign()
Returns the alignment. |
java.awt.Color |
getColor()
Returns the color for this format. |
Format |
getDefaultFormat()
Returns this field's report's default field's format (*whew*). |
java.awt.Font |
getFont()
Based on our font family name, alignment flags, and size, return a font. |
java.lang.String |
getFontFamilyName()
Returns the font family name for this format. |
java.lang.String |
getFormat()
Returns the format string for this field. |
double |
getSize()
Returns the size for this format. |
int |
hashCode()
|
boolean |
isBold()
Returns the bold state. |
boolean |
isItalic()
Returns the italic state. |
boolean |
isUnderline()
Returns the underline state. |
boolean |
isWrap()
Returns the wrap state. |
void |
setAlign(int newAlign)
Sets the alignment. |
void |
setBold(boolean newBold)
Sets the bold state. |
void |
setColor(java.awt.Color newColor)
Sets the color |
(package private) void |
setField(Field f)
Normally you don't need to call this, because Field.setFormat(jimm.datavision.field.Format)
calls this. |
void |
setFontFamilyName(java.lang.String newFontFamilyName)
Sets the font family name |
void |
setFormat(java.lang.String newFormat)
Sets the format string. |
void |
setItalic(boolean newItalic)
Sets the italic state. |
void |
setSize(double newSize)
Sets the size |
void |
setUnderline(boolean newUnderline)
Sets the underline state. |
void |
setWrap(boolean newWrap)
Sets the wrap state. |
java.lang.String |
toString()
Returns a string representation of this format. |
void |
writeXML(XMLWriter out)
Writes this format as an XML tag. |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String DEFAULT_FONT_FAMILY_NAME
protected static final int DEFAULT_SIZE
protected static final java.awt.Color DEFAULT_COLOR
public static final int ALIGN_LEFT
public static final int ALIGN_CENTER
public static final int ALIGN_RIGHT
protected Field field
protected java.lang.String fontFamilyName
protected java.lang.Double size
protected java.lang.Boolean bold
protected java.lang.Boolean italic
protected java.lang.Boolean underline
protected java.lang.Boolean wrap
protected java.lang.Integer align
protected java.lang.String format
protected java.awt.Color color
protected java.awt.Font font
Constructor Detail |
---|
Format()
Method Detail |
---|
public static int alignFromString(java.lang.String s)
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.
s
- the string "left", "center", or "right" (case is not
significant)
ALIGN_LEFT
, ALIGN_CENTER
,
or ALIGN_RIGHT
public static java.lang.String alignToString(int align)
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".
align
- one of "left", "center", or "right"public static Format createEmptyFormat()
public static Format createDefaultFormat()
void setField(Field f)
Field.setFormat(jimm.datavision.field.Format)
calls this.
f
- a fieldpublic java.lang.Object clone()
clone
in class java.lang.Object
protected void fillClonedField(Format f)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public Format getDefaultFormat()
public java.lang.String getFontFamilyName()
public void setFontFamilyName(java.lang.String newFontFamilyName)
newFontFamilyName
- the new font family namepublic java.awt.Font getFont()
null
.
null
public void clearFontCache()
public double getSize()
public void setSize(double newSize)
newSize
- the new sizepublic boolean isBold()
public void setBold(boolean newBold)
newBold
- the new valuepublic boolean isItalic()
public void setItalic(boolean newItalic)
newItalic
- the new valuepublic boolean isUnderline()
public void setUnderline(boolean newUnderline)
newUnderline
- the new underline statepublic boolean isWrap()
public void setWrap(boolean newWrap)
newWrap
- the new wrap statepublic int getAlign()
ALIGN_*
valuespublic void setAlign(int newAlign)
newAlign
- one of the ALIGN_*
valuespublic java.lang.String getFormat()
null
.
null
public void setFormat(java.lang.String newFormat)
newFormat
- the new format stringpublic java.awt.Color getColor()
public void setColor(java.awt.Color newColor)
newColor
- the new colorpublic java.lang.String toString()
toString
in class java.lang.Object
public void writeXML(XMLWriter out)
writeXML
in interface Writeable
out
- a writer that knows how to write XML
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |