com.tensegrity.composite.style
Class DefaultStyleItem

java.lang.Object
  extended bycom.tensegrity.composite.style.DefaultStyleItem
All Implemented Interfaces:
CanonicalDescribable, StyleItem

public class DefaultStyleItem
extends java.lang.Object
implements StyleItem

Default implementation of interface StyleItem. Have a look at this interface for documentation

Version:
$Id: DefaultStyleItem.java,v 1.12 2005/01/21 10:59:25 MichaelKegel Exp $
Author:
MichaelKegel
See Also:
StyleItem

Field Summary
 
Fields inherited from interface com.tensegrity.composite.style.StyleItem
ELEMENT_ITEM, ELLIPSE_ITEM, GENERAL_ITEM, ITEM_TYPE_MAX, LABEL_ITEM, LINE_ITEM, POLYGON_ITEM, RECT_ITEM, TABLE_ITEM
 
Fields inherited from interface com.tensegrity.generic.util.CanonicalDescribable
DELIMITER
 
Constructor Summary
DefaultStyleItem(int type, java.lang.String name, AttributeSet attributes)
          Constructor for a DefaultStyleItem.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 AttributeSet getAttributes()
          Returns an AttributeSet that holds the various attributes of this StyleItem.
 java.lang.String getCanonicalDescription()
          Returns a canonical description from the name and the type of this StyleItem.
 java.lang.String getName()
          Returns the name of this StyleItem.
 int getType()
          Returns the type of this StyleItem.
 java.lang.String toString()
          Returns this items name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultStyleItem

public DefaultStyleItem(int type,
                        java.lang.String name,
                        AttributeSet attributes)
Constructor for a DefaultStyleItem. Throws InvalidArgumentException if the given type is not among the predefined constants of class StyleItem.

Parameters:
type - the type (have a look a StyleItem for valid values.
name - a name for this StyleItem.
attributes - an AttributeSet holding the Attributes to be used.
Method Detail

getType

public int getType()
Description copied from interface: StyleItem
Returns the type of this StyleItem. Have a look at the constants of this class for possible values for type.

Specified by:
getType in interface StyleItem
Returns:
the type of this StyleItem.

getName

public java.lang.String getName()
Description copied from interface: StyleItem
Returns the name of this StyleItem.

Specified by:
getName in interface StyleItem
Returns:
Returns the name of this StyleItem.

getAttributes

public AttributeSet getAttributes()
Description copied from interface: StyleItem
Returns an AttributeSet that holds the various attributes of this StyleItem. If no attributes are assigned to the StyleItem the return value is null.

Specified by:
getAttributes in interface StyleItem
Returns:
an AttributeSet holding the various attributes of this StyleItem or null.

getCanonicalDescription

public java.lang.String getCanonicalDescription()
Returns a canonical description from the name and the type of this StyleItem. All values of the AttributeSet are also added.

Specified by:
getCanonicalDescription in interface CanonicalDescribable
Returns:
a canonical description.
See Also:
CanonicalDescribable.getCanonicalDescription()

toString

public java.lang.String toString()
Returns this items name.

See Also:
Object.toString()

equals

public boolean equals(java.lang.Object obj)


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