de.cau.cs.kieler.kiml.export.util
Class XtendUtil

java.lang.Object
  extended by de.cau.cs.kieler.kiml.export.util.XtendUtil

public final class XtendUtil
extends Object

A utility class that provides functionality that can be accessed by xtend transformations.

Rating red

Method Summary
static void callMethod(Object instance, String methodName, Object... params)
          This is a workaround method for xtend to solve the issue of missing methods, which are not really missing, but unknown to xtend.
static void callStringMethod(Object instance, String methodName, String param)
          See callMethod.
static String generateName(String generatorName, String namePrefix)
          Generates a name for the given generator name using the prefix.
static KEdgeLayout getEdgeLayout(KEdge edge)
          Returns the edge layout for the given edge.
static KShapeLayout getShapeLayout(KNode node)
          Returns the shape layout for the given node.
static void ogmlSetShapeBounds(ShapeType1 shape, KShapeLayout shapeLayout)
          Applies the bounds defined by a shape layout to an ogml shape.
static void resetGenerator(String generatorName)
          Resets the generator specified by the given name.
static void resetGenerators()
          Resets all name generators.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

generateName

public static String generateName(String generatorName,
                                  String namePrefix)
Generates a name for the given generator name using the prefix.

Parameters:
generatorName - the name of the generator
namePrefix - a prefix for the generated name
Returns:
the generated name

resetGenerator

public static void resetGenerator(String generatorName)
Resets the generator specified by the given name.

Parameters:
generatorName - the generator name

resetGenerators

public static void resetGenerators()
Resets all name generators.


callMethod

public static void callMethod(Object instance,
                              String methodName,
                              Object... params)
This is a workaround method for xtend to solve the issue of missing methods, which are not really missing, but unknown to xtend. It calls a method of a class instance with a number of parameters.

Parameters:
instance - the class instance
methodName - the method name
params - the parameters

callStringMethod

public static void callStringMethod(Object instance,
                                    String methodName,
                                    String param)
See callMethod. This method is restricted on methods with a single string parameter.

Parameters:
instance - the class instance
methodName - the method name
param - the string parameter

getShapeLayout

public static KShapeLayout getShapeLayout(KNode node)
Returns the shape layout for the given node.

Parameters:
node - the node
Returns:
the shape layout

getEdgeLayout

public static KEdgeLayout getEdgeLayout(KEdge edge)
Returns the edge layout for the given edge.

Parameters:
edge - the edge
Returns:
the edge layout

ogmlSetShapeBounds

public static void ogmlSetShapeBounds(ShapeType1 shape,
                                      KShapeLayout shapeLayout)
Applies the bounds defined by a shape layout to an ogml shape.

Parameters:
shape - the shape
shapeLayout - the shape layout