com.tensegrity.gui.template
Class TemplateAttributableOnSet

java.lang.Object
  extended bycom.tensegrity.gui.template.TemplateAttributableOnSet
All Implemented Interfaces:
Attributable, AttributableOnSet

public class TemplateAttributableOnSet
extends java.lang.Object
implements AttributableOnSet

The GeometryAttributableOnSet represents the current set of Attributes for a Geometry, which can be created/edited with the CompositeEditor. Such an AttributableOnSet contains the name of the Geometry, a list of currently added items, its size, etc.

Version:
$Id: TemplateAttributableOnSet.java,v 1.25 2006/03/14 14:40:28 MichaelKegel Exp $
Author:
Gilles Iachelini

Field Summary
protected  AttributableOnSetListener attributableOnSetListener
          Listener instance for the attributableonset implementation.
static java.lang.String DEFAULT_ELEMENT_FILENAME
          Default filename for element lists.
static java.lang.String DEFAULT_GEOMETRY_FILENAME
          Default filename for geometry lists.
static java.lang.String DEFAULT_STYLE_FILENAME
          Default filename for Template lists.
static java.lang.String FILE_CATEGORY
          Constant string field for the File related Category.
static java.lang.String FILE_DIRECTORY
          Directory attribute for the files.
static java.lang.String FILE_ELEMENT
          Constant string field or the element.xml filename.
static java.lang.String FILE_GEOMETRY
          Constant string field or the geometry.xml filename.
static java.lang.String FILE_STYLE
          Constant string field or the style.xml filename.
static java.lang.String FILENAME_SEPARATOR
          A public tag to be used as separator between name and type of the xml file.
static java.lang.String NAME
          Constant string field for the Template name-Attribute.
static java.lang.String TEMPLATES_CATEGORY
          Constant string field for the category concerning the template.
static java.lang.String TEMPLATES_NAME
          Constant string field for the name of the template.
 
Fields inherited from interface com.tensegrity.generic.attribute.AttributableOnSet
TREE_SUBSET_POSTFIX
 
Constructor Summary
TemplateAttributableOnSet()
          Creates the TemplateAttributableOnSet.
 
Method Summary
 void addAttributableOnSetListener(AttributableOnSetListener attributableOnSetListener)
          Adds a listener to the attributable on set instance.
 boolean areAttributableEventsEnabled()
          Returns a boolean that indicates whether generating of events is enabled or not.
 void disableAttributableEvents()
          Disables events for the registered listeners.
 void enableAttributableEvents()
          Enables the transmission of events to registered listeners.
 Attribute getAttribute(java.lang.String name)
          Returns the attribute specified by the given name from the templateSet created by the TemplateAttributableOnSet#getTemplateSet() method.
 AttributeSet getAttributes()
          Returns an AttributeSet consisting of all attributes of this AttributableOnSet.
 AttributeSet getAttributesTree()
          Returns an AttributeSet containing all Attributes of this AttributableOnSet in a treelike structure.
 AttributeType getAttributeType(java.lang.String name)
          Returns null.
 java.lang.Object getAttributeValue(java.lang.String name)
          Returns null.
 java.lang.String getDirectory()
          Returns the name of the directory where the templates should be saved.
 java.lang.String getElementXML()
          Returns the name of the file where to store the element definitions.
 java.lang.String getGeometryXML()
          Returns the name of the file where to store geometries
 java.lang.String getStyleXML()
          Returns the name of the file where to store the style.
 java.lang.String getTemplateName()
          Returns the template list name.
 java.lang.String getTemplatesName()
          Returns the name of the templates.
 void removeAttributableOnSetListener(AttributableOnSetListener attributableOnSetListener)
          Removes a listener from the attributable on set instance.
 void setAttribute(Attribute attribute)
          Empty.
 void setAttributes(AttributeSet attributes)
          Sets all Template relevant attributes according to the existing categories of the parameter attributeset.
 void setAttributesTree(AttributeSet attributes)
          Performs the same operation as the setAttributes(com.tensegrity.generic.attribute.AttributeSet) method with the difference that the AttributeSet given to this method must provide the treelike structure mentioned in the documentation of the getAttributesTree().
 void setAttributeValue(java.lang.String name, java.lang.Object value)
          Empty.
 void setDirectory(java.lang.String string)
          Sets the target directory for the templates.
 void setTemplateName(java.lang.String string)
          Sets the name of the currently represted template.
 void setTemplatesName(java.lang.String string)
          Sets the name of the templates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
