Package org.eclipse.graphiti.services
Interface IGaService
-
- All Superinterfaces:
IGaCreateService
,IGaLayoutService
- All Known Implementing Classes:
GaServiceImpl
public interface IGaService extends IGaCreateService, IGaLayoutService
The interface IGaService provides convenient services for the creation and layout of graphics algorithm.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_FONT
static int
DEFAULT_FONT_SIZE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
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.Style
findStyle(StyleContainer styleContainer, java.lang.String id)
Searches for a style with the given id.Color
getBackgroundColor(GraphicsAlgorithm ga, boolean checkStyles)
Gets the background color.Font
getFont(AbstractText at, boolean checkStyles)
Gets the font.Color
getForegroundColor(GraphicsAlgorithm ga, boolean checkStyles)
Gets the foreground color.Orientation
getHorizontalAlignment(AbstractText at, boolean checkStyles)
Gets the horizontal alignment.LineStyle
getLineStyle(GraphicsAlgorithm ga, boolean checkStyles)
Gets the line style.int
getLineWidth(GraphicsAlgorithm ga, boolean checkStyles)
Gets the line width.RenderingStyle
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.Orientation
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.Color
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.Color
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.Font
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.Font
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.Font
manageFont(Diagram diagram, java.lang.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.Font
manageFont(Diagram diagram, java.lang.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 Detail
-
DEFAULT_FONT
static final java.lang.String DEFAULT_FONT
- Since:
- 0.9
- See Also:
- Constant Field Values
-
DEFAULT_FONT_SIZE
static final int DEFAULT_FONT_SIZE
- Since:
- 0.9
- See Also:
- Constant Field Values
-
-
Method Detail
-
deleteFont
void deleteFont(Font font)
Deletes the given font.- Parameters:
font
- the font to delete- Since:
- 0.8
-
deleteColor
void deleteColor(Color color)
Deletes the given color.- Parameters:
color
- the color to delete- Since:
- 0.8
-
deleteRenderingStyle
void deleteRenderingStyle(AbstractStyle abstractStyle)
Deletes the RenderingStyle from the given AbstractStyle.- Parameters:
abstractStyle
- the abstract style from which to delete the RenderingStyle.
-
findStyle
Style findStyle(StyleContainer styleContainer, java.lang.String id)
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
double getRotation(AbstractText at, boolean checkStyles)
Gets the rotation angle.- Parameters:
at
- the abstract textcheckStyles
- the check styles- Returns:
- the angle
- Since:
- 0.11
-
getBackgroundColor
Color getBackgroundColor(GraphicsAlgorithm ga, boolean checkStyles)
Gets the background color.- Parameters:
ga
- the graphics algorithmcheckStyles
- the check styles- Returns:
- the background color
-
getFont
Font getFont(AbstractText at, boolean checkStyles)
Gets the font.- Parameters:
at
- the abstract textcheckStyles
- the check styles- Returns:
- the font
-
getForegroundColor
Color getForegroundColor(GraphicsAlgorithm ga, boolean checkStyles)
Gets the foreground color.- Parameters:
ga
- the graphics algorithmcheckStyles
- the check styles- Returns:
- the foreground color
-
getHorizontalAlignment
Orientation getHorizontalAlignment(AbstractText at, boolean checkStyles)
Gets the horizontal alignment.- Parameters:
at
- the abstract textcheckStyles
- the check styles- Returns:
- the horizontal alignment
-
getLineStyle
LineStyle getLineStyle(GraphicsAlgorithm ga, boolean checkStyles)
Gets the line style.- Parameters:
ga
- the graphics algorithmcheckStyles
- the check styles- Returns:
- the line style
-
getLineWidth
int getLineWidth(GraphicsAlgorithm ga, boolean checkStyles)
Gets the line width.- Parameters:
ga
- the graphics algorithmcheckStyles
- the check styles- Returns:
- the line width
-
getRenderingStyle
RenderingStyle getRenderingStyle(GraphicsAlgorithm ga, boolean checkStyles)
Gets the rendering style.- Parameters:
ga
- the graphics algorithmcheckStyles
- the check styles- Returns:
- the rendering style
-
getTransparency
double getTransparency(GraphicsAlgorithm ga, boolean checkStyles)
Gets the transparency.- Parameters:
ga
- the graphics algorithmcheckStyles
- the check styles- Returns:
- the transparency
-
getVerticalAlignment
Orientation getVerticalAlignment(AbstractText at, boolean checkStyles)
Gets the vertical alignment.- Parameters:
at
- the abstract textcheckStyles
- the check styles- Returns:
- the vertical alignment
-
resetAll
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
.- Parameters:
abstractStyle
- The abstract style (style or graphics algorithm)- Since:
- 0.9
-
isFilled
boolean isFilled(GraphicsAlgorithm ga, boolean checkStyles)
Checks if is filled.- Parameters:
ga
- the graphics algorithmcheckStyles
- the check styles- Returns:
- true, if is filled
-
isLineVisible
boolean isLineVisible(GraphicsAlgorithm ga, boolean checkStyles)
Checks if line is visible.- Parameters:
ga
- the graphics algorithmcheckStyles
- the check styles- Returns:
- true, if line is visible
-
isProportional
boolean isProportional(Image image, boolean checkStyles)
Checks if is proportional.- Parameters:
image
- the imagecheckStyles
- the check styles- Returns:
- true, if is proportional
-
isStretchH
boolean isStretchH(Image image, boolean checkStyles)
Checks if is stretch h.- Parameters:
image
- the imagecheckStyles
- the check styles- Returns:
- true, if is stretch h
-
isStretchV
boolean isStretchV(Image image, boolean checkStyles)
Checks if is stretch v.- Parameters:
image
- the imagecheckStyles
- the check styles- Returns:
- true, if is stretch v
-
manageColor
Color 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.- Parameters:
diagram
- the diagram that aggregates the colorscolorConstant
- which contains the RGB values.- Returns:
- the color instance
-
manageColor
Color 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.- Parameters:
diagram
- the diagram that aggregates the colorsred
- the redgreen
- the greenblue
- the blue- Returns:
- the color instance
-
manageDefaultFont
Font 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.- Parameters:
diagram
- the diagram that aggregates the fonts- Returns:
- the font instance
- Since:
- 0.9
-
manageDefaultFont
Font 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.- Parameters:
diagram
- the diagram that aggregates the fontsisItalic
- the is italicisBold
- the is bold- Returns:
- the font instance
- Since:
- 0.9
-
manageFont
Font manageFont(Diagram diagram, java.lang.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.- 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
Font manageFont(Diagram diagram, java.lang.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.- 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
void movePolylinePoint(Polyline polyline, int index, int deltaX, int deltaY)
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.
-
-