gov.nih.nlm.mms.browser
Class BrowserState

java.lang.Object
  extended bygov.nih.nlm.mms.browser.BrowserState

public class BrowserState
extends Object

Data repository for historical information on past opened directories and viewed concepts.

Author:
Deborah Shapiro (dshapiro@apelon.com)

Constructor Summary
BrowserState()
          Constructor.
 
Method Summary
 void addDirectory(String dir, ConceptList cl)
          Adds a directory path to the history list of opened directories.
 void addProperties(Configurable f, Properties props)
           
static BrowserState getBrowserState()
          Returns the singleton reference to the BrowserState.
static BrowserState getBrowserState(File file)
          Returns the singleton reference to the BrowserState.
 ConceptList getConceptListForDirectory(String dir)
          Returns the ConceptList associated with the given directory.
 ConceptList getCurrentConceptList()
          Returns the list of viewed concepts in the currently opened directory.
 String getCurrentDirectory()
          Returns the current subset directory.
 String[] getDirectoryHistory()
          Returns the last five opened directories.
 Map getDirectoryToConceptListMap()
          Returns the map of directories to their ConceptLists.
 String getFontFamily()
          Returns the current font family.
 int getFontPointSize()
          Returns the current font point size.
 Properties getProperties(Configurable f)
           
static void save(File file)
          Saves the BrowserState to the given File.
 void setDirectoryHistory(String[] history)
          Resets the directory history to that given.
 void setDirectoryToConceptListMap(Map map)
          Resets the Map of directories to their ConceptLists.
 void setFontFamily(String font_family)
          Resets the font family to that given.
 void setFontPointSize(int font_point_size)
          Resets the font point size to that given.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrowserState

public BrowserState()
Constructor.

Method Detail

getBrowserState

public static BrowserState getBrowserState()
Returns the singleton reference to the BrowserState.

Returns:
the singleton reference to the BrowserState

getBrowserState

public static BrowserState getBrowserState(File file)
                                    throws Exception
Returns the singleton reference to the BrowserState.

Parameters:
file - where BrowserState was written
Returns:
the singleton reference to the BrowserState
Throws:
Exception

save

public static void save(File file)
                 throws Exception
Saves the BrowserState to the given File.

Parameters:
file - File
Throws:
Exception

getDirectoryHistory

public String[] getDirectoryHistory()
Returns the last five opened directories.

Returns:
String[] of directory paths

setDirectoryHistory

public void setDirectoryHistory(String[] history)
Resets the directory history to that given.

Parameters:
history - String[]

getDirectoryToConceptListMap

public Map getDirectoryToConceptListMap()
Returns the map of directories to their ConceptLists.

Returns:
Map

setDirectoryToConceptListMap

public void setDirectoryToConceptListMap(Map map)
Resets the Map of directories to their ConceptLists.

Parameters:
map - Map

getConceptListForDirectory

public ConceptList getConceptListForDirectory(String dir)
Returns the ConceptList associated with the given directory.

Parameters:
dir - subset directory of interest
Returns:
associated ConceptList

getCurrentDirectory

public String getCurrentDirectory()
Returns the current subset directory.

Returns:
String path to subset directory

getCurrentConceptList

public ConceptList getCurrentConceptList()
Returns the list of viewed concepts in the currently opened directory.

Returns:
Concept[] list of concepts

addDirectory

public void addDirectory(String dir,
                         ConceptList cl)
Adds a directory path to the history list of opened directories.

Parameters:
dir - String
cl - ConceptList

getFontPointSize

public int getFontPointSize()
Returns the current font point size.

Returns:
int font point size

setFontPointSize

public void setFontPointSize(int font_point_size)
Resets the font point size to that given.

Parameters:
font_point_size - int

getFontFamily

public String getFontFamily()
Returns the current font family.

Returns:
String font family

setFontFamily

public void setFontFamily(String font_family)
Resets the font family to that given.

Parameters:
font_family - String

addProperties

public void addProperties(Configurable f,
                          Properties props)

getProperties

public Properties getProperties(Configurable f)


Copyright ©2005