public class GaServiceImpl extends java.lang.Object implements IGaService
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.DEFAULT_FONT, DEFAULT_FONT_SIZE| Constructor and Description |
|---|
GaServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
IDimension |
calculateSize(GraphicsAlgorithm ga)
Calculates the size of the given graphics algorithm.
|
IDimension |
calculateSize(GraphicsAlgorithm ga,
boolean considerLineWidth)
Calculates the size of the given graphics algorithm.
|
MultiText |
createDefaultMultiText(Diagram diagram,
GraphicsAlgorithmContainer gaContainer)
Creates a
MultiText graphics algorithm with the default font
(Arial, size 8). |
MultiText |
createDefaultMultiText(Diagram diagram,
GraphicsAlgorithmContainer gaContainer,
java.lang.String value)
Creates a
MultiText graphics algorithm with the default font
(Arial, size 8) and the given text. |
Text |
createDefaultText(Diagram diagram,
GraphicsAlgorithmContainer gaContainer)
Creates a
Text graphics algorithm with the default font (Arial,
size 8). |
Text |
createDefaultText(Diagram diagram,
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. |
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(Diagram diagram,
GraphicsAlgorithmContainer gaContainer,
java.lang.String value,
java.lang.String fontName,
int fontSize)
Creates a
MultiText graphics algorithm with the given text and
font. |
MultiText |
createMultiText(Diagram diagram,
GraphicsAlgorithmContainer gaContainer,
java.lang.String value,
java.lang.String fontName,
int fontSize,
boolean isFontItalic,
boolean isFontBold)
Creates a
MultiText graphics algorithm with the given text and
font. |
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. |
Ellipse |
createPlainEllipse(GraphicsAlgorithmContainer gaContainer)
Creates a plain
Ellipse graphics algorithm. |
Image |
createPlainImage(GraphicsAlgorithmContainer gaContainer,
java.lang.String imageId)
Creates a plain
Image graphics algorithm with the given image id. |
MultiText |
createPlainMultiText(GraphicsAlgorithmContainer gaContainer)
Creates a plain
MultiText graphics algorithm. |
MultiText |
createPlainMultiText(GraphicsAlgorithmContainer gaContainer,
java.lang.String value)
Creates a plain
MultiText graphics algorithm with the given text. |
PlatformGraphicsAlgorithm |
createPlainPlatformGraphicsAlgorithm(GraphicsAlgorithmContainer gaContainer,
java.lang.String id)
Creates the plain
PlatformGraphicsAlgorithm. |
Polygon |
createPlainPolygon(GraphicsAlgorithmContainer gaContainer)
Creates a plain
Polygon graphics algorithm. |
Polygon |
createPlainPolygon(GraphicsAlgorithmContainer gaContainer,
java.util.Collection<Point> points)
Creates a plain
Polygon graphics algorithm with the given points. |
Polygon |
createPlainPolygon(GraphicsAlgorithmContainer gaContainer,
int[] xy)
Creates a plain
Polygon graphics algorithm with the given points. |
Polygon |
createPlainPolygon(GraphicsAlgorithmContainer gaContainer,
int[] xy,
int[] beforeAfter)
Creates a plain
Polygon graphics algorithm with the given points. |
Polyline |
createPlainPolyline(GraphicsAlgorithmContainer gaContainer)
Creates a plain
Polyline graphics algorithm. |
Polyline |
createPlainPolyline(GraphicsAlgorithmContainer gaContainer,
java.util.Collection<Point> points)
Creates a plain
Polyline graphics algorithm with the given
points. |
Polyline |
createPlainPolyline(GraphicsAlgorithmContainer gaContainer,
int[] xy)
Creates a plain polyline graphics algorithm with the given points.
|
Polyline |
createPlainPolyline(GraphicsAlgorithmContainer gaContainer,
int[] xy,
int[] beforeAfter)
Creates a plain
Polyline graphics algorithm with the given
points. |
Rectangle |
createPlainRectangle(GraphicsAlgorithmContainer gaContainer)
Creates a plain
Rectangle graphics algorithm. |
RoundedRectangle |
createPlainRoundedRectangle(GraphicsAlgorithmContainer gaContainer,
int cornerWidth,
int cornerHeight)
Creates a plain
RoundedRectangle graphics algorithm with the
given corner dimensions. |
Style |
createPlainStyle(StyleContainer styleContainer,
java.lang.String id)
Creates a
Style with the given id. |
Text |
createPlainText(GraphicsAlgorithmContainer gaContainer)
Creates a plain
Text graphics algorithm with empty text. |
Text |
createPlainText(GraphicsAlgorithmContainer gaContainer,
java.lang.String value)
Creates a plain
Text graphics algorithm with the given text. |
PlatformGraphicsAlgorithm |
createPlatformGraphicsAlgorithm(GraphicsAlgorithmContainer gaContainer,
java.lang.String id)
Creates the
PlatformGraphicsAlgorithm. |
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
RoundedRectangle 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(Diagram diagram,
GraphicsAlgorithmContainer gaContainer,
java.lang.String value,
java.lang.String fontName,
int fontSize)
Creates a
Text graphics algorithm with the given text and font. |
Text |
createText(Diagram diagram,
GraphicsAlgorithmContainer gaContainer,
java.lang.String value,
java.lang.String fontName,
int fontSize,
boolean isFontItalic,
boolean isFontBold)
Creates a
Text graphics algorithm with the given text and font. |
Text |
createText(GraphicsAlgorithmContainer gaContainer)
Creates a
Text graphics algorithm with empty text. |
Text |
createText(GraphicsAlgorithmContainer gaContainer,
java.lang.String value)
Creates a
Text graphics algorithm with the given text. |
TextStyle |
createTextStyle(TextStyleRegion region)
Creates a
TextStyle. |
TextStyle |
createTextStyle(TextStyleRegion region,
boolean underline,
boolean strikeout,
UnderlineStyle underlineStyle)
Creates a
TextStyle with the given values. |
TextStyleRegion |
createTextStyleRegion(AbstractText abstractText)
Creates a
TextStyleRegion. |
TextStyleRegion |
createTextStyleRegion(AbstractText abstractText,
int start,
int end)
Creates a
TextStyleRegion with the given bounds. |
void |
deleteColor(Color color)
Deletes the given color.
|
void |
deleteFont(AbstractText abstractText) |
void |
deleteFont(Font font)
Deletes the given font.
|
void |
deleteRenderingStyle(AbstractStyle abstractStyle)
Deletes the RenderingStyle from the given AbstractStyle.
|
Style |
findStyle(StyleContainer styleContainer,
java.lang.String id)
Searches for a style with the given id.
|
Color |
getBackgroundColor(GraphicsAlgorithm ga,
boolean checkStyles)
Gets the background color.
|
Font |
getFont(AbstractText at,
boolean checkStyles)
Gets the font.
|
Color |
getForegroundColor(GraphicsAlgorithm ga,
boolean checkStyles)
Gets the foreground color.
|
Orientation |
getHorizontalAlignment(AbstractText at,
boolean checkStyles)
Gets the horizontal alignment.
|
LineStyle |
getLineStyle(GraphicsAlgorithm ga,
boolean checkStyles)
Gets the line style.
|
int |
getLineWidth(GraphicsAlgorithm ga,
boolean checkStyles)
Gets the line width.
|
RenderingStyle |
getRenderingStyle(GraphicsAlgorithm ga,
boolean checkStyles)
Gets the rendering style.
|
double |
getRotation(AbstractText at,
boolean checkStyles)
Gets the rotation angle.
|
double |
getTransparency(GraphicsAlgorithm ga,
boolean checkStyles)
Gets the transparency.
|
Orientation |
getVerticalAlignment(AbstractText at,
boolean checkStyles)
Gets the vertical alignment.
|
boolean |
isFilled(GraphicsAlgorithm ga,
boolean checkStyles)
Checks if is filled.
|
boolean |
isLineVisible(GraphicsAlgorithm ga,
boolean checkStyles)
Checks if line is visible.
|
boolean |
isProportional(Image image,
boolean checkStyles)
Checks if is proportional.
|
boolean |
isStretchH(Image image,
boolean checkStyles)
Checks if is stretch h.
|
boolean |
isStretchV(Image image,
boolean checkStyles)
Checks if is stretch v.
|
Color |
manageColor(Diagram diagram,
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,
java.lang.String name,
int size)
Provides a font instance by either creating a new one and aggregating it
to the diagram or finding it in the diagrams list of fonts.
|
Font |
manageFont(Diagram diagram,
java.lang.String name,
int size,
boolean isItalic,
boolean isBold)
Provides a font instance by either creating a new one and aggregating it
to the diagram or finding it in the diagrams list of fonts.
|
void |
movePolylinePoint(Polyline polyline,
int index,
int deltaX,
int deltaY)
Move polyline point.
|
void |
resetAll(AbstractStyle abstractStyle)
Sets the 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 |
setHeight(GraphicsAlgorithm ga,
int height)
Sets the height of the given graphics algorithm.
|
void |
setLocation(GraphicsAlgorithm ga,
int x,
int y)
Sets the location of the given graphics algorithm.
|
void |
setLocation(GraphicsAlgorithm ga,
int x,
int y,
boolean avoidNegativeCoordinates)
Sets the location of the given graphics algorithm.
|
void |
setLocationAndSize(GraphicsAlgorithm ga,
int x,
int y,
int width,
int height)
Sets location and size of the given graphics algorithm.
|
void |
setLocationAndSize(GraphicsAlgorithm ga,
int x,
int y,
int width,
int height,
boolean avoidNegativeCoordinates)
Sets location and size of the given graphics algorithm.
|
void |
setRenderingStyle(AbstractStyle abstractStyle,
AdaptedGradientColoredAreas adaptedGradientColoredAreas)
Sets a RenderingStyle with given adapted gradient colored areas for the
given
AbstractStyle. |
void |
setSize(GraphicsAlgorithm ga,
int width,
int height)
Sets the size of the given graphics algorithm.
|
void |
setWidth(GraphicsAlgorithm ga,
int width)
Sets the width of the given graphics algorithm.
|
public final IDimension calculateSize(GraphicsAlgorithm ga)
IGaLayoutServicecalculateSize in interface IGaLayoutServicega - graphics algorithmpublic final IDimension calculateSize(GraphicsAlgorithm ga, boolean considerLineWidth)
IGaLayoutServicecalculateSize in interface IGaLayoutServicega - graphics algorithmconsiderLineWidth - if TRUE, the line width will be considered in the dimensionpublic final MultiText createDefaultMultiText(Diagram diagram, GraphicsAlgorithmContainer gaContainer)
IGaCreateServiceMultiText 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
createDefaultMultiText in interface IGaCreateServicediagram - the diagram to manage the fontgaContainer - the container for the new graphics algorithmpublic final MultiText createDefaultMultiText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, java.lang.String value)
IGaCreateServiceMultiText 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
createDefaultMultiText in interface IGaCreateServicediagram - the diagram to manage the fontgaContainer - the container for the new graphics algorithmvalue - initial textpublic final Text createDefaultText(Diagram diagram, GraphicsAlgorithmContainer gaContainer)
IGaCreateServiceText 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
createDefaultText in interface IGaCreateServicediagram - the diagram to manage the fontgaContainer - the container for the new graphics algorithmpublic final Text createDefaultText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, java.lang.String value)
IGaCreateServiceText 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
createDefaultText in interface IGaCreateServicediagram - the diagram to manage the fontgaContainer - the container for the new graphics algorithmvalue - initial textpublic final Ellipse createEllipse(GraphicsAlgorithmContainer gaContainer)
IGaCreateServiceEllipse graphics algorithm.
The following values are set by default:
lineWidth: 1
lineStyle: SOLID
transparency: 0.0
width: 0
height: 0
x: 0
y: 0
createEllipse in interface IGaCreateServicegaContainer - the container for the new graphics algorithmpublic final Ellipse createPlainEllipse(GraphicsAlgorithmContainer gaContainer)
IGaCreateServiceEllipse graphics algorithm. Default values have
been reset, so you can use your styles, see AbstractStyle.createPlainEllipse in interface IGaCreateServicegaContainer - the container for the new graphics algorithmStyle,
IGaCreateService.createStyle(StyleContainer, String)public final Image createImage(GraphicsAlgorithmContainer gaContainer, java.lang.String imageId)
IGaCreateServiceImage 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
createImage in interface IGaCreateServicegaContainer - the container for the new graphics algorithmimageId - the image idpublic final Image createPlainImage(GraphicsAlgorithmContainer gaContainer, java.lang.String imageId)
IGaCreateServiceImage graphics algorithm with the given image id.
Default values have been reset, so you can use your styles, see
AbstractStyle.createPlainImage in interface IGaCreateServicegaContainer - the container for the new graphics algorithmimageId - the image idStyle,
IGaCreateService.createStyle(StyleContainer, String)public final Rectangle createInvisibleRectangle(PictogramElement pe)
IGaCreateServiceRectangle.
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
createInvisibleRectangle in interface IGaCreateServicepe - the pictogram element to create the rectanglepublic final MultiText createMultiText(GraphicsAlgorithmContainer gaContainer)
IGaCreateServiceMultiText 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: ""
createMultiText in interface IGaCreateServicegaContainer - the container for the new graphics algorithmpublic final MultiText createPlainMultiText(GraphicsAlgorithmContainer gaContainer)
IGaCreateServiceMultiText graphics algorithm. Default values have
been reset, so you can use your styles, see AbstractStyle.createPlainMultiText in interface IGaCreateServicegaContainer - the container for the new graphics algorithmStyle,
IGaCreateService.createStyle(StyleContainer, String)public final MultiText createMultiText(GraphicsAlgorithmContainer gaContainer, java.lang.String value)
IGaCreateServiceMultiText 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
createMultiText in interface IGaCreateServicegaContainer - the container for the new graphics algorithmvalue - initial textpublic final MultiText createPlainMultiText(GraphicsAlgorithmContainer gaContainer, java.lang.String value)
IGaCreateServiceMultiText graphics algorithm with the given text.
Default values have been reset, so you can use your styles, see
AbstractStyle.createPlainMultiText in interface IGaCreateServicegaContainer - the container for the new graphics algorithmvalue - initial textStyle,
IGaCreateService.createStyle(StyleContainer, String)public final MultiText createMultiText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, java.lang.String value, java.lang.String fontName, int fontSize)
IGaCreateServiceMultiText 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
createMultiText in interface IGaCreateServicediagram - the diagram that shall be used for managing the font for the
new text fieldgaContainer - the container for the new graphics algorithmvalue - initial textfontName - the name of the font to use for the new text fieldfontSize - the size of the font to use for the new text fieldpublic final MultiText createMultiText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, java.lang.String value, java.lang.String fontName, int fontSize, boolean isFontItalic, boolean isFontBold)
IGaCreateServiceMultiText 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
createMultiText in interface IGaCreateServicediagram - the diagram that shall be used for managing the font for the
new text fieldgaContainer - the container for the new graphics algorithmvalue - initial textfontName - the name of the font to use for the new text fieldfontSize - the size of the font to use for the new text fieldisFontItalic - flag if the font to use for the new text field should be
italic or notisFontBold - flag if the font to use for the new text field should be bold
or notpublic final PlatformGraphicsAlgorithm createPlatformGraphicsAlgorithm(GraphicsAlgorithmContainer gaContainer, java.lang.String id)
IGaCreateServicePlatformGraphicsAlgorithm.
The following values are set by default:
lineWidth: 1
lineStyle: SOLID
transparency: 0.0
width: 0
height: 0
x: 0
y: 0
id: id
createPlatformGraphicsAlgorithm in interface IGaCreateServicegaContainer - the container for the new graphics algorithmid - the idpublic final PlatformGraphicsAlgorithm createPlainPlatformGraphicsAlgorithm(GraphicsAlgorithmContainer gaContainer, java.lang.String id)
IGaCreateServicePlatformGraphicsAlgorithm. Default values have
been reset, so you can use your styles, see AbstractStyle.createPlainPlatformGraphicsAlgorithm in interface IGaCreateServicegaContainer - the container for the new graphics algorithmid - the idStyle,
IGaCreateService.createStyle(StyleContainer, String)public final Point createPoint(int x, int y)
IGaCreateServicePoint datatype for the given x/y coordinates.createPoint in interface IGaCreateServicex - the x coordinatey - the y coordinatepublic final Point createPoint(int x, int y, int before, int after)
IGaCreateServicePoint 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.createPoint in interface IGaCreateServicex - the x coordinatey - the y coordinatebefore - the distance before, if supportedafter - the distance after, if supportedpublic final java.util.List<Point> createPointList(int[] xy)
IGaCreateServicePoint datatypes for the given x/y coordinates.createPointList in interface IGaCreateServicexy - The x/y coordinates: [x0, y0, ...,xN, yN]public final java.util.List<Point> createPointList(int[] xy, int[] beforeAfter)
IGaCreateServicePoint 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.createPointList in interface IGaCreateServicexy - The x/y coordinates: [x0, y0, ..., xN, yN]beforeAfter - The before/after parameters: [before0, after0, ..., beforeN,
afterN]public final Polygon createPolygon(GraphicsAlgorithmContainer gaContainer)
IGaCreateServicePolygon 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
createPolygon in interface IGaCreateServicegaContainer - the container for the new graphics algorithmpublic final Polygon createPlainPolygon(GraphicsAlgorithmContainer gaContainer)
IGaCreateServicePolygon graphics algorithm. Default values have
been reset, so you can use your styles, see AbstractStyle.createPlainPolygon in interface IGaCreateServicegaContainer - the container for the new graphics algorithmStyle,
IGaCreateService.createStyle(StyleContainer, String)public final Polygon createPolygon(GraphicsAlgorithmContainer gaContainer, java.util.Collection<Point> points)
IGaCreateServicePolygon 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
createPolygon in interface IGaCreateServicegaContainer - the container for the new graphics algorithmpoints - collection of pointpublic final Polygon createPlainPolygon(GraphicsAlgorithmContainer gaContainer, java.util.Collection<Point> points)
IGaCreateServicePolygon graphics algorithm with the given points.
Default values have been reset, so you can use your styles, see
AbstractStyle.createPlainPolygon in interface IGaCreateServicegaContainer - the container for the new graphics algorithmpoints - collection of pointStyle,
IGaCreateService.createStyle(StyleContainer, String)public final Polygon createPolygon(GraphicsAlgorithmContainer gaContainer, int[] xy)
IGaCreateServicePolygon 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
createPolygon in interface IGaCreateServicegaContainer - the container for the new graphics algorithmxy - The x/y coordinates: [x0, y0, ..., xN, yN]public final Polygon createPlainPolygon(GraphicsAlgorithmContainer gaContainer, int[] xy)
IGaCreateServicePolygon graphics algorithm with the given points.
Default values have been reset, so you can use your styles, see
AbstractStyle.createPlainPolygon in interface IGaCreateServicegaContainer - the container for the new graphics algorithmxy - The x/y coordinates: [x0, y0, ..., xN, yN]Style,
IGaCreateService.createStyle(StyleContainer, String)public final Polygon createPolygon(GraphicsAlgorithmContainer gaContainer, int[] xy, int[] beforeAfter)
IGaCreateServicePolygon 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
createPolygon in interface IGaCreateServicegaContainer - the container for the new graphics algorithmxy - The x/y coordinates: [x0, y0, ..., xN, yN]beforeAfter - The before/after parameters: [before0, after0, ..., beforeN,
afterN]public final Polygon createPlainPolygon(GraphicsAlgorithmContainer gaContainer, int[] xy, int[] beforeAfter)
IGaCreateServicePolygon graphics algorithm with the given points.
Default values have been reset, so you can use your styles, see
AbstractStyle.createPlainPolygon in interface IGaCreateServicegaContainer - the container for the new graphics algorithmxy - The x/y coordinates: [x0, y0, ..., xN, yN]beforeAfter - The before/after parameters: [before0, after0, ..., beforeN,
afterN]Style,
IGaCreateService.createStyle(StyleContainer, String)public final Polyline createPolyline(GraphicsAlgorithmContainer gaContainer)
IGaCreateServicePolyline 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
createPolyline in interface IGaCreateServicegaContainer - the container for the new graphics algorithmpublic final Polyline createPlainPolyline(GraphicsAlgorithmContainer gaContainer)
IGaCreateServicePolyline graphics algorithm. Default values have
been reset, so you can use your styles, see AbstractStyle.createPlainPolyline in interface IGaCreateServicegaContainer - the container for the new graphics algorithmStyle,
IGaCreateService.createStyle(StyleContainer, String)public final Polyline createPolyline(GraphicsAlgorithmContainer gaContainer, java.util.Collection<Point> points)
IGaCreateServicePolyline 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
createPolyline in interface IGaCreateServicegaContainer - the container for the new graphics algorithmpoints - collection of pointpublic final Polyline createPlainPolyline(GraphicsAlgorithmContainer gaContainer, java.util.Collection<Point> points)
IGaCreateServicePolyline graphics algorithm with the given
points. Default values have been reset, so you can use your styles, see
AbstractStyle.createPlainPolyline in interface IGaCreateServicegaContainer - the container for the new graphics algorithmpoints - collection of pointStyle,
IGaCreateService.createStyle(StyleContainer, String)public final Polyline createPolyline(GraphicsAlgorithmContainer gaContainer, int[] xy)
IGaCreateServicePolyline 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
createPolyline in interface IGaCreateServicegaContainer - the container for the new graphics algorithmxy - The x/y coordinates: [x0, y0, ..., xN, yN]public final Polyline createPlainPolyline(GraphicsAlgorithmContainer gaContainer, int[] xy)
IGaCreateServiceAbstractStyle.createPlainPolyline in interface IGaCreateServicegaContainer - the container for the new graphics algorithmxy - The x/y coordinates: [x0, y0, ..., xN, yN]Style,
IGaCreateService.createStyle(StyleContainer, String)public final Polyline createPolyline(GraphicsAlgorithmContainer gaContainer, int[] xy, int[] beforeAfter)
IGaCreateServicePolyline 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
createPolyline in interface IGaCreateServicegaContainer - the container for the new graphics algorithmxy - The x/y coordinates: [x0, y0, ..., xN, yN]beforeAfter - The before/after parameters: [before0, after0, ..., beforeN,
afterN]public final Polyline createPlainPolyline(GraphicsAlgorithmContainer gaContainer, int[] xy, int[] beforeAfter)
IGaCreateServicePolyline graphics algorithm with the given
points. Default values have been reset, so you can use your styles, see
AbstractStyle.createPlainPolyline in interface IGaCreateServicegaContainer - the container for the new graphics algorithmxy - The x/y coordinates: [x0, y0, ..., xN, yN]beforeAfter - The before/after parameters: [before0, after0, ..., beforeN,
afterN]Style,
IGaCreateService.createStyle(StyleContainer, String)public final Rectangle createRectangle(GraphicsAlgorithmContainer gaContainer)
IGaCreateServiceRectangle graphics algorithm.
The following values are set by default:
lineWidth: 1
lineStyle: SOLID
transparency: 0.0
width: 0
height: 0
x: 0
y: 0
createRectangle in interface IGaCreateServicegaContainer - the container for the new graphics algorithmpublic final Rectangle createPlainRectangle(GraphicsAlgorithmContainer gaContainer)
IGaCreateServiceRectangle graphics algorithm. Default values have
been reset, so you can use your styles, see AbstractStyle.createPlainRectangle in interface IGaCreateServicegaContainer - the container for the new graphics algorithmStyle,
IGaCreateService.createStyle(StyleContainer, String)public final RoundedRectangle createRoundedRectangle(GraphicsAlgorithmContainer gaContainer, int cornerWidth, int cornerHeight)
IGaCreateServiceRoundedRectangle 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
createRoundedRectangle in interface IGaCreateServicegaContainer - the container for the new graphics algorithmcornerWidth - the corner widthcornerHeight - the corner heightpublic final RoundedRectangle createPlainRoundedRectangle(GraphicsAlgorithmContainer gaContainer, int cornerWidth, int cornerHeight)
IGaCreateServiceRoundedRectangle graphics algorithm with the
given corner dimensions. Default values have been reset, so you can use
your styles, see AbstractStyle.createPlainRoundedRectangle in interface IGaCreateServicegaContainer - the container for the new graphics algorithmcornerWidth - the corner widthcornerHeight - the corner heightStyle,
IGaCreateService.createStyle(StyleContainer, String)public final Color createShiftedColor(Color color, int shift, Diagram diagram)
IGaCreateServiceColor darker or lighter.createShiftedColor in interface IGaCreateServicecolor - the color to be changedshift - negative shifts means darken the colordiagram - the diagrampublic final IColorConstant createShiftedColor(IColorConstant colorConstant, int shift)
IGaCreateServiceColor constant darker or lighter.createShiftedColor in interface IGaCreateServicecolorConstant - the color constant to be changedshift - negative shifts means darken the colorpublic final Style createStyle(StyleContainer styleContainer, java.lang.String id)
IGaCreateServiceStyle 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
createStyle in interface IGaCreateServicestyleContainer - container styleid - style idpublic final Style createPlainStyle(StyleContainer styleContainer, java.lang.String id)
IGaCreateServiceStyle 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.createPlainStyle in interface IGaCreateServicestyleContainer - container styleid - style idStyle,
IGaCreateService.createStyle(StyleContainer, String)public final Text createText(GraphicsAlgorithmContainer gaContainer)
IGaCreateServiceText 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: ""
createText in interface IGaCreateServicegaContainer - the container for the new graphics algorithmpublic final Text createPlainText(GraphicsAlgorithmContainer gaContainer)
IGaCreateServiceText graphics algorithm with empty text. Default
values have been reset, so you can use your styles, see
AbstractStyle.createPlainText in interface IGaCreateServicegaContainer - the container for the new graphics algorithmStyle,
IGaCreateService.createStyle(StyleContainer, String)public final Text createText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, java.lang.String value, java.lang.String fontName, int fontSize)
IGaCreateServiceText 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
createText in interface IGaCreateServicediagram - the diagram that shall be used for managing the font for the
new text fieldgaContainer - the container for the new graphics algorithmvalue - initial textfontName - the name of the font to use for the new text fieldfontSize - the size of the font to use for the new text fieldpublic final Text createText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, java.lang.String value, java.lang.String fontName, int fontSize, boolean isFontItalic, boolean isFontBold)
IGaCreateServiceText 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
createText in interface IGaCreateServicediagram - the diagram that shall be used for managing the font for the
new text fieldgaContainer - the container for the new graphics algorithmvalue - initial textfontName - the name of the font to use for the new text fieldfontSize - the size of the font to use for the new text fieldisFontItalic - flag if the font to use for the new text field should be
italic or notisFontBold - flag if the font to use for the new text field should be bold
or notpublic final Text createText(GraphicsAlgorithmContainer gaContainer, java.lang.String value)
IGaCreateServiceText 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
createText in interface IGaCreateServicegaContainer - the container for the new graphics algorithmvalue - initial textpublic final Text createPlainText(GraphicsAlgorithmContainer gaContainer, java.lang.String value)
IGaCreateServiceText graphics algorithm with the given text.
Default values have been reset, so you can use your styles, see
AbstractStyle.createPlainText in interface IGaCreateServicegaContainer - the container for the new graphics algorithmvalue - initial textStyle,
IGaCreateService.createStyle(StyleContainer, String)public TextStyleRegion createTextStyleRegion(AbstractText abstractText)
IGaCreateServiceTextStyleRegion. The style is aggregated under the
given abstract text.createTextStyleRegion in interface IGaCreateServiceabstractText - container textTextStyleRegion,
IGaCreateService.createTextStyleRegion(AbstractText, int, int)public TextStyleRegion createTextStyleRegion(AbstractText abstractText, int start, int end)
IGaCreateServiceTextStyleRegion with the given bounds. The style is
aggregated under the given abstract text.createTextStyleRegion in interface IGaCreateServiceabstractText - container textstart - region startend - retion endTextStyleRegionpublic TextStyle createTextStyle(TextStyleRegion region)
IGaCreateServiceTextStyle. The style is aggregated under the given text
style region.createTextStyle in interface IGaCreateServiceregion - container regionTextStyle,
IGaCreateService.createTextStyle(TextStyleRegion, boolean, boolean, UnderlineStyle)public TextStyle createTextStyle(TextStyleRegion region, boolean underline, boolean strikeout, UnderlineStyle underlineStyle)
IGaCreateServiceTextStyle with the given values. The style is
aggregated under the given text style region.createTextStyle in interface IGaCreateServiceregion - container regionunderline - the is underlinedstrikeout - the is stroke outunderlineStyle - the underline styleTextStyle,
IGaCreateService.createStyle(StyleContainer, String)public final void deleteFont(AbstractText abstractText)
public final void deleteFont(Font font)
IGaServicedeleteFont in interface IGaServicefont - the font to deletepublic final void deleteColor(Color color)
IGaServicedeleteColor in interface IGaServicecolor - the color to deletepublic final void deleteRenderingStyle(AbstractStyle abstractStyle)
IGaServicedeleteRenderingStyle in interface IGaServiceabstractStyle - the abstract style from which to delete the RenderingStyle.public final Style findStyle(StyleContainer styleContainer, java.lang.String id)
IGaServicefindStyle in interface IGaServicestyleContainer - the style containerid - style idpublic final double getRotation(AbstractText at, boolean checkStyles)
IGaServicegetRotation in interface IGaServiceat - the abstract textcheckStyles - the check stylespublic final Color getBackgroundColor(GraphicsAlgorithm ga, boolean checkStyles)
IGaServicegetBackgroundColor in interface IGaServicega - the graphics algorithmcheckStyles - the check stylespublic final Font getFont(AbstractText at, boolean checkStyles)
IGaServicegetFont in interface IGaServiceat - the abstract textcheckStyles - the check stylespublic final Color getForegroundColor(GraphicsAlgorithm ga, boolean checkStyles)
IGaServicegetForegroundColor in interface IGaServicega - the graphics algorithmcheckStyles - the check stylespublic final Orientation getHorizontalAlignment(AbstractText at, boolean checkStyles)
IGaServicegetHorizontalAlignment in interface IGaServiceat - the abstract textcheckStyles - the check stylespublic final LineStyle getLineStyle(GraphicsAlgorithm ga, boolean checkStyles)
IGaServicegetLineStyle in interface IGaServicega - the graphics algorithmcheckStyles - the check stylespublic final int getLineWidth(GraphicsAlgorithm ga, boolean checkStyles)
IGaServicegetLineWidth in interface IGaServicega - the graphics algorithmcheckStyles - the check stylespublic final RenderingStyle getRenderingStyle(GraphicsAlgorithm ga, boolean checkStyles)
IGaServicegetRenderingStyle in interface IGaServicega - the graphics algorithmcheckStyles - the check stylespublic final double getTransparency(GraphicsAlgorithm ga, boolean checkStyles)
IGaServicegetTransparency in interface IGaServicega - the graphics algorithmcheckStyles - the check stylespublic final Orientation getVerticalAlignment(AbstractText at, boolean checkStyles)
IGaServicegetVerticalAlignment in interface IGaServiceat - the abstract textcheckStyles - the check stylespublic final void resetAll(AbstractStyle abstractStyle)
IGaServiceAbstractStyle (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.resetAll in interface IGaServiceabstractStyle - The abstract style (style or graphics algorithm)public final boolean isFilled(GraphicsAlgorithm ga, boolean checkStyles)
IGaServiceisFilled in interface IGaServicega - the graphics algorithmcheckStyles - the check stylespublic final boolean isLineVisible(GraphicsAlgorithm ga, boolean checkStyles)
IGaServiceisLineVisible in interface IGaServicega - the graphics algorithmcheckStyles - the check stylespublic final boolean isProportional(Image image, boolean checkStyles)
IGaServiceisProportional in interface IGaServiceimage - the imagecheckStyles - the check stylespublic final boolean isStretchH(Image image, boolean checkStyles)
IGaServiceisStretchH in interface IGaServiceimage - the imagecheckStyles - the check stylespublic final boolean isStretchV(Image image, boolean checkStyles)
IGaServiceisStretchV in interface IGaServiceimage - the imagecheckStyles - the check stylespublic final Color manageColor(Diagram diagram, IColorConstant colorConstant)
IGaServicemanageColor in interface IGaServicediagram - the diagram that aggregates the colorscolorConstant - which contains the RGB values.public final Color manageColor(Diagram diagram, int red, int green, int blue)
IGaServicemanageColor in interface IGaServicediagram - the diagram that aggregates the colorsred - the redgreen - the greenblue - the bluepublic final Font manageDefaultFont(Diagram diagram)
IGaServicemanageDefaultFont in interface IGaServicediagram - the diagram that aggregates the fontspublic final Font manageDefaultFont(Diagram diagram, boolean isItalic, boolean isBold)
IGaServicemanageDefaultFont in interface IGaServicediagram - the diagram that aggregates the fontsisItalic - the is italicisBold - the is boldpublic final Font manageFont(Diagram diagram, java.lang.String name, int size)
IGaServicemanageFont in interface IGaServicediagram - the diagram that aggregates the fontsname - the name of the fontsize - the size of the fontpublic final Font manageFont(Diagram diagram, java.lang.String name, int size, boolean isItalic, boolean isBold)
IGaServicemanageFont in interface IGaServicediagram - the diagram that aggregates the fontsname - the name of the fontsize - the size of the fontisItalic - the is italicisBold - the is boldpublic final void movePolylinePoint(Polyline polyline, int index, int deltaX, int deltaY)
IGaServicemovePolylinePoint in interface IGaServicepolyline - the polylineindex - the indexdeltaX - the delta xdeltaY - the delta ypublic final void setHeight(GraphicsAlgorithm ga, int height)
IGaLayoutServicesetHeight in interface IGaLayoutServicega - graphics algorithmheight - the new heightpublic final void setLocationAndSize(GraphicsAlgorithm ga, int x, int y, int width, int height)
IGaLayoutServicesetLocationAndSize in interface IGaLayoutServicega - graphics algorithmx - the new x coordinatey - the new y coordinatewidth - the new widthheight - the new heightpublic final void setLocationAndSize(GraphicsAlgorithm ga, int x, int y, int width, int height, boolean avoidNegativeCoordinates)
IGaLayoutServicesetLocationAndSize in interface IGaLayoutServicega - graphics algorithmx - the new x coordinatey - the new y coordinatewidth - the new widthheight - the new heightavoidNegativeCoordinates - if TRUE, a negative coordinate will automatically set to 0.public final void setLocation(GraphicsAlgorithm ga, int x, int y)
IGaLayoutServicesetLocation in interface IGaLayoutServicega - graphics algorithmx - the new x coordinatey - the new y coordinatepublic final void setLocation(GraphicsAlgorithm ga, int x, int y, boolean avoidNegativeCoordinates)
IGaLayoutServicesetLocation in interface IGaLayoutServicega - graphics algorithmx - the new x coordinatey - the new y coordinateavoidNegativeCoordinates - if TRUE, a negative coordinate will automatically set to 0.public final void setSize(GraphicsAlgorithm ga, int width, int height)
IGaLayoutServicesetSize in interface IGaLayoutServicega - graphics algorithmwidth - the new widthheight - the new heightpublic final void setWidth(GraphicsAlgorithm ga, int width)
IGaLayoutServicesetWidth in interface IGaLayoutServicega - graphics algorithmwidth - the new widthpublic final void setRenderingStyle(AbstractStyle abstractStyle, AdaptedGradientColoredAreas adaptedGradientColoredAreas)
IGaServiceAbstractStyle. The AdaptedGradientColoredAreas are
defined and created in PredefinedColoredAreas.setRenderingStyle in interface IGaServiceabstractStyle - the abstract style for which to set the rendering style.adaptedGradientColoredAreas - The AdaptedGradientColoredAreas gradient colored
areas.