org.eclipse.graphiti.services
Interface IGaCreateService

All Known Subinterfaces:
ICreateService, IGaService

public interface IGaCreateService

The interface IGaCreateService provides services for the creation of all available graphics algorithm's. E.g. Polygon, Rectangle, Text, ...


Method Summary
 MultiText createDefaultMultiText(GraphicsAlgorithmContainer gaContainer)
          Creates a multitext graphics algorithm.
 MultiText createDefaultMultiText(GraphicsAlgorithmContainer gaContainer, java.lang.String value)
          Creates a multitext graphics algorithm with the given text.
 Text createDefaultText(GraphicsAlgorithmContainer gaContainer)
          Creates a text graphics algorithm with the default font (Arial, size 8).
 Text createDefaultText(GraphicsAlgorithmContainer gaContainer, java.lang.String value)
          Creates a text graphics algorithm with the default font (Arial, size 8) and the given text.
 Ellipse createEllipse(GraphicsAlgorithmContainer gaContainer)
          Creates an ellipse graphics algorithm.
 Font createFont(AbstractText text, java.lang.String name, int size)
          Creates a font datatype.
 Font createFont(AbstractText text, java.lang.String name, int size, boolean isItalic, boolean isBold)
          Creates a font datatype.
 Font createFont(Style style, java.lang.String name, int size)
          Creates a font datatype.
 Font createFont(Style style, java.lang.String name, int size, boolean isItalic, boolean isBold)
          Creates a font datatype.
 Image createImage(GraphicsAlgorithmContainer gaContainer, java.lang.String imageId)
          Creates a image graphics algorithm with the given image id.
 Rectangle createInvisibleRectangle(PictogramElement pe)
          Create an invisible rectangle.
 MultiText createMultiText(GraphicsAlgorithmContainer gaContainer)
          Creates a multitext graphics algorithm.
 MultiText createMultiText(GraphicsAlgorithmContainer gaContainer, java.lang.String value)
          Creates a multitext graphics algorithm with the given text.
 PlatformGraphicsAlgorithm createPlatformGraphicsAlgorithm(GraphicsAlgorithmContainer gaContainer, java.lang.String id)
          Creates the platform graphics algorithm.
 Point createPoint(int x, int y)
          Creates a point datatype for the given x/y coordinates.
 Point createPoint(int x, int y, int before, int after)
          Creates a point datatype for the given x/y coordinates.
 java.util.List<Point> createPointList(int[] xy)
          Creates a list of point datatypes for the given x/y coordinates.
 java.util.List<Point> createPointList(int[] xy, int[] beforeAfter)
          Creates a list of point datatypes for the given x/y coordinates.
 Polygon createPolygon(GraphicsAlgorithmContainer gaContainer)
          Creates a polygon graphics algorithm.
 Polygon createPolygon(GraphicsAlgorithmContainer gaContainer, java.util.Collection<Point> points)
          Creates a polygon graphics algorithm with the given points.
 Polygon createPolygon(GraphicsAlgorithmContainer gaContainer, int[] xy)
          Creates a polygon graphics algorithm with the given points.
 Polygon createPolygon(GraphicsAlgorithmContainer gaContainer, int[] xy, int[] beforeAfter)
          Creates a polygon graphics algorithm with the given points.
 Polyline createPolyline(GraphicsAlgorithmContainer gaContainer)
          Creates a polyline graphics algorithm.
 Polyline createPolyline(GraphicsAlgorithmContainer gaContainer, java.util.Collection<Point> points)
          Creates a polyline graphics algorithm with the given points.
 Polyline createPolyline(GraphicsAlgorithmContainer gaContainer, int[] xy)
          Creates a polyline graphics algorithm with the given points.
 Polyline createPolyline(GraphicsAlgorithmContainer gaContainer, int[] xy, int[] beforeAfter)
          Creates a polyline graphics algorithm with the given points.
 Rectangle createRectangle(GraphicsAlgorithmContainer gaContainer)
          Creates a rectangle graphics algorithm.
 RoundedRectangle createRoundedRectangle(GraphicsAlgorithmContainer gaContainer, int cornerWidth, int cornerHeight)
          Creates a rounded rectangle graphics algorithm with the given corner dimensions.
 Color createShiftedColor(Color color, int shift, Diagram diagram)
          Shifts the color darker or lighter.
 IColorConstant createShiftedColor(IColorConstant colorConstant, int shift)
          Shifts the color constant darker or lighter.
 Style createStyle(StyleContainer styleContainer, java.lang.String id)
          Creates a style with the given id.
 Text createText(GraphicsAlgorithmContainer gaContainer)
          Creates a text graphics algorithm.
 Text createText(GraphicsAlgorithmContainer gaContainer, java.lang.String value)
          Creates a text graphics algorithm with the given text.
 

