Class GaServiceImpl

java.lang.Object
org.eclipse.graphiti.services.impl.GaServiceImpl
All Implemented Interfaces:
IGaCreateService, IGaLayoutService, IGaService

public class GaServiceImpl extends Object implements IGaService
Provides the default implementation for the Graphiti GraphicsAlgorithm related services. Usually clients consume this service via Graphiti.getGaService() or Graphiti.getGaCreateService() and get the default behavior, but Clients can subclass this to modify the default attributes that will be set for Text or MultiText graphics algorithms like the default font by overriding #setDefaultTextAttributes(Diagram, AbstractText, String, boolean). Also default attributes of other graphics algorithms can be influenced by overriding setDefaultGraphicsAlgorithmAttributes(GraphicsAlgorithm). Note that in this case Graphiti does not provide any means to manage the service class instance and to access it from any place.
Since:
0.9
  • Constructor Details

    • GaServiceImpl

      public GaServiceImpl()
  • Method Details

    • calculateSize

      public final 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 interface IGaLayoutService
      Parameters:
      ga - graphics algorithm
      Returns:
      the dimension of the given graphics algorithm
    • calculateSize

      public final 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 interface IGaLayoutService
      Parameters:
      ga - graphics algorithm
      considerLineWidth - if TRUE, the line width will be considered in the dimension
      Returns:
      the dimension of the given graphics algorithm
    • createDefaultMultiText

      public final MultiText createDefaultMultiText(Diagram diagram, GraphicsAlgorithmContainer gaContainer)
      Description copied from interface: IGaCreateService
      Creates a MultiText graphics algorithm with the default font (Arial, size 8). Use this method only if you want to use the default text, otherwise use IGaCreateService.createMultiText(GraphicsAlgorithmContainer)

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: false
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0
      horizontalAlignment: ALIGNMENT_LEFT
      verticalAlignment: ALIGNMENT_CENTER
      angle: 0
      value:""
      name: Arial
      size: 8
      italic: false
      bold: false

      Specified by:
      createDefaultMultiText in interface IGaCreateService
      Parameters:
      diagram - the diagram to manage the font
      gaContainer - the container for the new graphics algorithm
      Returns:
      the new multiline text
    • createDefaultMultiText

      public final MultiText createDefaultMultiText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value)
      Description copied from interface: IGaCreateService
      Creates a MultiText graphics algorithm with the default font (Arial, size 8) and the given text. Use this method only if you want to use the default text, otherwise use IGaCreateService.createMultiText(GraphicsAlgorithmContainer, String)

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: false
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0
      horizontalAlignment: ALIGNMENT_LEFT
      verticalAlignment: ALIGNMENT_CENTER
      angle: 0
      value: value
      name: Arial
      size: 8
      italic: false
      bold: false

      Specified by:
      createDefaultMultiText in interface IGaCreateService
      Parameters:
      diagram - the diagram to manage the font
      gaContainer - the container for the new graphics algorithm
      value - initial text
      Returns:
      the new multiline text
    • createDefaultText

      public final Text createDefaultText(Diagram diagram, GraphicsAlgorithmContainer gaContainer)
      Description copied from interface: IGaCreateService
      Creates a Text graphics algorithm with the default font (Arial, size 8). Use this method only if you want to use the default text, otherwise use IGaCreateService.createText(GraphicsAlgorithmContainer)

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: false
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0
      horizontalAlignment: ALIGNMENT_LEFT
      verticalAlignment: ALIGNMENT_CENTER
      angle: 0
      value:""
      name: Arial
      size: 8
      italic: false
      bold: false

      Specified by:
      createDefaultText in interface IGaCreateService
      Parameters:
      diagram - the diagram to manage the font
      gaContainer - the container for the new graphics algorithm
      Returns:
      the new text
    • createDefaultText

      public final Text createDefaultText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value)
      Description copied from interface: IGaCreateService
      Creates a Text graphics algorithm with the default font (Arial, size 8) and the given text. Use this method only if you want to use the default text, otherwise use IGaCreateService.createText(GraphicsAlgorithmContainer, String)

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: false
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0
      horizontalAlignment: ALIGNMENT_LEFT
      verticalAlignment: ALIGNMENT_CENTER
      angle: 0
      value: value
      name: Arial
      size: 8
      italic: false
      bold: false

      Specified by:
      createDefaultText in interface IGaCreateService
      Parameters:
      diagram - the diagram to manage the font
      gaContainer - the container for the new graphics algorithm
      value - initial text
      Returns:
      the new text
    • createEllipse

      public final Ellipse createEllipse(GraphicsAlgorithmContainer gaContainer)
      Description copied from interface: IGaCreateService
      Creates an Ellipse graphics algorithm.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0

      Specified by:
      createEllipse in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      Returns:
      the new ellipse
    • createPlainEllipse

      public final Ellipse createPlainEllipse(GraphicsAlgorithmContainer gaContainer)
      Description copied from interface: IGaCreateService
      Creates a plain Ellipse graphics algorithm. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainEllipse in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      Returns:
      the new ellipse
      See Also:
    • createImage

      public final Image createImage(GraphicsAlgorithmContainer gaContainer, String imageId)
      Description copied from interface: IGaCreateService
      Creates a Image graphics algorithm with the given image id.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: true
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0
      id: TEST
      stretchH: false
      stretchV: false
      proportional: false

      Specified by:
      createImage in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      imageId - the image id
      Returns:
      the new image
    • createPlainImage

      public final Image createPlainImage(GraphicsAlgorithmContainer gaContainer, String imageId)
      Description copied from interface: IGaCreateService
      Creates a plain Image graphics algorithm with the given image id. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainImage in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      imageId - the image id
      Returns:
      the new image
      See Also:
    • createInvisibleRectangle

      public final Rectangle createInvisibleRectangle(PictogramElement pe)
      Description copied from interface: IGaCreateService
      Create an invisible Rectangle.

      The following values are set by default when it is shown:

      lineWidth: 1
      lineStyle: SOLID
      filled: false
      lineVisible: false
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0

      Specified by:
      createInvisibleRectangle in interface IGaCreateService
      Parameters:
      pe - the pictogram element to create the rectangle
      Returns:
      the rectangle
    • createMultiText

      public final MultiText createMultiText(GraphicsAlgorithmContainer gaContainer)
      Description copied from interface: IGaCreateService
      Creates a MultiText graphics algorithm.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: false
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0
      horizontalAlignment: ALIGNMENT_LEFT
      verticalAlignment: ALIGNMENT_CENTER
      angle: 0
      value: ""

      Specified by:
      createMultiText in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      Returns:
      the new multiline text
    • createPlainMultiText

      public final MultiText createPlainMultiText(GraphicsAlgorithmContainer gaContainer)
      Description copied from interface: IGaCreateService
      Creates a plain MultiText graphics algorithm. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainMultiText in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      Returns:
      the new multiline text
      See Also:
    • createMultiText

      public final MultiText createMultiText(GraphicsAlgorithmContainer gaContainer, String value)
      Description copied from interface: IGaCreateService
      Creates a MultiText graphics algorithm with the given text.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: false
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0
      horizontalAlignment: ALIGNMENT_LEFT
      verticalAlignment: ALIGNMENT_CENTER
      angle: 0
      value: value

      Specified by:
      createMultiText in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      value - initial text
      Returns:
      the new multiline text
    • createPlainMultiText

      public final MultiText createPlainMultiText(GraphicsAlgorithmContainer gaContainer, String value)
      Description copied from interface: IGaCreateService
      Creates a plain MultiText graphics algorithm with the given text. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainMultiText in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      value - initial text
      Returns:
      the new multiline text
      See Also:
    • createMultiText

      public final MultiText createMultiText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value, String fontName, int fontSize)
      Description copied from interface: IGaCreateService
      Creates a MultiText graphics algorithm with the given text and font. The font will be displayed in straight (no italics or bold) and will be managed within the given diagram; in case the font already exists it will be reused, otherwise the corresponding font instance will be created.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: false
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0
      horizontalAlignment: ALIGNMENT_LEFT
      verticalAlignment: ALIGNMENT_CENTER
      angle: 0
      value: value
      name: fontNamel
      size: fontSize
      italic: false
      bold: false

      Specified by:
      createMultiText in interface IGaCreateService
      Parameters:
      diagram - the diagram that shall be used for managing the font for the new text field
      gaContainer - the container for the new graphics algorithm
      value - initial text
      fontName - the name of the font to use for the new text field
      fontSize - the size of the font to use for the new text field
      Returns:
      the new multiline text
    • createMultiText

      public final MultiText createMultiText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value, String fontName, int fontSize, boolean isFontItalic, boolean isFontBold)
      Description copied from interface: IGaCreateService
      Creates a MultiText graphics algorithm with the given text and font. The font will be managed within the given diagram; in case the font already exists it will be reused, otherwise the corresponding font instance will be created.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: false
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0
      horizontalAlignment: ALIGNMENT_LEFT
      verticalAlignment: ALIGNMENT_CENTER
      angle: 0
      value: value
      name: fontNamel
      size: fontSize
      italic: isFontItalic
      bold: isFontBold

      Specified by:
      createMultiText in interface IGaCreateService
      Parameters:
      diagram - the diagram that shall be used for managing the font for the new text field
      gaContainer - the container for the new graphics algorithm
      value - initial text
      fontName - the name of the font to use for the new text field
      fontSize - the size of the font to use for the new text field
      isFontItalic - flag if the font to use for the new text field should be italic or not
      isFontBold - flag if the font to use for the new text field should be bold or not
      Returns:
      the new multiline text
    • createPlatformGraphicsAlgorithm

      public final PlatformGraphicsAlgorithm createPlatformGraphicsAlgorithm(GraphicsAlgorithmContainer gaContainer, String id)
      Description copied from interface: IGaCreateService
      Creates the PlatformGraphicsAlgorithm.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0
      id: id

      Specified by:
      createPlatformGraphicsAlgorithm in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      id - the id
      Returns:
      the platform graphics algorithm
    • createPlainPlatformGraphicsAlgorithm

      public final PlatformGraphicsAlgorithm createPlainPlatformGraphicsAlgorithm(GraphicsAlgorithmContainer gaContainer, String id)
      Description copied from interface: IGaCreateService
      Creates the plain PlatformGraphicsAlgorithm. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainPlatformGraphicsAlgorithm in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      id - the id
      Returns:
      the platform graphics algorithm
      See Also:
    • createPoint

      public final Point createPoint(int x, int y)
      Description copied from interface: IGaCreateService
      Creates a Point datatype for the given x/y coordinates.
      Specified by:
      createPoint in interface IGaCreateService
      Parameters:
      x - the x coordinate
      y - the y coordinate
      Returns:
      the new point
    • createPoint

      public final Point createPoint(int x, int y, int before, int after)
      Description copied from interface: IGaCreateService
      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.
      Specified by:
      createPoint in interface IGaCreateService
      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

      public final List<Point> createPointList(int[] xy)
      Description copied from interface: IGaCreateService
      Creates a list of Point datatypes for the given x/y coordinates.
      Specified by:
      createPointList in interface IGaCreateService
      Parameters:
      xy - The x/y coordinates: [x0, y0, ...,xN, yN]
      Returns:
      the point list
    • createPointList

      public final List<Point> createPointList(int[] xy, int[] beforeAfter)
      Description copied from interface: IGaCreateService
      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.
      Specified by:
      createPointList in interface IGaCreateService
      Parameters:
      xy - The x/y coordinates: [x0, y0, ..., xN, yN]
      beforeAfter - The before/after parameters: [before0, after0, ..., beforeN, afterN]
      Returns:
      the point list
    • createPolygon

      public final Polygon createPolygon(GraphicsAlgorithmContainer gaContainer)
      Description copied from interface: IGaCreateService
      Creates a Polygon graphics algorithm.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: true
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0

      Specified by:
      createPolygon in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      Returns:
      the new polygon
    • createPlainPolygon

      public final Polygon createPlainPolygon(GraphicsAlgorithmContainer gaContainer)
      Description copied from interface: IGaCreateService
      Creates a plain Polygon graphics algorithm. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainPolygon in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      Returns:
      the new polygon
      See Also:
    • createPolygon

      public final Polygon createPolygon(GraphicsAlgorithmContainer gaContainer, Collection<Point> points)
      Description copied from interface: IGaCreateService
      Creates a Polygon graphics algorithm with the given points.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: true
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0

      Specified by:
      createPolygon in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      points - collection of point
      Returns:
      the new polygon
    • createPlainPolygon

      public final Polygon createPlainPolygon(GraphicsAlgorithmContainer gaContainer, Collection<Point> points)
      Description copied from interface: IGaCreateService
      Creates a plain Polygon graphics algorithm with the given points. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainPolygon in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      points - collection of point
      Returns:
      the new polygon
      See Also:
    • createPolygon

      public final Polygon createPolygon(GraphicsAlgorithmContainer gaContainer, int[] xy)
      Description copied from interface: IGaCreateService
      Creates a Polygon graphics algorithm with the given points.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: true
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0

      Specified by:
      createPolygon in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      xy - The x/y coordinates: [x0, y0, ..., xN, yN]
      Returns:
      the new polygon
    • createPlainPolygon

      public final Polygon createPlainPolygon(GraphicsAlgorithmContainer gaContainer, int[] xy)
      Description copied from interface: IGaCreateService
      Creates a plain Polygon graphics algorithm with the given points. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainPolygon in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      xy - The x/y coordinates: [x0, y0, ..., xN, yN]
      Returns:
      the new polygon
      See Also:
    • createPolygon

      public final Polygon createPolygon(GraphicsAlgorithmContainer gaContainer, int[] xy, int[] beforeAfter)
      Description copied from interface: IGaCreateService
      Creates a Polygon graphics algorithm with the given points.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: true
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0

      Specified by:
      createPolygon in interface IGaCreateService
      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
    • createPlainPolygon

      public final Polygon createPlainPolygon(GraphicsAlgorithmContainer gaContainer, int[] xy, int[] beforeAfter)
      Description copied from interface: IGaCreateService
      Creates a plain Polygon graphics algorithm with the given points. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainPolygon in interface IGaCreateService
      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
      See Also:
    • createPolyline

      public final Polyline createPolyline(GraphicsAlgorithmContainer gaContainer)
      Description copied from interface: IGaCreateService
      Creates a Polyline graphics algorithm.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: false
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0

      Specified by:
      createPolyline in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      Returns:
      the new polyline
    • createPlainPolyline

      public final Polyline createPlainPolyline(GraphicsAlgorithmContainer gaContainer)
      Description copied from interface: IGaCreateService
      Creates a plain Polyline graphics algorithm. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainPolyline in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      Returns:
      the new polyline
      See Also:
    • createPolyline

      public final Polyline createPolyline(GraphicsAlgorithmContainer gaContainer, Collection<Point> points)
      Description copied from interface: IGaCreateService
      Creates a Polyline graphics algorithm with the given points.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: false
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0

      Specified by:
      createPolyline in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      points - collection of point
      Returns:
      the new polyline
    • createPlainPolyline

      public final Polyline createPlainPolyline(GraphicsAlgorithmContainer gaContainer, Collection<Point> points)
      Description copied from interface: IGaCreateService
      Creates a plain Polyline graphics algorithm with the given points. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainPolyline in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      points - collection of point
      Returns:
      the new polyline
      See Also:
    • createPolyline

      public final Polyline createPolyline(GraphicsAlgorithmContainer gaContainer, int[] xy)
      Description copied from interface: IGaCreateService
      Creates a Polyline graphics algorithm with the given points.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: false
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0

      Specified by:
      createPolyline in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      xy - The x/y coordinates: [x0, y0, ..., xN, yN]
      Returns:
      the new polyline
    • createPlainPolyline

      public final Polyline createPlainPolyline(GraphicsAlgorithmContainer gaContainer, int[] xy)
      Description copied from interface: IGaCreateService
      Creates a plain polyline graphics algorithm with the given points. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainPolyline in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      xy - The x/y coordinates: [x0, y0, ..., xN, yN]
      Returns:
      the new polyline
      See Also:
    • createPolyline

      public final Polyline createPolyline(GraphicsAlgorithmContainer gaContainer, int[] xy, int[] beforeAfter)
      Description copied from interface: IGaCreateService
      Creates a Polyline graphics algorithm with the given points.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: false
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0

      Specified by:
      createPolyline in interface IGaCreateService
      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
    • createPlainPolyline

      public final Polyline createPlainPolyline(GraphicsAlgorithmContainer gaContainer, int[] xy, int[] beforeAfter)
      Description copied from interface: IGaCreateService
      Creates a plain Polyline graphics algorithm with the given points. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainPolyline in interface IGaCreateService
      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
      See Also:
    • createRectangle

      public final Rectangle createRectangle(GraphicsAlgorithmContainer gaContainer)
      Description copied from interface: IGaCreateService
      Creates a Rectangle graphics algorithm.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0

      Specified by:
      createRectangle in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      Returns:
      the new rectangle
    • createPlainRectangle

      public final Rectangle createPlainRectangle(GraphicsAlgorithmContainer gaContainer)
      Description copied from interface: IGaCreateService
      Creates a plain Rectangle graphics algorithm. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainRectangle in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      Returns:
      the new rectangle
      See Also:
    • createRoundedRectangle

      public final RoundedRectangle createRoundedRectangle(GraphicsAlgorithmContainer gaContainer, int cornerWidth, int cornerHeight)
      Description copied from interface: IGaCreateService
      Creates a RoundedRectangle graphics algorithm with the given corner dimensions.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0
      cornerHeight: cornerHeight
      cornerWidth: cornerWidth

      Specified by:
      createRoundedRectangle in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      cornerWidth - the corner width
      cornerHeight - the corner height
      Returns:
      the new rounded rectangle
    • createPlainRoundedRectangle

      public final RoundedRectangle createPlainRoundedRectangle(GraphicsAlgorithmContainer gaContainer, int cornerWidth, int cornerHeight)
      Description copied from interface: IGaCreateService
      Creates a plain RoundedRectangle graphics algorithm with the given corner dimensions. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainRoundedRectangle in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      cornerWidth - the corner width
      cornerHeight - the corner height
      Returns:
      the new rounded rectangle
      See Also:
    • createShiftedColor

      public final Color createShiftedColor(Color color, int shift, Diagram diagram)
      Description copied from interface: IGaCreateService
      Shifts the Color darker or lighter.
      Specified by:
      createShiftedColor in interface IGaCreateService
      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

      public final IColorConstant createShiftedColor(IColorConstant colorConstant, int shift)
      Description copied from interface: IGaCreateService
      Shifts the Color constant darker or lighter.
      Specified by:
      createShiftedColor in interface IGaCreateService
      Parameters:
      colorConstant - the color constant to be changed
      shift - negative shifts means darken the color
      Returns:
      the color constant with the shifted values
    • createStyle

      public final Style createStyle(StyleContainer styleContainer, String id)
      Description copied from interface: IGaCreateService
      Creates a Style with the given id. The style is aggregated under the given container style.

      The following values are set by default:

      lineStyle: SOLID
      id: id
      horizontalAlignment: ALIGNMENT_CENTER
      verticalAlignment: ALIGNMENT_CENTER<br<

      Specified by:
      createStyle in interface IGaCreateService
      Parameters:
      styleContainer - container style
      id - style id
      Returns:
      the newly created style
    • createPlainStyle

      public final Style createPlainStyle(StyleContainer styleContainer, String id)
      Description copied from interface: IGaCreateService
      Creates a Style with the given id. The style is aggregated under the given container style. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainStyle in interface IGaCreateService
      Parameters:
      styleContainer - container style
      id - style id
      Returns:
      the newly created style
      See Also:
    • createText

      public final Text createText(GraphicsAlgorithmContainer gaContainer)
      Description copied from interface: IGaCreateService
      Creates a Text graphics algorithm with empty text.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: false
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0
      horizontalAlignment: ALIGNMENT_LEFT
      verticalAlignment: ALIGNMENT_CENTER
      angle: 0
      value: ""

      Specified by:
      createText in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      Returns:
      the new text
    • createPlainText

      public final Text createPlainText(GraphicsAlgorithmContainer gaContainer)
      Description copied from interface: IGaCreateService
      Creates a plain Text graphics algorithm with empty text. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainText in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      Returns:
      the new text
      See Also:
    • createText

      public final Text createText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value, String fontName, int fontSize)
      Description copied from interface: IGaCreateService
      Creates a Text graphics algorithm with the given text and font. The font will be displayed in straight (no italics or bold) and will be managed within the given diagram; in case the font already exists it will be reused, otherwise the corresponding font instance will be created.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: false
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0
      horizontalAlignment: ALIGNMENT_LEFT
      verticalAlignment: ALIGNMENT_CENTER
      angle: 0
      value: value
      name: fontNamel
      size: fontSize
      italic: false
      bold: false

      Specified by:
      createText in interface IGaCreateService
      Parameters:
      diagram - the diagram that shall be used for managing the font for the new text field
      gaContainer - the container for the new graphics algorithm
      value - initial text
      fontName - the name of the font to use for the new text field
      fontSize - the size of the font to use for the new text field
      Returns:
      the new text
    • createText

      public final Text createText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value, String fontName, int fontSize, boolean isFontItalic, boolean isFontBold)
      Description copied from interface: IGaCreateService
      Creates a Text graphics algorithm with the given text and font. The font will be managed within the given diagram; in case the font already exists it will be reused, otherwise the corresponding font instance will be created.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: false
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0
      horizontalAlignment: ALIGNMENT_LEFT
      verticalAlignment: ALIGNMENT_CENTER
      angle: 0
      value: value
      name: fontNamel
      size: fontSize
      italic: isFontItalic
      bold: isFontBold

      Specified by:
      createText in interface IGaCreateService
      Parameters:
      diagram - the diagram that shall be used for managing the font for the new text field
      gaContainer - the container for the new graphics algorithm
      value - initial text
      fontName - the name of the font to use for the new text field
      fontSize - the size of the font to use for the new text field
      isFontItalic - flag if the font to use for the new text field should be italic or not
      isFontBold - flag if the font to use for the new text field should be bold or not
      Returns:
      the new text
    • createText

      public final Text createText(GraphicsAlgorithmContainer gaContainer, String value)
      Description copied from interface: IGaCreateService
      Creates a Text graphics algorithm with the given text.

      The following values are set by default:

      lineWidth: 1
      lineStyle: SOLID
      filled: false
      transparency: 0.0
      width: 0
      height: 0
      x: 0
      y: 0
      horizontalAlignment: ALIGNMENT_LEFT
      verticalAlignment: ALIGNMENT_CENTER
      angle: 0
      value: value

      Specified by:
      createText in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      value - initial text
      Returns:
      the new text
    • createPlainText

      public final Text createPlainText(GraphicsAlgorithmContainer gaContainer, String value)
      Description copied from interface: IGaCreateService
      Creates a plain Text graphics algorithm with the given text. Default values have been reset, so you can use your styles, see AbstractStyle.
      Specified by:
      createPlainText in interface IGaCreateService
      Parameters:
      gaContainer - the container for the new graphics algorithm
      value - initial text
      Returns:
      the new text
      See Also:
    • createTextStyleRegion

      public TextStyleRegion createTextStyleRegion(AbstractText abstractText)
      Description copied from interface: IGaCreateService
      Creates a TextStyleRegion. The style is aggregated under the given abstract text.
      Specified by:
      createTextStyleRegion in interface IGaCreateService
      Parameters:
      abstractText - container text
      Returns:
      the newly created text style region
      Since:
      0.10
      See Also:
    • createTextStyleRegion

      public TextStyleRegion createTextStyleRegion(AbstractText abstractText, int start, int end)
      Description copied from interface: IGaCreateService
      Creates a TextStyleRegion with the given bounds. The style is aggregated under the given abstract text.
      Specified by:
      createTextStyleRegion in interface IGaCreateService
      Parameters:
      abstractText - container text
      start - region start
      end - retion end
      Returns:
      the newly created text style region
      Since:
      0.10
      See Also:
    • createTextStyle

      public TextStyle createTextStyle(TextStyleRegion region)
      Description copied from interface: IGaCreateService
      Creates a TextStyle. The style is aggregated under the given text style region.
      Specified by:
      createTextStyle in interface IGaCreateService
      Parameters:
      region - container region
      Returns:
      the newly created text style
      Since:
      0.10
      See Also:
    • createTextStyle

      public TextStyle createTextStyle(TextStyleRegion region, boolean underline, boolean strikeout, UnderlineStyle underlineStyle)
      Description copied from interface: IGaCreateService
      Creates a TextStyle with the given values. The style is aggregated under the given text style region.
      Specified by:
      createTextStyle in interface IGaCreateService
      Parameters:
      region - container region
      underline - the is underlined
      strikeout - the is stroke out
      underlineStyle - the underline style
      Returns:
      the newly created text style
      Since:
      0.10
      See Also:
    • deleteFont

      public final void deleteFont(AbstractText abstractText)
    • deleteFont

      public final void deleteFont(Font font)
      Description copied from interface: IGaService
      Deletes the given font.
      Specified by:
      deleteFont in interface IGaService
      Parameters:
      font - the font to delete
    • deleteColor

      public final void deleteColor(Color color)
      Description copied from interface: IGaService
      Deletes the given color.
      Specified by:
      deleteColor in interface IGaService
      Parameters:
      color - the color to delete
    • deleteRenderingStyle

      public final void deleteRenderingStyle(AbstractStyle abstractStyle)
      Description copied from interface: IGaService
      Deletes the RenderingStyle from the given AbstractStyle.
      Specified by:
      deleteRenderingStyle in interface IGaService
      Parameters:
      abstractStyle - the abstract style from which to delete the RenderingStyle.
    • findStyle

      public final Style findStyle(StyleContainer styleContainer, String id)
      Description copied from interface: IGaService
      Searches for a style with the given id. The search scope is the given style container (which will usually be the diagram).
      Specified by:
      findStyle in interface IGaService
      Parameters:
      styleContainer - the style container
      id - style id
      Returns:
      the found style; null if not found
    • getRotation

      public final double getRotation(AbstractText at, boolean checkStyles)
      Description copied from interface: IGaService
      Gets the rotation angle.
      Specified by:
      getRotation in interface IGaService
      Parameters:
      at - the abstract text
      checkStyles - the check styles
      Returns:
      the angle
      Since:
      0.11
    • getBackgroundColor

      public final Color getBackgroundColor(GraphicsAlgorithm ga, boolean checkStyles)
      Description copied from interface: IGaService
      Gets the background color.
      Specified by:
      getBackgroundColor in interface IGaService
      Parameters:
      ga - the graphics algorithm
      checkStyles - the check styles
      Returns:
      the background color
    • getFont

      public final Font getFont(AbstractText at, boolean checkStyles)
      Description copied from interface: IGaService
      Gets the font.
      Specified by:
      getFont in interface IGaService
      Parameters:
      at - the abstract text
      checkStyles - the check styles
      Returns:
      the font
    • getForegroundColor

      public final Color getForegroundColor(GraphicsAlgorithm ga, boolean checkStyles)
      Description copied from interface: IGaService
      Gets the foreground color.
      Specified by:
      getForegroundColor in interface IGaService
      Parameters:
      ga - the graphics algorithm
      checkStyles - the check styles
      Returns:
      the foreground color
    • getHorizontalAlignment

      public final Orientation getHorizontalAlignment(AbstractText at, boolean checkStyles)
      Description copied from interface: IGaService
      Gets the horizontal alignment.
      Specified by:
      getHorizontalAlignment in interface IGaService
      Parameters:
      at - the abstract text
      checkStyles - the check styles
      Returns:
      the horizontal alignment
    • getLineStyle

      public final LineStyle getLineStyle(GraphicsAlgorithm ga, boolean checkStyles)
      Description copied from interface: IGaService
      Gets the line style.
      Specified by:
      getLineStyle in interface IGaService
      Parameters:
      ga - the graphics algorithm
      checkStyles - the check styles
      Returns:
      the line style
    • getLineWidth

      public final int getLineWidth(GraphicsAlgorithm ga, boolean checkStyles)
      Description copied from interface: IGaService
      Gets the line width.
      Specified by:
      getLineWidth in interface IGaService
      Parameters:
      ga - the graphics algorithm
      checkStyles - the check styles
      Returns:
      the line width
    • getRenderingStyle

      public final RenderingStyle getRenderingStyle(GraphicsAlgorithm ga, boolean checkStyles)
      Description copied from interface: IGaService
      Gets the rendering style.
      Specified by:
      getRenderingStyle in interface IGaService
      Parameters:
      ga - the graphics algorithm
      checkStyles - the check styles
      Returns:
      the rendering style
    • getTransparency

      public final double getTransparency(GraphicsAlgorithm ga, boolean checkStyles)
      Description copied from interface: IGaService
      Gets the transparency.
      Specified by:
      getTransparency in interface IGaService
      Parameters:
      ga - the graphics algorithm
      checkStyles - the check styles
      Returns:
      the transparency
    • getVerticalAlignment

      public final Orientation getVerticalAlignment(AbstractText at, boolean checkStyles)
      Description copied from interface: IGaService
      Gets the vertical alignment.
      Specified by:
      getVerticalAlignment in interface IGaService
      Parameters:
      at - the abstract text
      checkStyles - the check styles
      Returns:
      the vertical alignment
    • resetAll

      public final void resetAll(AbstractStyle abstractStyle)
      Description copied from interface: IGaService
      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.
      Specified by:
      resetAll in interface IGaService
      Parameters:
      abstractStyle - The abstract style (style or graphics algorithm)
    • isFilled

      public final boolean isFilled(GraphicsAlgorithm ga, boolean checkStyles)
      Description copied from interface: IGaService
      Checks if is filled.
      Specified by:
      isFilled in interface IGaService
      Parameters:
      ga - the graphics algorithm
      checkStyles - the check styles
      Returns:
      true, if is filled
    • isLineVisible

      public final boolean isLineVisible(GraphicsAlgorithm ga, boolean checkStyles)
      Description copied from interface: IGaService
      Checks if line is visible.
      Specified by:
      isLineVisible in interface IGaService
      Parameters:
      ga - the graphics algorithm
      checkStyles - the check styles
      Returns:
      true, if line is visible
    • isProportional

      public final boolean isProportional(Image image, boolean checkStyles)
      Description copied from interface: IGaService
      Checks if is proportional.
      Specified by:
      isProportional in interface IGaService
      Parameters:
      image - the image
      checkStyles - the check styles
      Returns:
      true, if is proportional
    • isStretchH

      public final boolean isStretchH(Image image, boolean checkStyles)
      Description copied from interface: IGaService
      Checks if is stretch h.
      Specified by:
      isStretchH in interface IGaService
      Parameters:
      image - the image
      checkStyles - the check styles
      Returns:
      true, if is stretch h
    • isStretchV

      public final boolean isStretchV(Image image, boolean checkStyles)
      Description copied from interface: IGaService
      Checks if is stretch v.
      Specified by:
      isStretchV in interface IGaService
      Parameters:
      image - the image
      checkStyles - the check styles
      Returns:
      true, if is stretch v
    • manageColor

      public final Color manageColor(Diagram diagram, IColorConstant colorConstant)
      Description copied from interface: IGaService
      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.
      Specified by:
      manageColor in interface IGaService
      Parameters:
      diagram - the diagram that aggregates the colors
      colorConstant - which contains the RGB values.
      Returns:
      the color instance
    • manageColor

      public final Color manageColor(Diagram diagram, int red, int green, int blue)
      Description copied from interface: IGaService
      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.
      Specified by:
      manageColor in interface IGaService
      Parameters:
      diagram - the diagram that aggregates the colors
      red - the red
      green - the green
      blue - the blue
      Returns:
      the color instance
    • manageDefaultFont

      public final Font manageDefaultFont(Diagram diagram)
      Description copied from interface: IGaService
      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.
      Specified by:
      manageDefaultFont in interface IGaService
      Parameters:
      diagram - the diagram that aggregates the fonts
      Returns:
      the font instance
    • manageDefaultFont

      public final Font manageDefaultFont(Diagram diagram, boolean isItalic, boolean isBold)
      Description copied from interface: IGaService
      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.
      Specified by:
      manageDefaultFont in interface IGaService
      Parameters:
      diagram - the diagram that aggregates the fonts
      isItalic - the is italic
      isBold - the is bold
      Returns:
      the font instance
    • manageFont

      public final Font manageFont(Diagram diagram, String name, int size)
      Description copied from interface: IGaService
      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.
      Specified by:
      manageFont in interface IGaService
      Parameters:
      diagram - the diagram that aggregates the fonts
      name - the name of the font
      size - the size of the font
      Returns:
      the font instance
    • manageFont

      public final Font manageFont(Diagram diagram, String name, int size, boolean isItalic, boolean isBold)
      Description copied from interface: IGaService
      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.
      Specified by:
      manageFont in interface IGaService
      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
    • movePolylinePoint

      public final void movePolylinePoint(Polyline polyline, int index, int deltaX, int deltaY)
      Description copied from interface: IGaService
      Move polyline point.
      Specified by:
      movePolylinePoint in interface IGaService
      Parameters:
      polyline - the polyline
      index - the index
      deltaX - the delta x
      deltaY - the delta y
    • setDefaultGraphicsAlgorithmAttributes

      protected void setDefaultGraphicsAlgorithmAttributes(GraphicsAlgorithm graphicsAlgorithm)
      Sets the default attributes of the newly created Graphiti GraphicsAlgorithms. The default implementation sets the location (X and Y values) and the size (Width and height values) to 0, the LineStyle to solid, the line width to 1 and the transparency to 0.
      Parameters:
      graphicsAlgorithm - the GraphicsAlgorithm to set the defaults for
    • setDefaultTextAttributes

      protected void setDefaultTextAttributes(Diagram diagram, AbstractText abstractText, boolean createFont)
      Sets the default attributes of newly created AbstractText graphics algorithms (Text and MultiText). The default implementation sets the default attributes for all graphics algorithms setDefaultGraphicsAlgorithmAttributes(GraphicsAlgorithm), filled to false and the font to IGaService.DEFAULT_FONT with size IGaService.DEFAULT_FONT_SIZE (Arial in size 8).
      Parameters:
      diagram - the diagram to use for managing the Font
      abstractText - the AbstractText to set the attributes for
      createFont - true in case the font shall be created, false otherwise
    • setHeight

      public final void setHeight(GraphicsAlgorithm ga, int height)
      Description copied from interface: IGaLayoutService
      Sets the height of the given graphics algorithm.
      Specified by:
      setHeight in interface IGaLayoutService
      Parameters:
      ga - graphics algorithm
      height - the new height
    • setLocationAndSize

      public final 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 interface IGaLayoutService
      Parameters:
      ga - graphics algorithm
      x - the new x coordinate
      y - the new y coordinate
      width - the new width
      height - the new height
    • setLocationAndSize

      public final 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 interface IGaLayoutService
      Parameters:
      ga - graphics algorithm
      x - the new x coordinate
      y - the new y coordinate
      width - the new width
      height - the new height
      avoidNegativeCoordinates - if TRUE, a negative coordinate will automatically set to 0.
    • setLocation

      public final 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 interface IGaLayoutService
      Parameters:
      ga - graphics algorithm
      x - the new x coordinate
      y - the new y coordinate
    • setLocation

      public final 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 interface IGaLayoutService
      Parameters:
      ga - graphics algorithm
      x - the new x coordinate
      y - the new y coordinate
      avoidNegativeCoordinates - if TRUE, a negative coordinate will automatically set to 0.
    • setSize

      public final 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 interface IGaLayoutService
      Parameters:
      ga - graphics algorithm
      width - the new width
      height - the new height
    • setWidth

      public final void setWidth(GraphicsAlgorithm ga, int width)
      Description copied from interface: IGaLayoutService
      Sets the width of the given graphics algorithm.
      Specified by:
      setWidth in interface IGaLayoutService
      Parameters:
      ga - graphics algorithm
      width - the new width
    • setRenderingStyle

      public final void setRenderingStyle(AbstractStyle abstractStyle, AdaptedGradientColoredAreas adaptedGradientColoredAreas)
      Description copied from interface: IGaService
      Sets a RenderingStyle with given adapted gradient colored areas for the given AbstractStyle. The AdaptedGradientColoredAreas are defined and created in PredefinedColoredAreas.
      Specified by:
      setRenderingStyle in interface IGaService
      Parameters:
      abstractStyle - the abstract style for which to set the rendering style.
      adaptedGradientColoredAreas - The AdaptedGradientColoredAreas gradient colored areas.