planet.generic.commonapi.GML
Class GMLFactoryImpl

java.lang.Object
  extended by planet.generic.commonapi.GML.GMLFactoryImpl
All Implemented Interfaces:
java.io.Serializable, GMLFactory

public class GMLFactoryImpl
extends java.lang.Object
implements GMLFactory

Factory for the GML implementation classes.

Author:
Marc Sanchez, Jordi Pujol
See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_GML_CONSTRAINT_CLASS
          Default GMLConstraint implementation to use
static java.lang.String DEFAULT_GML_EDGE_CLASS
          Edge class implementation
static java.lang.String DEFAULT_GML_GENERATOR_CLASS
          Default GMLConstraint implementation to use
 
Constructor Summary
GMLFactoryImpl(java.lang.String propertiesFile)
          Loads all specified classes in the propertiesFile, related to the GML items.
 
Method Summary
 GMLConstraint buildDefaultGMLConstraint()
          Build the GMLConstraint specified in the GML properties file.
 GMLEdge buildEdge(Id source, Id target, boolean directed)
          Build a GML edge with the specified values.
 GMLEdge buildEdge(Id source, Id target, boolean directed, java.lang.String fill)
          Build a GML edge with the specified values.
 GMLGenerator buildGMLGenerator()
          Builds the GMLGenerator specified in the GML properties file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_GML_EDGE_CLASS

public static final java.lang.String DEFAULT_GML_EDGE_CLASS
Edge class implementation

See Also:
Constant Field Values

DEFAULT_GML_CONSTRAINT_CLASS

public static final java.lang.String DEFAULT_GML_CONSTRAINT_CLASS
Default GMLConstraint implementation to use

See Also:
Constant Field Values

DEFAULT_GML_GENERATOR_CLASS

public static final java.lang.String DEFAULT_GML_GENERATOR_CLASS
Default GMLConstraint implementation to use

See Also:
Constant Field Values
Constructor Detail

GMLFactoryImpl

public GMLFactoryImpl(java.lang.String propertiesFile)
               throws InitializationException
Loads all specified classes in the propertiesFile, related to the GML items.

Parameters:
propertiesFile - Path to the GML properties file.
Throws:
InitializationException
Method Detail

buildEdge

public GMLEdge buildEdge(Id source,
                         Id target,
                         boolean directed)
                  throws InitializationException
Build a GML edge with the specified values. The fill color is used the predefined one (the appeared in GMLDefaultProperties.fill property).

Specified by:
buildEdge in interface GMLFactory
Parameters:
source - Source node Id.
target - Destination node Id.
directed - true when the edge is directed. false in other case.
Returns:
An instance of GMLEdge.
Throws:
InitializationException - if an error occurs during the initialization.
See Also:
GMLDefaultProperties

buildEdge

public GMLEdge buildEdge(Id source,
                         Id target,
                         boolean directed,
                         java.lang.String fill)
                  throws InitializationException
Build a GML edge with the specified values. The fill color is used the predefined one (the appeared in GMLDefaultProperties.fill property).

Specified by:
buildEdge in interface GMLFactory
Parameters:
source - Source node Id.
target - Destination node Id.
directed - true when the edge is directed. false in other case.
fill - Fill color in "#RRGGBB" format.
Returns:
An instance of GMLEdge.
Throws:
InitializationException - if an error occurs during the initialization.

buildGMLGenerator

public GMLGenerator buildGMLGenerator()
                               throws InitializationException
Builds the GMLGenerator specified in the GML properties file.

Specified by:
buildGMLGenerator in interface GMLFactory
Returns:
The GMLGenerator.
Throws:
InitializationException - if an error occurs during the initialization.

buildDefaultGMLConstraint

public GMLConstraint buildDefaultGMLConstraint()
                                        throws InitializationException
Build the GMLConstraint specified in the GML properties file.

Specified by:
buildDefaultGMLConstraint in interface GMLFactory
Returns:
The GMLConstraint.
Throws:
InitializationException - if an error occurs during the initialization.