org.openbp.cockpit.modeler.util
Class ModelerUtil

java.lang.Object
  extended by org.openbp.cockpit.modeler.util.ModelerUtil

public class ModelerUtil
extends java.lang.Object

Modeler util.

Author:
Heiko Erhardt

Method Summary
static NodeFigure createFinalNodeFromSocket(SocketFigure patternSocketFigure)
          Creates an final node figure from a socket figure.
static NodeFigure createInitialNodeFromSocket(SocketFigure patternSocketFigure)
          Creates an initial node figure from a socket figure.
static java.util.List<java.lang.String> getStringListFromSettings(java.lang.String settingName)
          Gets a list of class names from the specified setting element.
static void preventOverlap(ProcessDrawing drawing, CH.ifa.draw.framework.Figure figure)
          Positions the figure within the process drawing so that is doesn't completely overlap another figure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

preventOverlap

public static void preventOverlap(ProcessDrawing drawing,
                                  CH.ifa.draw.framework.Figure figure)
Positions the figure within the process drawing so that is doesn't completely overlap another figure. The method will check if the position of the given figure is already occupied by another figure of the same type. If yes, it will recursively try an offset 50 pixels to the lower right.

Parameters:
drawing - Drawing to operate on
figure - Figure to position

createInitialNodeFromSocket

public static NodeFigure createInitialNodeFromSocket(SocketFigure patternSocketFigure)
Creates an initial node figure from a socket figure. The initial node will have the same name, display name, description and role definitions and the same parameters on its socket as the given socket The node figure will be placed to the left or right of the socket figure (according to the socket's angle).

Parameters:
patternSocketFigure - Pattern socket figure
Returns:
The new node figure

createFinalNodeFromSocket

public static NodeFigure createFinalNodeFromSocket(SocketFigure patternSocketFigure)
Creates an final node figure from a socket figure. The final node will have the same name, display name and description and the same parameters on its socket as the given socket The node figure will be placed to the left or right of the socket figure (according to the socket's angle).

Parameters:
patternSocketFigure - Pattern socket figure
Returns:
The new node figure

getStringListFromSettings

public static java.util.List<java.lang.String> getStringListFromSettings(java.lang.String settingName)
Gets a list of class names from the specified setting element.

Parameters:
settingName - Name of the property setting
Returns:
An iterator of class names


Copyright © 2011. All Rights Reserved.