com.jfimagine.jfgraph.shape.base
Class ObjectFactory

java.lang.Object
  |
  +--com.jfimagine.jfgraph.shape.base.ObjectFactory

public class ObjectFactory
extends java.lang.Object

object factory is a simple object factory for all shape objects for CAD. We used a singleton pattern here.

Version:
$Revision: 1.1 $
Author:
CookieMaker

Method Summary
static AbstractObject createObj(int objectType)
          Create objects by object type.
static AbstractObject createObj(java.lang.String xmlTag)
          Create objects by XML tag.
static ObjectFactory getInstance()
          Get a ObjectFactory instance for constructing objects.
static AbstractObject loadObjFromStream(JFReader stream, JFVersion version)
          Load an object from a JFReader object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ObjectFactory getInstance()
Get a ObjectFactory instance for constructing objects.

Returns:
A ObjectFactory instance.

createObj

public static AbstractObject createObj(int objectType)
Create objects by object type.

Parameters:
objectType - An object type defined in ShapeConst.
Returns:
A ObjectFactory instance.

createObj

public static AbstractObject createObj(java.lang.String xmlTag)
Create objects by XML tag.

Parameters:
xmlTag - An XML tag defined in each object or shape class.
Returns:
A ObjectFactory instance.

loadObjFromStream

public static AbstractObject loadObjFromStream(JFReader stream,
                                               JFVersion version)
                                        throws java.io.IOException
Load an object from a JFReader object.

Parameters:
stream - A JFReader object for loading an object.
version - A file version notification so this object can obey the rules to fetch data.
Returns:
A AbstractObject loaded.
java.io.IOException


Copyright 2004 ~ 2005 JingFei International Cooperation LTD. All Rights Reserved.