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

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

public class DefaultLayoutConfig
extends Object
implements ILayoutConfig

Default implementation of the layout configuration interface. This configuration handles the default values of layout algorithms and layout options.

Rating proposed yellow
(2011-01-13) msp

Field Summary
static IProperty<LayoutAlgorithmData> CONTAINER_ALGO
          the layout algorithm that is assigned to the container of the current graph element.
static IProperty<String> CONTAINER_DIAGT
          the diagram type identifier for the container of the current graph element.
static IProperty<String> CONTAINER_HINT
          the layout algorithm or type identifier for the container of the current graph element.
static IProperty<LayoutAlgorithmData> CONTENT_ALGO
          the layout algorithm that is responsible for the content of the current graph element.
static IProperty<String> CONTENT_DIAGT
          the diagram type identifier for the content of the current graph element.
static IProperty<String> CONTENT_HINT
          the layout algorithm or type identifier for the content of the current graph element.
static IProperty<Boolean> HAS_PORTS
          whether the node in the current context contains any ports.
static IProperty<Boolean> OPT_MAKE_OPTIONS
          option for layout context: whether the OPTIONS list shall be created.
static IProperty<List<LayoutOptionData<?>>> OPTIONS
          the layout options that are supported by the active layout algorithm.
static int PRIORITY
          the priority for the default layout configuration.
 
Constructor Summary
DefaultLayoutConfig()
           
 
Method Summary
 void enrich(LayoutContext context)
          Enrich the given context with additional information that can be derived from what is already contained.
static LayoutAlgorithmData getLayouterData(String theLayoutHint, String diagramType)
          Determine the most appropriate layout algorithm for the given layout hint and diagram type.
 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 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 the default layout configuration.

See Also:
Constant Field Values

OPT_MAKE_OPTIONS

public static final IProperty<Boolean> OPT_MAKE_OPTIONS
option for layout context: whether the OPTIONS list shall be created.


OPTIONS

public static final IProperty<List<LayoutOptionData<?>>> OPTIONS
the layout options that are supported by the active layout algorithm.


CONTENT_HINT

public static final IProperty<String> CONTENT_HINT
the layout algorithm or type identifier for the content of the current graph element.


CONTENT_DIAGT

public static final IProperty<String> CONTENT_DIAGT
the diagram type identifier for the content of the current graph element.


CONTENT_ALGO

public static final IProperty<LayoutAlgorithmData> CONTENT_ALGO
the layout algorithm that is responsible for the content of the current graph element.


CONTAINER_HINT

public static final IProperty<String> CONTAINER_HINT
the layout algorithm or type identifier for the container of the current graph element.


CONTAINER_DIAGT

public static final IProperty<String> CONTAINER_DIAGT
the diagram type identifier for the container of the current graph element.


CONTAINER_ALGO

public static final IProperty<LayoutAlgorithmData> CONTAINER_ALGO
the layout algorithm that is assigned to the container of the current graph element.


HAS_PORTS

public static final IProperty<Boolean> HAS_PORTS
whether the node in the current context contains any ports.

Constructor Detail

DefaultLayoutConfig

public DefaultLayoutConfig()
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

getLayouterData

public static LayoutAlgorithmData getLayouterData(String theLayoutHint,
                                                  String diagramType)
Determine the most appropriate layout algorithm for the given layout hint and diagram type.

Parameters:
theLayoutHint - either a layout algorithm identifier, or a layout type identifier, or null
diagramType - a diagram type identifier
Returns:
the most appropriate layout algorithm

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