|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graphics.FormatPool
The FormatPool is the facility that takes over the work of
pooling the different types of formats the graphics framework
provides. Pooling the formats is necessary because these formats are
frequently used objects. The actually pooled types of formats are listed
below:
StrokeFormatPaintFormatFontFormatMarkerFormat
| Method Summary | |
static void |
changeFontFormat(FontFormat format,
int size,
int weight,
java.lang.String family,
int color,
boolean italic,
boolean underline,
boolean strikethrough)
Changes the FontFormat given by format to the
values given by size, weight,
family, color, italic,
underline and strikethrough.
|
static void |
changeFontFormat(FontFormat format,
int size,
int weight,
java.lang.String family,
int color,
boolean italic,
boolean underline,
boolean strikethrough,
StrokeFormat strokeUnderline,
StrokeFormat strokeStrikethrough)
Changes the FontFormat given by format to the
values given by size, weight,
family, color, italic,
underline and strikethrough.
|
static void |
changePaintFormat(PaintFormat format,
int style,
int colorback,
int colorfore,
int gradienttype,
int patterntype,
java.lang.String texturerasterkey,
int transparency,
boolean transparent)
Changes the PaintFormat given by format to
the values given by style,colorfore,
colorback,gradienttype,
patterntype,texturerasterkey,
transparency and transparent.
|
static void |
changeStrokeFormat(StrokeFormat format,
int style,
int weight,
int color)
Changes the StrokeFormat given by format to the
values given by style, weight and
color.
|
static void |
changeStrokeFormat(StrokeFormat format,
int style,
int weight,
int color,
double[] pattern)
Changes the StrokeFormat given by format to the
values given by style, weight and
color.
|
static void |
clear()
Clears all format pools. |
static void |
clearFontFormatPool()
Clears the pool for the FontFormats. |
static void |
clearMarkerFormatPool()
Clears the pool for the MarkerFormats. |
static void |
clearPaintFormatPool()
Clears the pool for the PaintFormats. |
static void |
clearStrokeFormatPool()
Clears the pool for the StrokeFormats. |
static void |
dump(java.io.PrintStream s)
Dumps the FormatPool to the PrintStream given
by s. |
static java.util.Map |
getFontFormatPool()
Returns the Map used to pool FontFormats. |
static java.util.Map |
getMarkerFormatPool()
Returns the Map used to pool MarkerFormats. |
static java.util.Map |
getPaintFormatPool()
Returns the Map used to pool PaintFormats. |
static java.util.Map |
getStrokeFormatPool()
Returns the Map used to pool StrokeFormats. |
static FontFormat |
parseFontFormat(int size,
int weight,
java.lang.String family,
int color,
boolean italic,
boolean underline,
boolean strikethrough)
Parses the given font format and returns an instance of a FontFormat. |
static FontFormat |
parseFontFormat(int size,
int weight,
java.lang.String family,
int color,
boolean italic,
boolean underline,
boolean strikethrough,
StrokeFormat underlineStroke,
StrokeFormat strikethroughStroke)
Parses the given font format and returns an instance of a FontFormat. |
static FontFormat |
parseFontFormat(java.lang.String description)
Parses the given font format description and returns an instance of a FontFormat. |
static MarkerFormat |
parseMarkerFormat(java.lang.String description)
Parses the given marker format description and returns an
instance of a MarkerFormat. |
static PaintFormat |
parsePaintFormat(java.lang.String description)
Parses the given paint format description and returns an
instance of a PaintFormat. |
static StrokeFormat |
parseStrokeFormat(java.lang.String description)
Parses the given stroke format description and returns an
instance of a StrokeFormat. |
static int |
size()
Returns the accumulated sizes of all the internal pools. |
static int |
sizeOfFontFormatPool()
Returns the size of the FontFormat pool. |
static int |
sizeOfMarkerFormatPool()
Returns the size of the MarkerFormat pool. |
static int |
sizeOfPaintFormatPool()
Returns the size of the PaintFormat pool. |
static int |
sizeOfStrokeFormatPool()
Returns the size of the StrokeFormat pool. |
static void |
useThreadLocal()
A call to this method configures the FormatPool to make use
of the ThreadLocal class hence a pool is created for each
Thread the FormatPool is used by.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static final void useThreadLocal()
FormatPool to make use
of the ThreadLocal class hence a pool is created for each
Thread the FormatPool is used by.
FormatPool is in use by any Thread.
ThreadLocal
public static final StrokeFormat parseStrokeFormat(java.lang.String description)
throws StrokeFormatParseException
description and returns an
instance of a StrokeFormat. The instance is pooled if
necessary. If the given stroke format description is not
valid a StrokeFormatParseException is thrown.
description - of the stroke format
StrokeFormat
StrokeFormatParseException - if the stroke format description is
not valid
public static final PaintFormat parsePaintFormat(java.lang.String description)
throws PaintFormatParseException
description and returns an
instance of a PaintFormat. The instance is pooled if
necessary. If the given paint format description is not
valid a PaintFormatParseException is thrown.
description - of the paint format
PaintFormat
PaintFormatParseException - if the paint format description is not
valid
public static final FontFormat parseFontFormat(int size,
int weight,
java.lang.String family,
int color,
boolean italic,
boolean underline,
boolean strikethrough)
FontFormat. The instance is pooled if
necessary.
size - the value for the size of the fontweight - the value for the weight of the fontfamily - the value for the family of the fontcolor - the value for the color of the fontitalic - the flag that indicates an italic fontunderline - the flag that indicates an underlined fontstrikethrough - the flag that indicates a strikethrough font
FontFormat.
public static final FontFormat parseFontFormat(int size,
int weight,
java.lang.String family,
int color,
boolean italic,
boolean underline,
boolean strikethrough,
StrokeFormat underlineStroke,
StrokeFormat strikethroughStroke)
FontFormat. The instance is pooled if
necessary.
size - the value for the size of the fontweight - the value for the weight of the fontfamily - the value for the family of the fontcolor - the value for the color of the fontitalic - the flag that indicates an italic fontunderline - the flag that indicates an underlined fontstrikethrough - the flag that indicates a strikethrough fontunderlineStroke - the stroke to use for the underlinestrikethroughStroke - the stroke to use for the strikethrough
FontFormat.
public static final FontFormat parseFontFormat(java.lang.String description)
throws FontFormatParseException
FontFormat. The instance is pooled if
necessary. If the given font format description is not valid,
a FontFormatParseException is thrown. The
String "family=Arial, size=50, weight=400, color=-16777216,
italic=false, underline=false, strikethrough=false" is an example for a
valid canonical description.
description - of the font format
FontFormat
FontFormatParseException - if the font format description is not
valid
public static final MarkerFormat parseMarkerFormat(java.lang.String description)
throws MarkerFormatParseException
description and returns an
instance of a MarkerFormat. The instance is pooled if
necessary. If the given marker format description is not
valid a MarkerFormatParseException is thrown.
description - of the marker format
MarkerFormat
MarkerFormatParseException - if the marker format description is
not valid
public static final void changeStrokeFormat(StrokeFormat format,
int style,
int weight,
int color)
StrokeFormat given by format to the
values given by style, weight and
color.
format - the StrokeFormat to changestyle - the new style for the StrokeFormatweight - the new weight for the StrokeFormatcolor - then new color for the StrokeFormat
public static final void changeStrokeFormat(StrokeFormat format,
int style,
int weight,
int color,
double[] pattern)
StrokeFormat given by format to the
values given by style, weight and
color.
format - the StrokeFormat to changestyle - the new style for the StrokeFormatweight - the new weight for the StrokeFormatcolor - the new color for the StrokeFormatpattern - the custom pattern for this StrokeFormat
public static final void changePaintFormat(PaintFormat format,
int style,
int colorback,
int colorfore,
int gradienttype,
int patterntype,
java.lang.String texturerasterkey,
int transparency,
boolean transparent)
PaintFormat given by format to
the values given by style,colorfore,
colorback,gradienttype,
patterntype,texturerasterkey,
transparency and transparent.
format - the PaintFormat to changestyle - the new style for the PaintFormatcolorback - the new background color for the
PaintFormatcolorfore - the new foreground color for the
PaintFormatgradienttype - the new gradienttype for the PaintFormatpatterntype - the new patterntype for the PaintFormattexturerasterkey - the new texture for the PaintFormattransparency - the new tranparency level for the
PaintFormattransparent - the new value for the transparency flag of the
PaintFormat
public static final void changeFontFormat(FontFormat format,
int size,
int weight,
java.lang.String family,
int color,
boolean italic,
boolean underline,
boolean strikethrough)
FontFormat given by format to the
values given by size, weight,
family, color, italic,
underline and strikethrough.
format - the FontFormat to changesize - the new size for the FontFormatweight - the new weight for the FontFormatfamily - the new family for the FontFormatcolor - the new color for the FontFormatitalic - the new value for the italic flag of the
FontFormatunderline - the new value for the underline flag of the
FontFormatstrikethrough - the new value for the strikethrough flag of the
FontFormat
public static final void changeFontFormat(FontFormat format,
int size,
int weight,
java.lang.String family,
int color,
boolean italic,
boolean underline,
boolean strikethrough,
StrokeFormat strokeUnderline,
StrokeFormat strokeStrikethrough)
FontFormat given by format to the
values given by size, weight,
family, color, italic,
underline and strikethrough.
format - the FontFormat to changesize - the new size for the FontFormatweight - the new weight for the FontFormatfamily - the new family for the FontFormatcolor - the new color for the FontFormatitalic - the new value for the italic flag of the
FontFormatunderline - the new value for the underline flag of the
FontFormatstrikethrough - the new value for the strikethrough flag of the
FontFormatstrokeUnderline - The StrokeFormat to use for the
underline font decoration.strokeStrikethrough - The StrokeFormat to use for the
strikethrough font decoration.public static final java.util.Map getStrokeFormatPool()
StrokeFormats.
StrokeFormats.public static final java.util.Map getPaintFormatPool()
PaintFormats.
PaintFormats.public static final java.util.Map getFontFormatPool()
FontFormats.
FontFormats.public static final java.util.Map getMarkerFormatPool()
MarkerFormats.
MarkerFormatspublic static final int sizeOfStrokeFormatPool()
StrokeFormat pool.
StrokeFormatspublic static final int sizeOfPaintFormatPool()
PaintFormat pool.
PaintFormatspublic static final int sizeOfFontFormatPool()
FontFormat pool.
FontFormatspublic static final int sizeOfMarkerFormatPool()
MarkerFormat pool.
MarkerFormatspublic static final void clearStrokeFormatPool()
StrokeFormats.
public static final void clearPaintFormatPool()
PaintFormats.
public static final void clearFontFormatPool()
FontFormats.
public static final void clearMarkerFormatPool()
MarkerFormats.
public static final void clear()
public static final int size()
public static final void dump(java.io.PrintStream s)
FormatPool to the PrintStream given
by s.
s - the PrintStream to dump the FormatPool
to
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||