Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

edu.stanford.genetics.treeview
Class XmlConfig  view XmlConfig download XmlConfig.java

java.lang.Object
  extended byedu.stanford.genetics.treeview.XmlConfig

public class XmlConfig
extends java.lang.Object

This is a generic class for maintaining a configuration registry for documents. The root element is managed by this class, and configuration should be stored in children of the root. The class is actually implemented as wrapper around XMLElement that is associated with a file, and knows how to store itself.


Nested Class Summary
private  class XmlConfig.XmlConfigNode
           
 
Field Summary
private  boolean changed
           
private  java.lang.String file
           
private  XmlConfig.XmlConfigNode root
           
private  java.net.URL url
           
 
Constructor Summary
XmlConfig(java.lang.String xmlFile, java.lang.String tag)
          Construct new configuration information source
XmlConfig(java.net.URL xmlUrl, java.lang.String xmlText, java.lang.String tag)
          Construct new configuration information source
 
Method Summary
 ConfigNode getNode(java.lang.String name)
          returns node if it exists, otherwise makes a new one.
 java.awt.event.WindowListener getStoreOnWindowClose()
          Wherenever a settings panel which affects the xml config is closed, we want those changes to be saved.
static void main(java.lang.String[] args)
          Unit test, tries to load arg[0] as an xml file
private  XMLElement makeNewConfig(java.lang.String tag)
           
 void store()
          Store current configuration data structure in XML file
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

file

private java.lang.String file

url

private java.net.URL url

root

private XmlConfig.XmlConfigNode root

changed

private boolean changed
Constructor Detail

XmlConfig

public XmlConfig(java.lang.String xmlFile,
                 java.lang.String tag)
Construct new configuration information source


XmlConfig

public XmlConfig(java.net.URL xmlUrl,
                 java.lang.String xmlText,
                 java.lang.String tag)
Construct new configuration information source

Method Detail

makeNewConfig

private XMLElement makeNewConfig(java.lang.String tag)

getStoreOnWindowClose

public java.awt.event.WindowListener getStoreOnWindowClose()
Wherenever a settings panel which affects the xml config is closed, we want those changes to be saved. returns a WindowListener which will store the xml config every time a window it listens on is closed.


getNode

public ConfigNode getNode(java.lang.String name)
returns node if it exists, otherwise makes a new one.


store

public void store()
Store current configuration data structure in XML file


main

public static void main(java.lang.String[] args)
Unit test, tries to load arg[0] as an xml file


toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).