net.sourceforge.nite.nstyle
Class JDomParser

java.lang.Object
  extended by net.sourceforge.nite.nstyle.JDomParser

public class JDomParser
extends java.lang.Object

A parser which produces a Swing component tree based on a JDOM XML document containing JDisplayObject elements. The general alogrithm for setting up the interface, based on the specification is as follows: Parse the Actions, putting the IDs of components as placeholders when they are referred to in an action Parse the DisplayObjects, putting the IDs of actions as placeholders Go through each of the actions , and replace the place holders with the actual display components which they refer to. Also replace actionID placeholders with the actions the refer to. Go through each of the display objects and replace the action placeholders with the actual actions. Also deal with cases where an output component value is prefixed by a '#' - this means that the data will be retrieved from the contents of an input component

Author:
Judy Robertson

Constructor Summary
JDomParser(NStyle n, Document original, Document spec, javax.swing.JDesktopPane desktopPane, Clock clock)
          Construct a JDomParser which will parse the specified XML document, contributing components to the specified Swing JDesktopPane.
 
Method Summary
 Element findElementForID(Element element, java.lang.String value)
          Finds the element in the source document with the unique ID field matching the value "value".
 NMetaData getMetadata()
          Returns the metadata.
 void parse()
          Parse the XML document, causing the appropriate components to be added to the top-level Swing container.
 void redisplayAll()
          Used to apply the stylesheet to data which has just changed so it can be re-displayed on the interface
 void setMetadata(NMetaData metadata)
          Sets the metadata.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDomParser

public JDomParser(NStyle n,
                  Document original,
                  Document spec,
                  javax.swing.JDesktopPane desktopPane,
                  Clock clock)
Construct a JDomParser which will parse the specified XML document, contributing components to the specified Swing JDesktopPane.

Parameters:
interfaceSpecDoc -
frame -
clock -
Method Detail

redisplayAll

public void redisplayAll()
Used to apply the stylesheet to data which has just changed so it can be re-displayed on the interface


parse

public void parse()
Parse the XML document, causing the appropriate components to be added to the top-level Swing container.


findElementForID

public Element findElementForID(Element element,
                                java.lang.String value)
Finds the element in the source document with the unique ID field matching the value "value".


getMetadata

public NMetaData getMetadata()
Returns the metadata.

Returns:
NiteMetaData

setMetadata

public void setMetadata(NMetaData metadata)
Sets the metadata.

Parameters:
metadata - The metadata to set