de.cau.cs.kieler.kiml.ui.diagram
Class ApplyLayoutRequest

java.lang.Object
  extended by org.eclipse.gef.Request
      extended by de.cau.cs.kieler.kiml.ui.diagram.ApplyLayoutRequest

public class ApplyLayoutRequest
extends Request

Request for automatic layout on a set of edit parts of a diagram.

Rating proposed yellow
(2009-12-11) msp

Field Summary
static String REQ_APPLY_LAYOUT
          the request type used to apply layout.
 
Constructor Summary
ApplyLayoutRequest()
          Creates a request to apply layout.
 
Method Summary
 void addElement(KGraphElement element, GraphicalEditPart editPart)
          Adds the given graph element and edit part to the request.
 List<Pair<KGraphElement,GraphicalEditPart>> getElements()
          Returns a list of the graph elements and edit parts of this request.
 float getXBound()
          Returns the upper bound for horizontal coordinates.
 float getYBound()
          Returns the upper bound for vertical coordinates.
 void setUpperBound(float x, float y)
          Set an upper bound on the coordinates of the layout graph.
 
Methods inherited from class org.eclipse.gef.Request
getExtendedData, getType, setExtendedData, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQ_APPLY_LAYOUT

public static final String REQ_APPLY_LAYOUT
the request type used to apply layout.

See Also:
Constant Field Values
Constructor Detail

ApplyLayoutRequest

public ApplyLayoutRequest()
Creates a request to apply layout.

Method Detail

addElement

public void addElement(KGraphElement element,
                       GraphicalEditPart editPart)
Adds the given graph element and edit part to the request. Graph elements for which the NO_LAYOUT option is active are not included.

Parameters:
element - graph element with layout data
editPart - the corresponding edit part

getElements

public List<Pair<KGraphElement,GraphicalEditPart>> getElements()
Returns a list of the graph elements and edit parts of this request.

Returns:
a list with graph elements and corresponding edit parts

setUpperBound

public void setUpperBound(float x,
                          float y)
Set an upper bound on the coordinates of the layout graph.

Parameters:
x - the upper bound for horizontal coordinates
y - the upper bound for vertical coordinates

getXBound

public float getXBound()
Returns the upper bound for horizontal coordinates.

Returns:
the x bound

getYBound

public float getYBound()
Returns the upper bound for vertical coordinates.

Returns:
the y bound