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
static String DEFAULT_FONT
           
static int DEFAULT_FONT_SIZE
           
 
Method Summary
 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, String id)
          Searches for a style with the given id.
 int getAngle(AbstractText at, boolean checkStyles)
          Deprecated. replaced by getRotation(AbstractText, boolean)
 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 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, 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.
 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.
 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, 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, 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 provided AbstractStyle (could be a GraphicsAlgorithm or a Style) to ignore all locally set attributes and instead use the ones provided by the style set to the AbstractStyle.
 void setRenderingStyle(AbstractStyle abstractStyle, AdaptedGradientColoredAreas adaptedGradientColoredAreas)
          Sets a RenderingStyle with given adapted gradient colored areas for the given AbstractStyle.
 
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 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,
                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 container
id - style id
Returns:
the found style; null if not found

getAngle

int getAngle(AbstractText at,
             boolean checkStyles)
Deprecated. replaced by getRotation(AbstractText, boolean)

Gets the angle.

Parameters:
at - the abstract text
checkStyles - the check styles
Returns:
the angle

getRotation

double getRotation(AbstractText at,
                   boolean checkStyles)
Gets the angle.

Parameters:
at - the abstract text
checkStyles - the check styles
Returns:
the angle
Since:
0.11

getBackgroundColor

Color getBackgroundColor(GraphicsAlgorithm ga,
                         boolean checkStyles)
Gets the background color.

Parameters:
ga - the graphics algorithm
checkStyles - the check styles
Returns:
the background color

getFont

Font getFont(AbstractText at,
             boolean checkStyles)
Gets the font.

Parameters:
at - the abstract text
checkStyles - the check styles
Returns:
the font

getForegroundColor

Color getForegroundColor(GraphicsAlgorithm ga,
                         boolean checkStyles)
Gets the foreground color.

Parameters:
ga - the graphics algorithm
checkStyles - the check styles
Returns:
the foreground color

getHorizontalAlignment

Orientation getHorizontalAlignment(AbstractText at,
                                   boolean checkStyles)
Gets the horizontal alignment.

Parameters:
at - the abstract text
checkStyles - the check styles
Returns:
the horizontal alignment

getLineStyle

LineStyle getLineStyle(GraphicsAlgorithm ga,
                       boolean checkStyles)
Gets the line style.

Parameters:
ga - the graphics algorithm
checkStyles - the check styles
Returns:
the line style

getLineWidth

int getLineWidth(GraphicsAlgorithm ga,
                 boolean checkStyles)
Gets the line width.

Parameters:
ga - the graphics algorithm
checkStyles - the check styles
Returns:
the line width

getRenderingStyle

RenderingStyle getRenderingStyle(GraphicsAlgorithm ga,
                                 boolean checkStyles)
Gets the rendering style.

Parameters:
ga - the graphics algorithm
checkStyles - the check styles
Returns:
the rendering style

getTransparency

double getTransparency(GraphicsAlgorithm ga,
                       boolean checkStyles)
Gets the transparency.

Parameters:
ga - the graphics algorithm
checkStyles - the check styles
Returns:
the transparency

getVerticalAlignment

Orientation getVerticalAlignment(AbstractText at,
                                 boolean checkStyles)
Gets the vertical alignment.

Parameters:
at - the abstract text
checkStyles - the check styles
Returns:
the vertical alignment

resetAll

void resetAll(AbstractStyle abstractStyle)
Sets the provided AbstractStyle (could be a GraphicsAlgorithm or a Style) to ignore all locally set attributes and instead use the ones provided by the style set to the AbstractStyle.

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 algorithm
checkStyles - the check styles
Returns:
true, if is filled

isLineVisible

boolean isLineVisible(GraphicsAlgorithm ga,
                      boolean checkStyles)
Checks if line is visible.

Parameters:
ga - the graphics algorithm
checkStyles - the check styles
Returns:
true, if line is visible

isProportional

boolean isProportional(Image image,
                       boolean checkStyles)
Checks if is proportional.

Parameters:
image - the image
checkStyles - the check styles
Returns:
true, if is proportional

isStretchH

boolean isStretchH(Image image,
                   boolean checkStyles)
Checks if is stretch h.

Parameters:
image - the image
checkStyles - the check styles
Returns:
true, if is stretch h

isStretchV

boolean isStretchV(Image image,
                   boolean checkStyles)
Checks if is stretch v.

Parameters:
image - the image
checkStyles - 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 colors
colorConstant - 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 colors
red - the red
green - the green
blue - 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 fonts
isItalic - the is italic
isBold - the is bold
Returns:
the font instance
Since:
0.9

manageFont

Font 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.

Parameters:
diagram - the diagram that aggregates the fonts
name - the name of the font
size - the size of the font
Returns:
the font instance
Since:
0.8

manageFont

Font 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.

Parameters:
diagram - the diagram that aggregates the fonts
name - the name of the font
size - the size of the font
isItalic - the is italic
isBold - 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 polyline
index - the index
deltaX - the delta x
deltaY - the delta y

setRenderingStyle

void setRenderingStyle(AbstractStyle abstractStyle,
                       AdaptedGradientColoredAreas adaptedGradientColoredAreas)
Sets a RenderingStyle with given adapted gradient colored areas for the given AbstractStyle. The AdaptedGradientColoredAreas are defined and created in PredefinedColoredAreas.

Parameters:
abstractStyle - the abstract style for which to set the rendering style.
adaptedGradientColoredAreas - The AdaptedGradientColoredAreas gradient colored areas.


Copyright (c) SAP AG 2005, 2012.