Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring of ProcessData: remove Ae suffixe #8

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions GeoView-Bloc-Alexandrie/BlElementAeGeoView.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ BlElementAeGeoView >> configureLayer: aLayer [
aLayer graphicModel projection: self displayToGraphicProjection.

"add alexandrie process datas"
aLayer graphicModel setProcessData: DCompositeShapeGeoViewAeProcessData new for: SmockDCompositeShape.
aLayer graphicModel setProcessData: DSymbolGeoViewAeProcessData new for: SmockDSymbol.
aLayer graphicModel setProcessData: DCircleGeoViewAeProcessData new for: SmockDCircle.
aLayer graphicModel setProcessData: DTextGeoViewAeProcessData new for: SmockDText.
aLayer graphicModel setProcessData: DCompositeShapeGeoViewProcessData new for: SmockDCompositeShape.
aLayer graphicModel setProcessData: DSymbolGeoViewProcessData new for: SmockDSymbol.
aLayer graphicModel setProcessData: DCircleGeoViewProcessData new for: SmockDCircle.
aLayer graphicModel setProcessData: DTextGeoViewProcessData new for: SmockDText.
"aLayer displayToGraphicModel defaultProcessData: DShapeAeProcessData new."
]

Expand Down
37 changes: 37 additions & 0 deletions GeoView-Tests/DCompositeShapeGeoViewAeProcessDataTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"
A DCompositeShapeGeoViewAeProcessDataTest is a test class for testing the behavior of DCompositeShapeGeoViewAeProcessData
"
Class {
#name : #DCompositeShapeGeoViewAeProcessDataTest,
#superclass : #TestCase,
#category : #'GeoView-Tests'
}

