fi.paatti.research.paattiapplication.views.eventview.tools
Class NodeFactory

java.lang.Object
  extended by fi.paatti.research.paattiapplication.views.eventview.tools.NodeFactory
All Implemented Interfaces:
Serializable

public class NodeFactory
extends Object
implements Serializable

NodeFactory handles the creation of the TreeNodes used in the event tree.

Author:
Tapio Keränen, t.tapio.keranen@student.jyu.fi
See Also:
Serialized Form
 

Nested Class Summary
 class NodeFactory.MultiPathNode
          MultiPathNode is a TreeNode that can have multiple children and multiple exit paths all leading to different destinations (or the same if needed).
static class NodeFactory.NODE_TYPE
          The enum that contains the node types used by the node factory.
protected  class NodeFactory.RadioNode
          RadioNode is a node that contains paths leading to different (or just one) TreeNode(s).
 class NodeFactory.RootNode
          RootNode is an unremoveable node that has only one child and cannot have any parents.
 class NodeFactory.SinglePathNode
          SinglePathNode is a TreeNode that can have only one child.
 class NodeFactory.TreeNode
          TreeNode is the base class extended by all the nodes in an event tree.
 
Constructor Summary
NodeFactory()
          NodeFactory constructor.
 
Method Summary
 NodeFactory.TreeNode createNode(NodeFactory.NODE_TYPE type, int x, int y)
          Creates a new node of the given type and places it to the given point (x,y).
 void reset()
          Sets the factory's running id back to zero.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeFactory

public NodeFactory()
NodeFactory constructor.

Method Detail

createNode

public NodeFactory.TreeNode createNode(NodeFactory.NODE_TYPE type,
                                       int x,
                                       int y)
Creates a new node of the given type and places it to the given point (x,y).

Parameters:
type - the enum type of the new node.
x - the x coordinate.
y - the y coordinate.
Returns:
the new node of the specified type.

reset

public void reset()
Sets the factory's running id back to zero.



Copyright © 2012. All Rights Reserved.