infovis.tree.visualization.nodelink
Class TreeLayoutFactory

java.lang.Object
  extended by infovis.utils.BasicFactory
      extended by infovis.tree.visualization.nodelink.TreeLayoutFactory

public class TreeLayoutFactory
extends BasicFactory

Factory of Tree Layout objects.

Version:
$Revision: 1.3 $
Author:
Jean-Daniel Fekete

Nested Class Summary
static class TreeLayoutFactory.AbstractCreator
          Class abstract class implementing the Creator interface.
static interface TreeLayoutFactory.Creator
          Creator for NodeLinkTreeLayout objects.
static class TreeLayoutFactory.DefaultCreator
          Default implementation of the Creator interface.
 
Constructor Summary
TreeLayoutFactory()
          Constructor.
 
Method Summary
 void add(String name, Class c)
          Register a new creator with a specified name and a specified class.
 void add(String name, String className, String data)
          
 void add(String name, TreeLayoutFactory.Creator c)
          Registers a new creator with a specified name.
 void add(TreeLayoutFactory.Creator c)
          Registers a new creator.
static void addLayout(String name, Class c)
          Register a new layout class.
 NodeLinkTreeLayout create(String name, NodeLinkTreeVisualization vis)
          Returns a Creator for the specified layout name and visualization.
static NodeLinkTreeLayout createLayout(String name, NodeLinkTreeVisualization visualization)
          Returns a NodeLinkTreeLayout given its name and a NodeLinkTreeVisualization.
 TreeLayoutFactory.Creator getCreator(String name)
          Returns a Creator for a specified layout name.
static TreeLayoutFactory getInstance()
          Returns the instance of this factory.
 Iterator iterator()
          Returns an iterator over the names of layouts.
static Iterator layoutNamesIterator()
          Returns an iterator over the names of layouts.
 void remove(String name)
          Removes a creator given its name.
static void setInstance(TreeLayoutFactory inst)
          Sets the instance of TreeLayoutFactory.
 
Methods inherited from class infovis.utils.BasicFactory
loadProperties
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeLayoutFactory

public TreeLayoutFactory()
Constructor.

Method Detail

getInstance

public static TreeLayoutFactory getInstance()
Returns the instance of this factory.

Returns:
the instance of this factory.

setInstance

public static void setInstance(TreeLayoutFactory inst)
Sets the instance of TreeLayoutFactory.

Parameters:
inst - the new instance.

createLayout

public static NodeLinkTreeLayout createLayout(String name,
                                              NodeLinkTreeVisualization visualization)
Returns a NodeLinkTreeLayout given its name and a NodeLinkTreeVisualization.

Parameters:
name - the name
visualization - the visualization
Returns:
a NodeLinkTreeLayout given its name and a NodeLinkTreeVisualization.

addLayout

public static void addLayout(String name,
                             Class c)
Register a new layout class.

Parameters:
name - the class name
c - the class

layoutNamesIterator

public static Iterator layoutNamesIterator()
Returns an iterator over the names of layouts.

Returns:
an iterator over the names of layouts.

getCreator

public TreeLayoutFactory.Creator getCreator(String name)
Returns a Creator for a specified layout name.

Parameters:
name - the name
Returns:
a Creator for the specified layout name.

create

public NodeLinkTreeLayout create(String name,
                                 NodeLinkTreeVisualization vis)
Returns a Creator for the specified layout name and visualization.

Parameters:
name - the name
vis - the visualization
Returns:
a Creator for the specified layout name and visualization.

iterator

public Iterator iterator()
Returns an iterator over the names of layouts.

Returns:
an iterator over the names of layouts.

add

public void add(String name,
                String className,
                String data)


add

public void add(String name,
                TreeLayoutFactory.Creator c)
Registers a new creator with a specified name.

Parameters:
name - the layout name
c - the creator

add

public void add(TreeLayoutFactory.Creator c)
Registers a new creator.

Parameters:
c - the creator.

add

public void add(String name,
                Class c)
Register a new creator with a specified name and a specified class.

Parameters:
name - the name
c - the class

remove

public void remove(String name)
Removes a creator given its name.

Parameters:
name - the name


Copyright 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.