de.cau.cs.kieler.kiml.graphiti
Class GraphitiLayoutConfig

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

public class GraphitiLayoutConfig
extends Object
implements IMutableLayoutConfig

Layout option configuration for Graphiti.

Rating red

Field Summary
static String DEF_PREFIX
          Prefix for diagram defaults stored in the top-level edit part.
static IProperty<org.eclipse.graphiti.mm.pictograms.PictogramElement> PICTO_ELEM
          the pictogram element for the graph element in the context.
static String PREFIX
          Prefix for all layout options.
static int PRIORITY
          the priority for the Graphiti layout configuration.
 
Fields inherited from interface de.cau.cs.kieler.kiml.config.IMutableLayoutConfig
OPT_RECURSIVE
 
Constructor Summary
GraphitiLayoutConfig()
           
 
Method Summary
 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 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
 

Field Detail

PRIORITY

public static final int PRIORITY
the priority for the Graphiti layout configuration.

See Also:
Constant Field Values

PREFIX

public static final String PREFIX
Prefix for all layout options.

See Also:
Constant Field Values

DEF_PREFIX

public static final String DEF_PREFIX
Prefix for diagram defaults stored in the top-level edit part.

See Also:
Constant Field Values

PICTO_ELEM

public static final IProperty<org.eclipse.graphiti.mm.pictograms.PictogramElement> PICTO_ELEM
the pictogram element for the graph element in the context.

Constructor Detail

GraphitiLayoutConfig

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

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

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

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

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