org.formaria.editor.project.style
Class EditorStyleManager

java.lang.Object
  extended by org.formaria.aria.style.StyleManager
      extended by org.formaria.editor.project.style.EditorStyleManager

public class EditorStyleManager
extends StyleManager

A subclass of the StyleManager intended to allow saving of styles on behalf of the editor-ide

Copyright (c) Formaria Ltd., 1998-2003


Field Summary
 
Fields inherited from class org.formaria.aria.style.StyleManager
baseStyle, currentProject, fontCache, fontMap, mergedStyles, styles, uiManagerAttributes
 
Constructor Summary
EditorStyleManager(Project project, int styleCount)
           
 
Method Summary
protected  void addChildStyles(XmlElement eleRoot, java.lang.String[] styleNames, int start)
          Add/derive a refinement of a style
protected  void addColorElement(XmlElement ele, Style xstyle, java.lang.String styleEleName, int index, Style parent)
          Add an element that represents a colour to the style hierarchy
protected  void addFontStyles(XmlElement ele, Style xstyle, Style parent)
           
protected  void addIntElement(XmlElement ele, Style xstyle, java.lang.String styleEleName, int index, Style parent)
           
protected  XmlElement addStyle(XmlElement eleRoot, java.lang.String fullName, java.lang.String newName, Style parent)
           
protected  java.lang.String formatColor(int portion)
           
static StyleManager getInstance()
          Deprecated. use EditorProjectManager.getStyleManager() instead
 java.lang.String[] getStylesArray()
          Get an array of style names
 void load(java.lang.String file)
          Load the styles from the specified file
 void removeAll()
           
 void removeStyle(java.lang.String name)
           
 void saveStyles(java.lang.String filename)
          Save the styles to the specified file
 void setupSynthStyles()
          Try to add the default styles for the Synth LAF
 
Methods inherited from class org.formaria.aria.style.StyleManager
addStyle, getFont, getFont, getStyle, getStyle, getStyleParent, getStyles, hasStyle, loadStyle, mapUiMgrAttribute, reset, setFontMap, setUiMgrAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditorStyleManager

public EditorStyleManager(Project project,
                          int styleCount)
Method Detail

getInstance

public static StyleManager getInstance()
Deprecated. use EditorProjectManager.getStyleManager() instead

Create the instance. This class now delegates to the project manager.


load

public void load(java.lang.String file)
Load the styles from the specified file

Overrides:
load in class StyleManager
Parameters:
file - the file name of the file to load

saveStyles

public void saveStyles(java.lang.String filename)
Save the styles to the specified file

Parameters:
filename -

addChildStyles

protected void addChildStyles(XmlElement eleRoot,
                              java.lang.String[] styleNames,
                              int start)
Add/derive a refinement of a style

Parameters:
eleRoot -
styleNames -
start -

addStyle

protected XmlElement addStyle(XmlElement eleRoot,
                              java.lang.String fullName,
                              java.lang.String newName,
                              Style parent)

addColorElement

protected void addColorElement(XmlElement ele,
                               Style xstyle,
                               java.lang.String styleEleName,
                               int index,
                               Style parent)
Add an element that represents a colour to the style hierarchy

Parameters:
ele - the source element
xstyle - the style
styleEleName -
index -
parent -

formatColor

protected java.lang.String formatColor(int portion)

addFontStyles

protected void addFontStyles(XmlElement ele,
                             Style xstyle,
                             Style parent)

addIntElement

protected void addIntElement(XmlElement ele,
                             Style xstyle,
                             java.lang.String styleEleName,
                             int index,
                             Style parent)

getStylesArray

public java.lang.String[] getStylesArray()
Get an array of style names

Returns:

removeStyle

public void removeStyle(java.lang.String name)

removeAll

public void removeAll()

setupSynthStyles

public void setupSynthStyles()
Try to add the default styles for the Synth LAF