Method Detail

createDefaultMultiText

MultiText createDefaultMultiText(GraphicsAlgorithmContainer gaContainer)
Creates a multitext graphics algorithm.

The following values are set by default:

graphicsAlgorithm.setFilled(true);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);
text.setFont(createFont(DEFAULT_FONT, 8));
text.setAngle(0);
text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);
text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);

Parameters:
gaContainer - the container for the new graphics algorithm
Returns:
the new multiline text

createDefaultMultiText

MultiText createDefaultMultiText(GraphicsAlgorithmContainer gaContainer,
                                 java.lang.String value)
Creates a multitext graphics algorithm with the given text.

The following values are set by default:

graphicsAlgorithm.setFilled(true);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);
text.setFont(createFont(DEFAULT_FONT, 8));
text.setAngle(0);
text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);
text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);

Parameters:
gaContainer - the container for the new graphics algorithm
value - initial text
Returns:
the new multiline text

createDefaultText

Text createDefaultText(GraphicsAlgorithmContainer gaContainer)
Creates a text graphics algorithm with the default font (Arial, size 8).

The following values are set by default:

graphicsAlgorithm.setFilled(true);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);
text.setFont(createFont(DEFAULT_FONT, 8));
text.setAngle(0);
text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);
text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);

Parameters:
gaContainer - the container for the new graphics algorithm
Returns:
the new text

createDefaultText

Text createDefaultText(GraphicsAlgorithmContainer gaContainer,
                       java.lang.String value)
Creates a text graphics algorithm with the default font (Arial, size 8) and the given text.

The following values are set by default:

graphicsAlgorithm.setFilled(true);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);
text.setFont(createFont(DEFAULT_FONT, 8));
text.setAngle(0);
text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);
text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);

Parameters:
gaContainer - the container for the new graphics algorithm
value - initial text
Returns:
the new text

createEllipse

Ellipse createEllipse(GraphicsAlgorithmContainer gaContainer)
Creates an ellipse graphics algorithm.

The following values are set by default:

graphicsAlgorithm.setFilled(true);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);

Parameters:
gaContainer - the container for the new graphics algorithm
Returns:
the new ellipse

createFont

Font createFont(AbstractText text,
                java.lang.String name,
                int size)
Creates a font datatype.

Parameters:
text - the text
name - the name
size - the size
Returns:
the new font

createFont

Font createFont(AbstractText text,
                java.lang.String name,
                int size,
                boolean isItalic,
                boolean isBold)
Creates a font datatype.

Parameters:
text - the text
name - the name
size - the size
isItalic - the is italic
isBold - the is bold
Returns:
the new font

createFont

Font createFont(Style style,
                java.lang.String name,
                int size)
Creates a font datatype.

Parameters:
style - the style
name - the name
size - the size
Returns:
the new font

createFont

Font createFont(Style style,
                java.lang.String name,
                int size,
                boolean isItalic,
                boolean isBold)
Creates a font datatype.

Parameters:
style - the style
name - the name
size - the size
isItalic - the is italic
isBold - the is bold
Returns:
the new font

createImage

Image createImage(GraphicsAlgorithmContainer gaContainer,
                  java.lang.String imageId)
Creates a image graphics algorithm with the given image id.

The following values are set by default:

graphicsAlgorithm.setFilled(true);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);
image.setId(imageId);
image.setProportional(false);
image.setStretchH(false);
image.setStretchV(false);

Parameters:
gaContainer - the container for the new graphics algorithm
imageId - the image id
Returns:
the new image

createInvisibleRectangle

