Package org.eclipse.graphiti.services
Interface IGaLayoutService
- All Known Subinterfaces:
IGaService
,ILayoutService
,IUiLayoutService
- All Known Implementing Classes:
GaServiceImpl
,LayoutServiceImpl
,UiLayoutService
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
Modifier and TypeMethodDescriptionCalculates the size of the given graphics algorithm.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 Details
-
calculateSize
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
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 algorithmconsiderLineWidth
- if TRUE, the line width will be considered in the dimension- Returns:
- the dimension of the given graphics algorithm
-
setHeight
Sets the height of the given graphics algorithm.- Parameters:
ga
- graphics algorithmheight
- the new height
-
setLocationAndSize
Sets location and size of the given graphics algorithm.- Parameters:
ga
- graphics algorithmx
- the new x coordinatey
- the new y coordinatewidth
- the new widthheight
- 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 algorithmx
- the new x coordinatey
- the new y coordinatewidth
- the new widthheight
- the new heightavoidNegativeCoordinates
- if TRUE, a negative coordinate will automatically set to 0.
-
setLocation
Sets the location of the given graphics algorithm.- Parameters:
ga
- graphics algorithmx
- the new x coordinatey
- the new y coordinate
-
setLocation
Sets the location of the given graphics algorithm.- Parameters:
ga
- graphics algorithmx
- the new x coordinatey
- the new y coordinateavoidNegativeCoordinates
- if TRUE, a negative coordinate will automatically set to 0.
-
setSize
Sets the size of the given graphics algorithm.- Parameters:
ga
- graphics algorithmwidth
- the new widthheight
- the new height
-
setWidth
Sets the width of the given graphics algorithm.- Parameters:
ga
- graphics algorithmwidth
- the new width
-