-
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
999c0d1
commit 5effc00
Showing
8 changed files
with
328 additions
and
328 deletions.
There are no files selected for viewing
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,58 +1,58 @@ | ||
Class { | ||
#name : #ClClock, | ||
#superclass : #Object, | ||
#instVars : [ | ||
'osVersion', | ||
'posixCompliant', | ||
'base_Class' | ||
], | ||
#category : 'OP-ClockProfile-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 : 'OP-ClockProfile-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 | ||
] |
150 changes: 75 additions & 75 deletions
150
repository/OP-ClockProfile/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,75 +1,75 @@ | ||
Class { | ||
#name : #ClClockProfileFactory, | ||
#superclass : #OPUmlCustomProfile, | ||
#category : 'OP-ClockProfile-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 new emptyModel. | ||
profile := self class profile. | ||
model profileApplications | ||
add: | ||
(OPUMLProfileApplication new | ||
uuid: model uuid , '-_profileApplication.0'; | ||
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'> | ||
OPUmlProject openOnModel: self modelWithAppliedStereotype | ||
] | ||
|
||
{ #category : #'instance creation' } | ||
ClClockProfileFactory >> openProfile [ | ||
<script: 'self new openProfile'> | ||
OPUmlProject openOnModel: self class profile | ||
] | ||
|
||
{ #category : #'instance creation' } | ||
ClClockProfileFactory >> reset [ | ||
<script: 'self reset'> | ||
self class reset | ||
] | ||
Class { | ||
#name : #ClClockProfileFactory, | ||
#superclass : #OPUmlCustomProfile, | ||
#category : #'OP-ClockProfile-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 new emptyModel. | ||
profile := self class profile. | ||
model profileApplications | ||
add: | ||
(OPUMLProfileApplication new | ||
uuid: model uuid , '-_profileApplication.0'; | ||
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 | ||
] | ||
|
||
{ #category : #'instance creation' } | ||
ClClockProfileFactory >> openProfile [ | ||
<script: 'self new openProfile'> | ||
OPProject openOnModel: self class profile | ||
] | ||
|
||
{ #category : #'instance creation' } | ||
ClClockProfileFactory >> reset [ | ||
<script: 'self reset'> | ||
self class reset | ||
] |
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 : #'*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 | ||
] |
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 +1 @@ | ||
Package { #name : #'OP-ClockProfile' } | ||
Package { #name : #'OP-ClockProfile' } |
Oops, something went wrong.