-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6233ef7
commit 9501d1f
Showing
19 changed files
with
373 additions
and
373 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
repository/BaselineOfOpenPonkUMLProfiles/BaselineOfOpenPonkUMLProfiles.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
" | ||
Baseline for https://github.com/OpenPonk/uml-profiles | ||
" | ||
Class { | ||
#name : 'BaselineOfOpenPonkUMLProfiles', | ||
#superclass : 'BaselineOf', | ||
#category : 'BaselineOfOpenPonkUMLProfiles', | ||
#package : 'BaselineOfOpenPonkUMLProfiles' | ||
} | ||
|
||
{ #category : 'baselines' } | ||
BaselineOfOpenPonkUMLProfiles >> baseline: spec [ | ||
<baseline> | ||
spec | ||
for: #common | ||
do: [ spec | ||
baseline: 'OpenPonkUMLMetamodel' | ||
with: [ spec repository: 'github://openponk/uml-metamodel' ]. | ||
spec package: 'OpenPonk-UML-Profiles' with: [ spec requires: #('UMLMetamodel') ]. | ||
spec package: 'OpenPonk-ClockProfile' with: [ spec requires: #('OP-UML-Profiles') ]. | ||
spec package: 'OpenPonk-IssuesProfile' with: [ spec requires: #('OP-UML-Profiles') ]. | ||
spec group: 'default' with: #('OpenPonk-UML-Profiles' 'OpenPonk-ClockProfile' 'OpenPonk-IssuesProfile') ] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Package { #name : 'BaselineOfOpenPonkUMLProfiles' } |
23 changes: 0 additions & 23 deletions
23
repository/BaselineOfUMLProfiles/BaselineOfUMLProfiles.class.st
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
120 changes: 60 additions & 60 deletions
120
repository/OP-ClockProfile/ClClock.class.st → ...ry/OpenPonk-ClockProfile/ClClock.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,60 @@ | ||
Class { | ||
#name : 'ClClock', | ||
#superclass : 'Object', | ||
#instVars : [ | ||
'osVersion', | ||
'posixCompliant', | ||
'base_Class' | ||
], | ||
#category : 'OP-ClockProfile-Metamodel', | ||
#package : 'OP-ClockProfile', | ||
#tag : 'Metamodel' | ||
} | ||
|
||
{ #category : 'accessing' } | ||
ClClock >> base_Class [ | ||
^ base_Class | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ClClock >> base_Class: aClass [ | ||
| oldClass | | ||
oldClass := base_Class. | ||
base_Class := aClass. | ||
OPUMLToOneLink | ||
on: self | ||
thisSelector: #base_Class | ||
otherSelector: #extension_Clock | ||
updateFrom: oldClass | ||
to: aClass | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ClClock >> osVersion [ | ||
^ osVersion | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ClClock >> osVersion: aString [ | ||
osVersion := aString | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ClClock >> posixCompliant [ | ||
^ posixCompliant ifNil: [ false ] | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ClClock >> posixCompliant: aBoolean [ | ||
posixCompliant := aBoolean | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ClClock >> umlClassName [ | ||
^ 'Clock' | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ClClock >> umlMetaClass [ | ||
^ ClClockProfileFactory metaClassFor: self | ||
] | ||
Class { | ||
#name : 'ClClock', | ||
#superclass : 'Object', | ||
#instVars : [ | ||
'osVersion', | ||
'posixCompliant', | ||
'base_Class' | ||
], | ||
#category : 'OpenPonk-ClockProfile-Metamodel', | ||
#package : 'OpenPonk-ClockProfile', | ||
#tag : 'Metamodel' | ||
} | ||
|
||
{ #category : 'accessing' } | ||
ClClock >> base_Class [ | ||
^ base_Class | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ClClock >> base_Class: aClass [ | ||
| oldClass | | ||
oldClass := base_Class. | ||
base_Class := aClass. | ||
OPUMLToOneLink | ||
on: self | ||
thisSelector: #base_Class | ||
otherSelector: #extension_Clock | ||
updateFrom: oldClass | ||
to: aClass | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ClClock >> osVersion [ | ||
^ osVersion | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ClClock >> osVersion: aString [ | ||
osVersion := aString | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ClClock >> posixCompliant [ | ||
^ posixCompliant ifNil: [ false ] | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ClClock >> posixCompliant: aBoolean [ | ||
posixCompliant := aBoolean | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ClClock >> umlClassName [ | ||
^ 'Clock' | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ClClock >> umlMetaClass [ | ||
^ ClClockProfileFactory metaClassFor: self | ||
] |
156 changes: 78 additions & 78 deletions
156
...ockProfile/ClClockProfileFactory.class.st → ...ockProfile/ClClockProfileFactory.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,78 @@ | ||
Class { | ||
#name : 'ClClockProfileFactory', | ||
#superclass : 'OPUmlCustomProfile', | ||
#category : 'OP-ClockProfile-Model', | ||
#package : 'OP-ClockProfile', | ||
#tag : 'Model' | ||
} | ||
|
||
{ #category : 'instance creation' } | ||
ClClockProfileFactory >> createProfile [ | ||
| profile classMetaclass clock clockPair | | ||
profile := OPUMLProfile new | ||
name: 'Clock'; | ||
uuid: '_0'; | ||
URI: 'http://www.example.com/Clock/0.1'; | ||
implementationPackage: 'ClockProfile'; | ||
implementationPrefix: 'Cl'. | ||
classMetaclass := self metaClassNamed: 'Class'. | ||
clockPair := self newStereotype: 'Clock' to: classMetaclass. | ||
profile packagedElements addAll: clockPair. | ||
clock := clockPair first. | ||
OPUMLProperty new | ||
name: 'osVersion'; | ||
uuid: clock uuid , '-osVersion'; | ||
owningClass: clock; | ||
type: (OPUMLPrimitiveType new name: 'String'). | ||
"OPUMLProperty new | ||
name: 'startOperation'; | ||
uuid: clock uuid , '-startOperation'; | ||
owningClass: clock; | ||
type: (OPUMLClass new name: 'Operation')." | ||
OPUMLProperty new | ||
name: 'posixCompliant'; | ||
uuid: clock uuid , '-posixCompliant'; | ||
owningClass: clock; | ||
type: (OPUMLPrimitiveType new name: 'Boolean'). | ||
profile ownedStereotype do: [ :each | each profile: profile ]. | ||
^ profile | ||
] | ||
|
||
{ #category : 'instance creation' } | ||
ClClockProfileFactory >> modelWithAppliedStereotype [ | ||
|
||
<gtExample> | ||
| model class profile | | ||
model := OPUmlExamples emptyModel. | ||
profile := self class profile. | ||
model profileApplications add: | ||
(OPUMLProfileApplication new appliedProfile: profile). | ||
class := OPUMLClass new name: 'StopWatch'. | ||
class applyStereotype: | ||
(profile packagedElements detect: [ :each | each name = 'Clock' ]) | ||
implementationClass new. | ||
model packagedElements add: class. | ||
^ model | ||
] | ||
|
||
{ #category : 'instance creation' } | ||
ClClockProfileFactory >> openExample [ | ||
|
||
<script: 'self new openExample'> | ||
(OPProject openOnModel: self modelWithAppliedStereotype) | ||
showAllElementsInAllDiagrams | ||
] | ||
|
||
{ #category : 'instance creation' } | ||
ClClockProfileFactory >> openProfile [ | ||
|
||
<script: 'self new openProfile'> | ||
(OPProject openOnModel: self class profile) | ||
showAllElementsInAllDiagrams | ||
] | ||
|
||
{ #category : 'instance creation' } | ||
ClClockProfileFactory >> reset [ | ||
<script: 'self reset'> | ||
self class reset | ||
] | ||
Class { | ||
#name : 'ClClockProfileFactory', | ||
#superclass : 'OPUmlCustomProfile', | ||
#category : 'OpenPonk-ClockProfile-Model', | ||
#package : 'OpenPonk-ClockProfile', | ||
#tag : 'Model' | ||
} | ||
|
||
{ #category : 'instance creation' } | ||
ClClockProfileFactory >> createProfile [ | ||
| profile classMetaclass clock clockPair | | ||
profile := OPUMLProfile new | ||
name: 'Clock'; | ||
uuid: '_0'; | ||
URI: 'http://www.example.com/Clock/0.1'; | ||
implementationPackage: 'ClockProfile'; | ||
implementationPrefix: 'Cl'. | ||
classMetaclass := self metaClassNamed: 'Class'. | ||
clockPair := self newStereotype: 'Clock' to: classMetaclass. | ||
profile packagedElements addAll: clockPair. | ||
clock := clockPair first. | ||
OPUMLProperty new | ||
name: 'osVersion'; | ||
uuid: clock uuid , '-osVersion'; | ||
owningClass: clock; | ||
type: (OPUMLPrimitiveType new name: 'String'). | ||
"OPUMLProperty new | ||
name: 'startOperation'; | ||
uuid: clock uuid , '-startOperation'; | ||
owningClass: clock; | ||
type: (OPUMLClass new name: 'Operation')." | ||
OPUMLProperty new | ||
name: 'posixCompliant'; | ||
uuid: clock uuid , '-posixCompliant'; | ||
owningClass: clock; | ||
type: (OPUMLPrimitiveType new name: 'Boolean'). | ||
profile ownedStereotype do: [ :each | each profile: profile ]. | ||
^ profile | ||
] | ||
|
||
{ #category : 'instance creation' } | ||
ClClockProfileFactory >> modelWithAppliedStereotype [ | ||
|
||
<gtExample> | ||
| model class profile | | ||
model := OPUmlExamples emptyModel. | ||
profile := self class profile. | ||
model profileApplications add: | ||
(OPUMLProfileApplication new appliedProfile: profile). | ||
class := OPUMLClass new name: 'StopWatch'. | ||
class applyStereotype: | ||
(profile packagedElements detect: [ :each | each name = 'Clock' ]) | ||
implementationClass new. | ||
model packagedElements add: class. | ||
^ model | ||
] | ||
|
||
{ #category : 'instance creation' } | ||
ClClockProfileFactory >> openExample [ | ||
|
||
<script: 'self new openExample'> | ||
(OPProject openOnModel: self modelWithAppliedStereotype) | ||
showAllElementsInAllDiagrams | ||
] | ||
|
||
{ #category : 'instance creation' } | ||
ClClockProfileFactory >> openProfile [ | ||
|
||
<script: 'self new openProfile'> | ||
(OPProject openOnModel: self class profile) | ||
showAllElementsInAllDiagrams | ||
] | ||
|
||
{ #category : 'instance creation' } | ||
ClClockProfileFactory >> reset [ | ||
<script: 'self reset'> | ||
self class reset | ||
] |
38 changes: 19 additions & 19 deletions
38
...y/OP-ClockProfile/OPUMLClass.extension.st → ...Ponk-ClockProfile/OPUMLClass.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
Extension { #name : 'OPUMLClass' } | ||
|
||
{ #category : '*OP-ClockProfile-Metamodel' } | ||
OPUMLClass >> extension_Clock [ | ||
^ self tagAt: #extension_Clock ifAbsent: [ nil ] | ||
] | ||
|
||
{ #category : '*OP-ClockProfile-Metamodel' } | ||
OPUMLClass >> extension_Clock: aClock [ | ||
| oldClock | | ||
oldClock := self extension_Clock. | ||
self tagAt: #extension_Clock put: aClock. | ||
OPUMLToOneLink | ||
on: self | ||
thisSelector: #extension_Clock | ||
otherSelector: #base_Class | ||
updateFrom: oldClock | ||
to: aClock | ||
] | ||
Extension { #name : 'OPUMLClass' } | ||
|
||
{ #category : '*OpenPonk-ClockProfile-Metamodel' } | ||
OPUMLClass >> extension_Clock [ | ||
^ self tagAt: #extension_Clock ifAbsent: [ nil ] | ||
] | ||
|
||
{ #category : '*OpenPonk-ClockProfile-Metamodel' } | ||
OPUMLClass >> extension_Clock: aClock [ | ||
| oldClock | | ||
oldClock := self extension_Clock. | ||
self tagAt: #extension_Clock put: aClock. | ||
OPUMLToOneLink | ||
on: self | ||
thisSelector: #extension_Clock | ||
otherSelector: #base_Class | ||
updateFrom: oldClock | ||
to: aClock | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Package { #name : 'OpenPonk-ClockProfile' } |
Oops, something went wrong.