From 0fb19264d905509b5f257b756ec0892b4fc80a26 Mon Sep 17 00:00:00 2001 From: Jan Bliznicenko Date: Wed, 1 Jan 2025 10:55:36 +0100 Subject: [PATCH] Accomodating OP core changes, code cleanup --- .../OpenPonk-ERD/ManifestOpenPonkERD.class.st | 10 +- Pharo/OpenPonk-ERD/OPErd.class.st | 16 ++- .../OPErdAbstractNodeShape.class.st | 18 +-- Pharo/OpenPonk-ERD/OPErdAttribute.class.st | 34 ++--- .../OPErdAttributeController.class.st | 48 ++++--- .../OpenPonk-ERD/OPErdAttributeShape.class.st | 22 +-- Pharo/OpenPonk-ERD/OPErdController.class.st | 35 ++--- .../OPErdDerivedAttributeController.class.st | 16 ++- .../OPErdDisjointExtensionController.class.st | 10 +- Pharo/OpenPonk-ERD/OPErdEntity.class.st | 24 ++-- .../OPErdEntityController.class.st | 22 +-- Pharo/OpenPonk-ERD/OPErdEntityShape.class.st | 14 +- Pharo/OpenPonk-ERD/OPErdExamples.class.st | 14 +- Pharo/OpenPonk-ERD/OPErdExtensions.class.st | 34 ++--- .../OPErdExtensionsController.class.st | 18 +-- .../OPErdExtensionsShape.class.st | 35 ++--- .../OPErdFigureHighlighter.class.st | 20 +-- Pharo/OpenPonk-ERD/OPErdGraphML.class.st | 40 +++--- ...PErdIdentifyingRelationController.class.st | 12 +- .../OPErdIncomingTransition.class.st | 73 +++------- ...rdInheritanceTransitionController.class.st | 10 +- .../OPErdKeyAttributeController.class.st | 16 ++- Pharo/OpenPonk-ERD/OPErdLayouter.class.st | 14 +- .../OPErdModelSerializer.class.st | 30 ++-- ...ErdMultivaluedAttributeController.class.st | 10 +- .../OPErdNavigatorAdapter.class.st | 136 ++++++++---------- Pharo/OpenPonk-ERD/OPErdNode.class.st | 28 ++-- .../OpenPonk-ERD/OPErdNodeController.class.st | 43 +++--- ...ErdOverlappingExtensionController.class.st | 10 +- Pharo/OpenPonk-ERD/OPErdPlugin.class.st | 22 +-- Pharo/OpenPonk-ERD/OPErdRelation.class.st | 22 +-- .../OPErdRelationController.class.st | 18 +-- .../OpenPonk-ERD/OPErdRelationShape.class.st | 14 +- .../OPErdTotalTransitionController.class.st | 10 +- Pharo/OpenPonk-ERD/OPErdTransition.class.st | 60 ++++---- .../OPErdTransitionController.class.st | 42 +++--- .../OPErdTransitionLabel.class.st | 17 ++- .../OPErdTransitionShape.class.st | 49 ++++--- .../OPErdUnionExtensionController.class.st | 10 +- .../OPErdWeakEntityController.class.st | 16 ++- Pharo/OpenPonk-ERD/package.st | 2 +- 41 files changed, 564 insertions(+), 530 deletions(-) diff --git a/Pharo/OpenPonk-ERD/ManifestOpenPonkERD.class.st b/Pharo/OpenPonk-ERD/ManifestOpenPonkERD.class.st index 8db00ec..7c77592 100644 --- a/Pharo/OpenPonk-ERD/ManifestOpenPonkERD.class.st +++ b/Pharo/OpenPonk-ERD/ManifestOpenPonkERD.class.st @@ -2,12 +2,14 @@ Please describe the package using the class comment of the included manifest class. The manifest class also includes other additional metadata for the package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser " Class { - #name : #ManifestOpenPonkERD, - #superclass : #PackageManifest, - #category : #'OpenPonk-ERD-Manifest' + #name : 'ManifestOpenPonkERD', + #superclass : 'PackageManifest', + #category : 'OpenPonk-ERD-Manifest', + #package : 'OpenPonk-ERD', + #tag : 'Manifest' } -{ #category : #'code-critics' } +{ #category : 'code-critics' } ManifestOpenPonkERD class >> ruleBadMessageRule2V1FalsePositive [ diff --git a/Pharo/OpenPonk-ERD/OPErd.class.st b/Pharo/OpenPonk-ERD/OPErd.class.st index 9ccedcd..77c945a 100644 --- a/Pharo/OpenPonk-ERD/OPErd.class.st +++ b/Pharo/OpenPonk-ERD/OPErd.class.st @@ -1,25 +1,27 @@ Class { - #name : #OPErd, - #superclass : #OPModelObject, - #category : #'OpenPonk-ERD-Models' + #name : 'OPErd', + #superclass : 'OPModelObject', + #category : 'OpenPonk-ERD-Models', + #package : 'OpenPonk-ERD', + #tag : 'Models' } -{ #category : #testing } +{ #category : 'testing' } OPErd >> isState [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } OPErd >> isTransition [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } OPErd >> states [ ^ elements select: [ :each | each isState ] ] -{ #category : #testing } +{ #category : 'testing' } OPErd >> transitions [ ^ elements select: [ :each | each isTransition ] ] diff --git a/Pharo/OpenPonk-ERD/OPErdAbstractNodeShape.class.st b/Pharo/OpenPonk-ERD/OPErdAbstractNodeShape.class.st index 8b2be35..405818f 100644 --- a/Pharo/OpenPonk-ERD/OPErdAbstractNodeShape.class.st +++ b/Pharo/OpenPonk-ERD/OPErdAbstractNodeShape.class.st @@ -1,19 +1,21 @@ Class { - #name : #OPErdAbstractNodeShape, - #superclass : #OPBoundNode, + #name : 'OPErdAbstractNodeShape', + #superclass : 'OPBoundNode', #instVars : [ 'adornmentCreationBlock' ], - #category : #'OpenPonk-ERD-DiagramElements' + #category : 'OpenPonk-ERD-DiagramElements', + #package : 'OpenPonk-ERD', + #tag : 'DiagramElements' } -{ #category : #accessing } +{ #category : 'accessing' } OPErdAbstractNodeShape >> adornmentCreationBlock: aBlock [ adornmentCreationBlock := aBlock ] -{ #category : #rendering } +{ #category : 'rendering' } OPErdAbstractNodeShape >> renderShapeDetails [ self roassalShape @@ -24,7 +26,7 @@ OPErdAbstractNodeShape >> renderShapeDetails [ super renderShapeDetails ] -{ #category : #interactions } +{ #category : 'interactions' } OPErdAbstractNodeShape >> selectableInteraction [ | selectableInteraction | @@ -42,13 +44,13 @@ OPErdAbstractNodeShape >> selectableInteraction [ ^ selectableInteraction ] -{ #category : #interactions } +{ #category : 'interactions' } OPErdAbstractNodeShape >> shouldBePositionableByUser [ ^ true ] -{ #category : #interactions } +{ #category : 'interactions' } OPErdAbstractNodeShape >> shouldBeResizableByUser [ ^ true diff --git a/Pharo/OpenPonk-ERD/OPErdAttribute.class.st b/Pharo/OpenPonk-ERD/OPErdAttribute.class.st index 86cd545..a60f3f8 100644 --- a/Pharo/OpenPonk-ERD/OPErdAttribute.class.st +++ b/Pharo/OpenPonk-ERD/OPErdAttribute.class.st @@ -1,37 +1,39 @@ Class { - #name : #OPErdAttribute, - #superclass : #OPErdNode, + #name : 'OPErdAttribute', + #superclass : 'OPErdNode', #instVars : [ 'isDerived', 'isMultivalued', 'isKey' ], - #category : #'OpenPonk-ERD-Models' + #category : 'OpenPonk-ERD-Models', + #package : 'OpenPonk-ERD', + #tag : 'Models' } -{ #category : #associating } +{ #category : 'associating' } OPErdAttribute >> beDerived [ self isDerived: true ] -{ #category : #associating } +{ #category : 'associating' } OPErdAttribute >> beKey [ self isKey: true ] -{ #category : #associating } +{ #category : 'associating' } OPErdAttribute >> beMultivalued [ self isMultivalued: true ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdAttribute >> beNormal [ self isDerived: false. self isMultivalued: false. self isKey: false ] -{ #category : #associating } +{ #category : 'associating' } OPErdAttribute >> graphmlType [ self isDerived ifTrue: [ ^ #derived ] @@ -42,7 +44,7 @@ OPErdAttribute >> graphmlType [ ifFalse: [ ^ #regularAttribute ] ] ] ] -{ #category : #associating } +{ #category : 'associating' } OPErdAttribute >> initialize [ super initialize. isDerived := false. @@ -50,40 +52,40 @@ OPErdAttribute >> initialize [ isKey := false ] -{ #category : #associating } +{ #category : 'associating' } OPErdAttribute >> isDerived [ ^ isDerived ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdAttribute >> isDerived: aBoolean [ isDerived := aBoolean. self changed ] -{ #category : #associating } +{ #category : 'associating' } OPErdAttribute >> isKey [ ^ isKey ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdAttribute >> isKey: aBoolean [ isKey := aBoolean. self changed ] -{ #category : #associating } +{ #category : 'associating' } OPErdAttribute >> isMultivalued [ ^ isMultivalued ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdAttribute >> isMultivalued: aBoolean [ isMultivalued := aBoolean. self changed ] -{ #category : #associating } +{ #category : 'associating' } OPErdAttribute >> isNormal [ ^ (isDerived & isMultivalued & isKey) not ] diff --git a/Pharo/OpenPonk-ERD/OPErdAttributeController.class.st b/Pharo/OpenPonk-ERD/OPErdAttributeController.class.st index 4381877..440075c 100644 --- a/Pharo/OpenPonk-ERD/OPErdAttributeController.class.st +++ b/Pharo/OpenPonk-ERD/OPErdAttributeController.class.st @@ -1,10 +1,12 @@ Class { - #name : #OPErdAttributeController, - #superclass : #OPErdNodeController, - #category : #'OpenPonk-ERD-Controllers' + #name : 'OPErdAttributeController', + #superclass : 'OPErdNodeController', + #category : 'OpenPonk-ERD-Controllers', + #package : 'OpenPonk-ERD', + #tag : 'Controllers' } -{ #category : #forms } +{ #category : 'forms' } OPErdAttributeController >> buildEditorForm: aForm [ super buildEditorForm: aForm. @@ -39,13 +41,13 @@ OPErdAttributeController >> buildEditorForm: aForm [ self diagramController updateCanvas. ] -{ #category : #connecting } +{ #category : 'connecting' } OPErdAttributeController >> canBeSourceFor: aController [ ^ (aController class == OPErdTransitionController) ] -{ #category : #connecting } +{ #category : 'connecting' } OPErdAttributeController >> canBeTargetFor: aController [ ^ (aController class == OPErdTransitionController) ifTrue: [ ^ self sourceIsValid: aController source model ] @@ -53,33 +55,35 @@ OPErdAttributeController >> canBeTargetFor: aController [ ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdAttributeController >> derivedValidation [ + | inc out | - self model incoming isEmpty - ifTrue: [ inc := true ] - ifFalse: [ inc := self model incoming allSatisfy: - [ :each | self validDerivedSources includes: each source class] ]. - - self model outgoing isEmpty - ifTrue: [ out := true ] - ifFalse: [ out := self model outgoing includesAny: self validDerivedTargets ]. - (inc & out) ifTrue: [ ^ true ]. + inc := self model incoming isEmpty + ifTrue: [ true ] + ifFalse: [ + self model incoming allSatisfy: [ :each | + self validDerivedSources includes: each source class ] ]. + out := self model outgoing isEmpty + ifTrue: [ true ] + ifFalse: [ + self model outgoing includesAny: self validDerivedTargets ]. + inc & out ifTrue: [ ^ true ]. ^ false ] -{ #category : #construction } +{ #category : 'construction' } OPErdAttributeController >> diagramElementClass [ ^ OPErdAttributeShape ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdAttributeController >> modelClass [ ^ OPErdAttribute ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdAttributeController >> sourceIsValid: aModel [ (aModel class == self modelClass) ifTrue: [ ^ ((aModel uuid ~~ self model uuid) and: @@ -88,18 +92,18 @@ OPErdAttributeController >> sourceIsValid: aModel [ ifFalse: [ ^ self validSources includes: aModel class ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdAttributeController >> validDerivedSources [ ^ { OPErdEntity. OPErdRelation. } ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdAttributeController >> validDerivedTargets [ ^ { OPErdEntity. } ] -{ #category : #'accessing - DirectedRelationship' } +{ #category : 'accessing - DirectedRelationship' } OPErdAttributeController >> validSources [ "does not include self to avoid self -> self connections if not allowed" ^ { OPErdEntity. diff --git a/Pharo/OpenPonk-ERD/OPErdAttributeShape.class.st b/Pharo/OpenPonk-ERD/OPErdAttributeShape.class.st index 084bea6..79d2b8d 100644 --- a/Pharo/OpenPonk-ERD/OPErdAttributeShape.class.st +++ b/Pharo/OpenPonk-ERD/OPErdAttributeShape.class.st @@ -1,15 +1,17 @@ Class { - #name : #OPErdAttributeShape, - #superclass : #OPErdAbstractNodeShape, + #name : 'OPErdAttributeShape', + #superclass : 'OPErdAbstractNodeShape', #instVars : [ 'label', 'border', 'innerEllipse' ], - #category : #'OpenPonk-ERD-DiagramElements' + #category : 'OpenPonk-ERD-DiagramElements', + #package : 'OpenPonk-ERD', + #tag : 'DiagramElements' } -{ #category : #rendering } +{ #category : 'rendering' } OPErdAttributeShape >> renderBasicShape [ ^ RSEllipse new @@ -23,7 +25,7 @@ OPErdAttributeShape >> renderBasicShape [ yourself. ] -{ #category : #rendering } +{ #category : 'rendering' } OPErdAttributeShape >> renderShapeDetails [ super renderShapeDetails. @@ -71,7 +73,7 @@ OPErdAttributeShape >> renderShapeDetails [ for: self ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdAttributeShape >> updateBorder [ border radius: (self roassalShape radius); @@ -79,14 +81,14 @@ OPErdAttributeShape >> updateBorder [ width: (self roassalShape width). ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdAttributeShape >> updateDetails [ self updateBorder. self updateInnerEllipse. self updateLabel ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdAttributeShape >> updateInnerEllipse [ innerEllipse radius: (self roassalShape radius - 3); @@ -94,13 +96,13 @@ OPErdAttributeShape >> updateInnerEllipse [ height: (self roassalShape height - 7). ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdAttributeShape >> updateLabel [ label width: self roassalShape width. ] -{ #category : #rendering } +{ #category : 'rendering' } OPErdAttributeShape >> updateRenderFromModel [ label text: self modelElement name. diff --git a/Pharo/OpenPonk-ERD/OPErdController.class.st b/Pharo/OpenPonk-ERD/OPErdController.class.st index 4e77cac..6f3809f 100644 --- a/Pharo/OpenPonk-ERD/OPErdController.class.st +++ b/Pharo/OpenPonk-ERD/OPErdController.class.st @@ -1,37 +1,39 @@ Class { - #name : #OPErdController, - #superclass : #OPDiagramController, - #category : #'OpenPonk-ERD-Controllers' + #name : 'OPErdController', + #superclass : 'OPDiagramController', + #category : 'OpenPonk-ERD-Controllers', + #package : 'OpenPonk-ERD', + #tag : 'Controllers' } -{ #category : #connecting } +{ #category : 'connecting' } OPErdController >> canBeTargetFor: aController [ ^ (super canBeTargetFor: aController) or: [ aController isKindOf: OPErdNodeController ] ] -{ #category : #connecting } +{ #category : 'accessing' } OPErdController >> commonModelClassPrefix [ ^ 'OPErd' ] -{ #category : #connecting } +{ #category : 'accessing' } OPErdController >> controllerFactory [ + ^ super controllerFactory register: OPErdAttributeController forModel: OPErdAttribute; register: OPErdTransitionController forModel: OPErdTransition; - register: OPErdTransitionController forModel: OPErdIncomingTransition; register: OPErdEntityController forModel: OPErdEntity; register: OPErdRelationController forModel: OPErdRelation; register: OPErdExtensionsController forModel: OPErdExtensions ] -{ #category : #connecting } +{ #category : 'accessing' } OPErdController >> elementsToShowInside [ - ^ model elements + ^ self model elements ] -{ #category : #connecting } +{ #category : 'ui interaction' } OPErdController >> initializePalette: aPalette [ aPalette newCreationTool: 'Regular Entity' @@ -85,18 +87,7 @@ OPErdController >> initializePalette: aPalette [ icon: OPCoreIcons opErdOverlappingExtensionIcon ] -{ #category : #connecting } +{ #category : 'accessing' } OPErdController >> modelClass [ ^ OPErd ] - -{ #category : #connecting } -OPErdController >> newControllerFor: aModel [ - "IncomingTransition identifies itself as transition, but is not" - - ^ super - newControllerFor: - (aModel isTransition - ifTrue: [ aModel asTransition ] - ifFalse: [ aModel ]) -] diff --git a/Pharo/OpenPonk-ERD/OPErdDerivedAttributeController.class.st b/Pharo/OpenPonk-ERD/OPErdDerivedAttributeController.class.st index 0eaba25..3c3f73f 100644 --- a/Pharo/OpenPonk-ERD/OPErdDerivedAttributeController.class.st +++ b/Pharo/OpenPonk-ERD/OPErdDerivedAttributeController.class.st @@ -1,17 +1,19 @@ Class { - #name : #OPErdDerivedAttributeController, - #superclass : #OPErdAttributeController, - #category : #'OpenPonk-ERD-Controllers' + #name : 'OPErdDerivedAttributeController', + #superclass : 'OPErdAttributeController', + #category : 'OpenPonk-ERD-Controllers', + #package : 'OpenPonk-ERD', + #tag : 'Controllers' } -{ #category : #connecting } +{ #category : 'connecting' } OPErdDerivedAttributeController >> canBeTargetFor: aController [ ^ (aController class == OPErdTransitionController) ifTrue: [ ^ self sourceIsValid: aController source model ] ifFalse: [ ^ false ] ] -{ #category : #construction } +{ #category : 'construction' } OPErdDerivedAttributeController >> createModelIn: aParentModel [ ^ (super createModelIn: aParentModel) @@ -19,12 +21,12 @@ OPErdDerivedAttributeController >> createModelIn: aParentModel [ yourself ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdDerivedAttributeController >> sourceIsValid: aModel [ ^ self validSources includes: aModel class ] -{ #category : #'accessing - DirectedRelationship' } +{ #category : 'accessing - DirectedRelationship' } OPErdDerivedAttributeController >> validSources [ "does not include self to avoid self -> self connections if not allowed" ^ { OPErdEntity } diff --git a/Pharo/OpenPonk-ERD/OPErdDisjointExtensionController.class.st b/Pharo/OpenPonk-ERD/OPErdDisjointExtensionController.class.st index ea954e9..ae55a63 100644 --- a/Pharo/OpenPonk-ERD/OPErdDisjointExtensionController.class.st +++ b/Pharo/OpenPonk-ERD/OPErdDisjointExtensionController.class.st @@ -1,10 +1,12 @@ Class { - #name : #OPErdDisjointExtensionController, - #superclass : #OPErdExtensionsController, - #category : #'OpenPonk-ERD-Controllers' + #name : 'OPErdDisjointExtensionController', + #superclass : 'OPErdExtensionsController', + #category : 'OpenPonk-ERD-Controllers', + #package : 'OpenPonk-ERD', + #tag : 'Controllers' } -{ #category : #construction } +{ #category : 'construction' } OPErdDisjointExtensionController >> createModelIn: aParentModel [ ^ (super createModelIn: aParentModel) diff --git a/Pharo/OpenPonk-ERD/OPErdEntity.class.st b/Pharo/OpenPonk-ERD/OPErdEntity.class.st index 636da5c..15b77bc 100644 --- a/Pharo/OpenPonk-ERD/OPErdEntity.class.st +++ b/Pharo/OpenPonk-ERD/OPErdEntity.class.st @@ -1,51 +1,53 @@ Class { - #name : #OPErdEntity, - #superclass : #OPErdNode, + #name : 'OPErdEntity', + #superclass : 'OPErdNode', #instVars : [ 'isWeak' ], - #category : #'OpenPonk-ERD-Models' + #category : 'OpenPonk-ERD-Models', + #package : 'OpenPonk-ERD', + #tag : 'Models' } -{ #category : #accessing } +{ #category : 'accessing' } OPErdEntity >> beNormal [ self isWeak: false ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdEntity >> beWeak [ self isWeak: true ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdEntity >> diagramElement [ ^ OPErdEntityShape ] -{ #category : #associating } +{ #category : 'associating' } OPErdEntity >> graphmlType [ self isWeak ifTrue: [ ^ #weak ] ifFalse: [ ^ #regularEntity ] ] -{ #category : #initialization } +{ #category : 'initialization' } OPErdEntity >> initialize [ super initialize. isWeak := false ] -{ #category : #associating } +{ #category : 'associating' } OPErdEntity >> isNormal [ ^ isWeak not ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdEntity >> isWeak [ ^ isWeak ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdEntity >> isWeak: aBoolean [ isWeak := aBoolean. self changed diff --git a/Pharo/OpenPonk-ERD/OPErdEntityController.class.st b/Pharo/OpenPonk-ERD/OPErdEntityController.class.st index cc6ecd1..d3168d3 100644 --- a/Pharo/OpenPonk-ERD/OPErdEntityController.class.st +++ b/Pharo/OpenPonk-ERD/OPErdEntityController.class.st @@ -1,10 +1,12 @@ Class { - #name : #OPErdEntityController, - #superclass : #OPErdNodeController, - #category : #'OpenPonk-ERD-Controllers' + #name : 'OPErdEntityController', + #superclass : 'OPErdNodeController', + #category : 'OpenPonk-ERD-Controllers', + #package : 'OpenPonk-ERD', + #tag : 'Controllers' } -{ #category : #forms } +{ #category : 'forms' } OPErdEntityController >> buildEditorForm: aForm [ super buildEditorForm: aForm. (aForm addCheckbox: 'Weak') @@ -14,12 +16,12 @@ OPErdEntityController >> buildEditorForm: aForm [ self diagramElement modelChanged ] ] -{ #category : #connecting } +{ #category : 'connecting' } OPErdEntityController >> canBeSourceFor: aController [ ^ (aController isKindOf: OPErdTransitionController) ] -{ #category : #connecting } +{ #category : 'connecting' } OPErdEntityController >> canBeTargetFor: aController [ ^ (aController class == OPErdInheritanceTransitionController) ifTrue: [ ^ self sourceIsValid: aController source model ] @@ -32,25 +34,25 @@ OPErdEntityController >> canBeTargetFor: aController [ ifFalse: [ ^ false ] ] ] ] -{ #category : #forms } +{ #category : 'forms' } OPErdEntityController >> diagramElementClass [ ^ OPErdEntityShape ] -{ #category : #forms } +{ #category : 'forms' } OPErdEntityController >> modelClass [ ^ OPErdEntity ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdEntityController >> sourceIsValid: aModel [ (aModel class == self modelClass) ifTrue: [ ^ (aModel uuid ~~ self model uuid) ] ifFalse: [ ^ false ] ] -{ #category : #'accessing - DirectedRelationship' } +{ #category : 'accessing - DirectedRelationship' } OPErdEntityController >> validSources [ "does not include self to avoid self -> self connections if not allowed" ^ { OPErdRelation. diff --git a/Pharo/OpenPonk-ERD/OPErdEntityShape.class.st b/Pharo/OpenPonk-ERD/OPErdEntityShape.class.st index cb2eb1c..98c8c70 100644 --- a/Pharo/OpenPonk-ERD/OPErdEntityShape.class.st +++ b/Pharo/OpenPonk-ERD/OPErdEntityShape.class.st @@ -1,14 +1,16 @@ Class { - #name : #OPErdEntityShape, - #superclass : #OPErdAbstractNodeShape, + #name : 'OPErdEntityShape', + #superclass : 'OPErdAbstractNodeShape', #instVars : [ 'label', 'weak' ], - #category : #'OpenPonk-ERD-DiagramElements' + #category : 'OpenPonk-ERD-DiagramElements', + #package : 'OpenPonk-ERD', + #tag : 'DiagramElements' } -{ #category : #rendering } +{ #category : 'rendering' } OPErdEntityShape >> renderBasicShape [ ^ RSBox new height: 50; @@ -21,7 +23,7 @@ OPErdEntityShape >> renderBasicShape [ yourself ] -{ #category : #rendering } +{ #category : 'rendering' } OPErdEntityShape >> renderShapeDetails [ super renderShapeDetails. @@ -57,7 +59,7 @@ OPErdEntityShape >> renderShapeDetails [ for: self ] -{ #category : #rendering } +{ #category : 'rendering' } OPErdEntityShape >> updateRenderFromModel [ label text: self modelElement name. diff --git a/Pharo/OpenPonk-ERD/OPErdExamples.class.st b/Pharo/OpenPonk-ERD/OPErdExamples.class.st index 189706a..8004172 100644 --- a/Pharo/OpenPonk-ERD/OPErdExamples.class.st +++ b/Pharo/OpenPonk-ERD/OPErdExamples.class.st @@ -1,10 +1,12 @@ Class { - #name : #OPErdExamples, - #superclass : #Object, - #category : #'OpenPonk-ERD-Examples' + #name : 'OPErdExamples', + #superclass : 'Object', + #category : 'OpenPonk-ERD-Examples', + #package : 'OpenPonk-ERD', + #tag : 'Examples' } -{ #category : #'world menu' } +{ #category : 'world menu' } OPErdExamples class >> exampleERDsample [ | project erd | project := OPProject new name: 'Entity Relationship Diagram'''. @@ -13,7 +15,7 @@ OPErdExamples class >> exampleERDsample [ (OPWorkbench openProject: project) showAllElementsInAllDiagrams ] -{ #category : #'world menu' } +{ #category : 'world menu' } OPErdExamples class >> exampleEmpty [ | project erd | project := OPProject new name: 'Entity Relationship Diagram'. @@ -22,7 +24,7 @@ OPErdExamples class >> exampleEmpty [ (OPWorkbench openProject: project) showAllElementsInAllDiagrams ] -{ #category : #'world menu' } +{ #category : 'world menu' } OPErdExamples class >> menuCommandOn: aBuilder [ diff --git a/Pharo/OpenPonk-ERD/OPErdExtensions.class.st b/Pharo/OpenPonk-ERD/OPErdExtensions.class.st index ea08762..80216ee 100644 --- a/Pharo/OpenPonk-ERD/OPErdExtensions.class.st +++ b/Pharo/OpenPonk-ERD/OPErdExtensions.class.st @@ -1,38 +1,40 @@ Class { - #name : #OPErdExtensions, - #superclass : #OPErdNode, + #name : 'OPErdExtensions', + #superclass : 'OPErdNode', #instVars : [ 'isOverlapping', 'isDisjoint', 'isUnion' ], - #category : #'OpenPonk-ERD-Models' + #category : 'OpenPonk-ERD-Models', + #package : 'OpenPonk-ERD', + #tag : 'Models' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdExtensions >> beDisjoint [ self isDisjoint: true ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdExtensions >> beNormal [ self isOverlapping: false. self isUnion: false. self isDisjoint: false. ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdExtensions >> beOverlapping [ self isOverlapping: true ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdExtensions >> beUnion [ self isUnion: true ] -{ #category : #associating } +{ #category : 'associating' } OPErdExtensions >> graphmlType [ self isUnion ifTrue: [ ^ #union ] @@ -43,7 +45,7 @@ OPErdExtensions >> graphmlType [ ifFalse: [ ^ #regularExtensions ] ] ] ] -{ #category : #initialization } +{ #category : 'initialization' } OPErdExtensions >> initialize [ super initialize. isDisjoint := false. @@ -51,39 +53,39 @@ OPErdExtensions >> initialize [ isOverlapping := false ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdExtensions >> isDisjoint [ ^ isDisjoint ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdExtensions >> isDisjoint: aBoolean [ isDisjoint := aBoolean. self changed ] -{ #category : #associating } +{ #category : 'associating' } OPErdExtensions >> isNormal [ ^ (isUnion & isDisjoint & isOverlapping) not ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdExtensions >> isOverlapping [ ^ isOverlapping ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdExtensions >> isOverlapping: aBoolean [ isOverlapping := aBoolean. self changed ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdExtensions >> isUnion [ ^ isUnion ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdExtensions >> isUnion: aBoolean [ isUnion := aBoolean. self changed diff --git a/Pharo/OpenPonk-ERD/OPErdExtensionsController.class.st b/Pharo/OpenPonk-ERD/OPErdExtensionsController.class.st index 249cbe8..a3a0284 100644 --- a/Pharo/OpenPonk-ERD/OPErdExtensionsController.class.st +++ b/Pharo/OpenPonk-ERD/OPErdExtensionsController.class.st @@ -1,10 +1,12 @@ Class { - #name : #OPErdExtensionsController, - #superclass : #OPErdNodeController, - #category : #'OpenPonk-ERD-Controllers' + #name : 'OPErdExtensionsController', + #superclass : 'OPErdNodeController', + #category : 'OpenPonk-ERD-Controllers', + #package : 'OpenPonk-ERD', + #tag : 'Controllers' } -{ #category : #forms } +{ #category : 'forms' } OPErdExtensionsController >> buildEditorForm: aForm [ super buildEditorForm: aForm. (aForm addCheckbox: 'Disjoint') @@ -34,26 +36,26 @@ OPErdExtensionsController >> buildEditorForm: aForm [ self diagramController updateCanvas ] -{ #category : #connecting } +{ #category : 'connecting' } OPErdExtensionsController >> canBeSourceFor: aController [ ^ (aController class == OPErdTransitionController) | (aController class == OPErdTotalTransitionController) ] -{ #category : #connecting } +{ #category : 'connecting' } OPErdExtensionsController >> canBeTargetFor: aController [ ^ (aController isKindOf: OPErdTransitionController) ifTrue: [ ^ aController source model class == OPErdEntity ] ifFalse: [ ^ false ] ] -{ #category : #construction } +{ #category : 'construction' } OPErdExtensionsController >> diagramElementClass [ ^ OPErdExtensionsShape ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdExtensionsController >> modelClass [ ^ OPErdExtensions ] diff --git a/Pharo/OpenPonk-ERD/OPErdExtensionsShape.class.st b/Pharo/OpenPonk-ERD/OPErdExtensionsShape.class.st index b87f2c3..1ffc100 100644 --- a/Pharo/OpenPonk-ERD/OPErdExtensionsShape.class.st +++ b/Pharo/OpenPonk-ERD/OPErdExtensionsShape.class.st @@ -1,13 +1,15 @@ Class { - #name : #OPErdExtensionsShape, - #superclass : #OPErdAbstractNodeShape, + #name : 'OPErdExtensionsShape', + #superclass : 'OPErdAbstractNodeShape', #instVars : [ 'label' ], - #category : #'OpenPonk-ERD-DiagramElements' + #category : 'OpenPonk-ERD-DiagramElements', + #package : 'OpenPonk-ERD', + #tag : 'DiagramElements' } -{ #category : #rendering } +{ #category : 'rendering' } OPErdExtensionsShape >> renderBasicShape [ ^ RSEllipse new @@ -21,33 +23,34 @@ OPErdExtensionsShape >> renderBasicShape [ yourself ] -{ #category : #rendering } +{ #category : 'rendering' } OPErdExtensionsShape >> renderShapeDetails [ super renderShapeDetails. label := RSLabel new color: Color black; - height: (self roassalShape height / 4); - width: (self roassalShape width); - fontSize: (self roassalShape height / 4); + height: self roassalShape height / 4; + width: self roassalShape width; + fontSize: self roassalShape height / 4; model: self; yourself. - RSLocation new + RSLocation new stick: label on: self roassalShape; center. - self canvas - add: label. - self roassalShape when: RSShapeRemovedEvent do: [ - label remove] + self canvas add: label. + self roassalShape + when: RSShapeRemovedEvent + do: [ label remove ] + for: self ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdExtensionsShape >> updateDetails [ self updateLabel ] -{ #category : #updating } +{ #category : 'updating' } OPErdExtensionsShape >> updateLabel [ label height: (self roassalShape height / 4); @@ -56,7 +59,7 @@ OPErdExtensionsShape >> updateLabel [ ifTrue: [ label fontSize: (self roassalShape width / 4) ] ] -{ #category : #rendering } +{ #category : 'rendering' } OPErdExtensionsShape >> updateRenderFromModel [ (self modelElement isUnion diff --git a/Pharo/OpenPonk-ERD/OPErdFigureHighlighter.class.st b/Pharo/OpenPonk-ERD/OPErdFigureHighlighter.class.st index 6c7da6e..f2f387e 100644 --- a/Pharo/OpenPonk-ERD/OPErdFigureHighlighter.class.st +++ b/Pharo/OpenPonk-ERD/OPErdFigureHighlighter.class.st @@ -1,10 +1,12 @@ Class { - #name : #OPErdFigureHighlighter, - #superclass : #Object, - #category : #'OpenPonk-ERD-DiagramElements' + #name : 'OPErdFigureHighlighter', + #superclass : 'Object', + #category : 'OpenPonk-ERD-DiagramElements', + #package : 'OpenPonk-ERD', + #tag : 'DiagramElements' } -{ #category : #'api - highlight' } +{ #category : 'api - highlight' } OPErdFigureHighlighter class >> highlight: aShapedObject with: aColor [ aShapedObject isNode ifTrue: [ self highlightNode: aShapedObject with: aColor ]. @@ -12,7 +14,7 @@ OPErdFigureHighlighter class >> highlight: aShapedObject with: aColor [ ifTrue: [ self highlightLine: aShapedObject with: aColor ] ] -{ #category : #'api - highlight' } +{ #category : 'api - highlight' } OPErdFigureHighlighter class >> highlightLine: aLine with: aColor [ self unhighlightNode: aLine. @@ -21,7 +23,7 @@ OPErdFigureHighlighter class >> highlightLine: aLine with: aColor [ aLine signalUpdate ] -{ #category : #'api - highlight' } +{ #category : 'api - highlight' } OPErdFigureHighlighter class >> highlightNode: aNode with: aColor [ self unhighlightNode: aNode. @@ -30,7 +32,7 @@ OPErdFigureHighlighter class >> highlightNode: aNode with: aColor [ aNode signalUpdate ] -{ #category : #'api - highlight' } +{ #category : 'api - highlight' } OPErdFigureHighlighter class >> unhighlight: aShapedObject [ aShapedObject isNode ifTrue: [ self unhighlightNode: aShapedObject ]. @@ -38,7 +40,7 @@ OPErdFigureHighlighter class >> unhighlight: aShapedObject [ ifTrue: [ self unhighlightLine: aShapedObject ] ] -{ #category : #'api - highlight' } +{ #category : 'api - highlight' } OPErdFigureHighlighter class >> unhighlightLine: aLine [ aLine shape color: (aLine propertyAt: self name ifAbsent: [ ^ self ]). @@ -46,7 +48,7 @@ OPErdFigureHighlighter class >> unhighlightLine: aLine [ aLine signalUpdate ] -{ #category : #'api - highlight' } +{ #category : 'api - highlight' } OPErdFigureHighlighter class >> unhighlightNode: aNode [ aNode shape borderColor: diff --git a/Pharo/OpenPonk-ERD/OPErdGraphML.class.st b/Pharo/OpenPonk-ERD/OPErdGraphML.class.st index d1f4341..1a649ae 100644 --- a/Pharo/OpenPonk-ERD/OPErdGraphML.class.st +++ b/Pharo/OpenPonk-ERD/OPErdGraphML.class.st @@ -1,14 +1,16 @@ Class { - #name : #OPErdGraphML, - #superclass : #Object, + #name : 'OPErdGraphML', + #superclass : 'Object', #classVars : [ 'xPositions', 'yPositions' ], - #category : #'OpenPonk-ERD-Serialization' + #category : 'OpenPonk-ERD-Serialization', + #package : 'OpenPonk-ERD', + #tag : 'Serialization' } -{ #category : #toolbar } +{ #category : 'toolbar' } OPErdGraphML class >> exportPackage: aModel [ StFBSaveFileDialog new @@ -30,7 +32,7 @@ OPErdGraphML class >> exportPackage: aModel [ open ] -{ #category : #toolbar } +{ #category : 'toolbar' } OPErdGraphML class >> importToModel: aModel withBuilder: aBuilder [ StFBOpenFileDialog new @@ -43,7 +45,7 @@ OPErdGraphML class >> importToModel: aModel withBuilder: aBuilder [ open. ] -{ #category : #toolbar } +{ #category : 'toolbar' } OPErdGraphML class >> toolbarMenu: aBuilder [ @@ -55,14 +57,14 @@ OPErdGraphML class >> toolbarMenu: aBuilder [ action: [ self importToModel: aBuilder model diagramController model withBuilder: aBuilder ]. ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdGraphML class >> updateModelAfterImport: aModel [ aModel workbench projectTree refresh. aModel diagramController showAllElements. self updateNodePositionsof: aModel. ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdGraphML class >> updateNodePositionsof: aModel [ aModel diagramController diagramElement ownedElements do: [ :each | @@ -73,7 +75,7 @@ OPErdGraphML class >> updateNodePositionsof: aModel [ @ (yPositions at: each modelElement uuid) asInteger ] ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdGraphML >> edgeForType: aType [ aType = #regular ifTrue: [ ^ OPErdTransition new @@ -89,7 +91,7 @@ OPErdGraphML >> edgeForType: aType [ yourself ] ] -{ #category : #'public-exporting' } +{ #category : 'public-exporting' } OPErdGraphML >> export: aModel [ ^ (MustacheTemplate on: self template) value: @@ -115,7 +117,7 @@ OPErdGraphML >> export: aModel [ with: #graphmlType -> each graphmlType ]))} asDictionary" ] -{ #category : #import } +{ #category : 'import' } OPErdGraphML >> import: aXml [ | model doc graph graphData node nodeData edge edgeData nodes | doc := XMLDOMParser parse: aXml. @@ -156,7 +158,7 @@ OPErdGraphML >> import: aXml [ ^ model ] -{ #category : #import } +{ #category : 'import' } OPErdGraphML >> import: aXml into: model [ | doc graph graphData node nodeData edge edgeData nodes | doc := XMLDOMParser parse: aXml. @@ -195,7 +197,7 @@ OPErdGraphML >> import: aXml into: model [ ^ model ] -{ #category : #import } +{ #category : 'import' } OPErdGraphML >> nodeForType: aType [ aType = #derived ifTrue: [ ^ OPErdAttribute new @@ -247,7 +249,7 @@ OPErdGraphML >> nodeForType: aType [ yourself ]. ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdGraphML >> positionOfNode: aNode [ aNode announcer subscriptions subscriptions do: [ :subs | subs subscriber class == OPErd @@ -256,7 +258,7 @@ OPErdGraphML >> positionOfNode: aNode [ ^ 'position not found' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdGraphML >> setXPositionOfNode: aNode position: xPosition [ aNode announcer subscriptions subscriptions do: [ :subs | subs subscriber class == OPErd @@ -264,7 +266,7 @@ OPErdGraphML >> setXPositionOfNode: aNode position: xPosition [ ifTrue: [ subs subscriber diagramElement position x: xPosition ] ] ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdGraphML >> setYPositionOfNode: aNode position: yPosition [ aNode announcer subscriptions subscriptions do: [ :subs | subs subscriber class == OPErd @@ -272,7 +274,7 @@ OPErdGraphML >> setYPositionOfNode: aNode position: yPosition [ ifTrue: [ subs subscriber diagramElement position y: yPosition ] ] ] ] -{ #category : #'accessing - TemplateSignature' } +{ #category : 'accessing - TemplateSignature' } OPErdGraphML >> template [ ^ ' @@ -308,7 +310,7 @@ OPErdGraphML >> template [ ' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdGraphML >> xPositionOfNode: aNode [ aNode announcer subscriptions subscriptions do: [ :subs | subs subscriber class == OPErd @@ -317,7 +319,7 @@ OPErdGraphML >> xPositionOfNode: aNode [ ^ 'position not found' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdGraphML >> yPositionOfNode: aNode [ aNode announcer subscriptions subscriptions do: [ :subs | subs subscriber class == OPErd diff --git a/Pharo/OpenPonk-ERD/OPErdIdentifyingRelationController.class.st b/Pharo/OpenPonk-ERD/OPErdIdentifyingRelationController.class.st index 67ce15f..5f0a8fc 100644 --- a/Pharo/OpenPonk-ERD/OPErdIdentifyingRelationController.class.st +++ b/Pharo/OpenPonk-ERD/OPErdIdentifyingRelationController.class.st @@ -1,10 +1,12 @@ Class { - #name : #OPErdIdentifyingRelationController, - #superclass : #OPErdRelationController, - #category : #'OpenPonk-ERD-Controllers' + #name : 'OPErdIdentifyingRelationController', + #superclass : 'OPErdRelationController', + #category : 'OpenPonk-ERD-Controllers', + #package : 'OpenPonk-ERD', + #tag : 'Controllers' } -{ #category : #connecting } +{ #category : 'connecting' } OPErdIdentifyingRelationController >> canBeTargetFor: aController [ ^ (aController class == OPErdTotalTransitionController) ifTrue: [ (aController source model class == OPErdEntity) @@ -20,7 +22,7 @@ OPErdIdentifyingRelationController >> canBeTargetFor: aController [ ifFalse: [ ^ false ] ] ] -{ #category : #construction } +{ #category : 'construction' } OPErdIdentifyingRelationController >> createModelIn: aParentModel [ ^ (super createModelIn: aParentModel) diff --git a/Pharo/OpenPonk-ERD/OPErdIncomingTransition.class.st b/Pharo/OpenPonk-ERD/OPErdIncomingTransition.class.st index 1d29f41..e2ffc20 100644 --- a/Pharo/OpenPonk-ERD/OPErdIncomingTransition.class.st +++ b/Pharo/OpenPonk-ERD/OPErdIncomingTransition.class.st @@ -1,73 +1,46 @@ Class { - #name : #OPErdIncomingTransition, - #superclass : #Object, + #name : 'OPErdIncomingTransition', + #superclass : 'OPErdTransition', #instVars : [ 'transition' ], - #category : #'OpenPonk-ERD-Adapters' + #category : 'OpenPonk-ERD-Adapters', + #package : 'OpenPonk-ERD', + #tag : 'Adapters' } -{ #category : #'instance creation' } -OPErdIncomingTransition class >> of: aTransition [ - ^ self ofTransition: aTransition -] - -{ #category : #'instance creation' } -OPErdIncomingTransition class >> ofTransition: aTransition [ - ^ self new - transition: aTransition; - yourself -] +{ #category : 'testing' } +OPErdIncomingTransition class >> isDeprecated [ -{ #category : #comparing } -OPErdIncomingTransition >> = otherTransition [ - ^ self represents: otherTransition + ^ true ] -{ #category : #comparing } -OPErdIncomingTransition >> asTransition [ - ^ transition -] +{ #category : 'instance creation' } +OPErdIncomingTransition class >> new [ -{ #category : #comparing } -OPErdIncomingTransition >> changed [ - ^ transition changed + ^ self superclass new ] -{ #category : #comparing } -OPErdIncomingTransition >> doesNotUnderstand: aMessage [ - ^ aMessage sendTo: transition -] +{ #category : 'accessing' } +OPErdIncomingTransition >> isInheritance [ -{ #category : #comparing } -OPErdIncomingTransition >> hash [ - ^ transition hash + ^ super isInheritance ifNil: [ ^ transition isInheritance ] ] -{ #category : #comparing } -OPErdIncomingTransition >> isTransition [ +{ #category : 'accessing' } +OPErdIncomingTransition >> isTotal [ - ^ true + ^ super isTotal ifNil: [ ^ transition isTotal ] ] -{ #category : #comparing } -OPErdIncomingTransition >> printOn: aStream [ - ^ transition printOn: aStream -] +{ #category : 'comparing' } +OPErdIncomingTransition >> source [ -{ #category : #comparing } -OPErdIncomingTransition >> represents: otherTransition [ - - ^ super = otherTransition or: [ - transition == otherTransition or: [ transition = otherTransition ] ] + ^ super source ifNil: [ ^ transition source ] ] -{ #category : #comparing } -OPErdIncomingTransition >> transition: aTransition [ - transition := aTransition -] +{ #category : 'comparing' } +OPErdIncomingTransition >> target [ -{ #category : #comparing } -OPErdIncomingTransition >> when: anAnnouncementClass send: aSelector to: anObject [ - ^ transition when: anAnnouncementClass send: aSelector to: anObject + ^ super target ifNil: [ ^ transition target ] ] diff --git a/Pharo/OpenPonk-ERD/OPErdInheritanceTransitionController.class.st b/Pharo/OpenPonk-ERD/OPErdInheritanceTransitionController.class.st index 295381c..be60e44 100644 --- a/Pharo/OpenPonk-ERD/OPErdInheritanceTransitionController.class.st +++ b/Pharo/OpenPonk-ERD/OPErdInheritanceTransitionController.class.st @@ -1,10 +1,12 @@ Class { - #name : #OPErdInheritanceTransitionController, - #superclass : #OPErdTransitionController, - #category : #'OpenPonk-ERD-Controllers' + #name : 'OPErdInheritanceTransitionController', + #superclass : 'OPErdTransitionController', + #category : 'OpenPonk-ERD-Controllers', + #package : 'OpenPonk-ERD', + #tag : 'Controllers' } -{ #category : #construction } +{ #category : 'construction' } OPErdInheritanceTransitionController >> createModelIn: aParentModel [ ^ (super createModelIn: aParentModel) diff --git a/Pharo/OpenPonk-ERD/OPErdKeyAttributeController.class.st b/Pharo/OpenPonk-ERD/OPErdKeyAttributeController.class.st index b5db296..3322d3c 100644 --- a/Pharo/OpenPonk-ERD/OPErdKeyAttributeController.class.st +++ b/Pharo/OpenPonk-ERD/OPErdKeyAttributeController.class.st @@ -1,17 +1,19 @@ Class { - #name : #OPErdKeyAttributeController, - #superclass : #OPErdAttributeController, - #category : #'OpenPonk-ERD-Controllers' + #name : 'OPErdKeyAttributeController', + #superclass : 'OPErdAttributeController', + #category : 'OpenPonk-ERD-Controllers', + #package : 'OpenPonk-ERD', + #tag : 'Controllers' } -{ #category : #connecting } +{ #category : 'connecting' } OPErdKeyAttributeController >> canBeTargetFor: aController [ ^ (aController class == OPErdTransitionController) ifTrue: [ ^ self sourceIsValid: aController source model ] ifFalse: [ ^ false ] ] -{ #category : #construction } +{ #category : 'construction' } OPErdKeyAttributeController >> createModelIn: aParentModel [ ^ (super createModelIn: aParentModel) @@ -19,12 +21,12 @@ OPErdKeyAttributeController >> createModelIn: aParentModel [ yourself ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdKeyAttributeController >> sourceIsValid: aModel [ ^ self validSources includes: aModel class ] -{ #category : #'accessing - DirectedRelationship' } +{ #category : 'accessing - DirectedRelationship' } OPErdKeyAttributeController >> validSources [ "does not include self to avoid self -> self connections if not allowed" ^ { OPErdEntity } diff --git a/Pharo/OpenPonk-ERD/OPErdLayouter.class.st b/Pharo/OpenPonk-ERD/OPErdLayouter.class.st index d687976..bc686bc 100644 --- a/Pharo/OpenPonk-ERD/OPErdLayouter.class.st +++ b/Pharo/OpenPonk-ERD/OPErdLayouter.class.st @@ -1,24 +1,26 @@ Class { - #name : #OPErdLayouter, - #superclass : #OPLayouter, - #category : #'OpenPonk-ERD-Plugin' + #name : 'OPErdLayouter', + #superclass : 'OPLayouter', + #category : 'OpenPonk-ERD-Plugin', + #package : 'OpenPonk-ERD', + #tag : 'Plugin' } -{ #category : #accessing } +{ #category : 'accessing' } OPErdLayouter >> allEdges [ ^ diagramController controllers select: [ :ctrl | ctrl isKindOf: OPMcTransitionController ] thenCollect: #roassalShape ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdLayouter >> allNodes [ ^ diagramController controllers select: [ :ctrl | ctrl isKindOf: OPErdNodeController ] thenCollect: #roassalShape ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdLayouter >> defaultLayout [ self gridLayout ] diff --git a/Pharo/OpenPonk-ERD/OPErdModelSerializer.class.st b/Pharo/OpenPonk-ERD/OPErdModelSerializer.class.st index 426866f..600373f 100644 --- a/Pharo/OpenPonk-ERD/OPErdModelSerializer.class.st +++ b/Pharo/OpenPonk-ERD/OPErdModelSerializer.class.st @@ -1,63 +1,65 @@ Class { - #name : #OPErdModelSerializer, - #superclass : #OPModelSerializer, - #category : #'OpenPonk-ERD-Serialization' + #name : 'OPErdModelSerializer', + #superclass : 'OPModelSerializer', + #category : 'OpenPonk-ERD-Serialization', + #package : 'OpenPonk-ERD', + #tag : 'Serialization' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdModelSerializer class >> exportVersion [ ^ 1 ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdModelSerializer class >> formatName [ ^ #'graphml-ston' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdModelSerializer class >> minImportVersion [ ^ 1 ] -{ #category : #formatting } +{ #category : 'formatting' } OPErdModelSerializer >> formatName [ ^ 'ston' ] -{ #category : #formatting } +{ #category : 'formatting' } OPErdModelSerializer >> materializeDiagramFrom: aString [ ^ STON fromString: aString ] -{ #category : #formatting } +{ #category : 'formatting' } OPErdModelSerializer >> materializeModelFrom: aStream [ ^ self materializeModelFromString: aStream contents ] -{ #category : #formatting } +{ #category : 'formatting' } OPErdModelSerializer >> materializeModelFromString: aString [ ^ OPErdGraphML new import: aString ] -{ #category : #formatting } +{ #category : 'formatting' } OPErdModelSerializer >> modelExtension [ ^ 'graphml' ] -{ #category : #formatting } +{ #category : 'formatting' } OPErdModelSerializer >> serializeDiagram: aDiagramMemento [ ^ STON toStringPretty: aDiagramMemento ] -{ #category : #formatting } +{ #category : 'formatting' } OPErdModelSerializer >> serializeModel: aModel [ ^ OPErdGraphML new export: aModel ] -{ #category : #formatting } +{ #category : 'formatting' } OPErdModelSerializer >> serializeModel: aModel to: aStream [ ^ aStream << (self serializeModel: aModel) ] diff --git a/Pharo/OpenPonk-ERD/OPErdMultivaluedAttributeController.class.st b/Pharo/OpenPonk-ERD/OPErdMultivaluedAttributeController.class.st index c50731d..8554900 100644 --- a/Pharo/OpenPonk-ERD/OPErdMultivaluedAttributeController.class.st +++ b/Pharo/OpenPonk-ERD/OPErdMultivaluedAttributeController.class.st @@ -1,10 +1,12 @@ Class { - #name : #OPErdMultivaluedAttributeController, - #superclass : #OPErdAttributeController, - #category : #'OpenPonk-ERD-Controllers' + #name : 'OPErdMultivaluedAttributeController', + #superclass : 'OPErdAttributeController', + #category : 'OpenPonk-ERD-Controllers', + #package : 'OpenPonk-ERD', + #tag : 'Controllers' } -{ #category : #construction } +{ #category : 'construction' } OPErdMultivaluedAttributeController >> createModelIn: aParentModel [ ^ (super createModelIn: aParentModel) diff --git a/Pharo/OpenPonk-ERD/OPErdNavigatorAdapter.class.st b/Pharo/OpenPonk-ERD/OPErdNavigatorAdapter.class.st index a9c6e4a..45a4cb0 100644 --- a/Pharo/OpenPonk-ERD/OPErdNavigatorAdapter.class.st +++ b/Pharo/OpenPonk-ERD/OPErdNavigatorAdapter.class.st @@ -1,27 +1,27 @@ Class { - #name : #OPErdNavigatorAdapter, - #superclass : #OPNavigatorAdapter, - #category : #'OpenPonk-ERD-Adapters' + #name : 'OPErdNavigatorAdapter', + #superclass : 'OPNavigatorAdapter', + #category : 'OpenPonk-ERD-Adapters', + #package : 'OpenPonk-ERD', + #tag : 'Adapters' } -{ #category : #accessing } +{ #category : 'accessing' } OPErdNavigatorAdapter class >> priority [ ^ 10 ] -{ #category : #'widget API' } +{ #category : 'widget API' } OPErdNavigatorAdapter >> childrenMapping [ - ^ {(OPErd -> #states). - (OPErdNode - -> [ :o | - o outgoing - , (o incoming collect: [ :each | OPErdIncomingTransition of: each ]) ]). - (OPErdIncomingTransition -> #()). - (OPErdTransition -> #()) } + + ^ { + (OPErd -> #states). + (OPErdNode -> [ :o | o outgoing , o incoming ]). + (OPErdTransition -> #( )) } ] -{ #category : #'widget API' } +{ #category : 'widget API' } OPErdNavigatorAdapter >> displayMapping [ ^ {(OPErd -> 'Diagram'). (OPErdAttribute -> @@ -40,13 +40,6 @@ OPErdNavigatorAdapter >> displayMapping [ ifFalse: [ o isTotal ifTrue: [ 'Connection Total' ] ifFalse: [ 'Connection' ] ] ]). - (OPErdIncomingTransition -> - [ :o | - o isInheritance - ifTrue: [ 'Inc. Connection Inheritance' ] - ifFalse: [ o isTotal - ifTrue: [ 'Inc. Connection Total' ] - ifFalse: [ 'Inc. Connection' ] ] ]). (OPErdEntity -> [ :o | o isWeak @@ -68,74 +61,69 @@ OPErdNavigatorAdapter >> displayMapping [ ifFalse: [ 'Extension State' ] ] ] ])} ] -{ #category : #'widget API' } +{ #category : 'testing' } OPErdNavigatorAdapter >> hasMappingFor: anObject in: aModel [ - ^ { + ^ { OPErd. OPErdTransition. - OPErdIncomingTransition. OPErdNode } anySatisfy: [ :any | anObject isKindOf: any ] ] -{ #category : #'widget API' } -OPErdNavigatorAdapter >> iconMapping [ - ^ {(OPErd -> OPCoreIcons opErdDiagramIcon). - (OPErdIncomingTransition -> - [ :o | - o isInheritance - ifTrue: [ OPCoreIcons opErdInheritanceConnectionIcon ] - ifFalse: [ o isTotal - ifTrue: [ OPCoreIcons opErdTotalConnectionIcon ] - ifFalse: [ OPCoreIcons opErdConnectionIcon ] ] ]). - (OPErdTransition -> - [ :o | - o isInheritance - ifTrue: [ OPCoreIcons opErdInheritanceConnectionIcon ] - ifFalse: [ o isTotal - ifTrue: [ OPCoreIcons opErdTotalConnectionIcon ] - ifFalse: [ OPCoreIcons opErdConnectionIcon ] ] ]). - (OPErdEntity -> - [ :o | - o isWeak - ifTrue: [ OPCoreIcons opErdWeakEntityIcon ] - ifFalse: [ OPCoreIcons opErdEntityIcon ] ]). - (OPErdRelation -> - [ :o | - o isIdentifying - ifTrue: [ OPCoreIcons opErdIdentifyingRelationIcon ] - ifFalse: [ OPCoreIcons opErdRelationIcon ] ]). - (OPErdAttribute -> - [ :o | - o isDerived - ifTrue: [ OPCoreIcons opErdDerivedAttributeIcon ] - ifFalse: [ o isMultivalued - ifTrue: [ OPCoreIcons opErdMultivaluedAttributeIcon ] - ifFalse: [ o isKey - ifTrue: [ OPCoreIcons opErdKeyAttributeIcon ] - ifFalse: [ OPCoreIcons opErdAttributeIcon ] ] ] ]). - (OPErdExtensions -> - [ :o | - o isDisjoint - ifTrue: [ OPCoreIcons opErdDisjointExtensionIcon ] - ifFalse: [ o isOverlapping - ifTrue: [ OPCoreIcons opErdOverlappingExtensionIcon ] - ifFalse: [ o isUnion - ifTrue: [ OPCoreIcons opErdUnionExtensionIcon ] - ifFalse: [ OPCoreIcons opFsmRegularStateIcon ] ] ] ])} +{ #category : 'widget API' } +OPErdNavigatorAdapter >> iconMapping [ + + ^ { + (OPErd -> OPCoreIcons opErdDiagramIcon). + (OPErdTransition -> [ :o | + o isInheritance + ifTrue: [ OPCoreIcons opErdInheritanceConnectionIcon ] + ifFalse: [ + o isTotal + ifTrue: [ OPCoreIcons opErdTotalConnectionIcon ] + ifFalse: [ OPCoreIcons opErdConnectionIcon ] ] ]). + (OPErdEntity -> [ :o | + o isWeak + ifTrue: [ OPCoreIcons opErdWeakEntityIcon ] + ifFalse: [ OPCoreIcons opErdEntityIcon ] ]). + (OPErdRelation -> [ :o | + o isIdentifying + ifTrue: [ OPCoreIcons opErdIdentifyingRelationIcon ] + ifFalse: [ OPCoreIcons opErdRelationIcon ] ]). + (OPErdAttribute -> [ :o | + o isDerived + ifTrue: [ OPCoreIcons opErdDerivedAttributeIcon ] + ifFalse: [ + o isMultivalued + ifTrue: [ OPCoreIcons opErdMultivaluedAttributeIcon ] + ifFalse: [ + o isKey + ifTrue: [ OPCoreIcons opErdKeyAttributeIcon ] + ifFalse: [ OPCoreIcons opErdAttributeIcon ] ] ] ]). + (OPErdExtensions -> [ :o | + o isDisjoint + ifTrue: [ OPCoreIcons opErdDisjointExtensionIcon ] + ifFalse: [ + o isOverlapping + ifTrue: [ OPCoreIcons opErdOverlappingExtensionIcon ] + ifFalse: [ + o isUnion + ifTrue: [ OPCoreIcons opErdUnionExtensionIcon ] + ifFalse: [ OPCoreIcons opFsmRegularStateIcon ] ] ] ]) } ] -{ #category : #'widget API' } +{ #category : 'private' } OPErdNavigatorAdapter >> sort: modelObjects [ ^ modelObjects sorted: [ :a :b | a name isNotNil and: [ b name isNil or: [ a name < b name ] ] ] ] -{ #category : #'widget API' } +{ #category : 'widget API' } OPErdNavigatorAdapter >> typesByDependency [ - ^ {OPErd. - OPErdNode. - OPErdTransition. - OPErdIncomingTransition } + + ^ { + OPErd. + OPErdNode. + OPErdTransition } ] diff --git a/Pharo/OpenPonk-ERD/OPErdNode.class.st b/Pharo/OpenPonk-ERD/OPErdNode.class.st index 1186950..0dba470 100644 --- a/Pharo/OpenPonk-ERD/OPErdNode.class.st +++ b/Pharo/OpenPonk-ERD/OPErdNode.class.st @@ -1,57 +1,59 @@ Class { - #name : #OPErdNode, - #superclass : #OPModelObject, - #category : #'OpenPonk-ERD-Models' + #name : 'OPErdNode', + #superclass : 'OPModelObject', + #category : 'OpenPonk-ERD-Models', + #package : 'OpenPonk-ERD', + #tag : 'Models' } -{ #category : #associating } +{ #category : 'associating' } OPErdNode >> -> aVertex [ ^ OPErdTransition from: self to: aVertex ] -{ #category : #associating } +{ #category : 'associating' } OPErdNode >> graphmlType [ ^ self subclassResponsibility ] -{ #category : #associating } +{ #category : 'associating' } OPErdNode >> incoming [ owner ifNil: [ ^ #() ]. ^ owner transitions select: [ :each | each target = self ] ] -{ #category : #associating } +{ #category : 'associating' } OPErdNode >> isDerived [ ^ false ] -{ #category : #associating } +{ #category : 'associating' } OPErdNode >> isNormal [ ^ false ] -{ #category : #associating } +{ #category : 'associating' } OPErdNode >> isState [ ^ true ] -{ #category : #associating } +{ #category : 'associating' } OPErdNode >> isTransition [ ^ false ] -{ #category : #associating } +{ #category : 'associating' } OPErdNode >> outgoing [ owner ifNil: [ ^ #() ]. ^ owner transitions select: [ :each | each source = self ] ] -{ #category : #associating } +{ #category : 'associating' } OPErdNode >> relatedElements [ ^ (self incoming , self outgoing) asSet asOrderedCollection ] -{ #category : #associating } +{ #category : 'associating' } OPErdNode >> removedFrom: aDiagram [ self removedFrom: aDiagram diff --git a/Pharo/OpenPonk-ERD/OPErdNodeController.class.st b/Pharo/OpenPonk-ERD/OPErdNodeController.class.st index 126647e..ae6b12e 100644 --- a/Pharo/OpenPonk-ERD/OPErdNodeController.class.st +++ b/Pharo/OpenPonk-ERD/OPErdNodeController.class.st @@ -1,21 +1,23 @@ Class { - #name : #OPErdNodeController, - #superclass : #OPElementController, - #category : #'OpenPonk-ERD-Controllers' + #name : 'OPErdNodeController', + #superclass : 'OPElementController', + #category : 'OpenPonk-ERD-Controllers', + #package : 'OpenPonk-ERD', + #tag : 'Controllers' } -{ #category : #connecting } +{ #category : 'connecting' } OPErdNodeController >> canBeSourceFor: aController [ ^ (aController respondsTo: #modelClass) and: [ aController modelClass = OPErdTransition ] ] -{ #category : #connecting } +{ #category : 'connecting' } OPErdNodeController >> canBeTargetFor: aController [ ^ self canBeSourceFor: aController ] -{ #category : #connecting } +{ #category : 'connecting' } OPErdNodeController >> createAttributeAdornmentBy: builder [ builder @@ -43,7 +45,7 @@ OPErdNodeController >> createAttributeAdornmentBy: builder [ self diagramController editor palette selectTool: tool ] ] -{ #category : #connecting } +{ #category : 'connecting' } OPErdNodeController >> createRelationAdornmentBy: builder [ builder @@ -72,7 +74,7 @@ OPErdNodeController >> createRelationAdornmentBy: builder [ self diagramController editor palette selectTool: tool ] ] -{ #category : #connecting } +{ #category : 'connecting' } OPErdNodeController >> createTransitionAdornmentBy: builder [ builder @@ -90,12 +92,12 @@ OPErdNodeController >> createTransitionAdornmentBy: builder [ tool selectedControllers: { self } ] ] -{ #category : #connecting } +{ #category : 'accessing' } OPErdNodeController >> dependentElements [ - ^ (model incoming , model outgoing) asSet + ^ (self model incoming , self model outgoing) asSet ] -{ #category : #connecting } +{ #category : 'construction' } OPErdNodeController >> hookDiagramElement [ super hookDiagramElement. @@ -107,29 +109,28 @@ OPErdNodeController >> hookDiagramElement [ createTransitionAdornmentBy: builder ] ] -{ #category : #connecting } +{ #category : 'announcements' } OPErdNodeController >> internalSubscribeTo: aModel [ - super internalSubscribeTo: aModel. - aModel when: OPElementRemoved do: [ :e | self removeController ] -] -{ #category : #connecting } -OPErdNodeController >> isHideable [ - ^ true + super internalSubscribeTo: aModel. + aModel + when: OPElementRemoved + do: [ :e | self removeController ] + for: self ] -{ #category : #connecting } +{ #category : 'connecting' } OPErdNodeController >> modelAsParent [ ^ self model owner ] -{ #category : #connecting } +{ #category : 'destruction' } OPErdNodeController >> removeModel [ self model announcer unsubscribe: self. self diagramController model remove: self model ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdNodeController >> updateCheckboxOf: aForm named: aLabel [ aForm focusOrder do: [ :comp | (comp class == SpCheckBoxPresenter) diff --git a/Pharo/OpenPonk-ERD/OPErdOverlappingExtensionController.class.st b/Pharo/OpenPonk-ERD/OPErdOverlappingExtensionController.class.st index 7966930..63d0a34 100644 --- a/Pharo/OpenPonk-ERD/OPErdOverlappingExtensionController.class.st +++ b/Pharo/OpenPonk-ERD/OPErdOverlappingExtensionController.class.st @@ -1,10 +1,12 @@ Class { - #name : #OPErdOverlappingExtensionController, - #superclass : #OPErdExtensionsController, - #category : #'OpenPonk-ERD-Controllers' + #name : 'OPErdOverlappingExtensionController', + #superclass : 'OPErdExtensionsController', + #category : 'OpenPonk-ERD-Controllers', + #package : 'OpenPonk-ERD', + #tag : 'Controllers' } -{ #category : #construction } +{ #category : 'construction' } OPErdOverlappingExtensionController >> createModelIn: aParentModel [ ^ (super createModelIn: aParentModel) diff --git a/Pharo/OpenPonk-ERD/OPErdPlugin.class.st b/Pharo/OpenPonk-ERD/OPErdPlugin.class.st index 2000f9d..c74b67a 100644 --- a/Pharo/OpenPonk-ERD/OPErdPlugin.class.st +++ b/Pharo/OpenPonk-ERD/OPErdPlugin.class.st @@ -1,40 +1,42 @@ Class { - #name : #OPErdPlugin, - #superclass : #OPPlugin, - #category : #'OpenPonk-ERD-Plugin' + #name : 'OPErdPlugin', + #superclass : 'OPPlugin', + #category : 'OpenPonk-ERD-Plugin', + #package : 'OpenPonk-ERD', + #tag : 'Plugin' } -{ #category : #accessing } +{ #category : 'accessing' } OPErdPlugin >> diagramControllerClass [ ^ OPErdController ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdPlugin >> icon [ ^ OPCoreIcons opErdDiagramIcon ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdPlugin >> layouterClass [ ^ OPErdLayouter ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdPlugin >> modelClass [ ^ OPErd ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdPlugin >> modelSerializerClass [ ^ OPErdModelSerializer ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdPlugin >> name [ ^ 'ER Diagram' ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdPlugin >> supportsHidingElements [ ^ true ] diff --git a/Pharo/OpenPonk-ERD/OPErdRelation.class.st b/Pharo/OpenPonk-ERD/OPErdRelation.class.st index 7f90783..5e0583b 100644 --- a/Pharo/OpenPonk-ERD/OPErdRelation.class.st +++ b/Pharo/OpenPonk-ERD/OPErdRelation.class.st @@ -1,47 +1,49 @@ Class { - #name : #OPErdRelation, - #superclass : #OPErdNode, + #name : 'OPErdRelation', + #superclass : 'OPErdNode', #instVars : [ 'isIdentifying' ], - #category : #'OpenPonk-ERD-Models' + #category : 'OpenPonk-ERD-Models', + #package : 'OpenPonk-ERD', + #tag : 'Models' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdRelation >> beIdentifying [ self isIdentifying: true ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdRelation >> beNormal [ self isIdentifying: false ] -{ #category : #associating } +{ #category : 'associating' } OPErdRelation >> graphmlType [ self isIdentifying ifTrue: [ ^ #identifying ] ifFalse: [ ^ #regularRelation ] ] -{ #category : #initialization } +{ #category : 'initialization' } OPErdRelation >> initialize [ super initialize. isIdentifying := false ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdRelation >> isIdentifying [ ^ isIdentifying ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdRelation >> isIdentifying: aBoolean [ isIdentifying := aBoolean. self changed ] -{ #category : #associating } +{ #category : 'associating' } OPErdRelation >> isNormal [ ^ isIdentifying not ] diff --git a/Pharo/OpenPonk-ERD/OPErdRelationController.class.st b/Pharo/OpenPonk-ERD/OPErdRelationController.class.st index e041cff..6e1469e 100644 --- a/Pharo/OpenPonk-ERD/OPErdRelationController.class.st +++ b/Pharo/OpenPonk-ERD/OPErdRelationController.class.st @@ -1,10 +1,12 @@ Class { - #name : #OPErdRelationController, - #superclass : #OPErdNodeController, - #category : #'OpenPonk-ERD-Controllers' + #name : 'OPErdRelationController', + #superclass : 'OPErdNodeController', + #category : 'OpenPonk-ERD-Controllers', + #package : 'OpenPonk-ERD', + #tag : 'Controllers' } -{ #category : #forms } +{ #category : 'forms' } OPErdRelationController >> buildEditorForm: aForm [ super buildEditorForm: aForm. (aForm addCheckbox: 'Identifying') @@ -14,13 +16,13 @@ OPErdRelationController >> buildEditorForm: aForm [ self diagramElement modelChanged] ] -{ #category : #connecting } +{ #category : 'connecting' } OPErdRelationController >> canBeSourceFor: aController [ ^ (aController class == OPErdTransitionController) | (aController class == OPErdTotalTransitionController) ] -{ #category : #connecting } +{ #category : 'connecting' } OPErdRelationController >> canBeTargetFor: aController [ ^ (aController class == OPErdTotalTransitionController) ifTrue: [ (aController source model class == OPErdEntity) @@ -36,13 +38,13 @@ OPErdRelationController >> canBeTargetFor: aController [ ifFalse: [ ^ false ] ] ] -{ #category : #construction } +{ #category : 'construction' } OPErdRelationController >> diagramElementClass [ ^ OPErdRelationShape ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdRelationController >> modelClass [ ^ OPErdRelation ] diff --git a/Pharo/OpenPonk-ERD/OPErdRelationShape.class.st b/Pharo/OpenPonk-ERD/OPErdRelationShape.class.st index 3a065b0..a837969 100644 --- a/Pharo/OpenPonk-ERD/OPErdRelationShape.class.st +++ b/Pharo/OpenPonk-ERD/OPErdRelationShape.class.st @@ -1,14 +1,16 @@ Class { - #name : #OPErdRelationShape, - #superclass : #OPErdAbstractNodeShape, + #name : 'OPErdRelationShape', + #superclass : 'OPErdAbstractNodeShape', #instVars : [ 'label', 'identifying' ], - #category : #'OpenPonk-ERD-DiagramElements' + #category : 'OpenPonk-ERD-DiagramElements', + #package : 'OpenPonk-ERD', + #tag : 'DiagramElements' } -{ #category : #rendering } +{ #category : 'rendering' } OPErdRelationShape >> renderBasicShape [ ^ RSPolygon new @@ -18,7 +20,7 @@ OPErdRelationShape >> renderBasicShape [ yourself. ] -{ #category : #rendering } +{ #category : 'rendering' } OPErdRelationShape >> renderShapeDetails [ super renderShapeDetails. @@ -57,7 +59,7 @@ OPErdRelationShape >> renderShapeDetails [ for: self ] -{ #category : #rendering } +{ #category : 'rendering' } OPErdRelationShape >> updateRenderFromModel [ label text: self modelElement name. diff --git a/Pharo/OpenPonk-ERD/OPErdTotalTransitionController.class.st b/Pharo/OpenPonk-ERD/OPErdTotalTransitionController.class.st index 35b7aaf..473e708 100644 --- a/Pharo/OpenPonk-ERD/OPErdTotalTransitionController.class.st +++ b/Pharo/OpenPonk-ERD/OPErdTotalTransitionController.class.st @@ -1,10 +1,12 @@ Class { - #name : #OPErdTotalTransitionController, - #superclass : #OPErdTransitionController, - #category : #'OpenPonk-ERD-Controllers' + #name : 'OPErdTotalTransitionController', + #superclass : 'OPErdTransitionController', + #category : 'OpenPonk-ERD-Controllers', + #package : 'OpenPonk-ERD', + #tag : 'Controllers' } -{ #category : #construction } +{ #category : 'construction' } OPErdTotalTransitionController >> createModelIn: aParentModel [ ^ (super createModelIn: aParentModel) diff --git a/Pharo/OpenPonk-ERD/OPErdTransition.class.st b/Pharo/OpenPonk-ERD/OPErdTransition.class.st index 447d50c..59a197d 100644 --- a/Pharo/OpenPonk-ERD/OPErdTransition.class.st +++ b/Pharo/OpenPonk-ERD/OPErdTransition.class.st @@ -1,6 +1,6 @@ Class { - #name : #OPErdTransition, - #superclass : #OPModelObject, + #name : 'OPErdTransition', + #superclass : 'OPModelObject', #instVars : [ 'source', 'target', @@ -8,10 +8,12 @@ Class { 'isTotal', 'isInheritance' ], - #category : #'OpenPonk-ERD-Models' + #category : 'OpenPonk-ERD-Models', + #package : 'OpenPonk-ERD', + #tag : 'Models' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } OPErdTransition class >> from: aSource to: aTarget [ ^ self new source: aSource; @@ -19,7 +21,7 @@ OPErdTransition class >> from: aSource to: aTarget [ yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } OPErdTransition class >> from: aSource to: aTarget named: aString [ ^ self new source: aSource; @@ -28,43 +30,43 @@ OPErdTransition class >> from: aSource to: aTarget named: aString [ yourself ] -{ #category : #comparing } +{ #category : 'comparing' } OPErdTransition >> = otherTransition [ ^ (otherTransition respondsTo: #isTransition) and: [ otherTransition isTransition and: [ otherTransition represents: self ] ] ] -{ #category : #comparing } +{ #category : 'comparing' } OPErdTransition >> asTransition [ ^ self ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdTransition >> beInheritance [ self isInheritance: true ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdTransition >> beNormal [ self isTotal: false. self isInheritance: false. ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdTransition >> beTotal [ self isTotal: true ] -{ #category : #comparing } +{ #category : 'comparing' } OPErdTransition >> detach [ super detach. source := nil. target := nil ] -{ #category : #associating } +{ #category : 'associating' } OPErdTransition >> graphmlType [ self isTotal ifTrue: [ ^ #total ] @@ -73,7 +75,7 @@ OPErdTransition >> graphmlType [ ifFalse: [ ^ #regular ] ] ] -{ #category : #comparing } +{ #category : 'comparing' } OPErdTransition >> initialize [ super initialize. isTotal := false. @@ -81,80 +83,80 @@ OPErdTransition >> initialize [ matchBlock := [ :aValue | (self name splitOn: ',') includes: aValue asString ] ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdTransition >> isInheritance [ ^ isInheritance ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdTransition >> isInheritance: aBoolean [ isInheritance := aBoolean. self changed ] -{ #category : #testing } +{ #category : 'testing' } OPErdTransition >> isNormal [ - ^ (isTotal & isInheritance) not + ^ (self isTotal & self isInheritance) not ] -{ #category : #comparing } +{ #category : 'comparing' } OPErdTransition >> isState [ ^ false ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdTransition >> isTotal [ ^ isTotal ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdTransition >> isTotal: aBoolean [ isTotal := aBoolean. self changed ] -{ #category : #comparing } +{ #category : 'comparing' } OPErdTransition >> isTransition [ ^ true ] -{ #category : #comparing } +{ #category : 'comparing' } OPErdTransition >> matchBlock [ ^ matchBlock ] -{ #category : #comparing } +{ #category : 'comparing' } OPErdTransition >> matchBlock: aOneArgBlock [ matchBlock := aOneArgBlock. self changed ] -{ #category : #comparing } +{ #category : 'comparing' } OPErdTransition >> matches: aValue [ ^ matchBlock value: aValue ] -{ #category : #comparing } +{ #category : 'comparing' } OPErdTransition >> represents: otherTransition [ ^ super = otherTransition ] -{ #category : #comparing } +{ #category : 'comparing' } OPErdTransition >> source [ ^ source ] -{ #category : #comparing } +{ #category : 'comparing' } OPErdTransition >> source: aVertex [ source := aVertex ] -{ #category : #comparing } +{ #category : 'comparing' } OPErdTransition >> target [ ^ target ] -{ #category : #comparing } +{ #category : 'comparing' } OPErdTransition >> target: aVertex [ target := aVertex ] diff --git a/Pharo/OpenPonk-ERD/OPErdTransitionController.class.st b/Pharo/OpenPonk-ERD/OPErdTransitionController.class.st index 1288be8..e410cf7 100644 --- a/Pharo/OpenPonk-ERD/OPErdTransitionController.class.st +++ b/Pharo/OpenPonk-ERD/OPErdTransitionController.class.st @@ -1,10 +1,12 @@ Class { - #name : #OPErdTransitionController, - #superclass : #OPDirectionalRelationshipController, - #category : #'OpenPonk-ERD-Controllers' + #name : 'OPErdTransitionController', + #superclass : 'OPDirectionalRelationshipController', + #category : 'OpenPonk-ERD-Controllers', + #package : 'OpenPonk-ERD', + #tag : 'Controllers' } -{ #category : #forms } +{ #category : 'forms' } OPErdTransitionController >> buildEditorForm: aForm [ super buildEditorForm: aForm. @@ -26,62 +28,66 @@ OPErdTransitionController >> buildEditorForm: aForm [ self diagramElement modelChanged ]. ] -{ #category : #construction } +{ #category : 'construction' } OPErdTransitionController >> diagramElementClass [ ^ OPErdTransitionShape ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdTransitionController >> ensureSourceAndTargetIn: aDiagramController [ - source ifNil: [ + source ifNil: [ self source: (aDiagramController showWithoutDependentInDiagramModel: - model source) ]. - target ifNil: [ + self model source) ]. + target ifNil: [ self target: (aDiagramController showWithoutDependentInDiagramModel: - model target) ] + self model target) ] ] -{ #category : #announcements } +{ #category : 'announcements' } OPErdTransitionController >> internalSubscribeTo: aModel [ + super internalSubscribeTo: aModel. - aModel when: OPElementRemoved do: [ :e | self removeController ] + aModel + when: OPElementRemoved + do: [ :e | self removeController ] + for: self ] -{ #category : #testing } +{ #category : 'testing' } OPErdTransitionController >> isHideable [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdTransitionController >> modelClass [ ^ OPErdTransition ] -{ #category : #private } +{ #category : 'private' } OPErdTransitionController >> removeModel [ self model announcer unsubscribe: self. self diagramController model remove: self model ] -{ #category : #construction } +{ #category : 'construction' } OPErdTransitionController >> showInDiagram: aDiagramController [ self ensureSourceAndTargetIn: aDiagramController. ^ super showInDiagram: aDiagramController ] -{ #category : #construction } +{ #category : 'construction' } OPErdTransitionController >> showWithoutDependentInDiagram: aDiagramController [ self ensureSourceAndTargetIn: aDiagramController. ^ super showWithoutDependentInDiagram: aDiagramController ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdTransitionController >> updateCheckboxOf: aForm named: aLabel [ aForm focusOrder do: [ :comp | (comp className asString = 'SpCheckBoxPresenter') diff --git a/Pharo/OpenPonk-ERD/OPErdTransitionLabel.class.st b/Pharo/OpenPonk-ERD/OPErdTransitionLabel.class.st index 20ef417..8e57248 100644 --- a/Pharo/OpenPonk-ERD/OPErdTransitionLabel.class.st +++ b/Pharo/OpenPonk-ERD/OPErdTransitionLabel.class.st @@ -1,32 +1,35 @@ Class { - #name : #OPErdTransitionLabel, - #superclass : #OPEdgeLabel, - #category : #'OpenPonk-ERD-DiagramElements' + #name : 'OPErdTransitionLabel', + #superclass : 'OPEdgeLabel', + #category : 'OpenPonk-ERD-DiagramElements', + #package : 'OpenPonk-ERD', + #tag : 'DiagramElements' } -{ #category : #adding } +{ #category : 'adding' } OPErdTransitionLabel >> defaultAnchorConstraintPosition [ ^ OPRSAnchorConstraintBalanceReference balance: 0.2 ] -{ #category : #adding } +{ #category : 'adding' } OPErdTransitionLabel >> defaultMinDistance [ ^ 5 ] -{ #category : #adding } +{ #category : 'adding' } OPErdTransitionLabel >> defaultText [ ^ self modelElement name ] -{ #category : #adding } +{ #category : 'adding' } OPErdTransitionLabel >> renderShapeDetails [ super renderShapeDetails. self roassalShape when: RSMouseDoubleClick do: [ :evt | OPRenameElementCommand executeOn: self modelElement ] + for: self ] diff --git a/Pharo/OpenPonk-ERD/OPErdTransitionShape.class.st b/Pharo/OpenPonk-ERD/OPErdTransitionShape.class.st index d8f3ec5..c15bdd2 100644 --- a/Pharo/OpenPonk-ERD/OPErdTransitionShape.class.st +++ b/Pharo/OpenPonk-ERD/OPErdTransitionShape.class.st @@ -1,21 +1,23 @@ Class { - #name : #OPErdTransitionShape, - #superclass : #OPEdge, + #name : 'OPErdTransitionShape', + #superclass : 'OPEdge', #instVars : [ 'total', 'inheritance' ], - #category : #'OpenPonk-ERD-DiagramElements' + #category : 'OpenPonk-ERD-DiagramElements', + #package : 'OpenPonk-ERD', + #tag : 'DiagramElements' } -{ #category : #initialization } +{ #category : 'initialization' } OPErdTransitionShape >> createOwnedElementsWithoutController [ self ownedElements ifNotEmpty: [ ^ self ]. OPErdTransitionLabel in: self ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdTransitionShape >> inheritanceMarker [ ^ (RSMarker new shape: (RSPolygon new @@ -30,7 +32,7 @@ OPErdTransitionShape >> inheritanceMarker [ yourself) ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdTransitionShape >> inheritanceMarkerNil [ ^ RSMarker new shape: (RSPolygon new @@ -39,7 +41,7 @@ OPErdTransitionShape >> inheritanceMarkerNil [ yourself ] -{ #category : #initialization } +{ #category : 'initialization' } OPErdTransitionShape >> renderBasicShape [ ^ (self source = self target ifTrue: [ OPRSBezier ] @@ -53,33 +55,34 @@ OPErdTransitionShape >> renderBasicShape [ yourself ] -{ #category : #rendering } +{ #category : 'rendering' } OPErdTransitionShape >> renderShapeDetails [ super renderShapeDetails. total := (self source = self target - ifTrue: [ OPRSBezier ] - ifFalse: [ OPRSPolyline ]) new - attachPoint: (RSBorderAttachPoint new offset: 3); - controlPointsController: OPRSDraggableCPController new; - addInteraction: OPRSDraggableControlPoints; - color: Color transparent; - from: self source roassalShape; - to: self target roassalShape; - yourself. + ifTrue: [ OPRSBezier ] + ifFalse: [ OPRSPolyline ]) new + attachPoint: (RSBorderAttachPoint new offset: 3); + controlPointsController: OPRSDraggableCPController new; + addInteraction: OPRSDraggableControlPoints; + color: Color transparent; + from: self source roassalShape; + to: self target roassalShape; + yourself. RSLocation new stick: total on: self roassalShape. - self canvas - add: total. - self roassalShape when: RSShapeRemovedEvent do: [ - total remove ] + self canvas add: total. + self roassalShape + when: RSShapeRemovedEvent + do: [ total remove ] + for: self ] -{ #category : #accessing } +{ #category : 'accessing' } OPErdTransitionShape >> total [ ^ total ] -{ #category : #rendering } +{ #category : 'rendering' } OPErdTransitionShape >> updateRenderFromModel [ total color: (self modelElement isTotal diff --git a/Pharo/OpenPonk-ERD/OPErdUnionExtensionController.class.st b/Pharo/OpenPonk-ERD/OPErdUnionExtensionController.class.st index 09e991b..fd8bc25 100644 --- a/Pharo/OpenPonk-ERD/OPErdUnionExtensionController.class.st +++ b/Pharo/OpenPonk-ERD/OPErdUnionExtensionController.class.st @@ -1,10 +1,12 @@ Class { - #name : #OPErdUnionExtensionController, - #superclass : #OPErdExtensionsController, - #category : #'OpenPonk-ERD-Controllers' + #name : 'OPErdUnionExtensionController', + #superclass : 'OPErdExtensionsController', + #category : 'OpenPonk-ERD-Controllers', + #package : 'OpenPonk-ERD', + #tag : 'Controllers' } -{ #category : #construction } +{ #category : 'construction' } OPErdUnionExtensionController >> createModelIn: aParentModel [ ^ (super createModelIn: aParentModel) diff --git a/Pharo/OpenPonk-ERD/OPErdWeakEntityController.class.st b/Pharo/OpenPonk-ERD/OPErdWeakEntityController.class.st index 47db8a8..10e0c78 100644 --- a/Pharo/OpenPonk-ERD/OPErdWeakEntityController.class.st +++ b/Pharo/OpenPonk-ERD/OPErdWeakEntityController.class.st @@ -1,10 +1,12 @@ Class { - #name : #OPErdWeakEntityController, - #superclass : #OPErdEntityController, - #category : #'OpenPonk-ERD-Controllers' + #name : 'OPErdWeakEntityController', + #superclass : 'OPErdEntityController', + #category : 'OpenPonk-ERD-Controllers', + #package : 'OpenPonk-ERD', + #tag : 'Controllers' } -{ #category : #connecting } +{ #category : 'connecting' } OPErdWeakEntityController >> canBeTargetFor: aController [ ^ (aController class == OPErdTotalTransitionController) ifTrue: [ (aController source modelClass == OPErdRelation) @@ -18,7 +20,7 @@ OPErdWeakEntityController >> canBeTargetFor: aController [ ifFalse: [ ^ false ] ] ] ] -{ #category : #construction } +{ #category : 'construction' } OPErdWeakEntityController >> createModelIn: aParentModel [ ^ (super createModelIn: aParentModel) @@ -26,14 +28,14 @@ OPErdWeakEntityController >> createModelIn: aParentModel [ yourself ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OPErdWeakEntityController >> sourceIsValid: aModel [ (aModel class == self modelClass) ifTrue: [ ^ false ] ifFalse: [ ^ self validSources includes: aModel class ] ] -{ #category : #'accessing - DirectedRelationship' } +{ #category : 'accessing - DirectedRelationship' } OPErdWeakEntityController >> validSources [ "does not include self to avoid self -> self connections if not allowed" ^ { OPErdAttribute. diff --git a/Pharo/OpenPonk-ERD/package.st b/Pharo/OpenPonk-ERD/package.st index 19ee9bb..6bb93cc 100644 --- a/Pharo/OpenPonk-ERD/package.st +++ b/Pharo/OpenPonk-ERD/package.st @@ -1 +1 @@ -Package { #name : #'OpenPonk-ERD' } +Package { #name : 'OpenPonk-ERD' }