org.argouml.uml.ui
Class SaveGraphicsManager

java.lang.Object
  extended byorg.argouml.uml.ui.SaveGraphicsManager

public final class SaveGraphicsManager
extends Object

This class has some similar functions like PersistenceManager.

It centralizes all knowledge about the different graphical formats. This class is the only one that is supposed to know the complete list of supported graphics formats.


Field Summary
static ConfigurationKey KEY_DEFAULT_GRAPHICS_FILTER
          The configuration key for the preferred graphics format.
static ConfigurationKey KEY_GRAPHICS_RESOLUTION
          The configuration key for the export graphics resolution.
static ConfigurationKey KEY_SAVE_GRAPHICS_PATH
          The configuration key for the "save graphics" file location.
static ConfigurationKey KEY_SAVEALL_GRAPHICS_PATH
          The configuration key for the "save all graphics" file location.
 
Method Summary
 String fixExtension(String in)
           
 String getDefaultSuffix()
           
 SuffixFilter getFilterFromFileName(String name)
           
static SaveGraphicsManager getInstance()
           
 CmdSaveGraphics getSaveCommandBySuffix(String suffix)
           
 Collection getSettingsList()
           
 void register(SuffixFilter f)
          This function allows to add new filters.
 void setDefaultFilter(SuffixFilter f)
           
 void setDefaultFilterBySuffix(String suffix)
           
 void setFileChooserFilters(JFileChooser chooser, String defaultName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_DEFAULT_GRAPHICS_FILTER

public static final ConfigurationKey KEY_DEFAULT_GRAPHICS_FILTER
The configuration key for the preferred graphics format.


KEY_SAVE_GRAPHICS_PATH

public static final ConfigurationKey KEY_SAVE_GRAPHICS_PATH
The configuration key for the "save graphics" file location.


KEY_SAVEALL_GRAPHICS_PATH

public static final ConfigurationKey KEY_SAVEALL_GRAPHICS_PATH
The configuration key for the "save all graphics" file location.


KEY_GRAPHICS_RESOLUTION

public static final ConfigurationKey KEY_GRAPHICS_RESOLUTION
The configuration key for the export graphics resolution.

Method Detail

setDefaultFilterBySuffix

public void setDefaultFilterBySuffix(String suffix)
Parameters:
suffix - the extension of the new default file-format

setDefaultFilter

public void setDefaultFilter(SuffixFilter f)
Parameters:
f - the new default file-format

getInstance

public static SaveGraphicsManager getInstance()
Returns:
returns the singleton

register

public void register(SuffixFilter f)
This function allows to add new filters. This can be done e.g. by modules.

Parameters:
f - the filter

setFileChooserFilters

public void setFileChooserFilters(JFileChooser chooser,
                                  String defaultName)
Parameters:
chooser - the filechooser of which the filters will be set

getFilterFromFileName

public SuffixFilter getFilterFromFileName(String name)
Parameters:
name - the filename
Returns:
the filter

getDefaultSuffix

public String getDefaultSuffix()
Returns:
the extension of the default filter (just the text, not the ".")

fixExtension

public String fixExtension(String in)
Parameters:
in - the input file or path name which may or may not have a recognised extension
Returns:
the amended file or pathname, guaranteed to have a recognised extension

getSaveCommandBySuffix

public CmdSaveGraphics getSaveCommandBySuffix(String suffix)
Parameters:
suffix - the suffix (extension) of the filename, which corresponds to the graphics format to be used
Returns:
the command that will do the save

getSettingsList

public Collection getSettingsList()
Returns:
the complete collection of SuffixFilters, the first one is the default one


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook