42 lines
1014 B
Smalltalk
42 lines
1014 B
Smalltalk
Class {
|
|
#name : #GrafoscopioFormat,
|
|
#superclass : #Object,
|
|
#classInstVars : [
|
|
'instance'
|
|
],
|
|
#category : #'Grafoscopio-Pillar-TextFormat'
|
|
}
|
|
|
|
{ #category : #accessing }
|
|
GrafoscopioFormat class >> instance [
|
|
^ instance ifNil: [ instance := self new ]
|
|
]
|
|
|
|
{ #category : #'target resize' }
|
|
GrafoscopioFormat >> beInstalledIn: aNode [
|
|
self subclassResponsibility .
|
|
|
|
]
|
|
|
|
{ #category : #'target resize' }
|
|
GrafoscopioFormat >> installTextNodeAtLeftWithValue: aString in: aNode [
|
|
| newTextChild |
|
|
newTextChild := self newTextChildFor: aString in: aNode.
|
|
aNode children: {newTextChild} , aNode children
|
|
]
|
|
|
|
{ #category : #'target resize' }
|
|
GrafoscopioFormat >> installTextNodeAtRightWithValue: aString in: aNode [
|
|
| newTextChild |
|
|
newTextChild := self newTextChildFor: aString in: aNode.
|
|
aNode children: aNode children , {newTextChild}
|
|
]
|
|
|
|
{ #category : #'target resize' }
|
|
GrafoscopioFormat >> newTextChildFor: aString in: aNode [
|
|
^ GrafoscopioFormatTextNode new
|
|
text: aString;
|
|
parent: aNode;
|
|
yourself
|
|
]
|