diva.sketch.recognition
Class SceneBuilder

java.lang.Object
  extended by diva.util.xml.AbstractXmlBuilder
      extended by diva.sketch.recognition.SceneBuilder
All Implemented Interfaces:
XmlBuilder

public class SceneBuilder
extends AbstractXmlBuilder

Builder class for scenes and scene elements and simple data. FIXME - more docs

Version:
$Revision: 1.4 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu)

Field Summary
static String BUILDER_DECLS
           
static String COMPOSITE_ELEMENT_TAG
          Indicates a scene element.
static String CONFIDENCE_TAG
          Indicates the confidence of a scene element.
static String NAME_TAG
          Indicates the name of scene element in a composite element.
static String POINTS_TAG
          Indicates the stroke path for a stroke element.
static String ROOT_NAME
          The name of the root element.
static String SCENE_TAG
          Indicates the file contains a scene.
static String STROKE_ELEMENT_TAG
          Indicates a stroke element.
static String TYPE_TAG
          Indicates the type of scene element.
 
Constructor Summary
SceneBuilder()
           
 
Method Summary
 Object build(XmlElement elt, String type)
          "scene" => return a scene database "compositeElement" => return a CompositeElement object "strokeElement" => return a StrokeElement object
 CompositeElement buildCompositeElement(XmlElement elt, String type)
          Given a composite element represented by its parsed XML equivalent, first build all of its children in the database, then build it in the database.
 Scene buildScene(XmlElement elt, String type)
           
 StrokeElement buildStrokeElement(XmlElement elt, String type)
          Build the given elemnt into a stroke elem
 XmlElement generate(Object in)
          Unable to generate XML by default.
 XmlElement generateComposite(CompositeElement in, String name)
           
 XmlElement generateStroke(StrokeElement in)
           
 
Methods inherited from class diva.util.xml.AbstractXmlBuilder
getDelegate, setDelegate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUILDER_DECLS

public static final String BUILDER_DECLS
See Also:
Constant Field Values

SCENE_TAG

public static final String SCENE_TAG
Indicates the file contains a scene.

See Also:
Constant Field Values

COMPOSITE_ELEMENT_TAG

public static final String COMPOSITE_ELEMENT_TAG
Indicates a scene element.

See Also:
Constant Field Values

STROKE_ELEMENT_TAG

public static final String STROKE_ELEMENT_TAG
Indicates a stroke element.

See Also:
Constant Field Values

TYPE_TAG

public static final String TYPE_TAG
Indicates the type of scene element.

See Also:
Constant Field Values

NAME_TAG

public static final String NAME_TAG
Indicates the name of scene element in a composite element.

See Also:
Constant Field Values

ROOT_NAME

public static final String ROOT_NAME
The name of the root element.

See Also:
Constant Field Values

CONFIDENCE_TAG

public static final String CONFIDENCE_TAG
Indicates the confidence of a scene element.

See Also:
Constant Field Values

POINTS_TAG

public static final String POINTS_TAG
Indicates the stroke path for a stroke element.

See Also:
Constant Field Values
Constructor Detail

SceneBuilder

public SceneBuilder()
Method Detail

build

public Object build(XmlElement elt,
                    String type)
             throws Exception
"scene" => return a scene database "compositeElement" => return a CompositeElement object "strokeElement" => return a StrokeElement object

Specified by:
build in interface XmlBuilder
Specified by:
build in class AbstractXmlBuilder
Throws:
Exception

buildScene

public Scene buildScene(XmlElement elt,
                        String type)
                 throws Exception
Throws:
Exception

buildCompositeElement

public CompositeElement buildCompositeElement(XmlElement elt,
                                              String type)
                                       throws Exception
Given a composite element represented by its parsed XML equivalent, first build all of its children in the database, then build it in the database.

Throws:
Exception

buildStrokeElement

public StrokeElement buildStrokeElement(XmlElement elt,
                                        String type)
Build the given elemnt into a stroke elem


generate

public XmlElement generate(Object in)
                    throws Exception
Description copied from class: AbstractXmlBuilder
Unable to generate XML by default.

Specified by:
generate in interface XmlBuilder
Overrides:
generate in class AbstractXmlBuilder
Throws:
Exception

generateComposite

public XmlElement generateComposite(CompositeElement in,
                                    String name)
                             throws Exception
Throws:
Exception

generateStroke

public XmlElement generateStroke(StrokeElement in)
                          throws IOException
Throws:
IOException


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.