Rectangle createInvisibleRectangle(PictogramElement pe)
Create an invisible rectangle.

Parameters:
pe - the pictogram element to create the rectangle
Returns:
the rectangle

createMultiText

MultiText createMultiText(GraphicsAlgorithmContainer gaContainer)
Creates a multitext graphics algorithm.

The following values are set by default:

graphicsAlgorithm.setFilled(true);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);
text.setAngle(0);
text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);
text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);

Parameters:
gaContainer - the container for the new graphics algorithm
Returns:
the new multiline text

createMultiText

MultiText createMultiText(GraphicsAlgorithmContainer gaContainer,
                          java.lang.String value)
Creates a multitext graphics algorithm with the given text.

The following values are set by default:

graphicsAlgorithm.setFilled(true);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);
text.setAngle(0);
text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);
text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);

Parameters:
gaContainer - the container for the new graphics algorithm
value - initial text
Returns:
the new multiline text

createPlatformGraphicsAlgorithm

PlatformGraphicsAlgorithm createPlatformGraphicsAlgorithm(GraphicsAlgorithmContainer gaContainer,
                                                          java.lang.String id)
Creates the platform graphics algorithm.

Parameters:
gaContainer - the container for the new graphics algorithm
id - the id
Returns:
the platform graphics algorithm

createPoint

Point createPoint(int x,
                  int y)
Creates a point datatype for the given x/y coordinates.

Parameters:
x - the x coordinate
y - the y coordinate
Returns:
the new point

createPoint

Point createPoint(int x,
                  int y,
                  int before,
                  int after)
Creates a point datatype for the given x/y coordinates. The additional before/after parameters defined at which distance before/after the point a rounded curve will start/end. Note, that before/after parameters have only an effect, if the graphics algorithm support them, e.g. polygon and polyline.

Parameters:
x - the x coordinate
y - the y coordinate
before - the distance before, if supported
after - the distance after, if supported
Returns:
the new point

createPointList

java.util.List<Point> createPointList(int[] xy)
Creates a list of point datatypes for the given x/y coordinates.

Parameters:
xy - The x/y coordinates: [x0, y0, ...,xN, yN]
Returns:
the point list

createPointList

java.util.List<Point> createPointList(int[] xy,
                                      int[] beforeAfter)
Creates a list of point datatypes for the given x/y coordinates. Note, that before/after parameters have only an effect, if the graphics algorithm support them, e.g. polygon and polyline.

Parameters:
xy - The x/y coordinates: [x0, y0, ..., xN, yN]
beforeAfter - The before/after parameters: [before0, after0, ..., beforeN, afterN]
Returns:
the point list

createPolygon

Polygon createPolygon(GraphicsAlgorithmContainer gaContainer)
Creates a polygon graphics algorithm.

The following values are set by default:

graphicsAlgorithm.setFilled(true);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);

Parameters:
gaContainer - the container for the new graphics algorithm
Returns:
the new polygon

createPolygon

Polygon createPolygon(GraphicsAlgorithmContainer gaContainer,
                      java.util.Collection<Point> points)
Creates a polygon graphics algorithm with the given points.

The following values are set by default:

graphicsAlgorithm.setFilled(true);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);

Parameters:
gaContainer - the container for the new graphics algorithm
points - collection of point
Returns:
the new polygon

createPolygon

Polygon createPolygon(GraphicsAlgorithmContainer gaContainer,
                      int[] xy)
Creates a polygon graphics algorithm with the given points.

The following values are set by default:

graphicsAlgorithm.setFilled(true);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);

Parameters:
gaContainer - the container for the new graphics algorithm
xy - The x/y coordinates: [x0, y0, ..., xN, yN]
Returns:
the new polygon

createPolygon

Polygon createPolygon(GraphicsAlgorithmContainer gaContainer,
                      int[] xy,
                      int[] beforeAfter)
Creates a polygon graphics algorithm with the given points.

The following values are set by default:

graphicsAlgorithm.setFilled(true);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);

Parameters:
gaContainer - the container for the new graphics algorithm
xy - The x/y coordinates: [x0, y0, ..., xN, yN]
beforeAfter - The before/after parameters: [before0, after0, ..., beforeN, afterN]
Returns:
the new polygon

