de.cau.cs.kieler.core.model.graphiti
Class GraphitiUtil

java.lang.Object
  extended by de.cau.cs.kieler.core.model.graphiti.GraphitiUtil

public final class GraphitiUtil
extends Object

Utility class for Graphiti editors.

Rating red

Method Summary
static org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm findVisibleGa(org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm graphicsAlgorithm)
          Given a graphics algorithm, find the first child that is not invisible.
static boolean setBounds(org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm ga, int x, int y, int width, int height)
          Set the bounds of the given graphics algorithm.
static boolean setPoints(org.eclipse.graphiti.mm.algorithms.Polyline polyline, int[] coords)
          Set the points of the given polyline.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setBounds

public static boolean setBounds(org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm ga,
                                int x,
                                int y,
                                int width,
                                int height)
Set the bounds of the given graphics algorithm.

Parameters:
ga - a graphics algorithm
x - the new x coordinate
y - the new y coordinate
width - the new width
height - the new height
Returns:
whether the bounds have changed

setPoints

public static boolean setPoints(org.eclipse.graphiti.mm.algorithms.Polyline polyline,
                                int[] coords)
Set the points of the given polyline.

Parameters:
polyline - a polyline
coords - an array of alternating x / y coordinates
Returns:
true if the points have changed

findVisibleGa

public static org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm findVisibleGa(org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm graphicsAlgorithm)
Given a graphics algorithm, find the first child that is not invisible. If the GA itself is visible, it is returned.

Parameters:
graphicsAlgorithm - the parent graphics algorithm
Returns:
a visible graphics algorithm