Revision 8a57f3b03992351f46c4537fd0d9351592278d2b (click the page title to view the current version)

ecore/omgdd

Changes from 8a57f3b03992351f46c4537fd0d9351592278d2b to b3d79c7d55b72eb9c40f885cbb3277fe1cedc83f
---
title: OMG Diagram Definition metamodels
...


```{.clafer}
//OMG Diagram Definition metamodels
//DC
abstract Point
    x : int 
    y : int 
    x : int
    y : int

abstract Dimension
    width : int 
    height : int 
    width : int
    height : int
    [width >= 0 && height >=0]

abstract Bounds
    x : int 
    y : int 
    width : int 
    height : int 
    x : int
    y : int
    width : int
    height : int
    [width > 0 && height > 0]

enum AlignmentKind = start | end | center

enum KnownColor = maroon | red | orange | yellow | olive | purple | fuchsia | white | lime | green | navy | blue | aqua | teal | black | silver | gray

abstract Color
    red : int 
    green : int 
    red : int
    green : int
    blue : int
    [red >= 0 && red <= 255 && green >= 0 && green <= 255 && blue >=0 && blue <= 255]

//DG

abstract RadialGradient : Gradient 
    centerX : int 
    centerY : int 
    radius : int 
    focusX : int 
    focusY : int 
abstract RadialGradient : Gradient
    centerX : int
    centerY : int
    radius : int
    focusX : int
    focusY : int
    [focusX >= 0 && focusX <= 1 && focusY >= 0 && focusY <= 1]
    [radius >= 0 && radius <= 1]

abstract Gradient : Fill 
abstract Gradient : Fill
    stop : GradientStop 2..*

abstract Fill
    canvas -> Canvas 
    canvas -> Canvas
        [parent in this.fill]
    transform : Transform *

abstract Canvas : Group 
abstract Canvas : Group
    backgroundFill -> Fill ?
    backgroundColor : Color ?
    marker : Marker *
        [parent in this.canvas]
    fill : Fill *
        [parent in this.canvas]

abstract Group : GraphicalElement 
abstract Group : GraphicalElement
    member : GraphicalElement *
        [parent in this.group]

abstract GraphicalElement
    group -> Group ?
        [parent in this.member]
    localStyle : Style ?
    sharedStyle -> Style ?
    transform : Transform *
    clipPath : ClipPath ?
        [parent in this.clippedElement]

abstract Style
    fillOpacity : int ?
	[this >= 0 && this <= 1]
        [this >= 0 && this <= 1]
    strokeWidth : int ?
	[this >= 0]
        [this >= 0]
    strokeOpacity : int ?
	[this >= 0 && this <= 1]
        [this >= 0 && this <= 1]
    strokeDashLength : int *
    fontSize : int ?
	[this >= 0]
        [this >= 0]
    fontName : string ?
    fontItalic ?
    fontBold ?
    fontUnderline ?
    fontStrikeThrough ?
    fill -> Fill ?
    fillColor : Color ?
    strokeColor : Color ?
    fontColor : Color ?
    [(#strokeDashLength) - ((#strokeDashLength)/2)*2 = 0]
    
    



abstract Transform

abstract ClipPath : Group 
    clippedElement -> GraphicalElement 
abstract ClipPath : Group
    clippedElement -> GraphicalElement
        [parent in this.clipPath]

abstract Marker : Group 
    size : Dimension 
    reference : Point 
    canvas -> Canvas 
abstract Marker : Group
    size : Dimension
    reference : Point
    canvas -> Canvas
        [parent in this.marker]

abstract GradientStop
    offset : int 
    opacity : int 
    color : Color 
    offset : int
    opacity : int
    color : Color
    [offset >= 0 && offset <= 1]
    [opacity >= 0 && opacity <= 1]

abstract Pattern : Fill 
    bounds : Bounds 
    tile : GraphicalElement 
abstract Pattern : Fill
    bounds : Bounds
    tile : GraphicalElement

abstract LinearGradient : Gradient 
    x1 : int 
    x2 : int 
    y1 : int 
    y2 : int 
abstract LinearGradient : Gradient
    x1 : int
    x2 : int
    y1 : int
    y2 : int
    [x1 >= 0 && x1 <= 1 && x2 >= 0 && x2 <= 1 && y1 >= 0 && y1 <= 1 && y2 >= 0 && y2 <= 1]

abstract MarkedElement : GraphicalElement 
abstract MarkedElement : GraphicalElement
    startMarker -> Marker ?
    endMarker -> Marker ?
    midMarker -> Marker ?

abstract Rectangle : GraphicalElement 
    cornerRadius : int 
    bounds : Bounds 
abstract Rectangle : GraphicalElement
    cornerRadius : int
    bounds : Bounds

abstract Ellipse : GraphicalElement 
    center : Point 
    radii : Dimension 
abstract Ellipse : GraphicalElement
    center : Point
    radii : Dimension

abstract Text : GraphicalElement 
    data : string 
    alignment -> AlignmentKind 
    bounds : Bounds 
abstract Text : GraphicalElement
    data : string
    alignment -> AlignmentKind
    bounds : Bounds

abstract Line : MarkedElement 
    start : Point 
    end : Point 
abstract Line : MarkedElement
    start : Point
    end : Point

abstract Polyline : MarkedElement 
abstract Polyline : MarkedElement
    point : Point 2..*

abstract Polygon : MarkedElement 
abstract Polygon : MarkedElement
    point : Point 3..*

abstract Path : MarkedElement 
abstract Path : MarkedElement
    commands : PathCommand *

abstract PathCommand
    isRelative ?

abstract Translate : Transform 
    deltaX : int 
    deltaY : int 
abstract Translate : Transform
    deltaX : int
    deltaY : int

abstract Scale : Transform 
    factorX : int 
abstract Scale : Transform
    factorX : int
    factorY : int
    [ factorX >= 0 && factorY >= 0]

abstract Rotate : Transform 
    angle : int 
abstract Rotate : Transform
    angle : int
    center : Point ?

abstract Skew : Transform 
    angleX : int 
    angleY : int 
abstract Skew : Transform
    angleX : int
    angleY : int

abstract Image : GraphicalElement 
    source : string 
abstract Image : GraphicalElement
    source : string
    isAspectRatioPreserved ?
    bounds : Bounds 
    bounds : Bounds

abstract Circle : GraphicalElement 
    radius : int 
    center : Point 
abstract Circle : GraphicalElement
    radius : int
    center : Point
    [radius >= 0]

abstract Matrix : Transform 
    a : int 
    b : int 
    c : int 
    d : int 
    e : int 
    f : int 
abstract Matrix : Transform
    a : int
    b : int
    c : int
    d : int
    e : int
    f : int

abstract MoveTo : PathCommand 
    point : Point 
abstract MoveTo : PathCommand
    point : Point

abstract LineTo : PathCommand 
    point : Point 
abstract LineTo : PathCommand
    point : Point

abstract CubicCurveTo : PathCommand 
    point : Point 
    startControl : Point 
    endControl : Point 
abstract CubicCurveTo : PathCommand
    point : Point
    startControl : Point
    endControl : Point

abstract QuadraticCurveTo : PathCommand 
    point : Point 
    control : Point 
abstract QuadraticCurveTo : PathCommand
    point : Point
    control : Point

abstract EllipticalArcTo : PathCommand 
    rotation : int 
abstract EllipticalArcTo : PathCommand
    rotation : int
    isLargeArc ?
    isSweep ?
    point : Point 
    radii : Dimension 
    point : Point
    radii : Dimension

abstract ClosePath : PathCommand 
abstract ClosePath : PathCommand


```

```{.clafer .summary}
```