org.eclipse.graphiti.services
Interface IGaLayoutService

All Known Subinterfaces:
IGaService, ILayoutService, IUiLayoutService

public interface IGaLayoutService

The interface IGaLayoutService provides convenient services for the calculation and change of the size and/or location of graphics algorithm. This makes it easier to write layout features.


Method Summary
 IDimension calculateSize(GraphicsAlgorithm ga)
          Calculates the size of the given graphics algorithm.
 IDimension calculateSize(GraphicsAlgorithm ga, boolean considerLineWidth)
          Calculates the size of the given graphics algorithm.
 void setHeight(GraphicsAlgorithm ga, int height)
          Sets the height of the given graphics algorithm.
 void setLocation(GraphicsAlgorithm ga, int x, int y)
          Sets the location of the given graphics algorithm.
 void setLocation(GraphicsAlgorithm ga, int x, int y, boolean avoidNegativeCoordinates)
          Sets the location of the given graphics algorithm.
 void setLocationAndSize(GraphicsAlgorithm ga, int x, int y, int width, int height)
          Sets location and size of the given graphics algorithm.
 void setLocationAndSize(GraphicsAlgorithm ga, int x, int y, int width, int height, boolean avoidNegativeCoordinates)
          Sets location and size of the given graphics algorithm.
 void setSize(GraphicsAlgorithm ga, int width, int height)
          Sets the size of the given graphics algorithm.
 void setWidth(GraphicsAlgorithm ga, int width)
          Sets the width of the given graphics algorithm.
 

Method Detail

calculateSize

IDimension calculateSize(GraphicsAlgorithm ga)
Calculates the size of the given graphics algorithm. If the graphics algorithm is a polyline or polygon then the size will be calculated. Otherwise the size of the graphics algorithm is simply returned.

Parameters:
ga - graphics algorithm
Returns:
the dimension of the given graphics algorithm

calculateSize

IDimension calculateSize(GraphicsAlgorithm ga,
                         boolean considerLineWidth)
Calculates the size of the given graphics algorithm. If the graphics algorithm is a polyline or polygon then the size will be calculated. Otherwise the size of the graphics algorithm is simply returned.

Parameters:
ga - graphics algorithm
considerLineWidth - if TRUE, the line width will be considered in the dimension
Returns:
the dimension of the given graphics algorithm

setHeight

void setHeight(GraphicsAlgorithm ga,
               int height)
Sets the height of the given graphics algorithm.

Parameters:
ga - graphics algorithm
height - the new height

setLocationAndSize

void setLocationAndSize(GraphicsAlgorithm ga,
                        int x,
                        int y,
                        int width,
                        int height)
Sets location and size of the given graphics algorithm.

Parameters:
ga - graphics algorithm
x - the new x coordinate
y - the new y coordinate
width - the new width
height - the new height

setLocationAndSize

void setLocationAndSize(GraphicsAlgorithm ga,
                        int x,
                        int y,
                        int width,
                        int height,
                        boolean avoidNegativeCoordinates)
Sets location and size of the given graphics algorithm.

Parameters:
ga - graphics algorithm
x - the new x coordinate
y - the new y coordinate
width - the new width
height - the new height
avoidNegativeCoordinates - if TRUE, a negative coordinate will automatically set to 0.

setLocation

void setLocation(GraphicsAlgorithm ga,
                 int x,
                 int y)
Sets the location of the given graphics algorithm.

Parameters:
ga - graphics algorithm
x - the new x coordinate
y - the new y coordinate

setLocation

void setLocation(GraphicsAlgorithm ga,
                 int x,
                 int y,
                 boolean avoidNegativeCoordinates)
Sets the location of the given graphics algorithm.

Parameters:
ga - graphics algorithm
x - the new x coordinate
y - the new y coordinate
avoidNegativeCoordinates - if TRUE, a negative coordinate will automatically set to 0.

setSize

void setSize(GraphicsAlgorithm ga,
             int width,
             int height)
Sets the size of the given graphics algorithm.

Parameters:
ga - graphics algorithm
width - the new width
height - the new height

setWidth

void setWidth(GraphicsAlgorithm ga,
              int width)
Sets the width of the given graphics algorithm.

Parameters:
ga - graphics algorithm
width - the new width


Copyright (c) SAP AG 2005, 2010.