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