Constant string field for the Template name-Attribute.

See Also:
Constant Field Values

TEMPLATES_CATEGORY

public static final java.lang.String TEMPLATES_CATEGORY
Constant string field for the category concerning the template.

See Also:
Constant Field Values

TEMPLATES_NAME

public static final java.lang.String TEMPLATES_NAME
Constant string field for the name of the template.

See Also:
Constant Field Values

FILE_CATEGORY

public static final java.lang.String FILE_CATEGORY
Constant string field for the File related Category.

See Also:
Constant Field Values

FILE_DIRECTORY

public static final java.lang.String FILE_DIRECTORY
Directory attribute for the files.

See Also:
Constant Field Values

FILE_STYLE

public static final java.lang.String FILE_STYLE
Constant string field or the style.xml filename.

See Also:
Constant Field Values

FILE_GEOMETRY

public static final java.lang.String FILE_GEOMETRY
Constant string field or the geometry.xml filename.

See Also:
Constant Field Values

FILE_ELEMENT

public static final java.lang.String FILE_ELEMENT
Constant string field or the element.xml filename.

See Also:
Constant Field Values

attributableOnSetListener

protected transient AttributableOnSetListener attributableOnSetListener
Listener instance for the attributableonset implementation.


DEFAULT_STYLE_FILENAME

public static final java.lang.String DEFAULT_STYLE_FILENAME
Default filename for Template lists.

See Also:
Constant Field Values

DEFAULT_GEOMETRY_FILENAME

public static final java.lang.String DEFAULT_GEOMETRY_FILENAME
Default filename for geometry lists.

See Also:
Constant Field Values

DEFAULT_ELEMENT_FILENAME

public static final java.lang.String DEFAULT_ELEMENT_FILENAME
Default filename for element lists.

See Also:
Constant Field Values

FILENAME_SEPARATOR

public static final java.lang.String FILENAME_SEPARATOR
A public tag to be used as separator between name and type of the xml file.

See Also:
Constant Field Values
Constructor Detail

TemplateAttributableOnSet

public TemplateAttributableOnSet()
Creates the TemplateAttributableOnSet.

Method Detail

getAttributes

public AttributeSet getAttributes()
Description copied from interface: AttributableOnSet
Returns an AttributeSet consisting of all attributes of this AttributableOnSet.

Specified by:
getAttributes in interface AttributableOnSet
Returns:
AttributeSet an AttributeSet with all attributes.

getAttributesTree

public AttributeSet getAttributesTree()
Description copied from interface: AttributableOnSet
Returns an AttributeSet containing all Attributes of this AttributableOnSet in a treelike structure.
Treelike means that each attribute can have a subset that contains subsequent Attributes for an Attribute of this AttributableOnSet.
Since an Attribute can only have one value (in this case an object or the Attributes for an object) the subsequent attributes are plugged into the returned AttributeSet as a new Attribute with the same name and the AttributableOnSet.TREE_SUBSET_POSTFIX.

Specified by:
getAttributesTree in interface AttributableOnSet
Returns:
AttributeSet an AttributeSet with the attributes in a treelike structure

setAttributes

public void setAttributes(AttributeSet attributes)
Sets all Template relevant attributes according to the existing categories of the parameter attributeset.

Specified by:
setAttributes in interface AttributableOnSet
Parameters:
attributes - the AttributeSet consisting of the attributes whose values to set.
See Also:
AttributableOnSet.setAttributes(AttributeSet)

setAttributesTree

public void setAttributesTree(AttributeSet attributes)
Description copied from interface: AttributableOnSet
Performs the same operation as the AttributableOnSet.setAttributes(com.tensegrity.generic.attribute.AttributeSet) method with the difference that the AttributeSet given to this method must provide the treelike structure mentioned in the documentation of the AttributableOnSet.getAttributesTree().

Specified by:
setAttributesTree in interface AttributableOnSet
Parameters:
attributes - the AttributeSet containing the attributes whose values to set.

getAttribute

