Skip to content

Commit

Permalink
Renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
LabordePierre committed Nov 30, 2023
1 parent 1b66140 commit 0c33db0
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 75 deletions.
8 changes: 5 additions & 3 deletions GeoView-Tests/GeoSymbologyProviderTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ GeoSymbologyProviderTest class >> image2 [

{ #category : #private }
GeoSymbologyProviderTest >> createSampleImageFiles [
| image1 image2 form |

| directory image1 image2 form |
directory := self sampleImageFilesDirectory.

image1 := self sampleImageFilesDirectory / 'image1.png'.
image1 := directory / 'image1.png'.
form := Smalltalk compiler evaluate: self class image1.
image1 asFileReference binaryWriteStreamDo: [ :out | (PNGReadWriter on: out) nextPutImage: form ].
image1 ensureCreateFile.

image2 := self sampleImageFilesDirectory / 'image2.png'.
image2 := directory / 'image2.png'.
form := Smalltalk compiler evaluate: self class image2.
image2 asFileReference binaryWriteStreamDo: [ :out | (PNGReadWriter on: out) nextPutImage: form ].
image2 ensureCreateFile.
Expand Down
8 changes: 4 additions & 4 deletions GeoView-Tests/GeoViewManagerImplTests.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ GeoViewManagerImplTests >> testLayerServices [
layer := geoViewManager getLayer: #layer1.
self assert: layer notNil.

geoViewManager deleteLayer: #layer1.
geoViewManager removeLayer: #layer1.
self assert: geoViewManager getLayers isEmpty.

geoViewManager addLayer: (GeoViewTestLayer new layerName: #layer1).
self assert: geoViewManager getLayers size equals: 1.

geoViewManager deleteAllLayers.
geoViewManager removeAllLayers.
self assert: geoViewManager getLayers isEmpty.
]

Expand All @@ -78,9 +78,9 @@ GeoViewManagerImplTests >> testLayerServicesWithoutLayers [
layer := geoViewManager getLayer: #nonExistingLayer.
self assert: layer isNil.

geoViewManager deleteLayer: #nonExistingLayer.
geoViewManager removeLayer: #nonExistingLayer.
self assert: geoViewManager getLayers isEmpty.

geoViewManager deleteAllLayers.
geoViewManager removeAllLayers.
self assert: geoViewManager getLayers isEmpty.
]
10 changes: 5 additions & 5 deletions GeoView-Tests/GeoViewTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ GeoViewTest >> addLayer: aLayer [
self layers add: aLayer
]

{ #category : #layers }
GeoViewTest >> deleteLayer: aLayer [
self layers remove: aLayer
]

{ #category : #layers }
GeoViewTest >> getLayers [
^self layers
Expand All @@ -44,3 +39,8 @@ GeoViewTest >> layers [
GeoViewTest >> layers: anObject [
layers := anObject
]

{ #category : #layers }
GeoViewTest >> removeLayer: aLayer [
self layers remove: aLayer
]
30 changes: 15 additions & 15 deletions GeoView-Tests/GeoViewUserTestImpl.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ Class {
#category : #'GeoView-Tests-Utils'
}

{ #category : #events }
GeoViewUserTestImpl >> geoViewLayerAdded: aKey in: aGeoViewManagerKey [
self receivedGeoViewLayerEvents at: #layerAddedEvent put: (aKey -> aGeoViewManagerKey).
]

{ #category : #events }
GeoViewUserTestImpl >> geoViewLayerRemoved: aKey in: aGeoViewManagerKey [
self receivedGeoViewLayerEvents at: #layerDeletedEvent put: (aKey -> aGeoViewManagerKey).
]

{ #category : #events }
GeoViewUserTestImpl >> geoViewLayerUpdated: aKey in: aGeoViewManagerKey [
self receivedGeoViewLayerEvents at: #layerUpdatedEvent put: (aKey -> aGeoViewManagerKey).
]

{ #category : #'component accessing' }
GeoViewUserTestImpl >> getGeoViewManagerEventsSubscriber [
| eventsSymbol eventsSubscriber itf |
Expand All @@ -33,21 +48,6 @@ GeoViewUserTestImpl >> getGeoViewManagerLayerEventsSubscriber [
^eventsSubscriber
]

{ #category : #events }
GeoViewUserTestImpl >> layerAdded: aKey view: aGeoViewManagerKey [
self receivedGeoViewLayerEvents at: #layerAddedEvent put: (aKey -> aGeoViewManagerKey).
]

{ #category : #events }
GeoViewUserTestImpl >> layerDeleted: aKey view: aGeoViewManagerKey [
self receivedGeoViewLayerEvents at: #layerDeletedEvent put: (aKey -> aGeoViewManagerKey).
]

{ #category : #events }
GeoViewUserTestImpl >> layerUpdated: aKey view: aGeoViewManagerKey [
self receivedGeoViewLayerEvents at: #layerUpdatedEvent put: (aKey -> aGeoViewManagerKey).
]

{ #category : #callbacks }
GeoViewUserTestImpl >> receivedGeoViewLayerEvents [
receivedGeoViewLayerEvents ifNil:[receivedGeoViewLayerEvents := Dictionary new].
Expand Down
10 changes: 5 additions & 5 deletions GeoView/GeoView.trait.st
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ GeoView >> addLayer: aLayer [
self explicitRequirement
]

{ #category : #layers }
GeoView >> deleteLayer: aLayer [
self explicitRequirement
]

{ #category : #layers }
GeoView >> getLayers [
self explicitRequirement
Expand All @@ -46,6 +41,11 @@ GeoView >> removeGeoObjects: aGeoObjectList [
self explicitRequirement
]

{ #category : #layers }
GeoView >> removeLayer: aLayer [
self explicitRequirement
]

{ #category : #selection }
GeoView >> selectedGeoObjectKeys: aCollection [
self explicitRequirement
Expand Down
50 changes: 25 additions & 25 deletions GeoView/GeoViewManagerImpl.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ GeoViewManagerImpl >> addLayer: aLayer [
aLayer mapProjection: self getMapProjectionManagerServicesProvider getProjection.
aLayer symbologyProvider: self getGeoSymbologyManagerServicesProvider.
aLayer isGeoObjectLayer ifTrue:[
aLayer processDataChangedCallback: [ :l | self receiveLayerUpdateFrom: l ].
aLayer whenProcessDatasChangedDo: [ :l | self layerHasBeenUpdated: l ].
].
self view addLayer: aLayer.

self getGeoViewManagerLayerEventsNotifier layerAdded: aLayer layerName view: self componentName.
self getGeoViewManagerLayerEventsNotifier geoViewLayerAdded: aLayer layerName in: self componentName.
^aLayer
]

Expand Down Expand Up @@ -157,14 +157,6 @@ GeoViewManagerImpl >> cursorPositionChanged: anAssociation [
self getGeoViewManagerCursorEventsNotifier cursor: anAssociation key positionChanged: anAssociation value view: self componentName
]

{ #category : #'services - layer deletion' }
GeoViewManagerImpl >> deleteAllLayers [
| layers |
layers := self view getLayers.
layers do:[ :l | (self view deleteLayer: l) ifNotNil:[ self getGeoViewManagerLayerEventsNotifier layerDeleted: l layerName view: self componentName ]].
^layers
]

{ #category : #'event strategy' }
GeoViewManagerImpl >> deleteEventBehavior: aGeoViewEventBehavior [

Expand All @@ -183,17 +175,6 @@ GeoViewManagerImpl >> deleteEventBehaviors [
stack do:[ :e | e geoViewManager: nil ].
]

{ #category : #'services - layer deletion' }
GeoViewManagerImpl >> deleteLayer: aKey [
| layer |
aKey ifNil:[^nil].
layer := self getLayer: aKey.
layer ifNil:[^nil].
layer := self view deleteLayer: layer.
layer ifNotNil:[self getGeoViewManagerLayerEventsNotifier layerDeleted: aKey view: self componentName].
^layer
]

{ #category : #'events handling' }
GeoViewManagerImpl >> dispatchEvent: anEngineEvent [
"Transfert event in input strategy stack to each behavior processors"
Expand Down Expand Up @@ -380,6 +361,12 @@ GeoViewManagerImpl >> initializeView [
self setScaleInMeters: 1.4816e7.
]

{ #category : #events }
GeoViewManagerImpl >> layerHasBeenUpdated: aLayer [

self getGeoViewManagerLayerEventsNotifier geoViewLayerUpdated: (aLayer layerName) in: (self componentName).
]

{ #category : #accessing }
GeoViewManagerImpl >> maxScaleInMeters [
^ maxScaleInMeters
Expand Down Expand Up @@ -429,10 +416,12 @@ GeoViewManagerImpl >> pickAt: aGlobalPoint radius: aRadiusInPixels [
^ pickingResult
]

{ #category : #private }
GeoViewManagerImpl >> receiveLayerUpdateFrom: aLayer [

self getGeoViewManagerLayerEventsNotifier layerUpdated: (aLayer layerName) view: (self componentName).
{ #category : #'services - layer deletion' }
GeoViewManagerImpl >> removeAllLayers [
| layers |
layers := self view getLayers.
layers do:[ :l | (self view removeLayer: l) ifNotNil:[ self getGeoViewManagerLayerEventsNotifier geoViewLayerRemoved: l layerName in: self componentName ]].
^layers
]

{ #category : #'aggregated components' }
Expand All @@ -454,6 +443,17 @@ GeoViewManagerImpl >> removeGeoObjects: aGeoObjectList [
self view removeGeoObjects: aGeoObjectList
]

{ #category : #'services - layer deletion' }
GeoViewManagerImpl >> removeLayer: aKey [
| layer |
aKey ifNil:[^nil].
layer := self getLayer: aKey.
layer ifNil:[^nil].
layer := self view removeLayer: layer.
layer ifNotNil:[self getGeoViewManagerLayerEventsNotifier geoViewLayerRemoved: aKey in: self componentName].
^layer
]

{ #category : #scale }
GeoViewManagerImpl >> scaleDown [
self flag: 'PLA : faire un fonctionnement par pallier'.
Expand Down
6 changes: 3 additions & 3 deletions GeoView/GeoViewManagerLayerEvents.trait.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Trait {
}

{ #category : #events }
GeoViewManagerLayerEvents >> layerAdded: aKey view: aGeoViewManagerKey [
GeoViewManagerLayerEvents >> geoViewLayerAdded: aKey in: aGeoViewManagerKey [
]

{ #category : #events }
GeoViewManagerLayerEvents >> layerDeleted: aKey view: aGeoViewManagerKey [
GeoViewManagerLayerEvents >> geoViewLayerRemoved: aKey in: aGeoViewManagerKey [
]

{ #category : #events }
GeoViewManagerLayerEvents >> layerUpdated: aKey view: aGeoViewManagerKey [
GeoViewManagerLayerEvents >> geoViewLayerUpdated: aKey in: aGeoViewManagerKey [
]
16 changes: 8 additions & 8 deletions GeoView/GeoViewManagerLayerServices.trait.st
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ GeoViewManagerLayerServices >> createAndAddGeoObjectLayer: aKey [
GeoViewManagerLayerServices >> createAndAddGeoObjectLayer: aKey level: anInteger [
]

{ #category : #'services - layer deletion' }
GeoViewManagerLayerServices >> deleteAllLayers [
]

{ #category : #'services - layer deletion' }
GeoViewManagerLayerServices >> deleteLayer: aKey [
]

{ #category : #'services - layer accessing' }
GeoViewManagerLayerServices >> getLayer: aKey [
]
Expand All @@ -40,6 +32,14 @@ GeoViewManagerLayerServices >> getLayerLevel: aKey [
GeoViewManagerLayerServices >> getLayers [
]

{ #category : #'services - layer deletion' }
GeoViewManagerLayerServices >> removeAllLayers [
]

{ #category : #'services - layer deletion' }
GeoViewManagerLayerServices >> removeLayer: aKey [
]

{ #category : #'services - layer configuration' }
GeoViewManagerLayerServices >> setLevel: anInteger forLayer: aKey [
]
18 changes: 11 additions & 7 deletions GeoView/GeoViewObjectLayer.trait.st
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
Trait {
#name : #GeoViewObjectLayer,
#instVars : [
'processDataChangedBlock'
],
#category : #'GeoView-View & Layer'
}

{ #category : #'process data' }
GeoViewObjectLayer >> deleteProcessDataFor: aGeoObjectClass [
self explicitRequirement
]

{ #category : #'process data' }
GeoViewObjectLayer >> getAllProcessData [
self explicitRequirement
Expand All @@ -23,8 +21,8 @@ GeoViewObjectLayer >> isGeoObjectLayer [
^true
]

{ #category : #private }
GeoViewObjectLayer >> processDataChangedCallback: aCallbackBlock [
{ #category : #'process data' }
GeoViewObjectLayer >> removeProcessDataFor: aGeoObjectClass [
self explicitRequirement
]

Expand All @@ -38,3 +36,9 @@ GeoViewObjectLayer >> setProcessData: aProcessData for: aGeoObjectClass [
self explicitRequirement

]

{ #category : #private }
GeoViewObjectLayer >> whenProcessDatasChangedDo: aBlock [

processDataChangedBlock := aBlock
]

0 comments on commit 0c33db0

Please sign in to comment.