{ #category : #tests }
DCompositeShapeGeoViewAeProcessDataTest >> testProcessCreatedDataIncomingWithContext [

| processData dShape gShape |
processData := DCompositeShapeGeoViewProcessData new.
dShape := SmockDCompositeShape new.
gShape := processData processCreatedData: #test incoming: dShape with: nil context: nil.

self assert: gShape class equals: SmockGCompositeShape2D.
self assert: gShape id equals: #test.
self assert: gShape isVisible.
]

{ #category : #tests }
DCompositeShapeGeoViewAeProcessDataTest >> testProcessUpdatedDataIncomingWithContext [

| processData dShape gShape |
processData := DCompositeShapeGeoViewProcessData new.
dShape := SmockDCompositeShape new.
gShape := processData processCreatedData: #test incoming: dShape with: nil context: nil.

dShape isVisible: false.
gShape := processData processCreatedData: #test incoming: dShape with: gShape context: nil.

self assert: gShape class equals: SmockGCompositeShape2D.
self assert: gShape id equals: #test.
self deny: gShape isVisible.
]
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Class {
#name : #DCircleGeoViewAeProcessData,
#superclass : #DLeafShapeGeoViewAeProcessData,
#category : #'GeoView-Bloc-Alexandrie-GShape-ProcessData'
#name : #DCircleGeoViewProcessData,
#superclass : #DLeafShapeGeoViewProcessData,
#category : #'GeoView-GShape-ProcessData'
}

{ #category : #private }
DCircleGeoViewAeProcessData >> createGShape2D [
DCircleGeoViewProcessData >> createGShape2D [

^ SmockGCircle2D new
]

{ #category : #private }
DCircleGeoViewAeProcessData >> processUpdatedData: aKey incoming: aDCircle with: aGCircle2D context: aContext [
DCircleGeoViewProcessData >> processUpdatedData: aKey incoming: aDCircle with: aGCircle2D context: aContext [

| radius |
super processUpdatedData: aKey incoming: aDCircle with: aGCircle2D context: aContext.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Class {
#name : #DCompositeShapeGeoViewAeProcessData,
#superclass : #DShapeGeoViewAeProcessData,
#category : #'GeoView-Bloc-Alexandrie-GShape-ProcessData'
#name : #DCompositeShapeGeoViewProcessData,
#superclass : #DShapeGeoViewProcessData,
#category : #'GeoView-GShape-ProcessData'
}

{ #category : #processing }
DCompositeShapeGeoViewAeProcessData >> createAndAddGChildFrom: aDShape inGComposite: aGComposite2D [
DCompositeShapeGeoViewProcessData >> createAndAddGChildFrom: aDShape inGComposite: aGComposite2D [

| processData gShape2D |

Expand All @@ -26,7 +26,7 @@ DCompositeShapeGeoViewAeProcessData >> createAndAddGChildFrom: aDShape inGCompos
]

{ #category : #processing }
DCompositeShapeGeoViewAeProcessData >> processCreatedData: aKey incoming: aDComposite with: aGComposite2D context: aContext [
DCompositeShapeGeoViewProcessData >> processCreatedData: aKey incoming: aDComposite with: aGComposite2D context: aContext [

| gComposite2D |
gComposite2D := aGComposite2D
Expand All @@ -46,7 +46,7 @@ DCompositeShapeGeoViewAeProcessData >> processCreatedData: aKey incoming: aDComp
]

{ #category : #processing }
DCompositeShapeGeoViewAeProcessData >> processUpdatedData: aKey incoming: aDComposite with: aGComposite2D context: aContext [
DCompositeShapeGeoViewProcessData >> processUpdatedData: aKey incoming: aDComposite with: aGComposite2D context: aContext [

super processUpdatedData: aKey incoming: aDComposite with: aGComposite2D context: aContext.

Expand Down Expand Up @@ -118,7 +118,7 @@ DCompositeShapeGeoViewAeProcessData >> processUpdatedData: aKey incoming: aDComp
]

{ #category : #processing }
DCompositeShapeGeoViewAeProcessData >> removeGChild: aGShape2D createdFrom: aDShape offGComposite: aGComposite2D [
DCompositeShapeGeoViewProcessData >> removeGChild: aGShape2D createdFrom: aDShape offGComposite: aGComposite2D [

| processData gChild |

Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
Class {
#name : #DLeafShapeGeoViewAeProcessData,
#superclass : #DShapeGeoViewAeProcessData,
#category : #'GeoView-Bloc-Alexandrie-GShape-ProcessData'
#name : #DLeafShapeGeoViewProcessData,
#superclass : #DShapeGeoViewProcessData,
#category : #'GeoView-GShape-ProcessData'
}

{ #category : #accessing }
DLeafShapeGeoViewAeProcessData class >> isAbstract [
DLeafShapeGeoViewProcessData class >> isAbstract [

^ self = DLeafShapeGeoViewAeProcessData
^ self = DLeafShapeGeoViewProcessData
]

{ #category : #private }
DLeafShapeGeoViewAeProcessData >> createGShape2D [
DLeafShapeGeoViewProcessData >> createGShape2D [

^ self subclassResponsibility
]

{ #category : #processing }
DLeafShapeGeoViewAeProcessData >> processCreatedData: aKey incoming: aDShape with: aGShape2D context: aContext [
DLeafShapeGeoViewProcessData >> processCreatedData: aKey incoming: aDShape with: aGShape2D context: aContext [

| gShape2D |
gShape2D := aGShape2D ifNil: [ self createGShape2D ].
gShape2D id: aKey.

super processCreatedData: aKey incoming: aDShape with: gShape2D context: aContext.

^ self processUpdatedData: aKey incoming: aDShape with: gShape2D context: aContext
]

{ #category : #processing }
DLeafShapeGeoViewAeProcessData >> processUpdatedData: aKey incoming: aDShape with: aGShape2D context: aContext [
DLeafShapeGeoViewProcessData >> processUpdatedData: aKey incoming: aDShape with: aGShape2D context: aContext [

super processUpdatedData: aKey incoming: aDShape with: aGShape2D context: aContext.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Class {
#name : #DShapeGeoViewAeProcessData,
#name : #DShapeGeoViewProcessData,
#superclass : #SmockProcessData,
#category : #'GeoView-Bloc-Alexandrie-GShape-ProcessData'
#category : #'GeoView-GShape-ProcessData'
}

{ #category : #accessing }
DShapeGeoViewAeProcessData class >> isAbstract [
DShapeGeoViewProcessData class >> isAbstract [

^ self = DShapeGeoViewAeProcessData
^ self = DShapeGeoViewProcessData
]

{ #category : #processing }
DShapeGeoViewAeProcessData >> computePositionFor: aDShape context: aContext [
DShapeGeoViewProcessData >> computePositionFor: aDShape context: aContext [

aDShape coordinates ifNil:[ ^ nil ].
self processor ifNil:[ ^ nil ].
Expand All @@ -20,33 +20,33 @@ DShapeGeoViewAeProcessData >> computePositionFor: aDShape context: aContext [
]

{ #category : #processing }
DShapeGeoViewAeProcessData >> processCreatedData: aKey incoming: aDShape with: aGShape2D context: aContext [
DShapeGeoViewProcessData >> processCreatedData: aKey incoming: aDShape with: aGShape2D context: aContext [

(aDShape isNil or: [ aGShape2D isNil ]) ifTrue: [ ^ nil ].
aGShape2D id: aKey asString.
^ aGShape2D
]

{ #category : #processing }
DShapeGeoViewAeProcessData >> processDeletedData: aKey incoming: aDShape with: aGShape2D context: aContext [
DShapeGeoViewProcessData >> processDeletedData: aKey incoming: aDShape with: aGShape2D context: aContext [

^ aGShape2D
]

{ #category : #processing }
DShapeGeoViewAeProcessData >> processStateChanged: aKey state: aState value: aValueOrNil with: aProducedData context: aContext [
DShapeGeoViewProcessData >> processStateChanged: aKey state: aState value: aValueOrNil with: aProducedData context: aContext [

"do nothing"
]

{ #category : #processing }
DShapeGeoViewAeProcessData >> processUpdatedData: aKey incoming: aDShape with: aGShape2D context: aContext [
DShapeGeoViewProcessData >> processUpdatedData: aKey incoming: aDShape with: aGShape2D context: aContext [

| position |
(aDShape isNil or: [ aGShape2D isNil ]) ifTrue: [ ^ nil ].
aGShape2D isVisible: aDShape isVisible.
aGShape2D properties: (aDShape properties copy).

aGShape2D isTranslatedByParent: aDShape isTranslatedByParent.
position := self computePositionFor: aDShape context: aContext.
aGShape2D position: (position ifNil:[ 0@0 ]).

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Class {
#name : #DSymbolGeoViewAeProcessData,
#superclass : #DLeafShapeGeoViewAeProcessData,
#category : #'GeoView-Bloc-Alexandrie-GShape-ProcessData'
#name : #DSymbolGeoViewProcessData,
#superclass : #DLeafShapeGeoViewProcessData,
#category : #'GeoView-GShape-ProcessData'
}

{ #category : #private }
DSymbolGeoViewAeProcessData >> createGShape2D [
DSymbolGeoViewProcessData >> createGShape2D [

^ SmockGBitmap2D new
]

{ #category : #processing }
DSymbolGeoViewAeProcessData >> processUpdatedData: aKey incoming: aDSymbol with: aGBitmap2D context: aContext [
DSymbolGeoViewProcessData >> processUpdatedData: aKey incoming: aDSymbol with: aGBitmap2D context: aContext [

super processUpdatedData: aKey incoming: aDSymbol with: aGBitmap2D context: aContext.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Class {
#name : #DTextGeoViewAeProcessData,
#superclass : #DLeafShapeGeoViewAeProcessData,
#category : #'GeoView-Bloc-Alexandrie-GShape-ProcessData'
#name : #DTextGeoViewProcessData,
#superclass : #DLeafShapeGeoViewProcessData,
#category : #'GeoView-GShape-ProcessData'
}

{ #category : #private }
DTextGeoViewAeProcessData >> computePositionFor: aDShape context: aContext [
DTextGeoViewProcessData >> computePositionFor: aDShape context: aContext [
"Return a pixel position from an axis coordinates, ignore z axis"

| position |
Expand All @@ -19,13 +19,13 @@ DTextGeoViewAeProcessData >> computePositionFor: aDShape context: aContext [
]

{ #category : #private }
DTextGeoViewAeProcessData >> createGShape2D [
DTextGeoViewProcessData >> createGShape2D [

^ SmockGText2D new
]

{ #category : #processing }
DTextGeoViewAeProcessData >> processUpdatedData: aKey incoming: aDText with: aGText2D context: aContext [
DTextGeoViewProcessData >> processUpdatedData: aKey incoming: aDText with: aGText2D context: aContext [

super processUpdatedData: aKey incoming: aDText with: aGText2D context: aContext.

Expand Down
Loading