|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.xui.style.XStyleManager
public class XStyleManager
Class for managing XStyles. XStyles are created externally and added to the hashtable. Also handles the retrieval of styles.
Copyright (c) Xoetrope Ltd., 1998-2004
$Revision: 2.7 $
| Field Summary | |
|---|---|
protected static XStyle |
baseStyle
The base style from which all others will be inherited |
protected XProject |
currentProject
The XProject for which this instance of the XStyleManager is working |
protected java.util.Hashtable |
fontCache
Fonts found when creating styles |
protected java.util.Hashtable |
fontMap
Mapping of font attributes |
protected java.util.Hashtable |
mergedStyles
Used to merge child styles with their parents |
protected java.util.Hashtable |
styles
Hashtable of project styles |
| Constructor Summary | |
|---|---|
XStyleManager(XProject project)
Construct a new style manager. |
|
XStyleManager(XProject project,
int styleCount)
Construct a new style manager with an initial size. |
|
| Method Summary | |
|---|---|
void |
addStyle(java.lang.String name,
XStyle newStyle)
Add a new XStyle to the hashtable with a unique name |
java.awt.Font |
getFont(java.lang.String style)
Get the font for a given style. |
java.awt.Font |
getFont(XStyle style)
Get the font for a given style. |
XStyle |
getStyle(java.lang.String name)
Retrieve a named XStyle from the hashtable. loop thru the "/" character and merge each one found with a new XStyle. |
XStyle |
getStyle(java.lang.String name,
boolean create)
Retrieve a named XStyle from the hashtable. loop thru the "/" character and merge each one found with a new XStyle. |
XStyle |
getStyleParent(java.lang.String name)
Get the parent of the named style |
java.util.Hashtable |
getStyles()
Get the table of styles |
boolean |
hasStyle(java.lang.String styleName)
Check if a style is available, either already processed, or named somewhere in the raw styles file. |
void |
load(java.lang.String file)
Load the styles from the specified file |
void |
loadXStyle(XmlElement element,
java.lang.String path)
Load a style from the XML element and save it to the specified path in the style hierarchy |
void |
reset()
reset the styles in case a new stylesheet is to be loaded. |
void |
setFontMap(java.util.Hashtable fontMaps)
Setup the font mapping for |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Hashtable styles
protected java.util.Hashtable mergedStyles
protected java.util.Hashtable fontCache
protected static XStyle baseStyle
protected XProject currentProject
protected java.util.Hashtable fontMap
| Constructor Detail |
|---|
public XStyleManager(XProject project)
project - the owner project
public XStyleManager(XProject project,
int styleCount)
styleCount - The number of initial styles in the styles Hashtable| Method Detail |
|---|
public void addStyle(java.lang.String name,
XStyle newStyle)
name - The name of the stylenewStyle - The XStyle to be associated with the passed name
public XStyle getStyle(java.lang.String name,
boolean create)
name - The name of the style.create - booean to indicate whether the style should be created.
public boolean hasStyle(java.lang.String styleName)
styleName - the name of the style
public XStyle getStyle(java.lang.String name)
name - The name of the style.
public java.awt.Font getFont(java.lang.String style)
style - the name of the style
public java.awt.Font getFont(XStyle style)
style - the style
public void setFontMap(java.util.Hashtable fontMaps)
fontMaps - the font mappings (face and size or just face to face)public void load(java.lang.String file)
file - the file name of the file to load
public void loadXStyle(XmlElement element,
java.lang.String path)
element - the source elementpath - the save pathpublic java.util.Hashtable getStyles()
public XStyle getStyleParent(java.lang.String name)
name - the style name
public void reset()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||