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

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

public class VolatileLayoutConfig
extends Object
implements ILayoutConfig

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

Rating proposed yellow
(2011-01-13) msp

Field Summary
static int PRIORITY
          the priority for volatile layout configurations.
 
Constructor Summary
VolatileLayoutConfig()
           
 
Method Summary
 void copyValues(VolatileLayoutConfig other)
          Copy all values from the given layout configuration into this one.
 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.
 void setValue(IProperty<?> option, Object contextObj, IProperty<?> contextKey, Object value)
          Set a new value for a layout option in the context of the given object.
 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
 

Field Detail

PRIORITY

public static final int PRIORITY
the priority for volatile layout configurations.

See Also:
Constant Field Values
Constructor Detail

VolatileLayoutConfig

public VolatileLayoutConfig()
Method Detail

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

setValue

public void setValue(IProperty<?> option,
                     Object contextObj,
                     IProperty<?> contextKey,
                     Object value)
Set a new value for a layout option in the context of the given object.

Parameters:
option - a layout option property
contextObj - the object to which the option value is attached, e.g. a domain model element
contextKey - the layout context key related to the context object, e.g. LayoutContext.DOMAIN_MODEL
value - the new layout option value

copyValues

public void copyValues(VolatileLayoutConfig other)
Copy all values from the given layout configuration into this one.

Parameters:
other - another volatile layout configuration

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