Class LayoutServiceImpl
java.lang.Object
org.eclipse.graphiti.internal.services.impl.LayoutServiceImpl
- All Implemented Interfaces:
IGaLayoutService
,ILayoutService
,IPeLayoutService
-
Constructor Summary
-
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.getConnectionMidpoint
(Connection c, double d) Gets the connection midpoint.getGaBoundsForAnchor
(Anchor anchor) Returns the bounds of the graphics algorithm, which is referenced by the anchor.protected IGaService
getLocationInfo
(Shape shape, int x, int y) Returns the location info for a specific position inside a shape.getLocationRelativeToDiagram
(Anchor anchor) Returns the location of the anchor relative to the diagram.Returns the location of the shape relative to the diagram.protected IPeService
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.
-
Constructor Details
-
LayoutServiceImpl
public LayoutServiceImpl()
-
-
Method Details
-
calculateSize
Description copied from interface:IGaLayoutService
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.- Specified by:
calculateSize
in interfaceIGaLayoutService
- Parameters:
ga
-- Returns:
- See Also:
-
calculateSize
Description copied from interface:IGaLayoutService
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.- Specified by:
calculateSize
in interfaceIGaLayoutService
- Parameters:
ga
-considerLineWidth
-- Returns:
- See Also:
-
getConnectionMidpoint
Description copied from interface:IPeLayoutService
Gets the connection midpoint.- Specified by:
getConnectionMidpoint
in interfaceIPeLayoutService
- Parameters:
c
-d
-- Returns:
- See Also:
-
getGaBoundsForAnchor
Description copied from interface:IPeLayoutService
Returns the bounds of the graphics algorithm, which is referenced by the anchor.- Specified by:
getGaBoundsForAnchor
in interfaceIPeLayoutService
- Parameters:
anchor
-- Returns:
- See Also:
-
getLocationInfo
Description copied from interface:IPeLayoutService
Returns the location info for a specific position inside a shape. The location info contains the shape and the graphics algorithm at the given position.- Specified by:
getLocationInfo
in interfaceIPeLayoutService
- Parameters:
shape
-x
-y
-- Returns:
- See Also:
-
getLocationRelativeToDiagram
Description copied from interface:IPeLayoutService
Returns the location of the anchor relative to the diagram.- Specified by:
getLocationRelativeToDiagram
in interfaceIPeLayoutService
- Parameters:
anchor
-- Returns:
- See Also:
-
getLocationRelativeToDiagram
Description copied from interface:IPeLayoutService
Returns the location of the shape relative to the diagram.- Specified by:
getLocationRelativeToDiagram
in interfaceIPeLayoutService
- Parameters:
shape
-- Returns:
- See Also:
-
setHeight
Description copied from interface:IGaLayoutService
Sets the height of the given graphics algorithm.- Specified by:
setHeight
in interfaceIGaLayoutService
- Parameters:
ga
-height
-- See Also:
-
setLocationAndSize
Description copied from interface:IGaLayoutService
Sets location and size of the given graphics algorithm.- Specified by:
setLocationAndSize
in interfaceIGaLayoutService
- Parameters:
ga
-x
-y
-width
-height
-- See Also:
-
setLocationAndSize
public void setLocationAndSize(GraphicsAlgorithm ga, int x, int y, int width, int height, boolean avoidNegativeCoordinates) Description copied from interface:IGaLayoutService
Sets location and size of the given graphics algorithm.- Specified by:
setLocationAndSize
in interfaceIGaLayoutService
- Parameters:
ga
-x
-y
-width
-height
-avoidNegativeCoordinates
-- See Also:
-
setLocation
Description copied from interface:IGaLayoutService
Sets the location of the given graphics algorithm.- Specified by:
setLocation
in interfaceIGaLayoutService
- Parameters:
ga
-x
-y
-- See Also:
-
setLocation
Description copied from interface:IGaLayoutService
Sets the location of the given graphics algorithm.- Specified by:
setLocation
in interfaceIGaLayoutService
- Parameters:
ga
-x
-y
-avoidNegativeCoordinates
-- See Also:
-
setSize
Description copied from interface:IGaLayoutService
Sets the size of the given graphics algorithm.- Specified by:
setSize
in interfaceIGaLayoutService
- Parameters:
ga
-width
-height
-- See Also:
-
setWidth
Description copied from interface:IGaLayoutService
Sets the width of the given graphics algorithm.- Specified by:
setWidth
in interfaceIGaLayoutService
- Parameters:
ga
-width
-- See Also:
-
getGaService
-
getPeService
-