public Attribute getAttribute(java.lang.String name)
Returns the attribute specified by the given name from the templateSet created by the TemplateAttributableOnSet#getTemplateSet() method.

Specified by:
getAttribute in interface Attributable
Parameters:
name - name of the attribute to return.
Returns:
the attribute with the given name or null.
See Also:
Attributable.getAttribute(java.lang.String)

getAttributeType

public AttributeType getAttributeType(java.lang.String name)
Returns null.

Specified by:
getAttributeType in interface Attributable
Parameters:
name - the name of the attribute.
Returns:
the attribute type with given name.
See Also:
Attributable.getAttributeType(java.lang.String)

getAttributeValue

public java.lang.Object getAttributeValue(java.lang.String name)
Returns null.

Specified by:
getAttributeValue in interface Attributable
Parameters:
name - name of the attribute.
Returns:
the value of the attribute with the given name.
See Also:
Attributable.getAttributeValue(java.lang.String)

setAttribute

public void setAttribute(Attribute attribute)
Empty. This method does nothing.

Specified by:
setAttribute in interface Attributable
Parameters:
attribute - the attribute to be set.
See Also:
Attributable.setAttribute(com.tensegrity.generic.attribute.Attribute)

setAttributeValue

public void setAttributeValue(java.lang.String name,
                              java.lang.Object value)
Empty. This method does nothing.

Specified by:
setAttributeValue in interface Attributable
Parameters:
name - the name of the attribute.
value - the value to set the attributes value to.
See Also:
Attributable.setAttributeValue(java.lang.String, java.lang.Object)

removeAttributableOnSetListener

public void removeAttributableOnSetListener(AttributableOnSetListener attributableOnSetListener)
Description copied from interface: AttributableOnSet
Removes a listener from the attributable on set instance.

Specified by:
removeAttributableOnSetListener in interface AttributableOnSet
Parameters:
attributableOnSetListener - the AttributableOnSet to be removed from the list of listeners.

addAttributableOnSetListener

public void addAttributableOnSetListener(AttributableOnSetListener attributableOnSetListener)
Description copied from interface: AttributableOnSet
Adds a listener to the attributable on set instance.

Specified by:
addAttributableOnSetListener in interface AttributableOnSet
Parameters:
attributableOnSetListener - an AttributableOnSet listener listening for changes

disableAttributableEvents

public void disableAttributableEvents()
Description copied from interface: AttributableOnSet
Disables events for the registered listeners.

Specified by:
disableAttributableEvents in interface AttributableOnSet

enableAttributableEvents

public void enableAttributableEvents()
Description copied from interface: AttributableOnSet
Enables the transmission of events to registered listeners.

Specified by:
enableAttributableEvents in interface AttributableOnSet

areAttributableEventsEnabled

public boolean areAttributableEventsEnabled()
Description copied from interface: AttributableOnSet
Returns a boolean that indicates whether generating of events is enabled or not.

Specified by:
areAttributableEventsEnabled in interface AttributableOnSet
Returns:
boolean flag that indicates whether event generation is active or not

getTemplateName

public java.lang.String getTemplateName()
Returns the template list name.

Returns:
the name of the tempplate as String.

setTemplateName

public void setTemplateName(java.lang.String string)
Sets the name of the currently represted template.

Parameters:
string - the name of the template.

getElementXML

public java.lang.String getElementXML()
Returns the name of the file where to store the element definitions.

Returns:
the filename for the element xml file.

getGeometryXML

public java.lang.String getGeometryXML()
Returns the name of the file where to store geometries.,

Returns:
the filename for the geometry xml file.

getStyleXML

public java.lang.String getStyleXML()
Returns the name of the file where to store the style.

Returns:
the filename for the style xml file.

getDirectory

public java.lang.String getDirectory()
Returns the name of the directory where the templates should be saved.

Returns:
the directory as String.

setDirectory

public void setDirectory(java.lang.String string)
Sets the target directory for the templates.

Parameters:
string - name of the directory as String.

getTemplatesName

public java.lang.String getTemplatesName()
Returns the name of the templates.

Returns:
the name of the templates, where this template resides.

setTemplatesName

public void setTemplatesName(java.lang.String string)
Sets the name of the templates.

Parameters:
string - the name of the Template collection.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.