Package org.eclipse.graphiti.services
Interface IGaService
- All Superinterfaces:
IGaCreateService
,IGaLayoutService
- All Known Implementing Classes:
GaServiceImpl
The interface IGaService provides convenient services for the creation and
layout of graphics algorithm.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteColor
(Color color) Deletes the given color.void
deleteFont
(Font font) Deletes the given font.void
deleteRenderingStyle
(AbstractStyle abstractStyle) Deletes the RenderingStyle from the given AbstractStyle.findStyle
(StyleContainer styleContainer, String id) Searches for a style with the given id.getBackgroundColor
(GraphicsAlgorithm ga, boolean checkStyles) Gets the background color.getFont
(AbstractText at, boolean checkStyles) Gets the font.getForegroundColor
(GraphicsAlgorithm ga, boolean checkStyles) Gets the foreground color.getHorizontalAlignment
(AbstractText at, boolean checkStyles) Gets the horizontal alignment.getLineStyle
(GraphicsAlgorithm ga, boolean checkStyles) Gets the line style.int
getLineWidth
(GraphicsAlgorithm ga, boolean checkStyles) Gets the line width.getRenderingStyle
(GraphicsAlgorithm ga, boolean checkStyles) Gets the rendering style.double
getRotation
(AbstractText at, boolean checkStyles) Gets the rotation angle.double
getTransparency
(GraphicsAlgorithm ga, boolean checkStyles) Gets the transparency.getVerticalAlignment
(AbstractText at, boolean checkStyles) Gets the vertical alignment.boolean
isFilled
(GraphicsAlgorithm ga, boolean checkStyles) Checks if is filled.boolean
isLineVisible
(GraphicsAlgorithm ga, boolean checkStyles) Checks if line is visible.boolean
isProportional
(Image image, boolean checkStyles) Checks if is proportional.boolean
isStretchH
(Image image, boolean checkStyles) Checks if is stretch h.boolean
isStretchV
(Image image, boolean checkStyles) Checks if is stretch v.manageColor
(Diagram diagram, int red, int green, int blue) Provides a color instance with the given RGB values by either creating a new one and aggregating it to the diagram or finding it in the diagrams palette of colors.manageColor
(Diagram diagram, IColorConstant colorConstant) Provides a color instance with the given color constant by either creating a new one and aggregating it to the diagram or finding it in the diagrams palette of colors.manageDefaultFont
(Diagram diagram) Provides the font instance for the default font (Arial in size 8) by either creating a new one and aggregating it to the diagram or finding it in the diagrams list of fonts.manageDefaultFont
(Diagram diagram, boolean isItalic, boolean isBold) Provides the font instance for the default font (Arial in size 8) by either creating a new one and aggregating it to the diagram or finding it in the diagrams list of fonts.manageFont
(Diagram diagram, String name, int size) Provides a font instance by either creating a new one and aggregating it to the diagram or finding it in the diagrams list of fonts.manageFont
(Diagram diagram, String name, int size, boolean isItalic, boolean isBold) Provides a font instance by either creating a new one and aggregating it to the diagram or finding it in the diagrams list of fonts.void
movePolylinePoint
(Polyline polyline, int index, int deltaX, int deltaY) Move polyline point.void
resetAll
(AbstractStyle abstractStyle) Sets the providedAbstractStyle
(could be aGraphicsAlgorithm
or aStyle
) to ignore all locally set attributes and instead use the ones provided by the style set to theAbstractStyle
.void
setRenderingStyle
(AbstractStyle abstractStyle, AdaptedGradientColoredAreas adaptedGradientColoredAreas) Sets a RenderingStyle with given adapted gradient colored areas for the givenAbstractStyle
.Methods inherited from interface org.eclipse.graphiti.services.IGaCreateService
createDefaultMultiText, createDefaultMultiText, createDefaultText, createDefaultText, createEllipse, createImage, createInvisibleRectangle, createMultiText, createMultiText, createMultiText, createMultiText, createPlainEllipse, createPlainImage, createPlainMultiText, createPlainMultiText, createPlainPlatformGraphicsAlgorithm, createPlainPolygon, createPlainPolygon, createPlainPolygon, createPlainPolygon, createPlainPolyline, createPlainPolyline, createPlainPolyline, createPlainPolyline, createPlainRectangle, createPlainRoundedRectangle, createPlainStyle, createPlainText, createPlainText, createPlatformGraphicsAlgorithm, createPoint, createPoint, createPointList, createPointList, createPolygon, createPolygon, createPolygon, createPolygon, createPolyline, createPolyline, createPolyline, createPolyline, createRectangle, createRoundedRectangle, createShiftedColor, createShiftedColor, createStyle, createText, createText, createText, createText, createTextStyle, createTextStyle, createTextStyleRegion, createTextStyleRegion
Methods inherited from interface org.eclipse.graphiti.services.IGaLayoutService
calculateSize, calculateSize, setHeight, setLocation, setLocation, setLocationAndSize, setLocationAndSize, setSize, setWidth
-
Field Details
-
DEFAULT_FONT
- Since:
- 0.9
- See Also:
-
DEFAULT_FONT_SIZE
static final int DEFAULT_FONT_SIZE- Since:
- 0.9
- See Also:
-
-
Method Details
-
deleteFont
Deletes the given font.- Parameters:
font
- the font to delete- Since:
- 0.8
-
deleteColor
Deletes the given color.- Parameters:
color
- the color to delete- Since:
- 0.8
-
deleteRenderingStyle
Deletes the RenderingStyle from the given AbstractStyle.- Parameters:
abstractStyle
- the abstract style from which to delete the RenderingStyle.
-
findStyle
Searches for a style with the given id. The search scope is the given style container (which will usually be the diagram).- Parameters:
styleContainer
- the style containerid
- style id- Returns:
- the found style; null if not found
-
getRotation
Gets the rotation angle.- Parameters:
at
- the abstract textcheckStyles
- the check styles- Returns:
- the angle
- Since:
- 0.11
-
getBackgroundColor
Gets the background color.- Parameters:
ga
- the graphics algorithmcheckStyles
- the check styles- Returns:
- the background color
-
getFont
Gets the font.- Parameters:
at
- the abstract textcheckStyles
- the check styles- Returns:
- the font
-
getForegroundColor
Gets the foreground color.- Parameters:
ga
- the graphics algorithmcheckStyles
- the check styles- Returns:
- the foreground color
-
getHorizontalAlignment
Gets the horizontal alignment.- Parameters:
at
- the abstract textcheckStyles
- the check styles- Returns:
- the horizontal alignment
-
getLineStyle
Gets the line style.- Parameters:
ga
- the graphics algorithmcheckStyles
- the check styles- Returns:
- the line style
-
getLineWidth
Gets the line width.- Parameters:
ga
- the graphics algorithmcheckStyles
- the check styles- Returns:
- the line width
-
getRenderingStyle
Gets the rendering style.- Parameters:
ga
- the graphics algorithmcheckStyles
- the check styles- Returns:
- the rendering style
-
getTransparency
Gets the transparency.- Parameters:
ga
- the graphics algorithmcheckStyles
- the check styles- Returns:
- the transparency
-
getVerticalAlignment
Gets the vertical alignment.- Parameters:
at
- the abstract textcheckStyles
- the check styles- Returns:
- the vertical alignment
-
resetAll
Sets the providedAbstractStyle
(could be aGraphicsAlgorithm
or aStyle
) to ignore all locally set attributes and instead use the ones provided by the style set to theAbstractStyle
.- Parameters:
abstractStyle
- The abstract style (style or graphics algorithm)- Since:
- 0.9
-
isFilled
Checks if is filled.- Parameters:
ga
- the graphics algorithmcheckStyles
- the check styles- Returns:
- true, if is filled
-
isLineVisible
Checks if line is visible.- Parameters:
ga
- the graphics algorithmcheckStyles
- the check styles- Returns:
- true, if line is visible
-
isProportional
Checks if is proportional.- Parameters:
image
- the imagecheckStyles
- the check styles- Returns:
- true, if is proportional
-
isStretchH
Checks if is stretch h.- Parameters:
image
- the imagecheckStyles
- the check styles- Returns:
- true, if is stretch h
-
isStretchV
Checks if is stretch v.- Parameters:
image
- the imagecheckStyles
- the check styles- Returns:
- true, if is stretch v
-
manageColor
Provides a color instance with the given color constant by either creating a new one and aggregating it to the diagram or finding it in the diagrams palette of colors.- Parameters:
diagram
- the diagram that aggregates the colorscolorConstant
- which contains the RGB values.- Returns:
- the color instance
-
manageColor
Provides a color instance with the given RGB values by either creating a new one and aggregating it to the diagram or finding it in the diagrams palette of colors.- Parameters:
diagram
- the diagram that aggregates the colorsred
- the redgreen
- the greenblue
- the blue- Returns:
- the color instance
-
manageDefaultFont
Provides the font instance for the default font (Arial in size 8) by either creating a new one and aggregating it to the diagram or finding it in the diagrams list of fonts.- Parameters:
diagram
- the diagram that aggregates the fonts- Returns:
- the font instance
- Since:
- 0.9
-
manageDefaultFont
Provides the font instance for the default font (Arial in size 8) by either creating a new one and aggregating it to the diagram or finding it in the diagrams list of fonts.- Parameters:
diagram
- the diagram that aggregates the fontsisItalic
- the is italicisBold
- the is bold- Returns:
- the font instance
- Since:
- 0.9
-
manageFont
Provides a font instance by either creating a new one and aggregating it to the diagram or finding it in the diagrams list of fonts.- Parameters:
diagram
- the diagram that aggregates the fontsname
- the name of the fontsize
- the size of the font- Returns:
- the font instance
- Since:
- 0.8
-
manageFont
Provides a font instance by either creating a new one and aggregating it to the diagram or finding it in the diagrams list of fonts.- Parameters:
diagram
- the diagram that aggregates the fontsname
- the name of the fontsize
- the size of the fontisItalic
- the is italicisBold
- the is bold- Returns:
- the font instance
- Since:
- 0.8
-
movePolylinePoint
Move polyline point.- Parameters:
polyline
- the polylineindex
- the indexdeltaX
- the delta xdeltaY
- the delta y
-
setRenderingStyle
void setRenderingStyle(AbstractStyle abstractStyle, AdaptedGradientColoredAreas adaptedGradientColoredAreas) Sets a RenderingStyle with given adapted gradient colored areas for the givenAbstractStyle
. TheAdaptedGradientColoredAreas
are defined and created inPredefinedColoredAreas
.- Parameters:
abstractStyle
- the abstract style for which to set the rendering style.adaptedGradientColoredAreas
- TheAdaptedGradientColoredAreas
gradient colored areas.
-