de.cau.cs.kieler.kiml
Class VolatileLayoutConfig

java.lang.Object
  extended by de.cau.cs.kieler.kiml.VolatileLayoutConfig
All Implemented Interfaces:
IPropertyHolder, ILayoutConfig

public class VolatileLayoutConfig
extends Object
implements ILayoutConfig

A layout configuration that can be used to generate on-the-fly layout options.

Rating red

Constructor Summary
VolatileLayoutConfig()
           
 
Method Summary
 void clearProperties()
          Remove all stored layout options.
 void copyProperties(IPropertyHolder holder)
          Copy all properties from another property holder to this one.
 Map<IProperty<?>,Object> getAllProperties()
          Returns a map of all assigned properties with associated values.
 LayoutProviderData getContainerLayouterData()
          Returns null, since this layout configuration is not connected to a layout provider.
 LayoutProviderData getContentLayouterData()
          Returns null, since this layout configuration is not connected to a layout provider.
 LayoutProviderData getLayouterData(String layoutHint, String diagramType)
          Throws an UnsupportedOperationException, since this configuration cannot be used to handle layout providers.
 List<LayoutOptionData<?>> getOptionData()
          Returns a list of available layout option descriptors.
<T> T
getProperty(IProperty<T> property)
          Retrieves a property value.
 boolean isDefault(LayoutOptionData<?> optionData)
          Returns true if the given option has its default value.
 void setDiagramDefault(LayoutOptionData<?> optionData, Object value)
          Throws an UnsupportedOperationException, since this configuration cannot be used to change diagram options.
 void setFocus(Object element)
          Set the focus of this layout configuration on the given element.
 void setProperty(IProperty<?> property, Object value)
          Sets a property value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VolatileLayoutConfig

public VolatileLayoutConfig()
Method Detail

setFocus

public void setFocus(Object element)
Set the focus of this layout configuration on the given element.

Specified by:
setFocus in interface ILayoutConfig
Parameters:
element - a diagram element for which layout options shall be analyzed

setProperty

public void setProperty(IProperty<?> property,
                        Object value)
Sets a property value. No type checking is performed while setting, so users of this method must take care that the right object types are generated.

Specified by:
setProperty in interface IPropertyHolder
Parameters:
property - the property to set
value - the new value

getProperty

public <T> T getProperty(IProperty<T> property)
Retrieves a property value.

Specified by:
getProperty in interface IPropertyHolder
Type Parameters:
T - type of property
Parameters:
property - the property to get
Returns:
the current value, or the default value if the property is not set

copyProperties

public void copyProperties(IPropertyHolder holder)
Copy all properties from another property holder to this one.

Specified by:
copyProperties in interface IPropertyHolder
Parameters:
holder - another property holder

getAllProperties

public Map<IProperty<?>,Object> getAllProperties()
Returns a map of all assigned properties with associated values.

Specified by:
getAllProperties in interface IPropertyHolder
Returns:
a map of all properties

isDefault

public boolean isDefault(LayoutOptionData<?> optionData)
Returns true if the given option has its default value.

Specified by:
isDefault in interface ILayoutConfig
Parameters:
optionData - a layout option data
Returns:
whether the option has a default value

getOptionData

public List<LayoutOptionData<?>> getOptionData()
Returns a list of available layout option descriptors.

Specified by:
getOptionData in interface ILayoutConfig
Returns:
list of available layout options

clearProperties

public void clearProperties()
Remove all stored layout options.

Specified by:
clearProperties in interface ILayoutConfig

getContentLayouterData

public LayoutProviderData getContentLayouterData()
Returns null, since this layout configuration is not connected to a layout provider.

Specified by:
getContentLayouterData in interface ILayoutConfig
Returns:
null

getContainerLayouterData

public LayoutProviderData getContainerLayouterData()
Returns null, since this layout configuration is not connected to a layout provider.

Specified by:
getContainerLayouterData in interface ILayoutConfig
Returns:
null

setDiagramDefault

public void setDiagramDefault(LayoutOptionData<?> optionData,
                              Object value)
Throws an UnsupportedOperationException, since this configuration cannot be used to change diagram options.

Specified by:
setDiagramDefault in interface ILayoutConfig
Parameters:
optionData - a layout option
value - an option value

getLayouterData

public LayoutProviderData getLayouterData(String layoutHint,
                                          String diagramType)
Throws an UnsupportedOperationException, since this configuration cannot be used to handle layout providers.

Specified by:
getLayouterData in interface ILayoutConfig
Parameters:
layoutHint - a layout hint
diagramType - a diagram type
Returns:
nothing