Skip to content

Commit

Permalink
fix for issue pharo-graphics/Roassal#5
Browse files Browse the repository at this point in the history
  • Loading branch information
akevalion committed Oct 23, 2023
1 parent 3d31904 commit 9b34265
Show file tree
Hide file tree
Showing 65 changed files with 923 additions and 808 deletions.
4 changes: 2 additions & 2 deletions src/Roassal-Layouts/BlockClosure.extension.st
@@ -1,6 +1,6 @@
Extension { #name : #BlockClosure }
Extension { #name : 'BlockClosure' }

{ #category : #'*Roassal-Layouts' }
{ #category : '*Roassal-Layouts' }
BlockClosure >> rsValue: value [
^ self cull: value
]
4 changes: 2 additions & 2 deletions src/Roassal-Layouts/Collection.extension.st
@@ -1,6 +1,6 @@
Extension { #name : #Collection }
Extension { #name : 'Collection' }

{ #category : #'*Roassal-Layouts' }
{ #category : '*Roassal-Layouts' }
Collection >> maxValue: aBlock [
^ self inject: (aBlock value: self anyOne) into: [ :max :each | max max: (aBlock value: each) ]
]
8 changes: 5 additions & 3 deletions src/Roassal-Layouts/ManifestRoassalLayouts.class.st
Expand Up @@ -2,7 +2,9 @@
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 : #ManifestRoassalLayouts,
#superclass : #PackageManifest,
#category : #'Roassal-Layouts-Manifest'
#name : 'ManifestRoassalLayouts',
#superclass : 'PackageManifest',
#category : 'Roassal-Layouts-Manifest',
#package : 'Roassal-Layouts',
#tag : 'Manifest'
}
4 changes: 2 additions & 2 deletions src/Roassal-Layouts/Object.extension.st
@@ -1,6 +1,6 @@
Extension { #name : #Object }
Extension { #name : 'Object' }

{ #category : #'*Roassal-Layouts' }
{ #category : '*Roassal-Layouts' }
Object >> rsValue: anArgument [
^ self
]
4 changes: 2 additions & 2 deletions src/Roassal-Layouts/Point.extension.st
@@ -1,6 +1,6 @@
Extension { #name : #Point }
Extension { #name : 'Point' }

{ #category : #'*Roassal-Layouts' }
{ #category : '*Roassal-Layouts' }
Point class >> r: radius theta: angle [
^ (radius * angle cos) @ (radius * angle sin)
]
26 changes: 14 additions & 12 deletions src/Roassal-Layouts/RSAbstractBoxedLayout.class.st
Expand Up @@ -9,63 +9,65 @@ I define a layouts with horizontal and vertical gap spaces between elements.
"
Class {
#name : #RSAbstractBoxedLayout,
#superclass : #RSLayout,
#name : 'RSAbstractBoxedLayout',
#superclass : 'RSLayout',
#instVars : [
'gapSize',
'horizontalGap',
'verticalGap'
],
#category : #'Roassal-Layouts-Core'
#category : 'Roassal-Layouts-Core',
#package : 'Roassal-Layouts',
#tag : 'Core'
}

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

{ #category : #configuration }
{ #category : 'configuration' }
RSAbstractBoxedLayout >> defaultGapSize [
^ 5
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractBoxedLayout >> gapSize [
^ gapSize
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractBoxedLayout >> gapSize: aSizeInPixels [
gapSize := aSizeInPixels.
self horizontalGap: gapSize.
self verticalGap: gapSize.
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractBoxedLayout >> horizontalGap [

^ horizontalGap
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractBoxedLayout >> horizontalGap: aNumber [

horizontalGap := aNumber
]

{ #category : #initialization }
{ #category : 'initialization' }
RSAbstractBoxedLayout >> initialize [
super initialize.
self gapSize: self defaultGapSize
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractBoxedLayout >> verticalGap [

^ verticalGap
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractBoxedLayout >> verticalGap: aNumber [

verticalGap := aNumber
Expand Down
56 changes: 29 additions & 27 deletions src/Roassal-Layouts/RSAbstractCircleLayout.class.st
Expand Up @@ -10,62 +10,64 @@ My instance variables are
You have to override method `doExecute:` to perform the layout process.
"
Class {
#name : #RSAbstractCircleLayout,
#superclass : #RSLayout,
#name : 'RSAbstractCircleLayout',
#superclass : 'RSLayout',
#instVars : [
'initialAngle',
'scaleFactor',
'angleIncrement',
'layoutRadius',
'centerPoint'
],
#category : #'Roassal-Layouts-Circle'
#category : 'Roassal-Layouts-Circle',
#package : 'Roassal-Layouts',
#tag : 'Circle'
}

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

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> angleIncrement [
^ angleIncrement
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> angleIncrement: aNumberInRadian [
angleIncrement := aNumberInRadian
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> center [
^ self centerPoint
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> center: aPoint [
self centerPoint: aPoint
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> centerPoint [

^ centerPoint
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> centerPoint: aPoint [

centerPoint := aPoint
]

{ #category : #hook }
{ #category : 'hook' }
RSAbstractCircleLayout >> computeCenter: aNumber [
"returns the defined center point"
^ centerPoint ifNil: [ aNumber @ aNumber ]
]

{ #category : #hook }
{ #category : 'hook' }
RSAbstractCircleLayout >> computeIncrementalAngleFor: elements [
"Return the value _in radian_ of the incremental angle"

Expand All @@ -74,67 +76,67 @@ RSAbstractCircleLayout >> computeIncrementalAngleFor: elements [
ifFalse: [ angleIncrement ]
]

{ #category : #hook }
{ #category : 'hook' }
RSAbstractCircleLayout >> computeRadiusFor: elements [
"Return the radius of the circle. If none has been set (i.e., initialRadius = 0), then it is computed as the scale factor times the number of elements"
^ layoutRadius = 0
ifTrue: [ elements size * self scaleFactor ]
ifFalse: [ layoutRadius ]
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> initialAngle [
"Return the initial angle, in radian"
^ initialAngle
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> initialAngle: aFloat [
"aFloat is an angle in Radian."
initialAngle := aFloat
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> initialAngleInDegree [
"Return the initial angle in degree"
^ self initialAngle radiansToDegrees
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> initialAngleInDegree: aNumber [
"Set the initial angle in radian"
self initialAngle: aNumber degreesToRadians
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> initialIncrementalAngle [
"Return the initial incremental angle"
^ self angleIncrement
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> initialIncrementalAngle: aNumberInRadian [
self angleIncrement: aNumberInRadian
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> initialIncrementalAngleInDegree: aNumberInDegree [
self initialIncrementalAngle: aNumberInDegree degreesToRadians
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> initialRadius [
"Return the radius in pixels of the circle"
^ layoutRadius
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> initialRadius: aNumber [
"Set the radius of the circle"
layoutRadius := aNumber
]

{ #category : #initialization }
{ #category : 'initialization' }
RSAbstractCircleLayout >> initialize [
"Initialize a newly created instance. This method must answer the receiver."

Expand All @@ -149,25 +151,25 @@ RSAbstractCircleLayout >> initialize [
angleIncrement: 0
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> radius: aNumber [
"
Set the radius in pixels of the layout
"
^ self initialRadius: aNumber
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> scaleBy: aNumber [
self scaleFactor: aNumber
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> scaleFactor [
^ scaleFactor
]

{ #category : #accessing }
{ #category : 'accessing' }
RSAbstractCircleLayout >> scaleFactor: aNumber [
scaleFactor := aNumber
]

0 comments on commit 9b34265

Please sign in to comment.