com.tensegrity.composite.style
Interface StyleDescriptorHandler


public interface StyleDescriptorHandler

This interface defines the methods necessary to handle the determination of style items that should by applied to the primitives or children of a composite when a style is applied to it.

An implementation of this interface can be registered to the StyleDescriptorHandlerRegistry and will then be called during application of a style descriptor.

Version:
$Id: StyleDescriptorHandler.java,v 1.2 2005/06/01 12:54:56 BurkhardWick Exp $
Author:
MKegel

Method Summary
 java.util.Map createMapItem2Children(java.util.List basecomposites, StyleDescriptor style)
          Stores the style items that should be used for each of the given basecomposites into a map which is then returned.
 java.util.Map createMapItem2Primitives(java.util.List primitives, StyleDescriptor style)
          Stores the style items that should be used for each of the given primitives into a map which is then returned.
 boolean willHandleChildren(Composite composite, StyleDescriptor style)
          Returns true, if this handler will handle children of a composite (e.g.
 boolean willHandlePrimitives(Composite composite, StyleDescriptor style)
          Returns true, if this handler will handle the primitives of a composite during an apply of a style.
 

Method Detail

willHandlePrimitives

public boolean willHandlePrimitives(Composite composite,
                                    StyleDescriptor style)
Returns true, if this handler will handle the primitives of a composite during an apply of a style.

Parameters:
composite - The composite containing the primitives
style - The style that is currently being applied
Returns:
true, if the application of the style is handled by this instance

createMapItem2Primitives

public java.util.Map createMapItem2Primitives(java.util.List primitives,
                                              StyleDescriptor style)
Stores the style items that should be used for each of the given primitives into a map which is then returned. The values in the map might be of type StyleItem, StyleDescriptorItem or null (which avoids applying a style).

Parameters:
primitives - The list of primitives to determine the style item for
style - The style descriptor that is currently being applied
Returns:
A map containing style item information for each of the given primitives

willHandleChildren

public boolean willHandleChildren(Composite composite,
                                  StyleDescriptor style)
Returns true, if this handler will handle children of a composite (e.g. CompositeGroup) during an apply of a style.

Parameters:
composite - The composite containing the children
style - The style that is currently being applied
Returns:
true, if the application of the style is handled by this instance

createMapItem2Children

public java.util.Map createMapItem2Children(java.util.List basecomposites,
                                            StyleDescriptor style)
Stores the style items that should be used for each of the given basecomposites into a map which is then returned. The values in the map might be of type StyleItem, StyleDescriptorItem or null (which avoids applying a style).

Parameters:
basecomposites - The list of composites to determine the style item for
style - The style descriptor that is currently being applied
Returns:
A map containing style item information for each of the given basecomposites


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