Class JaxoObjectFactory
java.lang.Object
net.sf.jaxodraw.object.JaxoObjectFactory
Factory class to create instances of JaxoObjects.
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddObjectType(int type, String objectId) Adds a new type of JaxoObject to the list of know objects.static JaxoObjectnewObject(int type) Returns a new instance of a JaxoObject.static JaxoObjectCreates a new JaxoObject, initialized with values taken from thePreferences.static JaxoObjectReturns a new instance of a JaxoObject.
-
Method Details
-
newObject
Returns a new instance of a JaxoObject. The object is only instantiated, not initialized. A NoSuchElementException is thrown if type is not a known object.- Parameters:
type- The type of object to be created, as defined inJaxoConstants).- Returns:
- A new instance of a JaxoObject. Always non-null.
-
newObject
Returns a new instance of a JaxoObject. The object is only instantiated, not initialized. A NoSuchElementException is thrown if objectId is not a known object.- Parameters:
objectId- The class name of the object to be instantiated.- Returns:
- A new instance of a JaxoObject. Always non-null.
-
newObject
Creates a new JaxoObject, initialized with values taken from thePreferences. A NoSuchElementException is thrown if type is not a known object.- Parameters:
type- The type of object to be created (defined inJaxoConstants).location- the points of the object. The size of the array has to be equal to the point count of the object.- Returns:
- A new JaxoObject. Always non-null.
-
addObjectType
Adds a new type of JaxoObject to the list of know objects. No test is done here if the object can be instantiated.- Parameters:
type- The type of object to be created, has to be different from any of the pre-defined types inJaxoConstants).objectId- The class name of the object of the given type. This is used to instantiate the object.
-