createPolyline

Polyline createPolyline(GraphicsAlgorithmContainer gaContainer)
Creates a polyline graphics algorithm.

The following values are set by default:

graphicsAlgorithm.setFilled(false);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);

Parameters:
gaContainer - the container for the new graphics algorithm
Returns:
the new polyline

createPolyline

Polyline createPolyline(GraphicsAlgorithmContainer gaContainer,
                        java.util.Collection<Point> points)
Creates a polyline graphics algorithm with the given points.

The following values are set by default:

graphicsAlgorithm.setFilled(false);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);

Parameters:
gaContainer - the container for the new graphics algorithm
points - collection of point
Returns:
the new polyline

createPolyline

Polyline createPolyline(GraphicsAlgorithmContainer gaContainer,
                        int[] xy)
Creates a polyline graphics algorithm with the given points.

The following values are set by default:

graphicsAlgorithm.setFilled(false);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);

Parameters:
gaContainer - the container for the new graphics algorithm
xy - The x/y coordinates: [x0, y0, ..., xN, yN]
Returns:
the new polyline

createPolyline

Polyline createPolyline(GraphicsAlgorithmContainer gaContainer,
                        int[] xy,
                        int[] beforeAfter)
Creates a polyline graphics algorithm with the given points.

The following values are set by default:

graphicsAlgorithm.setFilled(false);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);

Parameters:
gaContainer - the container for the new graphics algorithm
xy - The x/y coordinates: [x0, y0, ..., xN, yN]
beforeAfter - The before/after parameters: [before0, after0, ..., beforeN, afterN]
Returns:
the new polyline

createRectangle

Rectangle createRectangle(GraphicsAlgorithmContainer gaContainer)
Creates a rectangle graphics algorithm.

The following values are set by default:

graphicsAlgorithm.setFilled(true);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);

Parameters:
gaContainer - the container for the new graphics algorithm
Returns:
the new rectangle

createRoundedRectangle

RoundedRectangle createRoundedRectangle(GraphicsAlgorithmContainer gaContainer,
                                        int cornerWidth,
                                        int cornerHeight)
Creates a rounded rectangle graphics algorithm with the given corner dimensions.

The following values are set by default:

graphicsAlgorithm.setFilled(true);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);

Parameters:
gaContainer - the container for the new graphics algorithm
cornerWidth - the corner width
cornerHeight - the corner height
Returns:
the new rounded rectangle

createShiftedColor

Color createShiftedColor(Color color,
                         int shift,
                         Diagram diagram)
Shifts the color darker or lighter.

Parameters:
color - the color to be changed
shift - negative shifts means darken the color
diagram - the diagram
Returns:
a new color datatype with the shiftet values

createShiftedColor

IColorConstant createShiftedColor(IColorConstant colorConstant,
                                  int shift)
Shifts the color constant darker or lighter.

Parameters:
colorConstant - the color constant to be changed
shift - negative shifts means darken the color
Returns:
the color constant with the shifted values

createStyle

Style createStyle(StyleContainer styleContainer,
                  java.lang.String id)
Creates a style with the given id. The style is aggregated under the given container style.

Parameters:
styleContainer - container style
id - style id
Returns:
the newly created style

createText

Text createText(GraphicsAlgorithmContainer gaContainer)
Creates a text graphics algorithm.

The following values are set by default:

graphicsAlgorithm.setFilled(true);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);
text.setAngle(0);
text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);
text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);

Parameters:
gaContainer - the container for the new graphics algorithm
Returns:
the new text

createText

Text createText(GraphicsAlgorithmContainer gaContainer,
                java.lang.String value)
Creates a text graphics algorithm with the given text.

The following values are set by default:

graphicsAlgorithm.setFilled(true);
graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID);
graphicsAlgorithm.setLineVisible(true);
graphicsAlgorithm.setLineWidth(1);
graphicsAlgorithm.setTransparency(0);
text.setAngle(0);
text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);
text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);

Parameters:
gaContainer - the container for the new graphics algorithm
value - initial text
Returns:
the new text


Copyright (c) SAP AG 2005, 2010.