de.cau.cs.kieler.kiml
Class LayoutAlgorithmData

java.lang.Object
  extended by de.cau.cs.kieler.kiml.LayoutAlgorithmData
All Implemented Interfaces:
ILayoutData

public class LayoutAlgorithmData
extends Object
implements ILayoutData

Data type used to store information for a layout algorithm.

Rating yellow
(2011-02-01) reviewed by cmot, soh

Field Summary
static String DEFAULT_LAYOUTER_NAME
          default name for layout algorithms for which no name is given.
static int MIN_PRIORITY
          The minimal allowed priority value.
 
Constructor Summary
LayoutAlgorithmData()
           
 
Method Summary
 void createPool(IFactory<AbstractLayoutProvider> providerFactory)
          Sets the layout provider that can execute the associated algorithm.
 boolean equals(Object obj)
          
 String getCategory()
          Returns the category.
 Object getDefaultValue(LayoutOptionData<?> optionData)
          Returns the layout algorithm's default value for the given option.
 String getDescription()
          Returns the description.
 String getId()
          Returns the id.
 String getName()
          Returns the name.
 Object getPreviewImage()
          Returns the preview image data.
 InstancePool<AbstractLayoutProvider> getProviderPool()
          Returns an instance pool for layout providers.
 int getSupportedPriority(String diagramType)
          Returns the supported priority for the given diagram type.
 String getType()
          Returns the type.
 int hashCode()
          
 boolean knowsOption(LayoutOptionData<?> optionData)
          Determines whether the layout algorithm knows the given layout option.
 void setCategory(String thecategory)
          Sets the category.
 void setDescription(String thedescription)
          Sets the description.
 void setDiagramSupport(String diagramType, int priority)
          Sets support for the given diagram type.
 void setId(String theid)
          Sets the id.
 void setName(String thename)
          Sets the name.
 void setOption(LayoutOptionData<?> optionData, Object defaultValue)
          Sets the knowledge status of the given layout option.
 void setPreviewImage(Object thepreviewImage)
          Sets the preview image data.
 void setType(String thetype)
          Sets the type.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_PRIORITY

public static final int MIN_PRIORITY
The minimal allowed priority value. Values less or equal to this value are treated as 'not supported'.

See Also:
Constant Field Values

DEFAULT_LAYOUTER_NAME

public static final String DEFAULT_LAYOUTER_NAME
default name for layout algorithms for which no name is given.

See Also:
Constant Field Values
Constructor Detail

LayoutAlgorithmData

public LayoutAlgorithmData()
Method Detail

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Overrides:
toString in class Object

setOption

public void setOption(LayoutOptionData<?> optionData,
                      Object defaultValue)
Sets the knowledge status of the given layout option.

Parameters:
optionData - layout option data
defaultValue - the default value, or null if none is specified

knowsOption

public boolean knowsOption(LayoutOptionData<?> optionData)
Determines whether the layout algorithm knows the given layout option.

Parameters:
optionData - layout option data
Returns:
true if the associated layout algorithm knows the option

getDefaultValue

public Object getDefaultValue(LayoutOptionData<?> optionData)
Returns the layout algorithm's default value for the given option.

Parameters:
optionData - layout option data
Returns:
the associated default value, or null if there is none

setDiagramSupport

public void setDiagramSupport(String diagramType,
                              int priority)
Sets support for the given diagram type. If the priority is less or equal to MIN_PRIORITY, the type is treated as not supported.

Parameters:
diagramType - identifier of diagram type
priority - priority value, or MIN_PRIORITY if the diagram type is not supported

getSupportedPriority

public int getSupportedPriority(String diagramType)
Returns the supported priority for the given diagram type. If the type is not supported, MIN_PRIORITY is returned.

Parameters:
diagramType - diagram type identifier
Returns:
associated priority, or MIN_PRIORITY if the diagram type is not supported

setId

public void setId(String theid)
Sets the id.

Specified by:
setId in interface ILayoutData
Parameters:
theid - the id to set

getId

public String getId()
Returns the id.

Specified by:
getId in interface ILayoutData
Returns:
the id

setName

public void setName(String thename)
Sets the name.

Specified by:
setName in interface ILayoutData
Parameters:
thename - the name to set

getName

public String getName()
Returns the name.

Specified by:
getName in interface ILayoutData
Returns:
the name

setDescription

public void setDescription(String thedescription)
Sets the description.

Specified by:
setDescription in interface ILayoutData
Parameters:
thedescription - the description to set

getDescription

public String getDescription()
Returns the description.

Specified by:
getDescription in interface ILayoutData
Returns:
the description

createPool

public void createPool(IFactory<AbstractLayoutProvider> providerFactory)
Sets the layout provider that can execute the associated algorithm.

Parameters:
providerFactory - a factory for layout providers

getProviderPool

public InstancePool<AbstractLayoutProvider> getProviderPool()
Returns an instance pool for layout providers.

Returns:
a layout provider instance pool

setType

public void setType(String thetype)
Sets the type.

Parameters:
thetype - the type to set

getType

public String getType()
Returns the type.

Returns:
the type

setCategory

public void setCategory(String thecategory)
Sets the category.

Parameters:
thecategory - the category to set

getCategory

public String getCategory()
Returns the category.

Returns:
the category

getPreviewImage

public Object getPreviewImage()
Returns the preview image data.

Returns:
the preview image

setPreviewImage

public void setPreviewImage(Object thepreviewImage)
Sets the preview image data.

Parameters:
thepreviewImage - the preview image to set