Skip to content

Commit

Permalink
Updates for Pharo 12
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed May 7, 2024
1 parent 576cdec commit 3af5ca9
Show file tree
Hide file tree
Showing 283 changed files with 3,480 additions and 2,919 deletions.
12 changes: 6 additions & 6 deletions repository/OpenPonk-Core/DoubleLink.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #DoubleLink }
Extension { #name : 'DoubleLink' }

{ #category : #'*OpenPonk-Core-accessing' }
{ #category : '*OpenPonk-Core-accessing' }
DoubleLink >> addPredecessor: aLink [
| oldPredeccessor |
oldPredeccessor := self previousLink.
Expand All @@ -10,7 +10,7 @@ DoubleLink >> addPredecessor: aLink [
self previousLink: aLink
]

{ #category : #'*OpenPonk-Core-accessing' }
{ #category : '*OpenPonk-Core-accessing' }
DoubleLink >> addSuccessor: aLink [
| oldSuccessor |
oldSuccessor := self nextLink.
Expand All @@ -20,17 +20,17 @@ DoubleLink >> addSuccessor: aLink [
self nextLink: aLink
]

{ #category : #'*OpenPonk-Core-accessing' }
{ #category : '*OpenPonk-Core-accessing' }
DoubleLink >> next [
^ self nextLink
]

{ #category : #'*OpenPonk-Core-accessing' }
{ #category : '*OpenPonk-Core-accessing' }
DoubleLink >> previous [
^ self previousLink
]

{ #category : #'*OpenPonk-Core-accessing' }
{ #category : '*OpenPonk-Core-accessing' }
DoubleLink >> removeLink [
| predecessor successor |
predecessor := self previousLink.
Expand Down
6 changes: 3 additions & 3 deletions repository/OpenPonk-Core/MAContainer.extension.st
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Extension { #name : #MAContainer }
Extension { #name : 'MAContainer' }

{ #category : #'*OpenPonk-Core' }
{ #category : '*OpenPonk-Core' }
MAContainer >> definingContext [

^ self propertyAt: #definingContext ifAbsent: [ nil ]
]

{ #category : #'*OpenPonk-Core' }
{ #category : '*OpenPonk-Core' }
MAContainer >> definingContext: anMADefiningContext [

^ self propertyAt: #definingContext put: anMADefiningContext
Expand Down
12 changes: 7 additions & 5 deletions repository/OpenPonk-Core/ManifestOpenPonkCore.class.st
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
Class {
#name : #ManifestOpenPonkCore,
#superclass : #PackageManifest,
#category : #'OpenPonk-Core-Manifest'
#name : 'ManifestOpenPonkCore',
#superclass : 'PackageManifest',
#category : 'OpenPonk-Core-Manifest',
#package : 'OpenPonk-Core',
#tag : 'Manifest'
}

{ #category : #'code-critics' }
{ #category : 'code-critics' }
ManifestOpenPonkCore class >> ruleRTInvocationSequenceRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#OPTRelationshipWithPathPointsController #layout #false)) #'2021-07-21T17:15:27.877427+02:00') #(#(#RGMethodDefinition #(#OPTRelationshipWithPathPointsController #layout: #false)) #'2021-07-21T17:17:28.272427+02:00') )
]

{ #category : #'code-critics' }
{ #category : 'code-critics' }
ManifestOpenPonkCore class >> ruleReTestClassNotInPackageWithTestEndingNameV1FalsePositive [
^ #(#(#(#RGPackageDefinition #(#'OpenPonk-Core')) #'2020-05-27T10:56:37.652665+02:00') )
]
4 changes: 2 additions & 2 deletions repository/OpenPonk-Core/NeoJSONObjectMapping.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #NeoJSONObjectMapping }
Extension { #name : 'NeoJSONObjectMapping' }

{ #category : #'*OpenPonk-Core' }
{ #category : '*OpenPonk-Core' }
NeoJSONObjectMapping >> sortProperties [
properties := properties sorted: #propertyName ascending
]
10 changes: 6 additions & 4 deletions repository/OpenPonk-Core/OPAbstractEdgeTest.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Class {
#name : #OPAbstractEdgeTest,
#superclass : #OPAbstractShapeTest,
#category : #'OpenPonk-Core-Tests'
#name : 'OPAbstractEdgeTest',
#superclass : 'OPAbstractShapeTest',
#category : 'OpenPonk-Core-Tests',
#package : 'OpenPonk-Core',
#tag : 'Tests'
}

{ #category : #tests }
{ #category : 'tests' }
OPAbstractEdgeTest >> testRenderSimplifiedForController [

| diagramController controller connectedController rsBox connectedShape |
Expand Down
14 changes: 8 additions & 6 deletions repository/OpenPonk-Core/OPAbstractLabelTest.class.st
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
Class {
#name : #OPAbstractLabelTest,
#superclass : #OPAbstractShapeTest,
#category : #'OpenPonk-Core-Tests'
#name : 'OPAbstractLabelTest',
#superclass : 'OPAbstractShapeTest',
#category : 'OpenPonk-Core-Tests',
#package : 'OpenPonk-Core',
#tag : 'Tests'
}

{ #category : #hooks }
{ #category : 'hooks' }
OPAbstractLabelTest >> shapeClass [
^ OPTestLabel
]

{ #category : #tests }
{ #category : 'tests' }
OPAbstractLabelTest >> testRoassalShape [

| roassalShape |
Expand All @@ -20,7 +22,7 @@ OPAbstractLabelTest >> testRoassalShape [
self assert: roassalShape text equals: 'some text'
]

{ #category : #tests }
{ #category : 'tests' }
OPAbstractLabelTest >> testRoassalShapeEmphasis [

| roassalShape |
Expand Down
18 changes: 10 additions & 8 deletions repository/OpenPonk-Core/OPAbstractShapeTest.class.st
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
Class {
#name : #OPAbstractShapeTest,
#superclass : #TestCase,
#name : 'OPAbstractShapeTest',
#superclass : 'TestCase',
#instVars : [
'canvas',
'shape'
],
#category : #'OpenPonk-Core-Tests'
#category : 'OpenPonk-Core-Tests',
#package : 'OpenPonk-Core',
#tag : 'Tests'
}

{ #category : #testing }
{ #category : 'testing' }
OPAbstractShapeTest class >> isAbstract [
^ self name includesSubstring: 'Abstract'
]

{ #category : #'instance creation' }
{ #category : 'instance creation' }
OPAbstractShapeTest >> newShapeInstance [
^ self shapeClass new
]

{ #category : #running }
{ #category : 'running' }
OPAbstractShapeTest >> setUp [

super setUp.
shape := self newShapeInstance.
canvas := RSCanvas new
]

{ #category : #hooks }
{ #category : 'hooks' }
OPAbstractShapeTest >> shapeClass [
^ self subclassResponsibility
]

{ #category : #tests }
{ #category : 'tests' }
OPAbstractShapeTest >> testRenderSimplifiedForController [

| diagramController controller |
Expand Down
8 changes: 5 additions & 3 deletions repository/OpenPonk-Core/OPAllFiguresDeselected.class.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Class {
#name : #OPAllFiguresDeselected,
#superclass : #Announcement,
#category : #'OpenPonk-Core-Controllers'
#name : 'OPAllFiguresDeselected',
#superclass : 'Announcement',
#category : 'OpenPonk-Core-Controllers',
#package : 'OpenPonk-Core',
#tag : 'Controllers'
}
32 changes: 17 additions & 15 deletions repository/OpenPonk-Core/OPAutosaveManager.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,62 @@ I manage autosaving and undo/redo operations of a single controller.
As I manage only a single controller, do not rely on this for cross-model operations (such as instance modeling), as changes in the ""linked-to"" model can make your model invalid if you undo/redo/recover only the instance.
"
Class {
#name : #OPAutosaveManager,
#superclass : #Object,
#name : 'OPAutosaveManager',
#superclass : 'Object',
#instVars : [
'history',
'current',
'future',
'serializer'
],
#category : #'OpenPonk-Core-Persistence'
#category : 'OpenPonk-Core-Persistence',
#package : 'OpenPonk-Core',
#tag : 'Persistence'
}

{ #category : #'instance creation' }
{ #category : 'instance creation' }
OPAutosaveManager class >> on: aSerializer [
^ self new
serializer: aSerializer;
yourself
]

{ #category : #'instance creation' }
{ #category : 'instance creation' }
OPAutosaveManager >> autosaveFileFor: aUUID [
self autosavePath ensureCreateDirectory.
^ self autosavePath / aUUID asString , 'ston'
]

{ #category : #accessing }
{ #category : 'accessing' }
OPAutosaveManager >> autosavePath [
^ FileLocator imageDirectory asFileReference / 'autosave'
]

{ #category : #testing }
{ #category : 'testing' }
OPAutosaveManager >> futureIsEmpty [
^ future isEmpty
]

{ #category : #testing }
{ #category : 'testing' }
OPAutosaveManager >> historyIsEmpty [
^ history isEmpty
]

{ #category : #initialization }
{ #category : 'initialization' }
OPAutosaveManager >> initialize [
super initialize.
history := OrderedCollection new.
future := OrderedCollection new
]

{ #category : #'save/load' }
{ #category : 'save/load' }
OPAutosaveManager >> loadCurrent [
current ifNil: [ ^ nil ].
^ current
readStreamDo: [ :stream | self serializer materializeFrom: stream ]
]

{ #category : #'save/load' }
{ #category : 'save/load' }
OPAutosaveManager >> loadNext [
future ifEmpty: [ ^ nil ].
history addLast: current.
Expand All @@ -68,7 +70,7 @@ OPAutosaveManager >> loadNext [
readStreamDo: [ :stream | self serializer materializeFrom: stream ]
]

{ #category : #'save/load' }
{ #category : 'save/load' }
OPAutosaveManager >> loadPrevious [
history ifEmpty: [ ^ nil ].
future addLast: current.
Expand All @@ -77,7 +79,7 @@ OPAutosaveManager >> loadPrevious [
readStreamDo: [ :stream | self serializer materializeFrom: stream ]
]

{ #category : #'save/load' }
{ #category : 'save/load' }
OPAutosaveManager >> saveState: aMemento [
future reset.
current ifNotNil: [ history addLast: current ].
Expand All @@ -91,12 +93,12 @@ OPAutosaveManager >> saveState: aMemento [
nextPutAll: current ]
]

{ #category : #accessing }
{ #category : 'accessing' }
OPAutosaveManager >> serializer [
^ serializer
]

{ #category : #accessing }
{ #category : 'accessing' }
OPAutosaveManager >> serializer: aSerializer [
serializer := aSerializer
]
30 changes: 16 additions & 14 deletions repository/OpenPonk-Core/OPBaseControllerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,50 @@
I provide basic scaffolding and utility functions to ease the testing of controllers.
"
Class {
#name : #OPBaseControllerTest,
#superclass : #TestCase,
#name : 'OPBaseControllerTest',
#superclass : 'TestCase',
#instVars : [
'controller',
'diagramController',
'model'
],
#category : #'OpenPonk-Core-Controllers - Tests'
#category : 'OpenPonk-Core-Controllers - Tests',
#package : 'OpenPonk-Core',
#tag : 'Controllers - Tests'
}

{ #category : #testing }
{ #category : 'testing' }
OPBaseControllerTest class >> isAbstract [
^ self = OPBaseControllerTest
]

{ #category : #accessing }
{ #category : 'accessing' }
OPBaseControllerTest >> controllerClass [
^ self subclassResponsibility
]

{ #category : #accessing }
{ #category : 'accessing' }
OPBaseControllerTest >> diagramControllerClass [
^ self subclassResponsibility
]

{ #category : #construction }
{ #category : 'construction' }
OPBaseControllerTest >> diagramElementClass [

^ OPTestDiagramElement
]

{ #category : #accessing }
{ #category : 'accessing' }
OPBaseControllerTest >> diagramModelClass [
^ self subclassResponsibility
]

{ #category : #accessing }
{ #category : 'accessing' }
OPBaseControllerTest >> modelClass [
^ self subclassResponsibility
]

{ #category : #'instance creation' }
{ #category : 'instance creation' }
OPBaseControllerTest >> newModel [

| aModel |
Expand All @@ -53,7 +55,7 @@ OPBaseControllerTest >> newModel [
^ aModel
]

{ #category : #running }
{ #category : 'running' }
OPBaseControllerTest >> setUp [

super setUp.
Expand All @@ -66,20 +68,20 @@ OPBaseControllerTest >> setUp [
model := self newModel
]

{ #category : #support }
{ #category : 'support' }
OPBaseControllerTest >> stubRefresh [
controller stub figure willReturn: Mock new.
controller stub refreshFigure willReturn: controller
]

{ #category : #tests }
{ #category : 'tests' }
OPBaseControllerTest >> testIsSupported [
self diagramControllerClass = self controllerClass
ifTrue: [ ^ self ].
self assert: (diagramController hasSupportForModel: model)
]

{ #category : #tests }
{ #category : 'tests' }
OPBaseControllerTest >> testModelClass [
self diagramControllerClass = self controllerClass
ifTrue: [ ^ self ].
Expand Down
Loading

0 comments on commit 3af5ca9

Please sign in to comment.