Skip to content

Commit

Permalink
Merge pull request #8222 from gcorriga/2138-Rubric-cleaning
Browse files Browse the repository at this point in the history
2138 Rubric cleanup
  • Loading branch information
Ducasse committed Jan 3, 2021
2 parents e7b4087 + af3007a commit 9a47d32
Showing 1 changed file with 210 additions and 13 deletions.
223 changes: 210 additions & 13 deletions src/Rubric/RubParagraphDecorator.class.st
Expand Up @@ -25,6 +25,11 @@ RubParagraphDecorator class >> next: aDecoratorOrAParagraph [
^ self new next: aDecoratorOrAParagraph
]

{ #category : #delegating }
RubParagraphDecorator >> aboutToBeUnplugged [
^self paragraph aboutToBeUnplugged
]

{ #category : #drawing }
RubParagraphDecorator >> canDrawDecoratorsOn: aCanvas [

Expand All @@ -36,13 +41,67 @@ RubParagraphDecorator >> canDrawDecoratorsOn: aCanvas [

]

{ #category : #delegating }
RubParagraphDecorator >> characterBlockAtPoint: aPoint [

^self paragraph characterBlockAtPoint: aPoint
]

{ #category : #delegating }
RubParagraphDecorator >> characterBlockForIndex: index [
^self paragraph characterBlockForIndex: index
]

{ #category : #delegating }
RubParagraphDecorator >> click: anEvent for: model controller: editor [

^self paragraph click: anEvent for: model controller: editor
]

{ #category : #delegating }
RubParagraphDecorator >> closingDelimiters [

^self paragraph closingDelimiters
]

{ #category : #delegating }
RubParagraphDecorator >> compose [
^self paragraph compose
]

{ #category : #delegating }
RubParagraphDecorator >> container [
^self paragraph container
]

{ #category : #delegating }
RubParagraphDecorator >> container: atextContainerOrRectangle [
^self paragraph container: atextContainerOrRectangle
]

{ #category : #querying }
RubParagraphDecorator >> decoratorNamed: aKey [
^ self key = aKey
ifTrue: [ self ]
ifFalse: [ next decoratorNamed: aKey ]
]

{ #category : #delegating }
RubParagraphDecorator >> defaultCharacterBlock [
^self paragraph defaultCharacterBlock
]

{ #category : #delegating }
RubParagraphDecorator >> defaultFontChange [

^self paragraph defaultFontChange
]

{ #category : #delegating }
RubParagraphDecorator >> disableDrawingWhile: aBlock [
^self paragraph disableDrawingWhile: aBlock
]

{ #category : #'error handling' }
RubParagraphDecorator >> doesNotUnderstand: aMessage [
^ [ aMessage sendTo: next ]
Expand Down Expand Up @@ -78,6 +137,17 @@ RubParagraphDecorator >> drawOnAthensCanvas: aCanvas bounds: aRectangle color: a
next drawOnAthensCanvas: aCanvas bounds: aRectangle color: aColor
]

{ #category : #delegating }
RubParagraphDecorator >> drawingEnabled [

^self paragraph drawingEnabled
]

{ #category : #delegating }
RubParagraphDecorator >> extent [
^self paragraph extent
]

{ #category : #querying }
RubParagraphDecorator >> hasDecorator: aDecorator [
^ self = aDecorator or: [ next hasDecorator: aDecorator ]
Expand All @@ -93,6 +163,51 @@ RubParagraphDecorator >> key [
^self class key
]

{ #category : #delegating }
RubParagraphDecorator >> lineIndexForPoint: aPoint [

^self paragraph lineIndexForPoint: aPoint
]

{ #category : #delegating }
RubParagraphDecorator >> lineIndexOfCharacterIndex: characterIndex [
^self paragraph lineIndexOfCharacterIndex: characterIndex
]

{ #category : #delegating }
RubParagraphDecorator >> lines [
^self paragraph lines
]

{ #category : #delegating }
RubParagraphDecorator >> margins [

^self paragraph margins
]

{ #category : #delegating }
RubParagraphDecorator >> minimumExtent [

^self paragraph minimumExtent
]

{ #category : #delegating }
RubParagraphDecorator >> model [
^self paragraph model
]

{ #category : #delegating }
RubParagraphDecorator >> move: anEvent for: model controller: editor [

^self paragraph move: anEvent for: model controller: editor
]

{ #category : #delegating }
RubParagraphDecorator >> moveBy: aPoint [

^self paragraph moveBy: aPoint
]

{ #category : #accessing }
RubParagraphDecorator >> next [
^ next
Expand All @@ -103,29 +218,105 @@ RubParagraphDecorator >> next: anObject [
next := anObject
]

{ #category : #'instead of DNU' }
{ #category : #delegating }
RubParagraphDecorator >> numberOfLines [
^self paragraph numberOfLines
]

{ #category : #delegating }
RubParagraphDecorator >> numberOfPhysicalLines [

^self paragraph numberOfPhysicalLines
]

{ #category : #delegating }
RubParagraphDecorator >> openingDelimiters [

^self paragraph openingDelimiters
]

{ #category : #delegating }
RubParagraphDecorator >> paragraph [
"this method is here to find the paragraph in the chain, instead of relying on implementing #doesNotUnderstand: !!!"
^next paragraph
]

| p |

p := next.

[ p isNotNil and: [ p isKindOf: RubParagraph ] ] whileFalse: [
p := p next.
].
{ #category : #delegating }
RubParagraphDecorator >> replaceFrom: start to: stop with: aText [
^self paragraph replaceFrom: start to: stop with: aText
]

^p


{ #category : #delegating }
RubParagraphDecorator >> selection [

^self paragraph selection
]

{ #category : #delegating }
RubParagraphDecorator >> selectionRects [

^self paragraph selectionRects
]

{ #category : #delegating }
RubParagraphDecorator >> selectionStart [

^self paragraph selectionStart
]

{ #category : #delegating }
RubParagraphDecorator >> selectionStop [

^self paragraph selectionStop
]

{ #category : #delegating }
RubParagraphDecorator >> string [

^self paragraph string
]

{ #category : #delegating }
RubParagraphDecorator >> tabWidth: anInteger [

^self paragraph tabWidth: anInteger
]

{ #category : #'instead of DNU' }
{ #category : #delegating }
RubParagraphDecorator >> text [

^self paragraph text
]

{ #category : #delegating }
RubParagraphDecorator >> text: aText [

^self paragraph text: aText
]

{ #category : #delegating }
RubParagraphDecorator >> textArea [

^self paragraph textArea
]

{ #category : #delegating }
RubParagraphDecorator >> textArea: aClient [

^self paragraph textArea: aClient
]

{ #category : #delegating }
RubParagraphDecorator >> textStyle [

^self paragraph textStyle
]

{ #category : #delegating }
RubParagraphDecorator >> theme [

^self paragraph theme
]

{ #category : #initialization }
RubParagraphDecorator >> unplug [
next
Expand All @@ -135,6 +326,12 @@ RubParagraphDecorator >> unplug [
super unplug
]

{ #category : #delegating }
RubParagraphDecorator >> verticesFrom: firstIndex to: lastIndex [

^self paragraph verticesFrom: firstIndex to: lastIndex
]

{ #category : #accessing }
RubParagraphDecorator >> visibleStringFrom: topLeft to: bottomRight [
| topLeftBlk bottomRightBlk startIdx stopIdx string |
Expand Down

0 comments on commit 9a47d32

Please sign in to comment.