Class DisplaySchemesProcessor

java.lang.Object
jspecview.application.DisplaySchemesProcessor

public class DisplaySchemesProcessor extends Object
DisplaySchemesProcessor loads and saves the display schemes of Jspecview. The Schemes are loaded from an XML file and saved in a TreeMap. Also saves the schemes out to XML file after modification
Author:
Debbie-Ann Facey, Khari A. Bryan, Prof Robert J. Lancashire
  • Constructor Details

    • DisplaySchemesProcessor

      public DisplaySchemesProcessor()
      Initialises the DisplaySchemesProcessor
  • Method Details

    • loadDefault

      public ColorParameters loadDefault()
      Load a default DisplayScheme if xml file not found
      Returns:
      boolean
    • getDefaultScheme

      public ColorParameters getDefaultScheme()
    • store

      public void store() throws Exception
      Saves the display schemes to file in XML format
      Throws:
      Exception
    • getDisplaySchemes

      public TreeMap<String,ColorParameters> getDisplaySchemes()
      Returns the list of DisplaySchemes that were loaded
      Returns:
      the list of DisplaySchemes that were loaded
    • load

      public boolean load(InputStream stream)
    • load

      public boolean load(String dispSchemeFileName)
      Loads the display schemes into memory and stores them in a Vector
      Parameters:
      dispSchemeFileName - the name of the file to load
      Returns:
      true if loaded successfully
    • load

      public boolean load(BufferedReader br) throws Exception
      Loads the display schemes into memory and stores them in a Vector
      Parameters:
      br -
      Returns:
      true if loaded successfully
      Throws:
      Exception
    • serializeDisplaySchemes

      public void serializeDisplaySchemes(Writer writer) throws Exception
      Serializes the display schemes to the given writer
      Parameters:
      writer - the writer for the output
      Throws:
      Exception