de.cau.cs.kieler.kiml.config
Class CompoundLayoutConfig

java.lang.Object
  extended by de.cau.cs.kieler.kiml.config.CompoundLayoutConfig
All Implemented Interfaces:
ILayoutConfig, IMutableLayoutConfig

public class CompoundLayoutConfig
extends Object
implements IMutableLayoutConfig

A layout configuration that is composed of multiple other configurations.

Rating red

Field Summary
 
Fields inherited from interface de.cau.cs.kieler.kiml.config.IMutableLayoutConfig
OPT_RECURSIVE
 
Constructor Summary
CompoundLayoutConfig()
           
 
Method Summary
 void add(ILayoutConfig conf)
          Insert the given layout configuration into this compound configuration according to its priority value.
 void addAll(Collection<ILayoutConfig> confs)
          Insert all given layout configurations into this compound configuration.
 void clearValues(LayoutContext context)
          Clear all layout option values that have been set for the given context.
 void enrich(LayoutContext context)
          Enrich the given context with additional information that can be derived from what is already contained.
 int getPriority()
          Return the priority of this layout configuration, which is relevant when multiple configurations are applied.
 Object getValue(LayoutOptionData<?> optionData, LayoutContext context)
          Get the current value for a layout option in the given context.
 boolean isSet(LayoutOptionData<?> optionData, LayoutContext context)
          Determine whether the given layout option is set, not considering any default values.
 void remove(ILayoutConfig conf)
          Remove the given layout configuration.
 void removeAll(Collection<ILayoutConfig> confs)
          Remove all given layout configurations.
 void setValue(LayoutOptionData<?> optionData, LayoutContext context, Object value)
          Set a new value for a layout option in the given context.
 void transferValues(KGraphData graphData, LayoutContext context)
          Transfer all non-default values that are managed by this layout configuration to the given graph data holder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundLayoutConfig

public CompoundLayoutConfig()
Method Detail

add

public void add(ILayoutConfig conf)
Insert the given layout configuration into this compound configuration according to its priority value.

Parameters:
conf - a layout configuration

addAll

public void addAll(Collection<ILayoutConfig> confs)
Insert all given layout configurations into this compound configuration.

Parameters:
confs - a collection of layout configurations

remove

public void remove(ILayoutConfig conf)
Remove the given layout configuration.

Parameters:
conf - a layout configuration

removeAll

public void removeAll(Collection<ILayoutConfig> confs)
Remove all given layout configurations.

Parameters:
confs - a collection of layout configurations

getPriority

public int getPriority()
Return the priority of this layout configuration, which is relevant when multiple configurations are applied.

Specified by:
getPriority in interface ILayoutConfig
Returns:
the priority

enrich

public void enrich(LayoutContext context)
Enrich the given context with additional information that can be derived from what is already contained.

Specified by:
enrich in interface ILayoutConfig
Parameters:
context - a context for layout configuration

getValue

public Object getValue(LayoutOptionData<?> optionData,
                       LayoutContext context)
Get the current value for a layout option in the given context.

Specified by:
getValue in interface ILayoutConfig
Parameters:
optionData - a layout option descriptor
context - a context for layout configuration
Returns:
the layout option value, or null if the option has no value in this context

transferValues

public void transferValues(KGraphData graphData,
                           LayoutContext context)
Transfer all non-default values that are managed by this layout configuration to the given graph data holder.

Specified by:
transferValues in interface ILayoutConfig
Parameters:
graphData - a graph data instance that can hold layout options
context - a context for layout configuration

clearValues

public void clearValues(LayoutContext context)
Clear all layout option values that have been set for the given context.

Specified by:
clearValues in interface IMutableLayoutConfig
Parameters:
context - a context for layout configuration

setValue

public void setValue(LayoutOptionData<?> optionData,
                     LayoutContext context,
                     Object value)
Set a new value for a layout option in the given context.

Specified by:
setValue in interface IMutableLayoutConfig
Parameters:
optionData - a layout option descriptor
context - a context for layout configuration
value - the new layout option value, or null if the current value shall be removed

isSet

public boolean isSet(LayoutOptionData<?> optionData,
                     LayoutContext context)
Determine whether the given layout option is set, not considering any default values.

Specified by:
isSet in interface IMutableLayoutConfig
Parameters:
optionData - a layout option descriptor
context - a context for layout configuration
Returns:
true if the option is set