Many refactors. pharo 9 en windows is working really bad

This commit is contained in:
sbragagnolo 2020-05-10 22:38:20 +02:00
parent ae12fe9576
commit 9cf21cb38b
80 changed files with 7652 additions and 7550 deletions

View File

@ -1,28 +1,28 @@
" "
I provide some convenience functionality to work with files. I provide some convenience functionality to work with files.
" "
Class { Class {
#name : #FileUtils, #name : #FileUtils,
#superclass : #Object, #superclass : #Object,
#category : #'Grafoscopio-Model' #category : #'Grafoscopio-Model'
} }
{ #category : #utilities } { #category : #utilities }
FileUtils class >> createFilesNamed: fileNames endingWith: fileExtension intoFolder: aFolder [ FileUtils class >> createFilesNamed: fileNames endingWith: fileExtension intoFolder: aFolder [
| createdFiles fullFileName existingFiles typedFileName | | createdFiles fullFileName existingFiles typedFileName |
createdFiles := OrderedCollection new. createdFiles := OrderedCollection new.
existingFiles := OrderedCollection new. existingFiles := OrderedCollection new.
fileNames do: [ :eachFile | fileNames do: [ :eachFile |
typedFileName := eachFile, fileExtension. typedFileName := eachFile, fileExtension.
fullFileName := aFolder / typedFileName. fullFileName := aFolder / typedFileName.
fullFileName exists fullFileName exists
ifFalse: [ ifFalse: [
fullFileName ensureCreateFile. fullFileName ensureCreateFile.
createdFiles add: fullFileName basename ] createdFiles add: fullFileName basename ]
ifTrue: [existingFiles add: fullFileName basename ]]. ifTrue: [existingFiles add: fullFileName basename ]].
^ (Dictionary new ^ (Dictionary new
at: 'created files' put: createdFiles; at: 'created files' put: createdFiles;
at: 'existing files' put: existingFiles; at: 'existing files' put: existingFiles;
yourself) yourself)
] ]

View File

@ -1,139 +1,139 @@
" "
Please comment me using the following template inspired by Class Responsibility Collaborator (CRC) design: Please comment me using the following template inspired by Class Responsibility Collaborator (CRC) design:
I'm FontAwesomeIcons, a custom selection of some icons in this font family used for the GUI of grafoscopio. I'm FontAwesomeIcons, a custom selection of some icons in this font family used for the GUI of grafoscopio.
For the Responsibility part: Three sentences about my main responsibility, what I'm doing, what services do I offer. For the Responsibility part: Three sentences about my main responsibility, what I'm doing, what services do I offer.
For the Collaborators Part: State my main collaborators and one line about how I interact with them. For the Collaborators Part: State my main collaborators and one line about how I interact with them.
Public API and Key Messages Public API and Key Messages
- message one - message one
- message two - message two
- what is the way to create instances is a plus. - what is the way to create instances is a plus.
One simple example is simply gorgeous. One simple example is simply gorgeous.
Internal Representation and Key Implementation Points. Internal Representation and Key Implementation Points.
Instance Variables Instance Variables
icons: <Object> icons: <Object>
Implementation Points Implementation Points
" "
Class { Class {
#name : #FontAwesomeIcons, #name : #FontAwesomeIcons,
#superclass : #Object, #superclass : #Object,
#instVars : [ #instVars : [
'icons' 'icons'
], ],
#classVars : [ #classVars : [
'Current' 'Current'
], ],
#category : #'Grafoscopio-UI' #category : #'Grafoscopio-UI'
} }
{ #category : #'accessing - icons' } { #category : #'accessing - icons' }
FontAwesomeIcons >> copyIcon [ FontAwesomeIcons >> copyIcon [
"Private - Generated method" "Private - Generated method"
^Form fromBinaryStream: (Base64MimeConverter mimeDecodeToBytes: self copyIconContents readStream) ^Form fromBinaryStream: (Base64MimeConverter mimeDecodeToBytes: self copyIconContents readStream)
] ]
{ #category : #'private - contents' } { #category : #'private - contents' }
FontAwesomeIcons >> copyIconContents [ FontAwesomeIcons >> copyIconContents [
"Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/FontAwesome/Png/copy.png" "Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/FontAwesome/Png/copy.png"
^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA2UlEQVR4nJXQIU6DQRAF4K+F ^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA2UlEQVR4nJXQIU6DQRAF4K+F
4DAYVFHlBEgctQgScL0DCbp3wKNJOAIXQDcEC5iqQoNsA4KkiO6GJX92/p+XvGxm983bN8Mv 4DAYVFHlBEgctQgScL0DCbp3wKNJOAIXQDcEC5iqQoNsA4KkiO6GJX92/p+XvGxm983bN8Mv
+rjFOnFYMNchbvCNSWooUTXopfMalxhjipfiLRucYg9bxf0zXCXBJP1yUkmwxhyviTN8wVsh +rjFOnFYMNchbvCNSWooUTXopfMalxhjipfiLRucYg9bxf0zXCXBJP1yUkmwxhyviTN8wVsh
yHwsms/wiSUuivu8m3BBR1hglH5tGGxXGmGAO5zjIdBVE9xrjnb8nwQjHBb1ymaJfxAZ7NjM yHwsms/wiSUuivu8m3BBR1hglH5tGGxXGmGAO5zjIdBVE9xrjnb8nwQjHBb1ymaJfxAZ7NjM
HSIbHLQJIzxpzpoZYdim6WTQ7xayjmiJ7x1SLHrB4y72Www+fgBc9T/67LlhnQAAAABJRU5E HSIbHLQJIzxpzpoZYdim6WTQ7xayjmiJ7x1SLHrB4y72Www+fgBc9T/67LlhnQAAAABJRU5E
rkJggg==' rkJggg=='
] ]
{ #category : #'accessing - icons' } { #category : #'accessing - icons' }
FontAwesomeIcons >> cutIcon [ FontAwesomeIcons >> cutIcon [
"Private - Generated method" "Private - Generated method"
^Form fromBinaryStream: (Base64MimeConverter mimeDecodeToBytes: self cutIconContents readStream) ^Form fromBinaryStream: (Base64MimeConverter mimeDecodeToBytes: self cutIconContents readStream)
] ]
{ #category : #'private - contents' } { #category : #'private - contents' }
FontAwesomeIcons >> cutIconContents [ FontAwesomeIcons >> cutIconContents [
"Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/FontAwesome/Png/cut.png" "Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/FontAwesome/Png/cut.png"
^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABOUlEQVR4nNXSzyvlYRTH8Rcu ^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABOUlEQVR4nNXSzyvlYRTH8Rcu
N5dmIt2FX4VpJktRUpKssB//wGSDUsrCahYzuykaGyk/YiFlb2VhYWVhYaUkKxsbTSYSYfE9 N5dmIt2FX4VpJktRUpKssB//wGSDUsrCahYzuykaGyk/YiFlb2VhYWVhYaUkKxsbTSYSYfE9
V3e+EQub+dRTz4/zvM85n+fhHXSNhxhX+IHSV+50IVNYbKAKn7EeoO8vXOyNmHFsolFMirWD V3e+EQub+dRTz4/zvM85n+fhHXSNhxhX+IHSV+50IVNYbKAKn7EeoO8vXOyNmHFsolFMirWD
89TeFyxhEuXoxjI+ZPAVFZjHX+SRQz3uMINbTOMCoxEzinsYwlGRDw/4iX2s4VNUkcUvDD/X 89TeFyxhEuXoxjI+ZPAVFZjHX+SRQz3uMINbTOMCoxEzinsYwlGRDw/4iX2s4VNUkcUvDD/X
Wwna0Y8WLGI7snSgGatx9o8KTn4MQB6VqA1ITuL4IP5E76dpyBQuUy0shGmHElPLI3YSs+HZ Wwna0Y8WLGI7snSgGatx9o8KTn4MQB6VqA1ITuL4IP5E76dpyBQuUy0shGmHElPLI3YSs+HZ
k+4kb98QlewGMIsyfMMKOiO+B1toKgDmimC5yHqSqjIb2efRhrqAtGbQhxHJs41JXB9JAW7w k+4kb98QlewGMIsyfMMKOiO+B1toKgDmimC5yHqSqjIb2efRhrqAtGbQhxHJs41JXB9JAW7w
G9WYkHygY5zBQfR9jz0MpE16i2ok7v+HegQfqT9MAMiDKwAAAABJRU5ErkJggg==' G9WYkHygY5zBQfR9jz0MpE16i2ok7v+HegQfqT9MAMiDKwAAAABJRU5ErkJggg=='
] ]
{ #category : #'accessing - icons' } { #category : #'accessing - icons' }
FontAwesomeIcons >> html5Icon [ FontAwesomeIcons >> html5Icon [
"Private - Generated method" "Private - Generated method"
^Form fromBinaryStream: (Base64MimeConverter mimeDecodeToBytes: self html5IconContents readStream) ^Form fromBinaryStream: (Base64MimeConverter mimeDecodeToBytes: self html5IconContents readStream)
] ]
{ #category : #'private - contents' } { #category : #'private - contents' }
FontAwesomeIcons >> html5IconContents [ FontAwesomeIcons >> html5IconContents [
"Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/FontAwesome/Png/html5.png" "Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/FontAwesome/Png/html5.png"
^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA+UlEQVR4nK3Tv0oDQRDH8c9J ^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA+UlEQVR4nK3Tv0oDQRDH8c9J
BMFKJGIXBBtFwc7SUlDfwpewEewsbQQL8QHsA2lSiK2NCFr4Av4hjYigVSxuV/bWjRhxYJhl BMFKJGIXBBtFwc7SUlDfwpewEewsbQQL8QHsA2lSiK2NCFr4Av4hjYigVSxuV/bWjRhxYJhl
9uY7v9m9rdR2ikm/tx7OoRUSO5gfA3AfFxMhPo9RDE85ICZ2Uf3gNzkgjhAVzIV4hJlC58Vc 9uY7v9m9rdR2ikm/tx7OoRUSO5gfA3AfFxMhPo9RDE85ICZ2Uf3gNzkgjhAVzIV4hJlC58Vc
cQ5oh7iJpb+MEBUsF+Snh/wNkI9QsqjuFe+jABu4xgDDxFcS+Ff30ggDrOEs6/6YKGgA8kOc cQ5oh7iJpb+MEBUsF+Snh/wNkI9QsqjuFe+jABu4xgDDxFcS+Ff30ggDrOEs6/6YKGgA8kOc
DfEQV+jgMoDb2bcNm0rkHqv/zOmwt4o93IX9kxIAXjTn/sBDlhviYBRgH7eFguhv6GI9LaoK DfEQV+jgMoDb2bcNm0rkHqv/zOmwt4o93IX9kxIAXjTn/sBDlhviYBRgH7eFguhv6GI9LaoK
oA62sYUF9NWv70Jyff9mnwBsQJo0owsMAAAAAElFTkSuQmCC' oA62sYUF9NWv70Jyff9mnwBsQJo0owsMAAAAAElFTkSuQmCC'
] ]
{ #category : #'accessing - icons' } { #category : #'accessing - icons' }
FontAwesomeIcons >> pasteIcon [ FontAwesomeIcons >> pasteIcon [
"Private - Generated method" "Private - Generated method"
^Form fromBinaryStream: (Base64MimeConverter mimeDecodeToBytes: self pasteIconContents readStream) ^Form fromBinaryStream: (Base64MimeConverter mimeDecodeToBytes: self pasteIconContents readStream)
] ]
{ #category : #'private - contents' } { #category : #'private - contents' }
FontAwesomeIcons >> pasteIconContents [ FontAwesomeIcons >> pasteIconContents [
"Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/FontAwesome/Png/paste.png" "Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/FontAwesome/Png/paste.png"
^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAqUlEQVR4nK3TTQrBQRzG8c/I ^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAqUlEQVR4nK3TTQrBQRzG8c/I
yk6SsrAilk5hYWfjWA6hXICycwtLByDJ2upvgZrG6+BbU7+3nnnmVxNQuDDC2j09LK5xB5u4 yk6SsrAilk5hYWfjWA6hXICycwtLByDJ2upvgZrG6+BbU7+3nnnmVxNQuDDC2j09LK5xB5u4
WY7iUpLH9ZcUGaedrZ4wznWQzh0wQfjWwRB9TF33lStwwABHzFG5WfvkCfsH/Vl4MBgToriC WY7iUpLH9ZcUGaedrZ4wznWQzh0wQfjWwRB9TF33lStwwABHzFG5WfvkCfsH/Vl4MBgToriC
ZpS3sMxxkNJGkbuDO/4isPtFoIwu6km9hdUvwg2cvP8bu/BMAVXU3ly0PQOGrUCXHk1emQAA ZpS3sMxxkNJGkbuDO/4isPtFoIwu6km9hdUvwg2cvP8bu/BMAVXU3ly0PQOGrUCXHk1emQAA
AABJRU5ErkJggg==' AABJRU5ErkJggg=='
] ]
{ #category : #'accessing - icons' } { #category : #'accessing - icons' }
FontAwesomeIcons >> tagIcon [ FontAwesomeIcons >> tagIcon [
"Private - Generated method" "Private - Generated method"
^Form fromBinaryStream: (Base64MimeConverter mimeDecodeToBytes: self tagIconContents readStream) ^Form fromBinaryStream: (Base64MimeConverter mimeDecodeToBytes: self tagIconContents readStream)
] ]
{ #category : #'private - contents' } { #category : #'private - contents' }
FontAwesomeIcons >> tagIconContents [ FontAwesomeIcons >> tagIconContents [
"Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/FontAwesome/Png/tag.png" "Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/FontAwesome/Png/tag.png"
^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAmUlEQVR4nKXPMQ4BQRSA4U9D ^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAmUlEQVR4nKXPMQ4BQRSA4U9D
oeIgKsdwAUfARSSiUTmExgUcYU8gGoVGpZFIGM0WG5mxM0zyMpni/zKPP0+nvleYNN4BZyxx oeIgKsdwAUfARSSiUTmExgUcYU8gGoVGpZFIGM0WG5mxM0zyMpni/zKPP0+nvleYNN4BZyxx
yIGedfQ5L8xygIA7RhjjUYoEXNFDH7fIT+ZtQMARpy/rJJFLIorNIgasC4Ao0sW+EJn+i2xi yIGedfQ5L8xygIA7RhjjUYoEXNFDH7fIT+ZtQMARpy/rJJFLIorNIgasC4Ao0sW+EJn+i2xi
q+QiFQYxIAepMEzFbUhWnEKK4iayxe6XOOu8ARtNbaMQ63x5AAAAAElFTkSuQmCC' q+QiFQYxIAepMEzFbUhWnEKK4iayxe6XOOu8ARtNbaMQ63x5AAAAAElFTkSuQmCC'
] ]
{ #category : #'accessing - icons' } { #category : #'accessing - icons' }
FontAwesomeIcons >> tagsIcon [ FontAwesomeIcons >> tagsIcon [
"Private - Generated method" "Private - Generated method"
^Form fromBinaryStream: (self tagsIconContents base64Decoded readStream) ^Form fromBinaryStream: (self tagsIconContents base64Decoded readStream)
] ]
{ #category : #'private - contents' } { #category : #'private - contents' }
FontAwesomeIcons >> tagsIconContents [ FontAwesomeIcons >> tagsIconContents [
"Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/FontAwesome/Png/tags.png" "Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/FontAwesome/Png/tags.png"
^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAANCAYAAACgu+4kAAAABHNCSVQICAgIfAhkiAAAAAlw ^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAANCAYAAACgu+4kAAAABHNCSVQICAgIfAhkiAAAAAlw
SFlzAAAOxAAADsQBlSsOGwAAAXRJREFUKJGN0j1Mk1EYxfH/edRFSKijH4kTJBgTJ0cGTdxE SFlzAAAOxAAADsQBlSsOGwAAAXRJREFUKJGN0j1Mk1EYxfH/edRFSKijH4kTJBgTJ0cGTdxE
TKyUGAfFSQcKUl3taIjIh3EUTJzaAoORwUGdmUlMXB1ktSaQGNp7HOyrgG8jZ733+d1zc69G TKyUGAfFSQcKUl3taIjIh3EUTJzaAoORwUGdmUlMXB1ktSaQGNp7HOyrgG8jZ733+d1zc69G
y9NvsC6RRbZhIxQLtkdtX5DjSW1x5hM5CdBtxGnjLUQf6IzQDSfXWu30EvTF4fdjE49GugCA y9NvsC6RRbZhIxQLtkdtX5DjSW1x5hM5CdBtxGnjLUQf6IzQDSfXWu30EvTF4fdjE49GugCA
Wa8vPLuIufO3CSePRnxspzQr+3UKGnlIdGoPlMqV84ihfasdpJX8XLCch0RnZz/SJlD+p2OG Wa8vPLuIufO3CSePRnxspzQr+3UKGnlIdGoPlMqV84ihfasdpJX8XLCch0RnZz/SJlD+p2OG
tNNcHhLA57y7dUOwl/YiKk48vCLFuuDYfyGz1Urp8pHQJNK4SUXZZqz8+GqS1w6DGL/j29fr tNNcHhLA57y7dUOwl/YiKk48vCLFuuDYfyGz1Urp8pHQJNK4SUXZZqz8+GqS1w6DGL/j29fr
OnX2O6b1+9XhsIixbyX0M8Sa8Ys/AEBpqjJsa7ULYtt3JTexGoZX5070PtgHANycnL4mYuUA OnX2O6b1+9XhsIixbyX0M8Sa8Ys/AEBpqjJsa7ULYtt3JTexGoZX5070PtgHANycnL4mYuUA
YsO4TTNwHWlpsNBzv1qtpjh4TGN+9q1JRcPuntr3Av8IXAeWs2HIfn5OSlOVYayntmeON3tr YsO4TTNwHWlpsNBzv1qtpjh4TGN+9q1JRcPuntr3Av8IXAeWs2HIfn5OSlOVYayntmeON3tr
O4XtD4KNwUJPJRsG+AVxqr+5c/rf8wAAAABJRU5ErkJggg==' O4XtD4KNwUJPJRsG+AVxqr+5c/rf8wAAAABJRU5ErkJggg=='
] ]

View File

@ -1,13 +1,13 @@
Extension { #name : #FormCanvas } Extension { #name : #FormCanvas }
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
FormCanvas >> gfcParagraph: para bounds: bounds color: c [ FormCanvas >> gfcParagraph: para bounds: bounds color: c [
| scanner | | scanner |
self setPaintColor: c. self setPaintColor: c.
scanner := (port clippedBy: (bounds translateBy: origin)) gfcDisplayScannerFor: para scanner := (port clippedBy: (bounds translateBy: origin)) gfcDisplayScannerFor: para
foreground: c background: Color transparent foreground: c background: Color transparent
ignoreColorChanges: false. ignoreColorChanges: false.
para drawOn: (self copyClipRect: bounds) using: scanner at: origin + bounds topLeft. para drawOn: (self copyClipRect: bounds) using: scanner at: origin + bounds topLeft.
] ]

View File

@ -1,351 +1,351 @@
" "
I'm the Graphical User Interface for Grafoscopio environment. I'm the Graphical User Interface for Grafoscopio environment.
My main responsability is to provide grafoscopio with a docking bar My main responsability is to provide grafoscopio with a docking bar
with menu options for open, browse notebooks, update the system with menu options for open, browse notebooks, update the system
and its components and the help menu. and its components and the help menu.
" "
Class { Class {
#name : #GfUIHelpers, #name : #GfUIHelpers,
#superclass : #DynamicComposablePresenter, #superclass : #DynamicComposablePresenter,
#instVars : [ #instVars : [
'windowMainMenu', 'windowMainMenu',
'tree', 'tree',
'nodeHeader', 'nodeHeader',
'nodeBody' 'nodeBody'
], ],
#classVars : [ #classVars : [
'dockingBar', 'dockingBar',
'recentNotebooks' 'recentNotebooks'
], ],
#classInstVars : [ #classInstVars : [
'dockingBar', 'dockingBar',
'recentNotebooks', 'recentNotebooks',
'helpMenu' 'helpMenu'
], ],
#category : #'Grafoscopio-UI' #category : #'Grafoscopio-UI'
} }
{ #category : #adding } { #category : #adding }
GfUIHelpers class >> addToHelpMenu: aGrafoscopioNotebook [ GfUIHelpers class >> addToHelpMenu: aGrafoscopioNotebook [
| metadata nbFile | | metadata nbFile |
metadata := aGrafoscopioNotebook metadata. metadata := aGrafoscopioNotebook metadata.
nbFile := aGrafoscopioNotebook workingFile. nbFile := aGrafoscopioNotebook workingFile.
(metadata at: 'showOnHelp' ifAbsent: [ ^ self ]) (metadata at: 'showOnHelp' ifAbsent: [ ^ self ])
ifTrue: [ ifTrue: [
self helpMenu submorphs self helpMenu submorphs
detect: [ :s | s contents = (metadata at: 'shortTitle') ] detect: [ :s | s contents = (metadata at: 'shortTitle') ]
ifFound: [ ifFound: [
self inform: self inform:
'The notebook: ', String cr, 'The notebook: ', String cr,
nbFile fullName, String cr, nbFile fullName, String cr,
' needs another shortTitle to be added to the docking bar Help Menu.' ] ' needs another shortTitle to be added to the docking bar Help Menu.' ]
ifNone: [ ifNone: [
self helpMenu self helpMenu
add: (metadata at: 'shortTitle') add: (metadata at: 'shortTitle')
target: [ GrafoscopioNotebook open: nbFile ] target: [ GrafoscopioNotebook open: nbFile ]
selector: #value ] ]. selector: #value ] ].
self updateUI self updateUI
] ]
{ #category : #updating } { #category : #updating }
GfUIHelpers class >> installDataviz [ GfUIHelpers class >> installDataviz [
"I install the Dataviz package. "I install the Dataviz package.
DataViz contains Data visualization helpers" DataViz contains Data visualization helpers"
"self isDatavizInstalled ifTrue: [ ^ self ]." "self isDatavizInstalled ifTrue: [ ^ self ]."
Metacello new Metacello new
smalltalkhubUser: 'Offray' project: 'Dataviz'; smalltalkhubUser: 'Offray' project: 'Dataviz';
configuration: 'Dataviz'; configuration: 'Dataviz';
load. load.
self inform: 'Dataviz package install finished.' self inform: 'Dataviz package install finished.'
] ]
{ #category : #updating } { #category : #updating }
GfUIHelpers class >> installDatavizUI [ GfUIHelpers class >> installDatavizUI [
"I'm the User Interface for installing the Dataviz package for the first time." "I'm the User Interface for installing the Dataviz package for the first time."
| install | | install |
install := (UIManager default install := (UIManager default
confirm: confirm:
'Dataviz is data visualization package, with several', String cr, 'Dataviz is data visualization package, with several', String cr,
'Domain Specific Examples, like Panama Papers, Twitter Data Selfies.', 'Domain Specific Examples, like Panama Papers, Twitter Data Selfies.',
String cr, 'Do you want to install it?' String cr, 'Do you want to install it?'
label: 'Install Dataviz package'). label: 'Install Dataviz package').
install ifFalse: [ ^ self ]. install ifFalse: [ ^ self ].
self installDataviz self installDataviz
] ]
{ #category : #updating } { #category : #updating }
GfUIHelpers class >> isDatavizInstalled [ GfUIHelpers class >> isDatavizInstalled [
^ (Metacello image ^ (Metacello image
configuration: #('Dataviz'); configuration: #('Dataviz');
list) isNotEmpty list) isNotEmpty
] ]
{ #category : #'graphical interface' } { #category : #'graphical interface' }
GfUIHelpers class >> messageAbout [ GfUIHelpers class >> messageAbout [
"I show the author(s), license, sponsors and main contributors to the project "I show the author(s), license, sponsors and main contributors to the project
and point to further documentation on the web" and point to further documentation on the web"
LongMessageDialogWindow new LongMessageDialogWindow new
entryText: entryText:
'_.:| Grafoscopio |:._', '_.:| Grafoscopio |:._',
(String with: Character cr), (String with: Character cr),
'(c) Copyright 2014-2017 by Offray Vladimir Luna Cárdenas', '(c) Copyright 2014-2017 by Offray Vladimir Luna Cárdenas',
(String with: Character cr), (String with: Character cr),
'Covered under MIT license.', 'Covered under MIT license.',
(String with: Character cr), (String with: Character cr),
(String with: Character cr), (String with: Character cr),
'[ Sponsors ]', '[ Sponsors ]',
(String with: Character cr), (String with: Character cr),
'mutabiT | www.mutabit.com ', 'mutabiT | www.mutabit.com ',
(String with: Character cr), (String with: Character cr),
'HiTec Lab, Fundación Universitaria Los Libertadores | www.ulibertadores.edu.co ', 'HiTec Lab, Fundación Universitaria Los Libertadores | www.ulibertadores.edu.co ',
(String with: Character cr), (String with: Character cr),
(String with: Character cr), (String with: Character cr),
'[ Thanks to ]', '[ Thanks to ]',
(String with: Character cr), (String with: Character cr),
'HackBo, Hackerspace Bogota | http://hackbo.co', 'HackBo, Hackerspace Bogota | http://hackbo.co',
(String with: Character cr), (String with: Character cr),
'// Regular workshops attendees \\ '// Regular workshops attendees \\
Rafael Medida, Iván Pulido, Camilo Hurtado', Rafael Medida, Iván Pulido, Camilo Hurtado',
(String with: Character cr), (String with: Character cr),
'// Coffe talk (mostly about grafoscopio) \\ '// Coffe talk (mostly about grafoscopio) \\
Yanneth Gil, Andrés Calderón, Luis Alejandro Bernal', Yanneth Gil, Andrés Calderón, Luis Alejandro Bernal',
(String with: Character cr), (String with: Character cr),
'// Pharo, Moose and Agile Visualization communities \\ '// Pharo, Moose and Agile Visualization communities \\
Tudor Girba, Alexandre Bergel, Nicolai Hess, Peter Uhnák, Milton Mamani ', Tudor Girba, Alexandre Bergel, Nicolai Hess, Peter Uhnák, Milton Mamani ',
(String with: Character cr), (String with: Character cr),
'// Family support while writing, coding & travelling (among others!) \\ '// Family support while writing, coding & travelling (among others!) \\
Divian Luna, Hilda Cárdenas', Divian Luna, Hilda Cárdenas',
(String with: Character cr), (String with: Character cr),
(String with: Character cr), (String with: Character cr),
'For further details and versions go to:', 'For further details and versions go to:',
(String with: Character cr), (String with: Character cr),
(String with: Character cr), (String with: Character cr),
'http://mutabit.com/grafoscopio'; 'http://mutabit.com/grafoscopio';
title: 'About Grafoscopio'; title: 'About Grafoscopio';
open. open.
] ]
{ #category : #'graphical interface' } { #category : #'graphical interface' }
GfUIHelpers class >> messageNoRecentDocuments [ GfUIHelpers class >> messageNoRecentDocuments [
"Shows that a feature is not implemeted and point to further documentation on the web" "Shows that a feature is not implemeted and point to further documentation on the web"
UIManager default abort: UIManager default abort:
'Recent documents list is emtpy.', 'Recent documents list is emtpy.',
(String with: Character cr), (String with: Character cr),
'To fill it, open a document using the Grafoscopio menu option at the top bar:', 'To fill it, open a document using the Grafoscopio menu option at the top bar:',
(String with: Character cr), (String with: Character cr),
(String with: Character cr), (String with: Character cr),
'"Launch > Notebook from file..."', '"Launch > Notebook from file..."',
(String with: Character cr), (String with: Character cr),
(String with: Character cr) (String with: Character cr)
title: 'No recent documents'. title: 'No recent documents'.
] ]
{ #category : #'graphical interface' } { #category : #'graphical interface' }
GfUIHelpers class >> messageNotImplementedYet [ GfUIHelpers class >> messageNotImplementedYet [
"Shows that a feature is not implemeted and point to further documentation on the web" "Shows that a feature is not implemeted and point to further documentation on the web"
UIManager default abort: UIManager default abort:
'This functionality is not implemented yet!', 'This functionality is not implemented yet!',
(String with: Character cr), (String with: Character cr),
'For more information about future releases, please visit: ', 'For more information about future releases, please visit: ',
(String with: Character cr), (String with: Character cr),
(String with: Character cr), (String with: Character cr),
'http://mutabit.com/grafoscopio', 'http://mutabit.com/grafoscopio',
(String with: Character cr), (String with: Character cr),
(String with: Character cr) (String with: Character cr)
title: 'To be implemented'. title: 'To be implemented'.
] ]
{ #category : #'graphical interface' } { #category : #'graphical interface' }
GfUIHelpers class >> openFromRecentlyUsed [ GfUIHelpers class >> openFromRecentlyUsed [
"Opens a recent notebooks list" "Opens a recent notebooks list"
| selection recentNotebooksReversed | | selection recentNotebooksReversed |
self recentNotebooks self recentNotebooks
ifNotEmpty: [ ifNotEmpty: [
recentNotebooksReversed := recentNotebooks reversed. recentNotebooksReversed := recentNotebooks reversed.
selection := UIManager default selection := UIManager default
chooseFrom: recentNotebooksReversed title: 'Choose a notebook...'. chooseFrom: recentNotebooksReversed title: 'Choose a notebook...'.
selection > 0 selection > 0
ifTrue: [ GrafoscopioNotebook new openFromFile: (recentNotebooksReversed at: selection)] ifTrue: [ GrafoscopioNotebook new openFromFile: (recentNotebooksReversed at: selection)]
ifFalse: [ self inform: 'No notebook selected!' ] ifFalse: [ self inform: 'No notebook selected!' ]
] ]
ifEmpty: [self messageNoRecentDocuments] ifEmpty: [self messageNoRecentDocuments]
] ]
{ #category : #accessing } { #category : #accessing }
GfUIHelpers class >> recentNotebooks [ GfUIHelpers class >> recentNotebooks [
^ recentNotebooks ifNil: [recentNotebooks := OrderedCollection new ] ^ recentNotebooks ifNil: [recentNotebooks := OrderedCollection new ]
] ]
{ #category : #updating } { #category : #updating }
GfUIHelpers class >> updateDataviz [ GfUIHelpers class >> updateDataviz [
"I update the Dataviz package with new versions of itself take from the source code "I update the Dataviz package with new versions of itself take from the source code
repository. repository.
DataViz contains Data visualization helpers" DataViz contains Data visualization helpers"
self isDatavizInstalled self isDatavizInstalled
ifFalse: [ self installDatavizUI ] ifFalse: [ self installDatavizUI ]
ifTrue: [ ifTrue: [
Gofer it Gofer it
smalltalkhubUser: 'Offray' project: 'Dataviz'; smalltalkhubUser: 'Offray' project: 'Dataviz';
configurationOf: 'Dataviz'; configurationOf: 'Dataviz';
load. load.
self inform: 'Dataviz package update finished.']. self inform: 'Dataviz package update finished.'].
] ]
{ #category : #updating } { #category : #updating }
GfUIHelpers class >> updateDatavizUI [ GfUIHelpers class >> updateDatavizUI [
"I'm the User Interface for updating the Dataviz package with new versions of itself "I'm the User Interface for updating the Dataviz package with new versions of itself
take from the source code repository" take from the source code repository"
| update | | update |
update := (UIManager default update := (UIManager default
confirm: confirm:
'Dataviz is data visualization package, with several', String cr, 'Dataviz is data visualization package, with several', String cr,
'Domain Specific Examples, like Panama Papers, Twitter Data Selfies.', 'Domain Specific Examples, like Panama Papers, Twitter Data Selfies.',
String cr, 'Do you want to update it?' String cr, 'Do you want to update it?'
label: 'Update Dataviz package'). label: 'Update Dataviz package').
update ifFalse: [ ^ self ]. update ifFalse: [ ^ self ].
self updateDataviz self updateDataviz
] ]
{ #category : #updating } { #category : #updating }
GfUIHelpers class >> updateGrafoscopio [ GfUIHelpers class >> updateGrafoscopio [
"Updates Grafoscopio with new versions of itself take from the source code repository and "Updates Grafoscopio with new versions of itself take from the source code repository and
reloads the User Interface" reloads the User Interface"
Gofer new Gofer new
smalltalkhubUser: 'Offray' project: 'Grafoscopio'; smalltalkhubUser: 'Offray' project: 'Grafoscopio';
package: 'Grafoscopio'; package: 'Grafoscopio';
load. load.
GrafoscopioUtils update. GrafoscopioUtils update.
] ]
{ #category : #updating } { #category : #updating }
GfUIHelpers class >> updateGrafoscopioUI [ GfUIHelpers class >> updateGrafoscopioUI [
"Updates Grafoscopio with new versions of itself take from the source code repository and "Updates Grafoscopio with new versions of itself take from the source code repository and
the User Interface" the User Interface"
| update | | update |
update := (UIManager default update := (UIManager default
confirm: 'Do you wish to update Grafoscopio?' confirm: 'Do you wish to update Grafoscopio?'
label: 'Grafoscopio update'). label: 'Grafoscopio update').
update ifFalse: [ ^ self ]. update ifFalse: [ ^ self ].
self updateGrafoscopio. self updateGrafoscopio.
GrafoscopioUtils update. GrafoscopioUtils update.
self updateUI. self updateUI.
self inform: 'Grafoscopio update finished' self inform: 'Grafoscopio update finished'
] ]
{ #category : #updating } { #category : #updating }
GfUIHelpers class >> updatePrerrequisitesScript [ GfUIHelpers class >> updatePrerrequisitesScript [
"Updates the system prerequisites with new versions of itself take from the source code repository" "Updates the system prerequisites with new versions of itself take from the source code repository"
"Visualization library (which also makes main menu loadable)" "Visualization library (which also makes main menu loadable)"
Gofer it Gofer it
smalltalkhubUser: 'ObjectProfile' project: 'Roassal2'; smalltalkhubUser: 'ObjectProfile' project: 'Roassal2';
configurationOf: 'Roassal2'; configurationOf: 'Roassal2';
loadStable. loadStable.
"Support for the STON format used in file persistance for grafoscopio notebooks" "Support for the STON format used in file persistance for grafoscopio notebooks"
Gofer new Gofer new
smalltalkhubUser: 'SvenVanCaekenberghe' project: 'STON'; smalltalkhubUser: 'SvenVanCaekenberghe' project: 'STON';
configurationOf: 'Ston'; configurationOf: 'Ston';
loadBleedingEdge. loadBleedingEdge.
"Moose and Roassal integration" "Moose and Roassal integration"
Gofer new Gofer new
smalltalkhubUser: 'Moose' project: 'Glamour'; smalltalkhubUser: 'Moose' project: 'Glamour';
package: 'Glamour-Tools'; package: 'Glamour-Tools';
package: 'Glamour-Roassal2-Presentations'; package: 'Glamour-Roassal2-Presentations';
load. load.
Gofer new Gofer new
smalltalkhubUser: 'Moose' project: 'GToolkit'; smalltalkhubUser: 'Moose' project: 'GToolkit';
package: 'GT-InspectorExtensions-CoreRoassal'; package: 'GT-InspectorExtensions-CoreRoassal';
load. load.
"Fast Table support" "Fast Table support"
Gofer it Gofer it
smalltalkhubUser: 'estebanlm' project: 'FastTable'; smalltalkhubUser: 'estebanlm' project: 'FastTable';
package: 'FastTable'; package: 'FastTable';
load. load.
"Integration with external tools" "Integration with external tools"
Gofer new Gofer new
smalltalkhubUser: 'Offray' project: 'Grafoscopio'; smalltalkhubUser: 'Offray' project: 'Grafoscopio';
package: 'Grafoscopio-ExternalTools'; package: 'Grafoscopio-ExternalTools';
load. load.
"HTML scrapping" "HTML scrapping"
Gofer new Gofer new
smalltalkhubUser: 'PharoExtras' project: 'Soup'; smalltalkhubUser: 'PharoExtras' project: 'Soup';
configurationOf: 'Soup'; configurationOf: 'Soup';
loadStable. loadStable.
"SQLite support" "SQLite support"
Gofer new Gofer new
url: 'http://smalltalkhub.com/mc/PharoExtras/NBSQLite3/main'; url: 'http://smalltalkhub.com/mc/PharoExtras/NBSQLite3/main';
package: 'NBSQLite3'; package: 'NBSQLite3';
load. load.
Gofer new Gofer new
url: 'http://smalltalkhub.com/mc/PharoExtras/NBSQLite3/main'; url: 'http://smalltalkhub.com/mc/PharoExtras/NBSQLite3/main';
package: 'NBSQLite3-Examples'; package: 'NBSQLite3-Examples';
load. load.
"Support for Operative System integration" "Support for Operative System integration"
Gofer new Gofer new
squeaksource: 'OSProcess'; squeaksource: 'OSProcess';
package: 'OSProcess'; package: 'OSProcess';
load. load.
Gofer new Gofer new
squeaksource: 'CommandShell'; squeaksource: 'CommandShell';
package: 'CommandShell-Piping'; package: 'CommandShell-Piping';
load. load.
"Bibliographic support" "Bibliographic support"
Gofer new Gofer new
squeaksource: 'Citezen'; squeaksource: 'Citezen';
package: 'ConfigurationOfCitezen'; package: 'ConfigurationOfCitezen';
load. load.
] ]
{ #category : #updating } { #category : #updating }
GfUIHelpers class >> updateRecentNotebooksWith: aFileReference [ GfUIHelpers class >> updateRecentNotebooksWith: aFileReference [
(self recentNotebooks includes: aFileReference) (self recentNotebooks includes: aFileReference)
ifFalse: [self recentNotebooks add: aFileReference]. ifFalse: [self recentNotebooks add: aFileReference].
] ]
{ #category : #updating } { #category : #updating }
GfUIHelpers class >> updateSystem [ GfUIHelpers class >> updateSystem [
| tmp1 | | tmp1 |
tmp1 := UIManager default tmp1 := UIManager default
question: 'Do you wish to update all Grafoscopio and its co-dependencies ?' question: 'Do you wish to update all Grafoscopio and its co-dependencies ?'
title: 'Grafoscopio update'. title: 'Grafoscopio update'.
tmp1 tmp1
ifNotNil: [ tmp1 ifNotNil: [ tmp1
ifTrue: [ ifTrue: [
self self
updateGrafoscopio; updateGrafoscopio;
updateDataviz. updateDataviz.
GrafoscopioDocumentation updateAll. GrafoscopioDocumentation updateAll.
self inform: 'System update finished.' ]] self inform: 'System update finished.' ]]
] ]
{ #category : #updating } { #category : #updating }
GfUIHelpers class >> updateUI [ GfUIHelpers class >> updateUI [
"I update the User Interface (UI) with new versions of the docking bar or logos where available. "I update the User Interface (UI) with new versions of the docking bar or logos where available.
I'm helpful while testing new functionality that should be expossed to the user via the UI" I'm helpful while testing new functionality that should be expossed to the user via the UI"
self start. self start.
(World submorphs select: [ :each | each class = DockingBarMorph ]) (World submorphs select: [ :each | each class = DockingBarMorph ])
allButFirstDo: [ :bar | bar delete ]. allButFirstDo: [ :bar | bar delete ].
] ]

View File

@ -1,165 +1,182 @@
" "
I define the Grafoscopio main menu presented in the Pharo World. I define the Grafoscopio main menu presented in the Pharo World.
" "
Class { Class {
#name : #GfWorldMenu, #name : #GfWorldMenu,
#superclass : #Object, #superclass : #Object,
#classInstVars : [ #classInstVars : [
'recentNotebooks' 'recentNotebooks'
], ],
#category : #'Grafoscopio-UI' #category : #'Grafoscopio-UI'
} }
{ #category : #'world menu' } { #category : #'world menu' }
GfWorldMenu class >> helpMenuOn: aBuilder [ GfWorldMenu class >> getProjectExample [
<worldMenu> | project unit |
project := GrafoscopioProject new.
(aBuilder item: #GfManual) unit := GrafoscopioUnitNode new.
label: 'Manual'; unit name: 'Pillar-Example'.
order: 1; unit
parent: #GfHelpAndDocs; addChild: [ GrafoscopioPillarNode new
action: [ GrafoscopioNotebook open: GrafoscopioDocs manual ]. text: GrafoscopioPillarASText openExample;
(aBuilder item: #GfManualPDF) yourself ]
label: 'Manual (PDF)'; ofClass: GrafoscopioPillarNode.
order: 2; project document addChild: unit ofClass: GrafoscopioUnitNode.
parent: #GfHelpAndDocs; ^ project
action: [ GrafoscopioDocs openPDFManual ]. ]
(aBuilder item: #GfHelpDataviz)
label: 'Dataviz'; { #category : #'world menu' }
order: 3; GfWorldMenu class >> getProjectFromFile [
parent: #GfHelpAndDocs; | file |
action: [ GrafoscopioNotebook open: DatavizDocs introNotebook ]. file := UIManager default
(aBuilder item: #GfHelpDevNotes) chooseExistingFileReference: 'Choose a file'
label: 'Devs''s notes'; extensions: #('ston')
order: 4; path: FileLocator documents.
parent: #GfHelpAndDocs; ^ (STON fromStream: file readStream)
action: [ GrafoscopioNotebook open: GrafoscopioDocs devNotes ]. ]
(aBuilder item: #GfHelpAbout)
label: 'About Grafoscopio'; { #category : #'world menu' }
order: 5; GfWorldMenu class >> helpMenuOn: aBuilder [
parent: #GfHelpAndDocs; <worldMenu>
action: [ GfUIHelpers messageAbout ].
] (aBuilder item: #GfManual)
label: 'Manual';
{ #category : #'world menu' } order: 1;
GfWorldMenu class >> launchCompatibilityMenuOn: aBuilder [ parent: #GfHelpAndDocs;
<worldMenu> action: [ GrafoscopioNotebook open: GrafoscopioDocs manual ].
(aBuilder item: #GfManualPDF)
(aBuilder item: #'New notebook') label: 'Manual (PDF)';
label: 'New notebook'; order: 2;
order: 1; parent: #GfHelpAndDocs;
parent: #GfLaunchCompatibility; action: [ GrafoscopioDocs openPDFManual ].
action: [ GrafoscopioNotebook new openDefault ]. (aBuilder item: #GfHelpDataviz)
(aBuilder item: #'Notebook from file...') label: 'Dataviz';
label: 'Notebook from file...'; order: 3;
order: 2; parent: #GfHelpAndDocs;
parent: #GfLaunchCompatibility; action: [ GrafoscopioNotebook open: DatavizDocs introNotebook ].
action: [ GrafoscopioNotebook new openFromFileSelector ]. (aBuilder item: #GfHelpDevNotes)
(aBuilder item: #'Notebook from the Internet...') label: 'Devs''s notes';
label: 'Notebook from the Internet...'; order: 4;
order: 3; parent: #GfHelpAndDocs;
parent: #GfLaunchCompatibility; action: [ GrafoscopioNotebook open: GrafoscopioDocs devNotes ].
action: [ GrafoscopioNotebook new openFromUrlUI ]. (aBuilder item: #GfHelpAbout)
(aBuilder item: #recentNotebooks) label: 'About Grafoscopio';
label: 'Recent notebooks...'; order: 5;
order: 4; parent: #GfHelpAndDocs;
parent: #GfLaunchCompatibility; action: [ GfUIHelpers messageAbout ].
action: [ GfUIHelpers openFromRecentlyUsed ] ]
]
{ #category : #'world menu' }
{ #category : #'world menu' } GfWorldMenu class >> launchCompatibilityMenuOn: aBuilder [
GfWorldMenu class >> launchMenuOn: aBuilder [ <worldMenu>
<worldMenu>
(aBuilder item: #'New notebook')
(aBuilder item: #'New notebook') label: 'New notebook';
label: 'New notebook'; order: 1;
order: 1; parent: #GfLaunchCompatibility;
parent: #GfLaunch; action: [ GrafoscopioNotebook new openDefault ].
action: [ GrafoscopioNewNotebook new openDefault ]. (aBuilder item: #'Notebook from file...')
(aBuilder item: #'Notebook from file...') label: 'Notebook from file...';
label: 'Notebook from file...'; order: 2;
order: 2; parent: #GfLaunchCompatibility;
parent: #GfLaunch; action: [ GrafoscopioNotebook new openFromFileSelector ].
action: [ GrafoscopioNewNotebook new openFromFileSelector ]. (aBuilder item: #'Notebook from the Internet...')
(aBuilder item: #GfLaunchOpenRecent) label: 'Notebook from the Internet...';
label: 'Open recent...'; order: 3;
order: 2; parent: #GfLaunchCompatibility;
parent: #GfLaunch. action: [ GrafoscopioNotebook new openFromUrlUI ].
(aBuilder item: #'Notebook from the Internet...') (aBuilder item: #recentNotebooks)
label: 'Notebook from the Internet...'; label: 'Recent notebooks...';
order: 3; order: 4;
parent: #GfLaunch; parent: #GfLaunchCompatibility;
action: [ GrafoscopioNewNotebook new openFromUrlUI ]. action: [ GfUIHelpers openFromRecentlyUsed ]
(aBuilder item: #recentNotebooks) ]
label: 'Recent notebooks...';
order: 4; { #category : #'world menu' }
parent: #GfLaunch; GfWorldMenu class >> launchMenuOn: aBuilder [
action: [ GfUIHelpers openFromRecentlyUsed ] <worldMenu>
]
(aBuilder item: #'New notebook')
{ #category : #'world menu' } label: 'New notebook';
GfWorldMenu class >> mainMenuItemsOn: aBuilder [ order: 1;
"I add the main Grafoscopio menu to the Pharo World." parent: #GfLaunch;
action: [ (GrafoscopioTreeNotebook on: GrafoscopioProject new ) openWithSpec ].
<worldMenu> (aBuilder item: #'New Notebook from example ')
(aBuilder item: #Grafoscopio) label: 'Notebook from from example ';
label: 'Grafoscopio'; order: 2;
order: 1; parent: #GfLaunch;
with: [ (aBuilder action: [ (GrafoscopioTreeNotebook on: (self getProjectExample)) openWithSpec ].
item: #GfLaunch; (aBuilder item: #'Notebook from file...')
label: 'Launch') target: self. label: 'Notebook from file...';
(aBuilder order: 2;
item: #GfLaunchCompatibility; parent: #GfLaunch;
label: 'Launch Compatibility') target: self. action: [ (GrafoscopioTreeNotebook on: (self getProjectFromFile)) openWithSpec ].
(aBuilder (aBuilder item: #GfLaunchOpenRecent)
item: #GfUpdate; label: 'Open recent...';
label: 'Update') target: self. order: 2;
(aBuilder parent: #GfLaunch.
item: #GfHelpAndDocs; (aBuilder item: #'Notebook from the Internet...')
label: 'Help & Docs') target: self ] label: 'Notebook from the Internet...';
] order: 3;
parent: #GfLaunch;
{ #category : #'world menu' } action: [ GrafoscopioTreeNotebook new openFromUrlUI ].
GfWorldMenu class >> openRecentMenu: aBuilder [ (aBuilder item: #recentNotebooks)
<worldMenu> label: 'Recent notebooks...';
order: 4;
GrafoscopioNotebook recents parent: #GfLaunch;
do: [ :f | action: [ GfUIHelpers openFromRecentlyUsed ]
(aBuilder item: #'Open', f basename ) ]
label: 'Open ', f basename;
order: 1; { #category : #'world menu' }
parent: #GfLaunchOpenRecent; GfWorldMenu class >> mainMenuItemsOn: aBuilder [
action: [ GrafoscopioNotebook open: f ] ] "I add the main Grafoscopio menu to the Pharo World."
]
<worldMenu>
{ #category : #'world menu' } (aBuilder item: #Grafoscopio)
GfWorldMenu class >> updateMenuOn: aBuilder [ label: 'Grafoscopio';
<worldMenu> order: 1;
with: [ (aBuilder
(aBuilder item: #GfUpdateGrafoscopio) item: #GfLaunch;
label: 'Grafoscopio'; label: 'Launch') target: self.
order: 1; (aBuilder
parent: #GfUpdate; item: #GfLaunchCompatibility;
action: [ GfUIHelpers updateGrafoscopioUI ]. label: 'Launch Compatibility') target: self.
(aBuilder item: #GfUpdateDocs) (aBuilder
label: 'Documentation'; item: #GfUpdate;
order: 2; label: 'Update') target: self.
parent: #GfUpdate; (aBuilder
action: [ GrafoscopioDocumentation updateAllUI ]. item: #GfHelpAndDocs;
(aBuilder item: #GfUpdateDataviz) label: 'Help & Docs') target: self ]
label: 'DataViz package'; ]
order: 3;
parent: #GfUpdate; { #category : #'world menu' }
action: [ GfUIHelpers updateDatavizUI ]. GfWorldMenu class >> updateMenuOn: aBuilder [
(aBuilder item: #GfUpdateAll) <worldMenu>
label: 'All the system';
order: 4; (aBuilder item: #GfUpdateGrafoscopio)
parent: #GfUpdate; label: 'Grafoscopio';
action: [ GfUIHelpers updateSystem ]. order: 1;
] parent: #GfUpdate;
action: [ GfUIHelpers updateGrafoscopioUI ].
{ #category : #updating } (aBuilder item: #GfUpdateDocs)
GfWorldMenu class >> updateRecentNotebooksWith: aFileReference [ label: 'Documentation';
(self recentNotebooks includes: aFileReference) order: 2;
ifFalse: [self recentNotebooks add: aFileReference]. parent: #GfUpdate;
] action: [ GrafoscopioDocumentation updateAllUI ].
(aBuilder item: #GfUpdateDataviz)
label: 'DataViz package';
order: 3;
parent: #GfUpdate;
action: [ GfUIHelpers updateDatavizUI ].
(aBuilder item: #GfUpdateAll)
label: 'All the system';
order: 4;
parent: #GfUpdate;
action: [ GfUIHelpers updateSystem ].
]
{ #category : #updating }
GfWorldMenu class >> updateRecentNotebooksWith: aFileReference [
(self recentNotebooks includes: aFileReference)
ifFalse: [self recentNotebooks add: aFileReference].
]

View File

@ -1,79 +1,79 @@
" "
I am a Spec ComposableModel for all Glamour presentations (GLMPresentation subclasses.) By default I open a Playground because its creation contract is special. I am a Spec ComposableModel for all Glamour presentations (GLMPresentation subclasses.) By default I open a Playground because its creation contract is special.
Example uses : Example uses :
""open a playground"" ""open a playground""
GlamourPresentationModel new openWithSpec. GlamourPresentationModel new openWithSpec.
""open a playground on 42"" ""open a playground on 42""
|ui| |ui|
ui := GlamourPresentationModel new. ui := GlamourPresentationModel new.
ui presentationClass: GTPlayground startOn: (GTPlayPage new saveContent: '42'). ui presentationClass: GTPlayground startOn: (GTPlayPage new saveContent: '42').
ui openWithSpec ui openWithSpec
""open an inspector on 42"" ""open an inspector on 42""
|ui| |ui|
ui := GlamourPresentationModel new. ui := GlamourPresentationModel new.
ui presentationClass: GTInspector startOn: 42. ui presentationClass: GTInspector startOn: 42.
ui openWithSpec ui openWithSpec
" "
Class { Class {
#name : #GlamourPresentationModel, #name : #GlamourPresentationModel,
#superclass : #SpPresenter, #superclass : #SpPresenter,
#instVars : [ #instVars : [
'presentation', 'presentation',
'glmPres' 'glmPres'
], ],
#category : #'Grafoscopio-UI' #category : #'Grafoscopio-UI'
} }
{ #category : #specs } { #category : #specs }
GlamourPresentationModel class >> defaultSpec [ GlamourPresentationModel class >> defaultSpec [
<spec: #default> <spec: #default>
^ SpBoxLayout newHorizontal ^ SpBoxLayout newHorizontal
add: #presentation; add: #presentation;
yourself yourself
] ]
{ #category : #deprecation } { #category : #deprecation }
GlamourPresentationModel class >> isDeprecated [ GlamourPresentationModel class >> isDeprecated [
^ true ^ true
] ]
{ #category : #accessing } { #category : #accessing }
GlamourPresentationModel >> glmPres [ GlamourPresentationModel >> glmPres [
glmPres isNil ifTrue:[glmPres := GTPlayground new startOn: GTPlayPage new]. glmPres isNil ifTrue:[glmPres := GTPlayground new startOn: GTPlayPage new].
^glmPres ^glmPres
] ]
{ #category : #initialization } { #category : #initialization }
GlamourPresentationModel >> initializeWidgets [ GlamourPresentationModel >> initializeWidgets [
"Should actually do nothing at all. "Should actually do nothing at all.
This is because we cannot create the morph and later set the presentation. This is because we cannot create the morph and later set the presentation.
So we will do all of this in the presentation: accessor. So we will do all of this in the presentation: accessor.
" "
self presentation. self presentation.
] ]
{ #category : #accessing } { #category : #accessing }
GlamourPresentationModel >> presentation [ GlamourPresentationModel >> presentation [
presentation isNil ifTrue:[ presentation isNil ifTrue:[
| morph | | morph |
morph := GLMMorphicRenderer new render: self glmPres. morph := GLMMorphicRenderer new render: self glmPres.
morph hResizing: #spaceFill. morph hResizing: #spaceFill.
morph vResizing: #spaceFill. morph vResizing: #spaceFill.
presentation := MorphicGenericAdapter morph: morph]. presentation := MorphicGenericAdapter morph: morph].
^ presentation ^ presentation
] ]
{ #category : #accessing } { #category : #accessing }
GlamourPresentationModel >> presentation: anObject [ GlamourPresentationModel >> presentation: anObject [
presentation := anObject presentation := anObject
] ]
{ #category : #api } { #category : #api }
GlamourPresentationModel >> presentationClass: aGLMCompositePresentation startOn: anObject [ GlamourPresentationModel >> presentationClass: aGLMCompositePresentation startOn: anObject [
glmPres := aGLMCompositePresentation new startOn: anObject glmPres := aGLMCompositePresentation new startOn: anObject
] ]

View File

@ -1,9 +1,9 @@
Extension { #name : #GrafPort } Extension { #name : #GrafPort }
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
GrafPort >> gfcDisplayScannerFor: para foreground: foreColor background: backColor ignoreColorChanges: shadowMode [ GrafPort >> gfcDisplayScannerFor: para foreground: foreColor background: backColor ignoreColorChanges: shadowMode [
^ (GrafoscopioDisplayScanner new text: para text textStyle: para textStyle ^ (GrafoscopioDisplayScanner new text: para text textStyle: para textStyle
foreground: foreColor background: backColor fillBlt: self foreground: foreColor background: backColor fillBlt: self
ignoreColorChanges: shadowMode) ignoreColorChanges: shadowMode)
setPort: self shallowCopy setPort: self shallowCopy
] ]

View File

@ -1,134 +1,134 @@
" "
Just an abstract node. Just an abstract node.
" "
Class { Class {
#name : #GrafoscopioAbstractNode, #name : #GrafoscopioAbstractNode,
#superclass : #Object, #superclass : #Object,
#instVars : [ #instVars : [
'created', 'created',
'edited', 'edited',
'tags', 'tags',
'order', 'order',
'name' 'name'
], ],
#classInstVars : [ #classInstVars : [
'clipboard' 'clipboard'
], ],
#category : #'Grafoscopio-Model' #category : #'Grafoscopio-Model'
} }
{ #category : #testing } { #category : #testing }
GrafoscopioAbstractNode class >> isAbstract [ GrafoscopioAbstractNode class >> isAbstract [
^ self = GrafoscopioAbstractNode ^ self = GrafoscopioAbstractNode
] ]
{ #category : #testing } { #category : #testing }
GrafoscopioAbstractNode class >> isLeaf [ GrafoscopioAbstractNode class >> isLeaf [
^ false ^ false
] ]
{ #category : #testing } { #category : #testing }
GrafoscopioAbstractNode class >> showInMenu [ GrafoscopioAbstractNode class >> showInMenu [
^ false ^ false
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractNode >> addChild: aBlock ofClass: aClass [ GrafoscopioAbstractNode >> addChild: aBlock ofClass: aClass [
self subclassResponsibility self subclassResponsibility
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractNode >> addTag: aTag [ GrafoscopioAbstractNode >> addTag: aTag [
"Tags the recipient node with aTag (string). For the moment we will have only one tag. "Tags the recipient node with aTag (string). For the moment we will have only one tag.
In the future we will have several and there will be rules to know how tags interact with In the future we will have several and there will be rules to know how tags interact with
each other" each other"
self tags add: aTag self tags add: aTag
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractNode >> created [ GrafoscopioAbstractNode >> created [
^ created ^ created
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractNode >> created: aTimestamp [ GrafoscopioAbstractNode >> created: aTimestamp [
"I tell when this object was created" "I tell when this object was created"
created := aTimestamp created := aTimestamp
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractNode >> edited [ GrafoscopioAbstractNode >> edited [
^ edited ^ edited
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractNode >> edited: aTimestamp [ GrafoscopioAbstractNode >> edited: aTimestamp [
"I store the last time when a node was edited. "I store the last time when a node was edited.
Because nodes in the notebook have a autosave feature, I'm updated automatically when nodes are Because nodes in the notebook have a autosave feature, I'm updated automatically when nodes are
edited from the GUI. edited from the GUI.
If I'm in the notebook root (i.e. node's level equals 0) I should store the last time the notebook If I'm in the notebook root (i.e. node's level equals 0) I should store the last time the notebook
was saved on the hard drive." was saved on the hard drive."
edited := aTimestamp edited := aTimestamp
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractNode >> initialize [ GrafoscopioAbstractNode >> initialize [
"I create a empty new node" "I create a empty new node"
super initialize. super initialize.
created := DateAndTime now. created := DateAndTime now.
edited := DateAndTime now edited := DateAndTime now
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractNode >> isLeaf [ GrafoscopioAbstractNode >> isLeaf [
^ self class isLeaf ^ self class isLeaf
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioAbstractNode >> moveDown [ GrafoscopioAbstractNode >> moveDown [
self subclassResponsibility self subclassResponsibility
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractNode >> name [ GrafoscopioAbstractNode >> name [
^ name ^ name
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractNode >> name: aName [ GrafoscopioAbstractNode >> name: aName [
name := aName name := aName
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioAbstractNode >> order [ GrafoscopioAbstractNode >> order [
^ order ifNil: [ 0 ] ^ order ifNil: [ 0 ]
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractNode >> tagAs: aTag [ GrafoscopioAbstractNode >> tagAs: aTag [
self self
error: error:
'tags are not used as markers anymore. Use addTag: instead and ensure you are not relying on text/codigo etc.' 'tags are not used as markers anymore. Use addTag: instead and ensure you are not relying on text/codigo etc.'
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractNode >> tags [ GrafoscopioAbstractNode >> tags [
"I returns the receiver tags." "I returns the receiver tags."
^ tags ifNil: [ tags := Set new ] ^ tags ifNil: [ tags := Set new ]
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractNode >> tags: aCollection [ GrafoscopioAbstractNode >> tags: aCollection [
tags := aCollection tags := aCollection
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioAbstractNode >> updateStamp [ GrafoscopioAbstractNode >> updateStamp [
self edited: DateAndTime now self edited: DateAndTime now
] ]

View File

@ -1,128 +1,128 @@
" "
This abstract class works for defining the basic type required by Rubric This abstract class works for defining the basic type required by Rubric
" "
Class { Class {
#name : #GrafoscopioAbstractText, #name : #GrafoscopioAbstractText,
#superclass : #Object, #superclass : #Object,
#category : #'Grafoscopio-Pillar' #category : #'Grafoscopio-Pillar'
} }
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioAbstractText >> allRangesOfSubstring: aString [ GrafoscopioAbstractText >> allRangesOfSubstring: aString [
^ { } ^ { }
] ]
{ #category : #converting } { #category : #converting }
GrafoscopioAbstractText >> asText [ GrafoscopioAbstractText >> asText [
^ self ^ self
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractText >> at: anIndex [ GrafoscopioAbstractText >> at: anIndex [
^ self subclassResponsibility ^ self subclassResponsibility
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractText >> attributesAt: characterIndex [ GrafoscopioAbstractText >> attributesAt: characterIndex [
"Answer the code for characters in the run beginning at characterIndex." "Answer the code for characters in the run beginning at characterIndex."
"NB: no senders any more (supplanted by #attributesAt:forStyle: but retained for the moment in order not to break user code that may exist somewhere that still calls this" "NB: no senders any more (supplanted by #attributesAt:forStyle: but retained for the moment in order not to break user code that may exist somewhere that still calls this"
| attributes | | attributes |
" self size = 0 " self size = 0
ifTrue: [^ Array with: (TextFontChange new fontNumber: 1)]." ifTrue: [^ Array with: (TextFontChange new fontNumber: 1)]."
self size = 0 ifTrue: [ ^#()]. self size = 0 ifTrue: [ ^#()].
attributes := self runs at: characterIndex. attributes := self runs at: characterIndex.
^ attributes ^ attributes
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractText >> attributesAt: anInteger forStyle: aTextStyle [ GrafoscopioAbstractText >> attributesAt: anInteger forStyle: aTextStyle [
| attributes size | | attributes size |
size := self size. size := self size.
(size = 0 or: [ size < anInteger ]) (size = 0 or: [ size < anInteger ])
ifTrue: [ ^ Array ifTrue: [ ^ Array
with: (TextFontChange new fontNumber: aTextStyle defaultFontIndex) ]. "null text tolerates access" with: (TextFontChange new fontNumber: aTextStyle defaultFontIndex) ]. "null text tolerates access"
attributes := self runs at: anInteger. attributes := self runs at: anInteger.
^ attributes ^ attributes
] ]
{ #category : #copying } { #category : #copying }
GrafoscopioAbstractText >> copy [ GrafoscopioAbstractText >> copy [
^ self ^ self
] ]
{ #category : #copying } { #category : #copying }
GrafoscopioAbstractText >> copyFrom: start to: stop [ GrafoscopioAbstractText >> copyFrom: start to: stop [
^ self subclassResponsibility ^ self subclassResponsibility
] ]
{ #category : #testing } { #category : #testing }
GrafoscopioAbstractText >> ifNotEmpty: isNotEmptyBlock ifEmpty: isEmptyBlock [ GrafoscopioAbstractText >> ifNotEmpty: isNotEmptyBlock ifEmpty: isEmptyBlock [
^ self isEmpty ^ self isEmpty
ifTrue: [ isEmptyBlock value ] ifTrue: [ isEmptyBlock value ]
ifFalse: [ isNotEmptyBlock value ] ifFalse: [ isNotEmptyBlock value ]
] ]
{ #category : #testing } { #category : #testing }
GrafoscopioAbstractText >> isEmpty [ GrafoscopioAbstractText >> isEmpty [
^ self size = 0 ^ self size = 0
] ]
{ #category : #testing } { #category : #testing }
GrafoscopioAbstractText >> isText [ GrafoscopioAbstractText >> isText [
^ true ^ true
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractText >> last [ GrafoscopioAbstractText >> last [
^ self at: self size ^ self at: self size
] ]
{ #category : #copying } { #category : #copying }
GrafoscopioAbstractText >> notEmpty [ GrafoscopioAbstractText >> notEmpty [
^ self isEmpty not ^ self isEmpty not
] ]
{ #category : #removing } { #category : #removing }
GrafoscopioAbstractText >> removeAttribute: anAttr [ GrafoscopioAbstractText >> removeAttribute: anAttr [
^ self removeAttribute: anAttr from: 1 to: self size ^ self removeAttribute: anAttr from: 1 to: self size
] ]
{ #category : #removing } { #category : #removing }
GrafoscopioAbstractText >> removeAttribute: att from: start to: stop [ GrafoscopioAbstractText >> removeAttribute: att from: start to: stop [
self subclassResponsibility self subclassResponsibility
] ]
{ #category : #editing } { #category : #editing }
GrafoscopioAbstractText >> replaceFrom: anInteger to: anInteger2 with: aCollection [ GrafoscopioAbstractText >> replaceFrom: anInteger to: anInteger2 with: aCollection [
self subclassResponsibility self subclassResponsibility
] ]
{ #category : #emphasis } { #category : #emphasis }
GrafoscopioAbstractText >> runLengthFor: characterIndex [ GrafoscopioAbstractText >> runLengthFor: characterIndex [
^ self runs runLengthFor: characterIndex ^ self runs runLengthFor: characterIndex
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractText >> runs [ GrafoscopioAbstractText >> runs [
self subclassResponsibility self subclassResponsibility
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractText >> runs: anArray [ GrafoscopioAbstractText >> runs: anArray [
self subclassResponsibility "runs := RunArray new: self size withAll: anArray . " self subclassResponsibility "runs := RunArray new: self size withAll: anArray . "
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractText >> size [ GrafoscopioAbstractText >> size [
^ self string size ^ self string size
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractText >> string [ GrafoscopioAbstractText >> string [
^ self subclassResponsibility ^ self subclassResponsibility
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAbstractText >> text: aParam [ GrafoscopioAbstractText >> text: aParam [
self subclassResponsibility self subclassResponsibility
] ]

View File

@ -1,146 +1,160 @@
Class { Class {
#name : #GrafoscopioAttributeBranchVisitor, #name : #GrafoscopioAttributeBranchVisitor,
#superclass : #Object, #superclass : #Object,
#instVars : [ #instVars : [
'attributes', 'attributes',
'level', 'level',
'listLevel', 'listLevel',
'index', 'index',
'text', 'text',
'styler' 'styler'
], ],
#category : #'Grafoscopio-Pillar-Style' #category : #'Grafoscopio-Pillar-Style'
} }
{ #category : #accessing } { #category : #accessing }
GrafoscopioAttributeBranchVisitor >> analyzeBranch: aBranch at: anIndex [ GrafoscopioAttributeBranchVisitor >> analyzeBranch: aBranch at: anIndex [
index := anIndex. index := anIndex.
^ [ aBranch ^ [ aBranch
inject: OrderedCollection new inject: OrderedCollection new
into: [ :attrs :node | into: [ :attrs :node |
node accept: self. node accept: self.
attrs addAll: (self attributesAt: node). attrs addAll: (self attributesAt: node).
attrs ] ] attrs ] ]
ensure: [ index := 0 ] ensure: [ index := 0 ]
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioAttributeBranchVisitor >> attributes [ GrafoscopioAttributeBranchVisitor >> attributes [
^ attributes ^ attributes
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioAttributeBranchVisitor >> attributesAt: aNode [ GrafoscopioAttributeBranchVisitor >> attributesAt: aNode [
^ (attributes detect: [ :a | a first = aNode ]) second ^ (attributes detect: [ :a | a first = aNode ]) second
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioAttributeBranchVisitor >> attributesAt: aNode ifAbsentPut: aBlock [ GrafoscopioAttributeBranchVisitor >> attributesAt: aNode force: aBlock [
^ attributes ^ attributes
detect: [ :a | a first = aNode ] detect: [ :a | a first = aNode ]
ifFound: [ :a | a second ] ifFound: [ :a | a at:2 put: aBlock value ]
ifNone: [ | val | ifNone: [ | val |
val := aBlock value. val := aBlock value.
attributes attributes
add: add:
{aNode. {aNode.
val}. val}.
val ] val ]
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioAttributeBranchVisitor >> index: anIndex [ GrafoscopioAttributeBranchVisitor >> attributesAt: aNode ifAbsentPut: aBlock [
index := anIndex ^ attributes
] detect: [ :a | a first = aNode ]
ifFound: [ :a | a second ]
{ #category : #'as yet unclassified' } ifNone: [ | val |
GrafoscopioAttributeBranchVisitor >> initialize [ val := aBlock value.
attributes := OrderedCollection new. attributes
styler := GrafoscopioPillarStyler defaultStyler. add:
] {aNode.
val}.
{ #category : #'as yet unclassified' } val ]
GrafoscopioAttributeBranchVisitor >> text: aGrafoscopioPillarASText [ ]
text := aGrafoscopioPillarASText
] { #category : #'as yet unclassified' }
GrafoscopioAttributeBranchVisitor >> index: anIndex [
{ #category : #'as yet unclassified' } index := anIndex
GrafoscopioAttributeBranchVisitor >> visitCodeblock: aPRCodeblock [ ]
self
attributesAt: aPRCodeblock { #category : #'as yet unclassified' }
ifAbsentPut: [ styler attributesForCodeBlock: aPRCodeblock at: index ] GrafoscopioAttributeBranchVisitor >> initialize [
] attributes := OrderedCollection new.
styler := GrafoscopioPillarStyler defaultStyler.
{ #category : #'as yet unclassified' } ]
GrafoscopioAttributeBranchVisitor >> visitCommentedLine: aPRCommentedLine [
self attributesAt: aPRCommentedLine ifAbsentPut: [ styler default ] { #category : #'as yet unclassified' }
] GrafoscopioAttributeBranchVisitor >> text: aGrafoscopioPillarASText [
text := aGrafoscopioPillarASText
{ #category : #'as yet unclassified' } ]
GrafoscopioAttributeBranchVisitor >> visitDocument: aPRDocument [
self attributesAt: aPRDocument ifAbsentPut: [ styler attributesForDocument: aPRDocument ] { #category : #'as yet unclassified' }
] GrafoscopioAttributeBranchVisitor >> visitCodeblock: aPRCodeblock [
self
{ #category : #'as yet unclassified' } attributesAt: aPRCodeblock
GrafoscopioAttributeBranchVisitor >> visitExternalLink: aPRExternalLink [ ifAbsentPut: [ styler attributesForCodeBlock: aPRCodeblock at: index ]
self ]
attributesAt: aPRExternalLink
ifAbsentPut: [ styler attributesForExternalLink: aPRExternalLink ] { #category : #'as yet unclassified' }
] GrafoscopioAttributeBranchVisitor >> visitCommentedLine: aPRCommentedLine [
self attributesAt: aPRCommentedLine ifAbsentPut: [ styler default ]
{ #category : #'as yet unclassified' } ]
GrafoscopioAttributeBranchVisitor >> visitFigure: aPRFigure [
self attributesAt: aPRFigure ifAbsentPut: [ styler attributesForFigure: aPRFigure ] { #category : #'as yet unclassified' }
] GrafoscopioAttributeBranchVisitor >> visitDocument: aPRDocument [
self attributesAt: aPRDocument ifAbsentPut: [ styler attributesForDocument: aPRDocument ]
{ #category : #'as yet unclassified' } ]
GrafoscopioAttributeBranchVisitor >> visitFormatText: aGrafoscopioFormatTextNode [
self attributesAt: aGrafoscopioFormatTextNode { #category : #'as yet unclassified' }
ifAbsentPut: [ styler attributesForFormatText: aGrafoscopioFormatTextNode ] GrafoscopioAttributeBranchVisitor >> visitExternalLink: aPRExternalLink [
] self
attributesAt: aPRExternalLink
{ #category : #'as yet unclassified' } ifAbsentPut: [ styler attributesForExternalLink: aPRExternalLink ]
GrafoscopioAttributeBranchVisitor >> visitHeader: aPRHeader [ ]
self
attributesAt: aPRHeader { #category : #'as yet unclassified' }
ifAbsentPut: [ styler attributesForHeader: aPRHeader ] GrafoscopioAttributeBranchVisitor >> visitFigure: aPRFigure [
] self attributesAt: aPRFigure ifAbsentPut: [ styler attributesForFigure: aPRFigure ]
]
{ #category : #'as yet unclassified' }
GrafoscopioAttributeBranchVisitor >> visitInternalLink: aPRInternalLink [ { #category : #'as yet unclassified' }
self GrafoscopioAttributeBranchVisitor >> visitFormatText: aGrafoscopioFormatTextNode [
attributesAt: aPRInternalLink self attributesAt: aGrafoscopioFormatTextNode
ifAbsentPut: [ styler attributesForInternalLink: aPRInternalLink ] ifAbsentPut: [ styler attributesForFormatText: aGrafoscopioFormatTextNode ]
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioAttributeBranchVisitor >> visitLineBreak: aPRLineBreak [ GrafoscopioAttributeBranchVisitor >> visitHeader: aPRHeader [
self attributesAt: aPRLineBreak self
ifAbsentPut: [ styler attributesForLineBreak: aPRLineBreak ] attributesAt: aPRHeader
] ifAbsentPut: [ styler attributesForHeader: aPRHeader ]
]
{ #category : #'as yet unclassified' }
GrafoscopioAttributeBranchVisitor >> visitListItem: aPRListItem [ { #category : #'as yet unclassified' }
self GrafoscopioAttributeBranchVisitor >> visitInternalLink: aPRInternalLink [
attributesAt: aPRListItem self
ifAbsentPut: [ styler attributesForListItem: aPRListItem at: index ] attributesAt: aPRInternalLink
] ifAbsentPut: [ styler attributesForInternalLink: aPRInternalLink ]
]
{ #category : #'as yet unclassified' }
GrafoscopioAttributeBranchVisitor >> visitParagraph: aPRParagraph [ { #category : #'as yet unclassified' }
self GrafoscopioAttributeBranchVisitor >> visitLineBreak: aPRLineBreak [
attributesAt: aPRParagraph self attributesAt: aPRLineBreak
ifAbsentPut: [ styler attributesForParagraph: aPRParagraph ] ifAbsentPut: [ styler attributesForLineBreak: aPRLineBreak ]
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioAttributeBranchVisitor >> visitText: aPRText [ GrafoscopioAttributeBranchVisitor >> visitListItem: aPRListItem [
self attributesAt: aPRText self
ifAbsentPut: [ styler attributesForText: aPRText ] attributesAt: aPRListItem
] force: [ styler attributesForListItem: aPRListItem at: index ]
]
{ #category : #'as yet unclassified' }
GrafoscopioAttributeBranchVisitor >> visitUnorderedList: aPRUnorderedList [ { #category : #'as yet unclassified' }
self attributesAt: aPRUnorderedList GrafoscopioAttributeBranchVisitor >> visitParagraph: aPRParagraph [
ifAbsentPut: [ styler attributesForUnorderedList: aPRUnorderedList ] self
] attributesAt: aPRParagraph
ifAbsentPut: [ styler attributesForParagraph: aPRParagraph ]
]
{ #category : #'as yet unclassified' }
GrafoscopioAttributeBranchVisitor >> visitText: aPRText [
self attributesAt: aPRText
ifAbsentPut: [ styler attributesForText: aPRText ]
]
{ #category : #'as yet unclassified' }
GrafoscopioAttributeBranchVisitor >> visitUnorderedList: aPRUnorderedList [
self attributesAt: aPRUnorderedList
ifAbsentPut: [ styler attributesForUnorderedList: aPRUnorderedList ]
]

View File

@ -1,87 +1,87 @@
" "
Branch node. this kind of node has no content Branch node. this kind of node has no content
" "
Class { Class {
#name : #GrafoscopioBranchNode, #name : #GrafoscopioBranchNode,
#superclass : #GrafoscopioLeafNode, #superclass : #GrafoscopioLeafNode,
#instVars : [ #instVars : [
'children' 'children'
], ],
#category : #'Grafoscopio-Model' #category : #'Grafoscopio-Model'
} }
{ #category : #'instance creation' } { #category : #'instance creation' }
GrafoscopioBranchNode class >> isLeaf [ GrafoscopioBranchNode class >> isLeaf [
^ false ^ false
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioBranchNode >> acceptVisitor: aGrafoscopioVisitor [ GrafoscopioBranchNode >> acceptVisitor: aGrafoscopioVisitor [
aGrafoscopioVisitor visitBranchNode: self. aGrafoscopioVisitor visitBranchNode: self.
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioBranchNode >> acceptsChildsOfClass: aClass [ GrafoscopioBranchNode >> acceptsChildsOfClass: aClass [
^ {GrafoscopioBranchNode. ^ {GrafoscopioBranchNode.
GrafoscopioUnitNode} includes: aClass GrafoscopioUnitNode} includes: aClass
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioBranchNode >> addAtBeginningChild: aBlock ofClass: aClass [ GrafoscopioBranchNode >> addAtBeginningChild: aBlock ofClass: aClass [
(self acceptsChildsOfClass: aClass) (self acceptsChildsOfClass: aClass)
ifTrue: [| child | ifTrue: [| child |
child := aBlock value. child := aBlock value.
child parent: self. child parent: self.
self children addFirst: child] self children addFirst: child]
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioBranchNode >> addChild: aBlock ofClass: aClass [ GrafoscopioBranchNode >> addChild: aBlock ofClass: aClass [
(self acceptsChildsOfClass: aClass) (self acceptsChildsOfClass: aClass)
ifTrue: [ | child | ifTrue: [ | child |
child := aBlock value. child := aBlock value.
child parent: self. child parent: self.
self children add: child ] self children add: child ]
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioBranchNode >> children [ GrafoscopioBranchNode >> children [
"Returns the receivers list of children" "Returns the receivers list of children"
^ children ifNil: [ children := OrderedCollection new ] ^ children ifNil: [ children := OrderedCollection new ]
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioBranchNode >> children: aCollection [ GrafoscopioBranchNode >> children: aCollection [
"Sets the receivers children" "Sets the receivers children"
aCollection do: [:currentNode | currentNode parent: self ]. aCollection do: [:currentNode | currentNode parent: self ].
children := aCollection. children := aCollection.
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioBranchNode >> isLeaf [ GrafoscopioBranchNode >> isLeaf [
^ false ^ false
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioBranchNode >> moveDown: aNode [ GrafoscopioBranchNode >> moveDown: aNode [
| index | | index |
"Moves the current node a place before in the children collection where is located" "Moves the current node a place before in the children collection where is located"
index := children indexOf: aNode. index := children indexOf: aNode.
children swap: index with: (index + 1 min: children size) children swap: index with: (index + 1 min: children size)
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioBranchNode >> moveUp: aNode [ GrafoscopioBranchNode >> moveUp: aNode [
| index | | index |
"Moves the current node a place before in the children collection where is located" "Moves the current node a place before in the children collection where is located"
index := children indexOf: aNode. index := children indexOf: aNode.
children swap: index with: (index - 1 max: 1) children swap: index with: (index - 1 max: 1)
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioBranchNode >> remove: aGrafoscopioTextNode [ GrafoscopioBranchNode >> remove: aGrafoscopioTextNode [
children remove: aGrafoscopioTextNode children remove: aGrafoscopioTextNode
] ]

View File

@ -1,86 +1,86 @@
" "
I'm just a prototype of how morphic buttons can be embedded I'm just a prototype of how morphic buttons can be embedded
inside a Grafoscopio notebook UI via Spec. inside a Grafoscopio notebook UI via Spec.
I'm not used in the actual UI, but I'm more a remainder of directions I'm not used in the actual UI, but I'm more a remainder of directions
to explore. to explore.
" "
Class { Class {
#name : #GrafoscopioButtonModel, #name : #GrafoscopioButtonModel,
#superclass : #ComposablePresenter, #superclass : #ComposablePresenter,
#instVars : [ #instVars : [
'button' 'button'
], ],
#category : #'Grafoscopio-UI' #category : #'Grafoscopio-UI'
} }
{ #category : #specs } { #category : #specs }
GrafoscopioButtonModel class >> defaultSpec [ GrafoscopioButtonModel class >> defaultSpec [
^ SpecLayout composed add: #button ^ SpecLayout composed add: #button
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioButtonModel >> body [ GrafoscopioButtonModel >> body [
^ self button ^ self button
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioButtonModel >> button [ GrafoscopioButtonModel >> button [
^ button ^ button
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioButtonModel >> button: anObject [ GrafoscopioButtonModel >> button: anObject [
button := anObject button := anObject
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioButtonModel >> cancel [ GrafoscopioButtonModel >> cancel [
^ cancel ^ cancel
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioButtonModel >> cancel: anObject [ GrafoscopioButtonModel >> cancel: anObject [
cancel := anObject cancel := anObject
] ]
{ #category : #api } { #category : #api }
GrafoscopioButtonModel >> content: anAssoc [ GrafoscopioButtonModel >> content: anAssoc [
button label: anAssoc key. button label: anAssoc key.
button action: anAssoc value. button action: anAssoc value.
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioButtonModel >> find [ GrafoscopioButtonModel >> find [
^ find ^ find
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioButtonModel >> find: anObject [ GrafoscopioButtonModel >> find: anObject [
find := anObject find := anObject
] ]
{ #category : #initalize } { #category : #initalize }
GrafoscopioButtonModel >> initializeWidgets [ GrafoscopioButtonModel >> initializeWidgets [
button := self newButton. button := self newButton.
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioButtonModel >> ok [ GrafoscopioButtonModel >> ok [
^ ok ^ ok
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioButtonModel >> ok: anObject [ GrafoscopioButtonModel >> ok: anObject [
ok := anObject ok := anObject
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioButtonModel >> replace [ GrafoscopioButtonModel >> replace [
^ replace ^ replace
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioButtonModel >> replace: anObject [ GrafoscopioButtonModel >> replace: anObject [
replace := anObject replace := anObject
] ]

View File

@ -1,64 +1,64 @@
" "
I represent a Pharo code node inside a Grafoscopio notebook as a I represent a Pharo code node inside a Grafoscopio notebook as a
embedded interactive Playground. embedded interactive Playground.
" "
Class { Class {
#name : #GrafoscopioCodeModel, #name : #GrafoscopioCodeModel,
#superclass : #ComposablePresenter, #superclass : #ComposablePresenter,
#instVars : [ #instVars : [
'body' 'body'
], ],
#category : #'Grafoscopio-UI' #category : #'Grafoscopio-UI'
} }
{ #category : #specs } { #category : #specs }
GrafoscopioCodeModel class >> defaultSpec [ GrafoscopioCodeModel class >> defaultSpec [
^ SpecLayout composed add: #body ^ SpecLayout composed add: #body
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioCodeModel >> body [ GrafoscopioCodeModel >> body [
^ body ^ body
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioCodeModel >> body: anObject [ GrafoscopioCodeModel >> body: anObject [
body := anObject body := anObject
] ]
{ #category : #API } { #category : #API }
GrafoscopioCodeModel >> content: aGrafoscopioNodeContent [ GrafoscopioCodeModel >> content: aGrafoscopioNodeContent [
body text: aGrafoscopioNodeContent body text: aGrafoscopioNodeContent
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioCodeModel >> extractHtmlImages [ GrafoscopioCodeModel >> extractHtmlImages [
"comment stating purpose of message" "comment stating purpose of message"
|imgSoup imgHost imgList src| |imgSoup imgHost imgList src|
imgList := Set new. imgList := Set new.
imgSoup := Soup fromString: self body. imgSoup := Soup fromString: self body.
(imgSoup findAllTags: 'img') do: [ :each| (imgSoup findAllTags: 'img') do: [ :each|
src := (each attributeAt: 'src') asUrl. src := (each attributeAt: 'src') asUrl.
(src host) ifNil: [src host: self links last asUrl removeLastPathSegment]. (src host) ifNil: [src host: self links last asUrl removeLastPathSegment].
imgList add: src. imgList add: src.
"imgList add: (each attributeAt: 'src') asUrl." "imgList add: (each attributeAt: 'src') asUrl."
"OSProcess waitForCommand: 'wget ', (each attributeAt: 'src')." "OSProcess waitForCommand: 'wget ', (each attributeAt: 'src')."
"imgHost := self links last removeLastPathSegment." "imgHost := self links last removeLastPathSegment."
"imgPath:= ((each attributeAt: 'src') asUrl). " "imgPath:= ((each attributeAt: 'src') asUrl). "
"ZnEasy getJpeg: (imgHost , imgPath) asUrl." "ZnEasy getJpeg: (imgHost , imgPath) asUrl."
"OSProcess waitForCommand: ('mkdir ', imgPath)." "OSProcess waitForCommand: ('mkdir ', imgPath)."
"Transcript show: ' wget ', imgPath , '/',(each attributeAt: 'src'). " "Transcript show: ' wget ', imgPath , '/',(each attributeAt: 'src'). "
]. ].
^imgList . ^imgList .
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioCodeModel >> initializeWidgets [ GrafoscopioCodeModel >> initializeWidgets [
body := self newCode. body := self newCode.
] ]

View File

@ -1,24 +0,0 @@
"
This kind of a leafNodes holds code text.
"
Class {
#name : #GrafoscopioCodeNode,
#superclass : #GrafoscopioTextNode,
#category : #'Grafoscopio-Model'
}
{ #category : #'as yet unclassified' }
GrafoscopioCodeNode class >> icon [
^ self iconNamed:#objects
]
{ #category : #'as yet unclassified' }
GrafoscopioCodeNode class >> nameForSelection [
^ 'New Code Node'
]
{ #category : #accessing }
GrafoscopioCodeNode >> acceptVisitor: aGrafoscopioVisitor [
aGrafoscopioVisitor visitCodeNode: self.
]

View File

@ -1,66 +1,66 @@
" "
I define the documentation for the Grafoscopio package. I define the documentation for the Grafoscopio package.
" "
Class { Class {
#name : #GrafoscopioDocs, #name : #GrafoscopioDocs,
#superclass : #GrafoscopioDocumentation, #superclass : #GrafoscopioDocumentation,
#category : #Grafoscopio #category : #Grafoscopio
} }
{ #category : #operation } { #category : #operation }
GrafoscopioDocs class >> devNotes [ GrafoscopioDocs class >> devNotes [
"I'm just an alias to ease the operation. I need to know wich is the index of the notebook "I'm just an alias to ease the operation. I need to know wich is the index of the notebook
I want to return, as defined on instance initialize method" I want to return, as defined on instance initialize method"
| docs | | docs |
docs := self newDefault. docs := self newDefault.
^ (docs localPlace fullName, '/', (docs documents at: 5)) asFileReference. ^ (docs localPlace fullName, '/', (docs documents at: 5)) asFileReference.
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioDocs class >> initialize [ GrafoscopioDocs class >> initialize [
self update self update
] ]
{ #category : #operation } { #category : #operation }
GrafoscopioDocs class >> manual [ GrafoscopioDocs class >> manual [
"I'm just an alias to ease the operation. I need to know wich is the index of the notebook "I'm just an alias to ease the operation. I need to know wich is the index of the notebook
I want to open, as defined on method." I want to open, as defined on method."
| docs | | docs |
docs := self newDefault. docs := self newDefault.
^ (docs localPlace fullName, '/', (docs documents at: 2)) asFileReference. ^ (docs localPlace fullName, '/', (docs documents at: 2)) asFileReference.
] ]
{ #category : #operation } { #category : #operation }
GrafoscopioDocs class >> openPDFManual [ GrafoscopioDocs class >> openPDFManual [
"I open the documentation in PDF format." "I open the documentation in PDF format."
| pdfManual | | pdfManual |
pdfManual := FileLocator imageDirectory asFileReference / 'Grafoscopio/Docs/En/Books/Manual/manual.pdf'. pdfManual := FileLocator imageDirectory asFileReference / 'Grafoscopio/Docs/En/Books/Manual/manual.pdf'.
WebBrowser openOn: pdfManual fullName. WebBrowser openOn: pdfManual fullName.
] ]
{ #category : #operation } { #category : #operation }
GrafoscopioDocs class >> tutorial [ GrafoscopioDocs class >> tutorial [
"I'm just an alias to ease the operation. I need to know wich is the index of the notebook "I'm just an alias to ease the operation. I need to know wich is the index of the notebook
I want to return, as defined on instance initialize method" I want to return, as defined on instance initialize method"
| docs | | docs |
docs := self newDefault. docs := self newDefault.
^ (docs localPlace fullName, '/', (docs documents at: 1)) asFileReference. ^ (docs localPlace fullName, '/', (docs documents at: 1)) asFileReference.
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioDocs >> initialize [ GrafoscopioDocs >> initialize [
"I model the important documents that belong to the Grafoscopio documentation. "I model the important documents that belong to the Grafoscopio documentation.
When more documents become more mature and usable, I will include them." When more documents become more mature and usable, I will include them."
super initialize. super initialize.
name := 'grafoscopio'. name := 'grafoscopio'.
repository := (FossilRepo new remote: 'http://mutabit.com/repos.fossil/grafoscopio'). repository := (FossilRepo new remote: 'http://mutabit.com/repos.fossil/grafoscopio').
localPlace := FileLocator workingDirectory asFileReference /'Grafoscopio'. localPlace := FileLocator workingDirectory asFileReference /'Grafoscopio'.
self self
addDocument: 'Docs/Es/Tutoriales/tutorial.ston'; addDocument: 'Docs/Es/Tutoriales/tutorial.ston';
addDocument: 'Docs/En/Books/Manual/manual.ston'; addDocument: 'Docs/En/Books/Manual/manual.ston';
addDocument: 'uv/Docs/En/Books/Manual/manual.pdf'; addDocument: 'uv/Docs/En/Books/Manual/manual.pdf';
addDocument: 'Docs/En/Books/DataActivism/techniques-for-datactivism.ston'; addDocument: 'Docs/En/Books/DataActivism/techniques-for-datactivism.ston';
addDocument: 'Docs/En/dev-notes.ston'; addDocument: 'Docs/En/dev-notes.ston';
addDocument: 'Docs/En/Books/SpecIUFramework/spec-ui-framework.ston'. addDocument: 'Docs/En/Books/SpecIUFramework/spec-ui-framework.ston'.
] ]

View File

@ -1,151 +0,0 @@
Class {
#name : #GrafoscopioDocumentEditionPerspective,
#superclass : #GrafoscopioPerspective,
#instVars : [
'tree',
'document'
],
#category : #'Grafoscopio-New-UI'
}
{ #category : #accessing }
GrafoscopioDocumentEditionPerspective class >> defaultSpec [
^ SpBoxLayout newVertical
add: #toolbar height: self toolbarHeight;
add:
(SpBoxLayout newHorizontal
add: #tree width: 100;
add: #viewport;
yourself) yourself
]
{ #category : #accessing }
GrafoscopioDocumentEditionPerspective class >> icon [
^ self iconNamed: #merge
]
{ #category : #'adding - convenience' }
GrafoscopioDocumentEditionPerspective >> addAtBeginningNewNodeOfClass: aClass [
self
addAtBeginningOf: (tree selectedItem ifNil: [ document ])
aNodeOfClass: aClass
]
{ #category : #'adding - base' }
GrafoscopioDocumentEditionPerspective >> addAtBeginningOf: aNode aNodeOfClass: aClass [
aNode
addAtBeginningChild: [ self instantiateNode: aClass ]
ofClass: aClass.
self modelChanged
]
{ #category : #'adding - convenience' }
GrafoscopioDocumentEditionPerspective >> addAtLastNewNodeOfClass: aClass [
self
addAtLastOf: (tree selectedItem ifNil: [ document ])
aNodeOfClass: aClass
]
{ #category : #'adding - base' }
GrafoscopioDocumentEditionPerspective >> addAtLastOf: aNode aNodeOfClass: aClass [
aNode
addChild: [ self instantiateNode: aClass ]
ofClass: aClass.
self modelChanged
]
{ #category : #'adding - convenience' }
GrafoscopioDocumentEditionPerspective >> addNewNodeAtBeginningOf: aNode [
self addAtBeginningOf: aNode aNodeOfClass: self chooseKindsOfNode
]
{ #category : #'adding - convenience' }
GrafoscopioDocumentEditionPerspective >> addNewNodeAtLastOf: aNode [
self addAtLastOf: aNode aNodeOfClass: self chooseKindsOfNode
]
{ #category : #'adding - convenience' }
GrafoscopioDocumentEditionPerspective >> addNewNodeOfClass: aClass [
^ self addAtLastNewNodeOfClass: aClass
]
{ #category : #initialization }
GrafoscopioDocumentEditionPerspective >> createDefaultViewportVisitor [
^ GrafoscopioViewportVisitor new
]
{ #category : #initialization }
GrafoscopioDocumentEditionPerspective >> createViewport [
^ self renderViewport: document
]
{ #category : #initialization }
GrafoscopioDocumentEditionPerspective >> informNodeHasChanged: aNode [
| path |
path := tree selection selectedPath.
tree roots: {document}.
tree selectPath: path.
]
{ #category : #initialization }
GrafoscopioDocumentEditionPerspective >> initializeWidgets [
super initializeWidgets.
tree := self newTreeTable.
tree
addColumn: (SpStringTableColumn evaluated: #name);
children: [ :node |
node isLeaf
ifTrue: [ {} ]
ifFalse: [ node children reject:[: a | a isLeaf ] ]].
tree activateOnDoubleClick.
tree whenSelectionChangedDo: [ : a | self renderViewport: a selectedItem ].
tree whenActivatedDo: [ : a | self tooglePresenterForEdition: a ].
]
{ #category : #'as yet unclassified' }
GrafoscopioDocumentEditionPerspective >> instantiateNode: aClass [
aClass class = GrafoscopioUnitNode species
ifTrue: [ | name |
name := UIManager default
request: 'Unit name'
initialAnswer: 'New unit'.
^ aClass new
name: name;
yourself ].
^ aClass new
]
{ #category : #initialization }
GrafoscopioDocumentEditionPerspective >> modelChanged [
| path |
viewport := self createViewport.
path := tree selection selectedPath.
tree roots: {document}.
tree selectPath: path.
self needRebuild: false.
self buildWithSpec
]
{ #category : #initialization }
GrafoscopioDocumentEditionPerspective >> renderViewport: aNode [
^ self createDefaultViewportVisitor createViewportFor: ( aNode ifNil: [ document ]) into: self
]
{ #category : #initialization }
GrafoscopioDocumentEditionPerspective >> setModelBeforeInitialization: aDomainObject [
super setModelBeforeInitialization: aDomainObject.
document := aDomainObject .
]
{ #category : #initialization }
GrafoscopioDocumentEditionPerspective >> tooglePresenterForEdition: anObect [
self halt.
]
{ #category : #initialization }
GrafoscopioDocumentEditionPerspective >> viewport [
^ viewport
]

View File

@ -0,0 +1,20 @@
Class {
#name : #GrafoscopioDocumentRichTextEditionPerspective,
#superclass : #GrafoscopioDocumentTextEditionPerspective,
#category : #'Grafoscopio-New-UI'
}
{ #category : #accessing }
GrafoscopioDocumentRichTextEditionPerspective class >> icon [
^ self iconNamed: #merge
]
{ #category : #initialization }
GrafoscopioDocumentRichTextEditionPerspective >> aboutToBeUninstalledFrom: aTreeNotebook [
]
{ #category : #initialization }
GrafoscopioDocumentRichTextEditionPerspective >> createDefaultViewportVisitor [
^ GrafoscopioViewportRichTextVisitor new
]

View File

@ -0,0 +1,189 @@
Class {
#name : #GrafoscopioDocumentTextEditionPerspective,
#superclass : #GrafoscopioPerspective,
#instVars : [
'tree',
'document',
'buildingVisitor'
],
#category : #'Grafoscopio-New-UI'
}
{ #category : #accessing }
GrafoscopioDocumentTextEditionPerspective class >> buildCommandsGroupWith: presenterInstance forRoot: rootCommandGroup [
rootCommandGroup
register: (self buildMenuBarGroupWith: presenterInstance)";
register: (self buildContextualMenuGroupWith: presenterInstance)"
]
{ #category : #accessing }
GrafoscopioDocumentTextEditionPerspective class >> buildContextualMenuGroupWith: presenterInstance [
^ (CmCommandGroup named: 'Context Menu') asSpecGroup
register: (self buildEditionGroupWith: presenterInstance);
register: (self buildAddingGroupWith: presenterInstance);
register: (self buildRemovingGroupWith: presenterInstance);
yourself
]
{ #category : #accessing }
GrafoscopioDocumentTextEditionPerspective class >> buildMenuBarGroupWith: presenterInstance [
^ (CmCommandGroup named: 'Context Menu') asSpecGroup
register:
(CmBlockCommand new
name: 'Inspect node';
block:
[ :context | context viewport selectedPage activePresenter inspectNode ];
asSpecCommand);
register:
(CmBlockCommand new
name: 'Inspect runs';
block:
[ :context | context viewport selectedPage activePresenter inspectRuns ];
asSpecCommand);
yourself
]
{ #category : #accessing }
GrafoscopioDocumentTextEditionPerspective class >> defaultSpec [
^ SpBoxLayout newVertical
add: #toolbar height: self toolbarHeight;
add:
(SpBoxLayout newHorizontal
add: #tree width: 100;
add: #viewport;
yourself) yourself
]
{ #category : #accessing }
GrafoscopioDocumentTextEditionPerspective class >> icon [
^ self iconNamed: #edit
]
{ #category : #'adding - convenience' }
GrafoscopioDocumentTextEditionPerspective >> aboutToBeUninstalledFrom: aTreeNotebook [
aTreeNotebook removePerspective: self
]
{ #category : #'adding - convenience' }
GrafoscopioDocumentTextEditionPerspective >> addAtLastNewNodeOfClass: aClass [
self
addAtLastOf: (tree selectedItem ifNil: [ document ])
aNodeOfClass: aClass
]
{ #category : #'adding - base' }
GrafoscopioDocumentTextEditionPerspective >> addAtLastOf: aNode aNodeOfClass: aClass [
aNode
addChild: [ self instantiateNode: aClass ]
ofClass: aClass.
self modelChanged
]
{ #category : #'adding - convenience' }
GrafoscopioDocumentTextEditionPerspective >> addNewNodeOfClass: aClass [
^ self addAtLastNewNodeOfClass: aClass
]
{ #category : #initialization }
GrafoscopioDocumentTextEditionPerspective >> buildingVisitor [
^ buildingVisitor
ifNil: [ buildingVisitor := self createDefaultViewportVisitor ]
]
{ #category : #initialization }
GrafoscopioDocumentTextEditionPerspective >> buildingVisitor: aVisitor [
buildingVisitor := aVisitor
]
{ #category : #initialization }
GrafoscopioDocumentTextEditionPerspective >> createDefaultViewportVisitor [
^ GrafoscopioViewportTextVisitor new
]
{ #category : #initialization }
GrafoscopioDocumentTextEditionPerspective >> createViewport [
^ self renderViewport: document
]
{ #category : #initialization }
GrafoscopioDocumentTextEditionPerspective >> informNodeHasChanged: aNode [
| path |
path := tree selection selectedPath.
tree roots: {document}.
tree selectPath: path.
]
{ #category : #initialization }
GrafoscopioDocumentTextEditionPerspective >> initializeWidgets [
super initializeWidgets.
tree := self newTreeTable.
tree
addColumn: (SpStringTableColumn evaluated: #name);
children: [ :node |
node isLeaf
ifTrue: [ {} ]
ifFalse: [ node children ] ].
tree activateOnDoubleClick.
tree
whenSelectionChangedDo: [ :a | self renderViewport: a selectedItem ].
tree whenActivatedDo: [ : a | self requestNewNameFor: a selectedItem ]
]
{ #category : #'as yet unclassified' }
GrafoscopioDocumentTextEditionPerspective >> instantiateNode: aClass [
| name |
name := UIManager default
request: 'Please, name the item'
initialAnswer: 'New item'.
^ aClass new
name: name;
yourself
]
{ #category : #initialization }
GrafoscopioDocumentTextEditionPerspective >> modelChanged [
| path |
path := tree selection selectedPath.
tree roots: {document}.
tree selectPath: path.
self needRebuild: false.
self buildWithSpec
]
{ #category : #initialization }
GrafoscopioDocumentTextEditionPerspective >> nameChanged [
| path |
path := tree selection selectedPath.
tree roots: {document}.
tree buildWithSpec.
tree selectPath: path
]
{ #category : #initialization }
GrafoscopioDocumentTextEditionPerspective >> renderViewport: aNode [
^ self buildingVisitor createViewportFor: ( aNode ifNil: [ document ]) into: self
]
{ #category : #initialization }
GrafoscopioDocumentTextEditionPerspective >> requestNewNameFor: aNode [
| name |
name := UIManager default
request: 'Please, name the node'
initialAnswer: aNode name asString.
name ifNotNil: [ aNode name: name ].
self buildingVisitor renamePageFor: aNode.
self nameChanged .
]
{ #category : #initialization }
GrafoscopioDocumentTextEditionPerspective >> setModelBeforeInitialization: aDomainObject [
super setModelBeforeInitialization: aDomainObject.
document := aDomainObject .
]
{ #category : #initialization }
GrafoscopioDocumentTextEditionPerspective >> viewport [
^ viewport
]

View File

@ -1,15 +1,15 @@
Class { Class {
#name : #GrafoscopioExportPerspective, #name : #GrafoscopioExportPerspective,
#superclass : #GrafoscopioPerspective, #superclass : #GrafoscopioPerspective,
#category : #'Grafoscopio-New-UI' #category : #'Grafoscopio-New-UI'
} }
{ #category : #accessing } { #category : #accessing }
GrafoscopioExportPerspective class >> icon [ GrafoscopioExportPerspective class >> icon [
^ self iconNamed: #export ^ self iconNamed: #export
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioExportPerspective >> createViewport [ GrafoscopioExportPerspective >> createViewport [
^ self newLabel ^ self newLabel
] ]

View File

@ -1,14 +1,14 @@
Class { Class {
#name : #GrafoscopioFmtAnchorAsBody, #name : #GrafoscopioFmtAnchorAsBody,
#superclass : #GrafoscopioFmtUrlAsBody, #superclass : #GrafoscopioFmtUrlAsBody,
#category : #'Grafoscopio-Pillar-TextFormat' #category : #'Grafoscopio-Pillar-TextFormat'
} }
{ #category : #'target resize' } { #category : #'target resize' }
GrafoscopioFmtAnchorAsBody >> beInstalledIn: anExternalLink [ GrafoscopioFmtAnchorAsBody >> beInstalledIn: anExternalLink [
anExternalLink children isEmpty ifFalse: [ ^ self ]. anExternalLink children isEmpty ifFalse: [ ^ self ].
self self
installTextNodeAtRightWithValue: anExternalLink anchor asString installTextNodeAtRightWithValue: anExternalLink anchor asString
in: anExternalLink in: anExternalLink
] ]

View File

@ -1,10 +1,11 @@
Class { Class {
#name : #GrafoscopioFmtAnchorOnTheLeft, #name : #GrafoscopioFmtAnchorOnTheLeft,
#superclass : #GrafoscopioFormat, #superclass : #GrafoscopioFormat,
#category : #'Grafoscopio-Pillar-TextFormat' #category : #'Grafoscopio-Pillar-TextFormat'
} }
{ #category : #'target resize' } { #category : #'target resize' }
GrafoscopioFmtAnchorOnTheLeft >> beInstalledIn: aNode [ GrafoscopioFmtAnchorOnTheLeft >> beInstalledIn: aNode [
self installTextNodeAtLeftWithValue: (Character value: 1) asString in: aNode
] self installTextNodeAtLeftWithValue: (Character value: 1) asString in: aNode
]

View File

@ -1,13 +1,13 @@
Class { Class {
#name : #GrafoscopioFmtAnchorOnTheLeft2, #name : #GrafoscopioFmtAnchorOnTheLeft2,
#superclass : #GrafoscopioFormat, #superclass : #GrafoscopioFormat,
#category : #'Grafoscopio-Pillar-TextFormat' #category : #'Grafoscopio-Pillar-TextFormat'
} }
{ #category : #'target resize' } { #category : #'target resize' }
GrafoscopioFmtAnchorOnTheLeft2 >> beInstalledIn: aNode [ GrafoscopioFmtAnchorOnTheLeft2 >> beInstalledIn: aNode [
aNode language originalName = 'pharo-image' aNode language originalName = 'pharo-image'
ifTrue: [ ifTrue: [
aNode propertyAt: #text put: aNode text. aNode propertyAt: #text put: aNode text.
aNode text: (Character value: 1) asString ] aNode text: (Character value: 1) asString ]
] ]

View File

@ -1,10 +1,11 @@
Class { Class {
#name : #GrafoscopioFmtBeginningLinebreak, #name : #GrafoscopioFmtBeginningLinebreak,
#superclass : #GrafoscopioFormat, #superclass : #GrafoscopioFormat,
#category : #'Grafoscopio-Pillar-TextFormat' #category : #'Grafoscopio-Pillar-TextFormat'
} }
{ #category : #'target resize' } { #category : #'target resize' }
GrafoscopioFmtBeginningLinebreak >> beInstalledIn: aNode [ GrafoscopioFmtBeginningLinebreak >> beInstalledIn: aNode [
self installTextNodeAtLeftWithValue: OSPlatform current lineEnding in: aNode " Should be using OSPlatform current lineEnding, but our text presenter does not support to have 2 character representation "
] self installTextNodeAtLeftWithValue: String cr in: aNode
]

View File

@ -1,11 +1,12 @@
Class { Class {
#name : #GrafoscopioFmtDoubleLinebreak, #name : #GrafoscopioFmtDoubleLinebreak,
#superclass : #GrafoscopioFormat, #superclass : #GrafoscopioFormat,
#category : #'Grafoscopio-Pillar-TextFormat' #category : #'Grafoscopio-Pillar-TextFormat'
} }
{ #category : #'target resize' } { #category : #'target resize' }
GrafoscopioFmtDoubleLinebreak >> beInstalledIn: aNode [ GrafoscopioFmtDoubleLinebreak >> beInstalledIn: aNode [
self installTextNodeAtLeftWithValue: OSPlatform current lineEnding in: aNode. " Should be using OSPlatform current lineEnding, but our text presenter does not support to have 2 character representation "
self installTextNodeAtRightWithValue: OSPlatform current lineEnding in: aNode self installTextNodeAtLeftWithValue: String cr in: aNode.
] self installTextNodeAtRightWithValue: String cr in: aNode
]

View File

@ -1,15 +1,16 @@
Class { Class {
#name : #GrafoscopioFmtEndingLinebreak, #name : #GrafoscopioFmtEndingLinebreak,
#superclass : #GrafoscopioFormat, #superclass : #GrafoscopioFormat,
#category : #'Grafoscopio-Pillar-TextFormat' #category : #'Grafoscopio-Pillar-TextFormat'
} }
{ #category : #'target resize' } { #category : #'target resize' }
GrafoscopioFmtEndingLinebreak >> beInstalledIn: aNode [ GrafoscopioFmtEndingLinebreak >> beInstalledIn: aNode [
self installTextNodeAtRightWithValue: OSPlatform current lineEnding in: aNode " Should be using OSPlatform current lineEnding, but our text presenter does not support to have 2 character representation "
] self installTextNodeAtRightWithValue: String cr in: aNode
]
{ #category : #'target resize' }
GrafoscopioFmtEndingLinebreak >> value: aString [ { #category : #'target resize' }
^aString , OSPlatform current lineEnding GrafoscopioFmtEndingLinebreak >> value: aString [
] ^aString , OSPlatform current lineEnding
]

View File

@ -1,12 +1,12 @@
Class { Class {
#name : #GrafoscopioFmtEndingSpace, #name : #GrafoscopioFmtEndingSpace,
#superclass : #GrafoscopioFormat, #superclass : #GrafoscopioFormat,
#category : #'Grafoscopio-Pillar-TextFormat' #category : #'Grafoscopio-Pillar-TextFormat'
} }
{ #category : #'target resize' } { #category : #'target resize' }
GrafoscopioFmtEndingSpace >> beInstalledIn: aNode [ GrafoscopioFmtEndingSpace >> beInstalledIn: aNode [
self self
installTextNodeAtRightWithValue: String space installTextNodeAtRightWithValue: String space
in: aNode in: aNode
] ]

View File

@ -1,14 +1,14 @@
Class { Class {
#name : #GrafoscopioFmtUrlAsBody, #name : #GrafoscopioFmtUrlAsBody,
#superclass : #GrafoscopioFormat, #superclass : #GrafoscopioFormat,
#category : #'Grafoscopio-Pillar-TextFormat' #category : #'Grafoscopio-Pillar-TextFormat'
} }
{ #category : #'target resize' } { #category : #'target resize' }
GrafoscopioFmtUrlAsBody >> beInstalledIn: anExternalLink [ GrafoscopioFmtUrlAsBody >> beInstalledIn: anExternalLink [
anExternalLink children isEmpty ifFalse: [ ^ self ]. anExternalLink children isEmpty ifFalse: [ ^ self ].
self self
installTextNodeAtRightWithValue: anExternalLink reference asString installTextNodeAtRightWithValue: anExternalLink reference asString
in: anExternalLink in: anExternalLink
] ]

View File

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

View File

@ -1,16 +1,16 @@
Class { Class {
#name : #GrafoscopioFormatTextNode, #name : #GrafoscopioFormatTextNode,
#superclass : #PRText, #superclass : #PRText,
#category : #'Grafoscopio-Pillar-TextFormat' #category : #'Grafoscopio-Pillar-TextFormat'
} }
{ #category : #visiting } { #category : #visiting }
GrafoscopioFormatTextNode >> accept: aVisitor [ GrafoscopioFormatTextNode >> accept: aVisitor [
aVisitor visitFormatText: self aVisitor visitFormatText: self
] ]
{ #category : #visiting } { #category : #visiting }
GrafoscopioFormatTextNode >> printOn: aStream [ GrafoscopioFormatTextNode >> printOn: aStream [
super printOn: aStream. super printOn: aStream.
aStream nextPutAll: ' format text: '; print: self text aStream nextPutAll: ' format text: '; print: self text
] ]

View File

@ -1,65 +1,65 @@
" "
Leaf node. Any content node is leaf Leaf node. Any content node is leaf
" "
Class { Class {
#name : #GrafoscopioLeafNode, #name : #GrafoscopioLeafNode,
#superclass : #GrafoscopioAbstractNode, #superclass : #GrafoscopioAbstractNode,
#instVars : [ #instVars : [
'parent' 'parent'
], ],
#category : #'Grafoscopio-Model' #category : #'Grafoscopio-Model'
} }
{ #category : #testing } { #category : #testing }
GrafoscopioLeafNode class >> isLeaf [ GrafoscopioLeafNode class >> isLeaf [
^ true ^ true
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioLeafNode >> acceptVisitor: aGrafoscopioVisitor [ GrafoscopioLeafNode >> acceptVisitor: aGrafoscopioVisitor [
aGrafoscopioVisitor visitLeafNode: self. aGrafoscopioVisitor visitLeafNode: self.
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioLeafNode >> addAtBeginningChild: aBlock ofClass: aClass [ GrafoscopioLeafNode >> addAtBeginningChild: aBlock ofClass: aClass [
self error: 'Leaf nodes are abstract. ' self error: 'Leaf nodes are abstract. '
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioLeafNode >> addChild: aBlock ofClass: aClass [ GrafoscopioLeafNode >> addChild: aBlock ofClass: aClass [
self error: 'Leaf nodes are abstract. ' self error: 'Leaf nodes are abstract. '
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioLeafNode >> level [ GrafoscopioLeafNode >> level [
"Returns the level of the node. See the setter message for details" "Returns the level of the node. See the setter message for details"
^ parent ifNil: [ 0 ] ifNotNil: [ 1 + parent level ] ^ parent ifNil: [ 0 ] ifNotNil: [ 1 + parent level ]
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioLeafNode >> moveDown [ GrafoscopioLeafNode >> moveDown [
parent moveDown: self. parent moveDown: self.
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioLeafNode >> moveUp [ GrafoscopioLeafNode >> moveUp [
parent moveUp: self. parent moveUp: self.
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioLeafNode >> parent [ GrafoscopioLeafNode >> parent [
"Returns the parent of the current node" "Returns the parent of the current node"
^ parent ^ parent
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioLeafNode >> parent: aNode [ GrafoscopioLeafNode >> parent: aNode [
parent := aNode parent := aNode
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioLeafNode >> remove [ GrafoscopioLeafNode >> remove [
parent remove: self. parent remove: self.
] ]

View File

@ -1,51 +1,51 @@
" "
I model the links of a GrafoscopioNode. I model the links of a GrafoscopioNode.
I'm responsable for showing the links and selecting them. I'm responsable for showing the links and selecting them.
" "
Class { Class {
#name : #GrafoscopioLinksList, #name : #GrafoscopioLinksList,
#superclass : #ComposablePresenter, #superclass : #ComposablePresenter,
#instVars : [ #instVars : [
'links' 'links'
], ],
#category : #'Grafoscopio-UI' #category : #'Grafoscopio-UI'
} }
{ #category : #specs } { #category : #specs }
GrafoscopioLinksList class >> defaultSpec [ GrafoscopioLinksList class >> defaultSpec [
^ SpLayout composed ^ SpLayout composed
add: #links; add: #links;
yourself yourself
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioLinksList >> content: aGrafoscopioNode [ GrafoscopioLinksList >> content: aGrafoscopioNode [
links items: aGrafoscopioNode links links items: aGrafoscopioNode links
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioLinksList >> initializeWidgets [ GrafoscopioLinksList >> initializeWidgets [
links := self newList. links := self newList.
self focusOrder add: links self focusOrder add: links
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioLinksList >> links [ GrafoscopioLinksList >> links [
^ links ^ links
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioLinksList >> links: anObject [ GrafoscopioLinksList >> links: anObject [
links := anObject links := anObject
] ]
{ #category : #api } { #category : #api }
GrafoscopioLinksList >> title [ GrafoscopioLinksList >> title [
^ 'Node links list' ^ 'Node links list'
] ]
{ #category : #'api-events' } { #category : #'api-events' }
GrafoscopioLinksList >> whenSelectedItemChanged: aBlock [ GrafoscopioLinksList >> whenSelectedItemChanged: aBlock [
links whenSelectedItemChanged: aBlock links whenSelectedItemChanged: aBlock
] ]

View File

@ -1,105 +0,0 @@
Class {
#name : #GrafoscopioNewCodeModel,
#superclass : #GrafoscopioNewTextModel,
#instVars : [
'preview',
'previewButton'
],
#category : #'Grafoscopio-New-UI'
}
{ #category : #specs }
GrafoscopioNewCodeModel class >> defaultSpec [
^ SpBoxLayout newVertical
add: #body;
yourself
]
{ #category : #initialization }
GrafoscopioNewCodeModel >> content: aGrafoscopioNodeContent [
self layout: (self createLayoutFor: aGrafoscopioNodeContent).
body text: (aGrafoscopioNodeContent ifNil: [ '' ])
]
{ #category : #initialization }
GrafoscopioNewCodeModel >> createLayoutFor: aGrafoscopioNodeContent [
^ SpBoxLayout newVertical
add:
(SpBoxLayout newHorizontal
add:
(SpBoxLayout newVertical
add: #up;
add: #down;
add: #delete;
yourself)
width: 30;
add:
(SpBoxLayout newHorizontal
add: #body;
add: #previewButton width: 30;
add: #preview;
yourself);
yourself)
height: (self heightFor: aGrafoscopioNodeContent)
]
{ #category : #initialization }
GrafoscopioNewCodeModel >> editionLayoutFor: aGrafoscopioNodeContent [
^ SpBoxLayout newVertical
add:
(SpBoxLayout newHorizontal
add:
(SpBoxLayout newVertical
add: #up;
add: #down;
add: #delete;
yourself)
width: 30;
add:
(SpBoxLayout newHorizontal
add: #body;
add: #previewButton width: 30;
add: #preview;
yourself);
yourself)
height: (self heightFor: aGrafoscopioNodeContent)
]
{ #category : #initialization }
GrafoscopioNewCodeModel >> initializeWidgets [
super initializeWidgets.
previewButton := self newButton.
previewButton icon: (self iconNamed: #smallFind).
previewButton action: [ self previewCode ].
preview := self newLabel
]
{ #category : #initialization }
GrafoscopioNewCodeModel >> newTextComponent [
^ self newCode
whenTextChangedDo: [ model text: body text ];
autoAccept: true;
yourself
]
{ #category : #initialization }
GrafoscopioNewCodeModel >> normalLayoutFor: aGrafoscopioNodeContent [
^ SpBoxLayout newVertical
add:
(SpBoxLayout newHorizontal
add:
(SpBoxLayout newHorizontal
add: #body;
add: #previewButton width: 30;
add: #preview;
yourself);
yourself)
height: (self heightFor: aGrafoscopioNodeContent)
]
{ #category : #initialization }
GrafoscopioNewCodeModel >> previewCode [
[ preview label: (self class compiler evaluate: body text) asString ]
on: Error
do: [ :e | preview label: e asString]
]

View File

@ -1,83 +0,0 @@
Class {
#name : #GrafoscopioNewTextInputModel,
#superclass : #SpDynamicPresenter,
#instVars : [
'#body',
'#model => SpObservableSlot',
'#onModifyNodeLocationDo'
],
#category : #'Grafoscopio-New-UI'
}
{ #category : #specs }
GrafoscopioNewTextInputModel class >> defaultSpec [
^ SpBoxLayout newVertical
add: #body height: 300;
yourself
]
{ #category : #API }
GrafoscopioNewTextInputModel >> content: aGrafoscopioNodeContent [
self layout: (self createLayoutFor: aGrafoscopioNodeContent).
body text: (aGrafoscopioNodeContent ifNil: [ '' ])
]
{ #category : #API }
GrafoscopioNewTextInputModel >> createLayoutFor: aGrafoscopioNodeContent [
^ SpBoxLayout newVertical
add: #body
height: (self heightFor: aGrafoscopioNodeContent)
]
{ #category : #'as yet unclassified' }
GrafoscopioNewTextInputModel >> heightFor: aGrafoscopioNodeContent [
^ aGrafoscopioNodeContent
ifNil: [ 100 ]
ifNotNil: [ (aGrafoscopioNodeContent asString lines size * self class toolbarHeight) max: 100 ]
]
{ #category : #initialization }
GrafoscopioNewTextInputModel >> informModification [
onModifyNodeLocationDo
ifNotNil: [ onModifyNodeLocationDo cull: self ]
]
{ #category : #initialization }
GrafoscopioNewTextInputModel >> initialize [
super initialize.
]
{ #category : #initialization }
GrafoscopioNewTextInputModel >> initializePrivateAnnouncements [
super initializePrivateAnnouncements.
self property: #model whenChangedDo: [ self modelChanged ]
]
{ #category : #initialization }
GrafoscopioNewTextInputModel >> initializeWidgets [
body := self newTextComponent.
]
{ #category : #initialization }
GrafoscopioNewTextInputModel >> model: aModel [
model := aModel
]
{ #category : #initialization }
GrafoscopioNewTextInputModel >> modelChanged [
self content: model text.
]
{ #category : #initialization }
GrafoscopioNewTextInputModel >> newTextComponent [
^ self newTextInput whenTextChangedDo: [
model text: body text.
self informModification ];
yourself
]
{ #category : #initialization }
GrafoscopioNewTextInputModel >> onModifyNodeLocationDo: aBlock [
onModifyNodeLocationDo := aBlock
]

View File

@ -1,78 +1,77 @@
Class { Class {
#name : #GrafoscopioNewTextModel, #name : #GrafoscopioNewTextModel,
#superclass : #GrafoscopioNewTextInputModel, #superclass : #SpPresenterWithModel,
#instVars : [ #instVars : [
'up', 'body',
'down', 'onModifyNodeLocationDo'
'delete', ],
'editionMode', #category : #'Grafoscopio-New-UI'
'lastHeightUsed' }
],
#category : #'Grafoscopio-New-UI' { #category : #specs }
} GrafoscopioNewTextModel class >> defaultSpec [
^ SpBoxLayout newVertical
{ #category : #initialization } add: #body;
GrafoscopioNewTextModel >> createLayoutFor: aGrafoscopioNodeContent [ yourself
lastHeightUsed := (self heightFor: aGrafoscopioNodeContent). ]
^ editionMode
ifTrue: [ self editionLayoutFor: aGrafoscopioNodeContent ] { #category : #'as yet unclassified' }
ifFalse: [ self normalLayoutFor: aGrafoscopioNodeContent ] GrafoscopioNewTextModel >> body [
] ^ body
]
{ #category : #initialization }
GrafoscopioNewTextModel >> editionLayoutFor: aGrafoscopioNodeContent [ { #category : #initialization }
^ SpBoxLayout newVertical GrafoscopioNewTextModel >> contextMenuFromCommandsGroup: aBlock [
add: ^ body contextMenuFromCommandsGroup: aBlock
(SpBoxLayout newHorizontal ]
add:
(SpBoxLayout newVertical { #category : #initialization }
add: #up; GrafoscopioNewTextModel >> informModification [
add: #down; onModifyNodeLocationDo
add: #delete; ifNotNil: [ onModifyNodeLocationDo cull: self ]
yourself) ]
width: 30;
add: #body; { #category : #initialization }
yourself) GrafoscopioNewTextModel >> initialize [
height: (self heightFor: aGrafoscopioNodeContent) super initialize.
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioNewTextModel >> initializeWidgets [ GrafoscopioNewTextModel >> initializeWidgets [
super initializeWidgets . body := self newText.
editionMode := true. body text: self model text.
up := self newButton icon: (self iconNamed: #up) ; color: Color transparent ; yourself . body whenTextChangedDo: [ self informModification ]
down := self newButton icon: (self iconNamed: #down) ; color: Color transparent ; yourself . ]
delete := self newButton icon: (self iconNamed: #delete) ; color: Color transparent ; yourself .
up action: [ model moveUp. self informModification. ]. { #category : #initialization }
down action: [ model moveDown. self informModification.]. GrafoscopioNewTextModel >> inspectNRun [
delete action: [ model remove .self informModification. ] body text
inspectRunAt:
] (body selectionInterval
ifNil: [ body cursorPositionIndex ]
{ #category : #initialization } ifNotNil: [ :i | i first ])
GrafoscopioNewTextModel >> newTextComponent [ ]
^ self newText
whenTextChangedDo: [ self textChanged ]; { #category : #initialization }
autoAccept: true; GrafoscopioNewTextModel >> inspectNode [
yourself body text
] inspectNodeAt:
(body selectionInterval
{ #category : #initialization } ifNil: [ body cursorPositionIndex ]
GrafoscopioNewTextModel >> normalLayoutFor: aGrafoscopioNodeContent [ ifNotNil: [ :i | i first ])
^ SpBoxLayout newVertical ]
add: #body
height: (self heightFor: aGrafoscopioNodeContent) { #category : #'as yet unclassified' }
] GrafoscopioNewTextModel >> inspectRuns [
^ self inspectNRun
{ #category : #initialization } ]
GrafoscopioNewTextModel >> textChanged [
model text: body text. { #category : #initialization }
(lastHeightUsed - (self heightFor: model text )) abs GrafoscopioNewTextModel >> modelChanged [
> (lastHeightUsed * 0.1) body text: self model text.
ifTrue: [ self modelChanged ] ]
]
{ #category : #initialization }
{ #category : #initialization } GrafoscopioNewTextModel >> onModifyNodeLocationDo: aBlock [
GrafoscopioNewTextModel >> toogleEditionMode [ onModifyNodeLocationDo := aBlock
editionMode := editionMode not. ]
]

File diff suppressed because it is too large Load Diff

View File

@ -1,171 +1,171 @@
" "
I test the main functionality of the GrafoscopioNode class. I test the main functionality of the GrafoscopioNode class.
" "
Class { Class {
#name : #GrafoscopioNodeTest, #name : #GrafoscopioNodeTest,
#superclass : #TestCase, #superclass : #TestCase,
#category : #'Grafoscopio-Model' #category : #'Grafoscopio-Model'
} }
{ #category : #tests } { #category : #tests }
GrafoscopioNodeTest >> dummyHtml [ GrafoscopioNodeTest >> dummyHtml [
| txt | | txt |
txt := '<html> <body> <img src="/web/files/pharo-logo-small.png"> txt := '<html> <body> <img src="/web/files/pharo-logo-small.png">
<img src="https://pharo.org/web/files/pharo.png"> <img src="https://pharo.org/web/files/pharo.png">
</body></html>'. </body></html>'.
^ txt ^ txt
] ]
{ #category : #tests } { #category : #tests }
GrafoscopioNodeTest >> newTestTree [ GrafoscopioNodeTest >> newTestTree [
| node0 node1 node2 node3 node4 | | node0 node1 node2 node3 node4 |
node0 := GrafoscopioTextNode new node0 := GrafoscopioTextNode new
created: DateAndTime now; created: DateAndTime now;
header: 'Arbol principal'. header: 'Arbol principal'.
node1 := GrafoscopioTextNode new node1 := GrafoscopioTextNode new
created: DateAndTime now; created: DateAndTime now;
header: 'Markup'; header: 'Markup';
body: 'I am <b>just a node with markup</b>'; body: 'I am <b>just a node with markup</b>';
tagAs: 'text'; tagAs: 'text';
links: 'temp.md'. links: 'temp.md'.
node2 := GrafoscopioTextNode new node2 := GrafoscopioTextNode new
created: DateAndTime now ; created: DateAndTime now ;
header: '%output Code'; header: '%output Code';
tagAs: 'código'; tagAs: 'código';
body: '(ConfigurationOfGrafoscopio>>#version14:) sourceCode'. body: '(ConfigurationOfGrafoscopio>>#version14:) sourceCode'.
node3 := GrafoscopioTextNode new node3 := GrafoscopioTextNode new
created: DateAndTime now ; created: DateAndTime now ;
header: '%invisible'; header: '%invisible';
tagAs: 'text'; tagAs: 'text';
body: '<i>Just testing</i>'. body: '<i>Just testing</i>'.
node1 addNode: node3. node1 addNode: node3.
node4 := GrafoscopioTextNode new node4 := GrafoscopioTextNode new
created: DateAndTime now ; created: DateAndTime now ;
header: 'Something'; header: 'Something';
tagAs: 'text'; tagAs: 'text';
body: '<h1>else</h1>'. body: '<h1>else</h1>'.
node1 addNode: node4. node1 addNode: node4.
node1 addNode: node2. node1 addNode: node2.
node0 addNode: node1. node0 addNode: node1.
^ node0 ^ node0
] ]
{ #category : #tests } { #category : #tests }
GrafoscopioNodeTest >> testAddingChildren [ GrafoscopioNodeTest >> testAddingChildren [
| tree nnode orig | | tree nnode orig |
tree := self newTestTree. tree := self newTestTree.
nnode := GrafoscopioTextNode new. nnode := GrafoscopioTextNode new.
orig := tree children size. orig := tree children size.
tree addNode: nnode. tree addNode: nnode.
self assert: tree children size equals: orig + 1. self assert: tree children size equals: orig + 1.
] ]
{ #category : #tests } { #category : #tests }
GrafoscopioNodeTest >> testDemoteNode [ GrafoscopioNodeTest >> testDemoteNode [
| tree child1 child2 | | tree child1 child2 |
tree := GrafoscopioTextNode new. tree := GrafoscopioTextNode new.
child1 := GrafoscopioTextNode new. child1 := GrafoscopioTextNode new.
child2 := GrafoscopioTextNode new. child2 := GrafoscopioTextNode new.
tree tree
addNode: child1; addNode: child1;
addNode: child2. addNode: child2.
child2 demote. child2 demote.
self assert: child2 level equals: child1 level + 1 self assert: child2 level equals: child1 level + 1
] ]
{ #category : #tests } { #category : #tests }
GrafoscopioNodeTest >> testFindAndReplace [ GrafoscopioNodeTest >> testFindAndReplace [
| tree | | tree |
tree := GrafoscopioTextNode new. tree := GrafoscopioTextNode new.
tree body: 'I''m only a test node.'. tree body: 'I''m only a test node.'.
tree find: 'only' andReplaceWith: 'JUST'. tree find: 'only' andReplaceWith: 'JUST'.
self assert: (tree body findString: 'JUST') > 0. self assert: (tree body findString: 'JUST') > 0.
] ]
{ #category : #tests } { #category : #tests }
GrafoscopioNodeTest >> testHasMarkdownSubtreesToExport [ GrafoscopioNodeTest >> testHasMarkdownSubtreesToExport [
"Because becomeDefaultTestTree contains at least one non empty 'links' object that "Because becomeDefaultTestTree contains at least one non empty 'links' object that
points to a relative path in the file system, ending in '.md' or '.markdown' the points to a relative path in the file system, ending in '.md' or '.markdown' the
result of this test is true. result of this test is true.
Please see look #becomeDefaultTestTree message to see the details that makes this test true." Please see look #becomeDefaultTestTree message to see the details that makes this test true."
| tree | | tree |
tree := self newTestTree. tree := self newTestTree.
self assert: tree selectMarkupSubtreesToExport isNotEmpty equals: true. self assert: tree selectMarkupSubtreesToExport isNotEmpty equals: true.
] ]
{ #category : #tests } { #category : #tests }
GrafoscopioNodeTest >> testInitializeIsOk [ GrafoscopioNodeTest >> testInitializeIsOk [
self shouldnt: [ GrafoscopioTextNode new ] raise: Error self shouldnt: [ GrafoscopioTextNode new ] raise: Error
] ]
{ #category : #tests } { #category : #tests }
GrafoscopioNodeTest >> testPromoteNode [ GrafoscopioNodeTest >> testPromoteNode [
| tree child1 child2 | | tree child1 child2 |
tree := GrafoscopioTextNode new. tree := GrafoscopioTextNode new.
child1 := GrafoscopioTextNode new. child1 := GrafoscopioTextNode new.
child2 := GrafoscopioTextNode new. child2 := GrafoscopioTextNode new.
tree addNode: child1. tree addNode: child1.
child1 addNode: child2. child1 addNode: child2.
child2 promote. child2 promote.
self assert: child2 level equals: child1 level self assert: child2 level equals: child1 level
] ]
{ #category : #'tests-utility' } { #category : #'tests-utility' }
GrafoscopioNodeTest >> testRemoveLeadingLineNumbersSized [ GrafoscopioNodeTest >> testRemoveLeadingLineNumbersSized [
| copiedCode testNode | | copiedCode testNode |
copiedCode := ' copiedCode := '
1var tree = d3.layout.tree() 1var tree = d3.layout.tree()
2 .sort(null) 2 .sort(null)
3 .size([size.height, size.width - maxLabelLength*options.fontSize]) 3 .size([size.height, size.width - maxLabelLength*options.fontSize])
4 .children(function(d) 4 .children(function(d)
5 { 5 {
6 return (!d.contents || d.contents.length === 0) ? null : d.contents; 6 return (!d.contents || d.contents.length === 0) ? null : d.contents;
7 }); 7 });
8 8
9var nodes = tree.nodes(treeData); 9var nodes = tree.nodes(treeData);
10var links = tree.links(nodes); 10var links = tree.links(nodes);
11 '. 11 '.
testNode := GrafoscopioTextNode new testNode := GrafoscopioTextNode new
body: copiedCode. body: copiedCode.
testNode removeLeadingLineNumbersSized: 3. testNode removeLeadingLineNumbersSized: 3.
self assert: testNode body equals: ' self assert: testNode body equals: '
var tree = d3.layout.tree() var tree = d3.layout.tree()
.sort(null) .sort(null)
.size([size.height, size.width - maxLabelLength*options.fontSize]) .size([size.height, size.width - maxLabelLength*options.fontSize])
.children(function(d) .children(function(d)
{ {
return (!d.contents || d.contents.length === 0) ? null : d.contents; return (!d.contents || d.contents.length === 0) ? null : d.contents;
}); });
var nodes = tree.nodes(treeData); var nodes = tree.nodes(treeData);
var links = tree.links(nodes); var links = tree.links(nodes);
' '
] ]
{ #category : #tests } { #category : #tests }
GrafoscopioNodeTest >> testRemovingChildren [ GrafoscopioNodeTest >> testRemovingChildren [
| tree orig | | tree orig |
tree := self newTestTree.. tree := self newTestTree..
orig := tree children size. orig := tree children size.
orig > 0 ifTrue: [ tree removeNode: (tree children at: 1) ]. orig > 0 ifTrue: [ tree removeNode: (tree children at: 1) ].
self assert: tree children size equals: orig - 1. self assert: tree children size equals: orig - 1.
] ]
{ #category : #tests } { #category : #tests }
GrafoscopioNodeTest >> testSanitizedLink [ GrafoscopioNodeTest >> testSanitizedLink [
| node link | | node link |
link := 'docutopia://hackbo:hackbot'. link := 'docutopia://hackbo:hackbot'.
node := GrafoscopioTextNode new links: link. node := GrafoscopioTextNode new links: link.
self assert: (node sanitizeDefaultLink = 'https://docutopia.tupale.co/hackbo:hackbot') equals: true self assert: (node sanitizeDefaultLink = 'https://docutopia.tupale.co/hackbo:hackbot') equals: true
] ]

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
" "
I test the main functionality of the GrafoscopioNode class. I test the main functionality of the GrafoscopioNode class.
" "
Class { Class {
#name : #GrafoscopioNotebookTest, #name : #GrafoscopioNotebookTest,
#superclass : #TestCase, #superclass : #TestCase,
#category : #'Grafoscopio-UI' #category : #'Grafoscopio-UI'
} }

View File

@ -1,196 +1,207 @@
Class { Class {
#name : #GrafoscopioPerspective, #name : #GrafoscopioPerspective,
#superclass : #SpPresenterWithModel, #superclass : #SpPresenterWithModel,
#instVars : [ #instVars : [
'toolbar', 'toolbar',
'viewport' 'viewport'
], ],
#category : #'Grafoscopio-New-UI' #category : #'Grafoscopio-New-UI'
} }
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPerspective class >> defaultPerspective [ GrafoscopioPerspective class >> defaultPerspective [
^ GrafoscopioDocumentEditionPerspective ^ GrafoscopioDocumentTextEditionPerspective
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPerspective class >> defaultSpec [ GrafoscopioPerspective class >> defaultSpec [
^ SpBoxLayout newVertical ^ SpBoxLayout newVertical
add: #toolbar height: self toolbarHeight; add: #toolbar height: self toolbarHeight;
add: #viewport; add: #viewport;
yourself yourself
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPerspective class >> isAbstract [ GrafoscopioPerspective class >> isAbstract [
^ self = GrafoscopioPerspective ^ self = GrafoscopioPerspective
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPerspective class >> perspectives [ GrafoscopioPerspective class >> perspectives [
^ self allSubclasses select: [ : c | c isAbstract not ] ^ self allSubclasses select: [ : c | c isAbstract not ]
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioPerspective >> aboutToBeUninstalledFrom: aTreeNotebook [ GrafoscopioPerspective >> aboutToBeInstalled: aTreeNotebook [
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioPerspective >> addItemTo: aGroup [ GrafoscopioPerspective >> aboutToBeUninstalledFrom: aTreeNotebook [
aGroup ]
addItem: [ :item |
item { #category : #initialization }
name: 'Dynamic'; GrafoscopioPerspective >> addItemTo: aGroup [
icon: (self iconNamed: #delete); aGroup
action: [ aGroup menuItems remove: item. addItem: [ :item |
self needRebuild: false. item
self buildWithSpec ] ]. name: 'Dynamic';
self needRebuild: false. icon: (self iconNamed: #delete);
self buildWithSpec action: [ aGroup menuItems remove: item.
] self needRebuild: false.
self buildWithSpec ] ].
{ #category : #initialization } self needRebuild: false.
GrafoscopioPerspective >> addingMenu [ self buildWithSpec
| menu | ]
menu := self newMenu.
self kindsOfNode { #category : #initialization }
do: [ :n | GrafoscopioPerspective >> addingMenu [
menu | menu |
addItem: [ :item | menu := self newMenu.
item self kindsOfNode
name: n nameForSelection; do: [ :n |
icon: n icon; menu
action: [ self addNewNodeOfClass: n ] ] ]. addItem: [ :item |
^ menu item
] name: n nameForSelection;
icon: n icon;
{ #category : #'as yet unclassified' } action: [ self addNewNodeOfClass: n ] ] ].
GrafoscopioPerspective >> chooseKindsOfNode [ ^ menu
| idx values | ]
values := self kindsOfNode.
idx := UIManager default { #category : #'as yet unclassified' }
chooseFrom: values GrafoscopioPerspective >> chooseKindsOfNode [
lines: {} | idx values |
title: 'What kind of node? '. values := self kindsOfNode.
^ idx = 0 idx := UIManager default
ifTrue: [ nil ] chooseFrom: values
ifFalse: [ values at: idx ] lines: {}
] title: 'What kind of node? '.
^ idx = 0
{ #category : #initialization } ifTrue: [ nil ]
GrafoscopioPerspective >> createToolbar [ ifFalse: [ values at: idx ]
| aMenu | ]
aMenu := self newMenuBar
addGroup: [ :group | { #category : #initialization }
group GrafoscopioPerspective >> createToolbar [
addItem: [ :item | | aMenu |
item aMenu := self newMenuBar
name: 'File'; addGroup: [ :group |
icon: (self iconNamed: #openIcon); group
subMenu: self subMenu ]. addItem: [ :item |
group item
addItem: [ :item | name: 'File';
item icon: (self iconNamed: #openIcon);
name: nil; subMenu: self subMenu ].
description: 'Open file'; group
icon: (self iconNamed: #openIcon); addItem: [ :item |
action: [ self inform: 'Open File' ] ]. item
group name: nil;
addItem: [ :item | description: 'Open file';
item icon: (self iconNamed: #openIcon);
name: nil; action: [ self inform: 'Open File' ] ].
description: 'Save File'; group
icon: (self iconNamed: #smallSaveIcon); addItem: [ :item |
action: [ self inform: 'Save File' ] ]. item
group name: nil;
addItem: [ :item | description: 'Save File';
item icon: (self iconNamed: #smallSaveIcon);
name: nil; action: [ self inform: 'Save File' ] ].
description: 'Print file'; group
icon: (self iconNamed: #smallPrintIcon); addItem: [ :item |
action: [ self inform: 'Print file' ] ] ]; item
addGroup: [ :group | name: nil;
group description: 'Print file';
addItem: [ :item | icon: (self iconNamed: #smallPrintIcon);
item action: [ self inform: 'Print file' ] ] ];
name: nil; addGroup: [ :group |
description: 'Undo'; group
icon: (self iconNamed: #smallUndoIcon); addItem: [ :item |
action: [ self inform: 'Undo' ] ]. item
group name: nil;
addItem: [ :item | description: 'Undo';
item icon: (self iconNamed: #smallUndoIcon);
name: nil; action: [ self inform: 'Undo' ] ].
description: 'Redo'; group
icon: (self iconNamed: #smallRedoIcon); addItem: [ :item |
action: [ self inform: 'Redo' ] ]. item
group name: nil;
addItem: [ :item | description: 'Redo';
item icon: (self iconNamed: #smallRedoIcon);
name: ''; action: [ self inform: 'Redo' ] ].
icon: (self iconNamed: #add); group
subMenu: self addingMenu ]. addItem: [ :item |
item
]; name: '';
addGroup: [ :group | icon: (self iconNamed: #add);
group subMenu: self addingMenu ].
addItem: [ :item |
item ];
name: nil; addGroup: [ :group |
description: 'Add menu item'; group
icon: (self iconNamed: #add); addItem: [ :item |
action: [ self addItemTo: group ] ] ]. item
aMenu color: Color transparent. name: nil;
^ aMenu description: 'Add menu item';
] icon: (self iconNamed: #add);
action: [ self addItemTo: group ] ] ].
{ #category : #initialization } aMenu color: Color transparent.
GrafoscopioPerspective >> createViewport [ ^ aMenu
self subclassResponsibility ]
]
{ #category : #initialization }
{ #category : #initialization } GrafoscopioPerspective >> createViewport [
GrafoscopioPerspective >> initializeWidgets [ self subclassResponsibility
super initializeWidgets. ]
toolbar := self createToolbar.
viewport := self createViewport { #category : #initialization }
] GrafoscopioPerspective >> initializeWidgets [
super initializeWidgets.
{ #category : #'as yet unclassified' } toolbar := self createToolbar.
GrafoscopioPerspective >> kindsOfNode [ viewport := self createViewport
^ GrafoscopioAbstractNode allSubclasses select: [ :c | c showInMenu ] ]
]
{ #category : #'as yet unclassified' }
{ #category : #initialization } GrafoscopioPerspective >> kindsOfNode [
GrafoscopioPerspective >> subMenu [ ^ GrafoscopioAbstractNode allSubclasses select: [ :c | c showInMenu ]
^ self newMenu ]
addItem: [ :item |
item { #category : #initialization }
name: 'Open'; GrafoscopioPerspective >> subMenu [
icon: (self iconNamed: #openIcon); ^ self newMenu
shortcut: $o meta; addItem: [ :item |
action: [ self inform: 'Open' ] ]; item
addItem: [ :item | name: 'Open';
item icon: (self iconNamed: #openIcon);
name: 'Save'; shortcut: $o meta;
icon: (self iconNamed: #smallSaveIcon); action: [ self inform: 'Open' ] ];
shortcut: $s meta; addItem: [ :item |
action: [ self inform: 'Save' ] ]; item
addItem: [ :item | name: 'Save';
item icon: (self iconNamed: #smallSaveIcon);
name: 'Print'; shortcut: $s meta;
shortcut: $p meta; action: [ self inform: 'Save' ] ];
icon: (self iconNamed: #smallPrintIcon); addItem: [ :item |
action: [ self inform: 'Print' ] ]; item
addItem: [ :item | name: 'Print';
item shortcut: $p meta;
name: 'Close'; icon: (self iconNamed: #smallPrintIcon);
shortcut: $c meta; action: [ self inform: 'Print' ] ];
icon: (self iconNamed: #smallCancelIcon); addItem: [ :item |
action: [ self inform: 'Kill' ] ]; item
yourself name: 'Close';
] shortcut: $c meta;
icon: (self iconNamed: #smallCancelIcon);
{ #category : #'as yet unclassified' } action: [ self inform: 'Kill' ] ];
GrafoscopioPerspective >> updateModel: aModel [ yourself
] ]
{ #category : #'as yet unclassified' }
GrafoscopioPerspective >> updateModel: aModel [
]
{ #category : #initialization }
GrafoscopioPerspective >> viewport: aViewport [
viewport := aViewport.
self buildWithSpec
]

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,80 @@
Class {
#name : #GrafoscopioPillarASTextNotebook,
#superclass : #SpPresenterWithModel,
#instVars : [
'sidebar',
'viewport',
'model',
'empty',
'perspectives'
],
#category : #'Grafoscopio-New-UI'
}
{ #category : #specs }
GrafoscopioPillarASTextNotebook class >> defaultSpec [
^ SpBoxLayout newHorizontal
add:
(SpBoxLayout newVertical
add: #empty height: self toolbarHeight;
add: #sidebar;
yourself)
width: 51;
add: #viewport;
yourself
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextNotebook >> basicInstallPerspective: aPerspective [
viewport ifNotNil: [ viewport aboutToBeUninstalledFrom: self ].
viewport := self perspectives
at: aPerspective
ifAbsentPut: [ self instantiate: aPerspective on: model document ].
]
{ #category : #initialization }
GrafoscopioPillarASTextNotebook >> createDefaultComponent [
^ self basicInstallPerspective: GrafoscopioPerspective defaultPerspective
]
{ #category : #initialization }
GrafoscopioPillarASTextNotebook >> initializeWidgets [
super initializeWidgets.
sidebar := self sidebar.
self createDefaultComponent.
empty := self newLabel.
]
{ #category : #initialization }
GrafoscopioPillarASTextNotebook >> installPerspective: aPerspective [
self basicInstallPerspective: aPerspective .
self modelChanged
]
{ #category : #initialization }
GrafoscopioPillarASTextNotebook >> modelChanged [
viewport modelChanged.
self needRebuild: false.
self buildWithSpec
]
{ #category : #initialization }
GrafoscopioPillarASTextNotebook >> perspectives [
^ perspectives ifNil: [ perspectives := Dictionary new ]
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextNotebook >> setModelBeforeInitialization: aDomainObject [
super setModelBeforeInitialization: aDomainObject.
model := aDomainObject
]
{ #category : #initialization }
GrafoscopioPillarASTextNotebook >> sidebar [
| bar |
bar := self instantiate: SpSidebar.
GrafoscopioPerspective perspectives
do:
[ :p | bar addAction: [ self installPerspective: p ] icon: p icon ].
^ bar
]

View File

@ -0,0 +1,205 @@
Class {
#name : #GrafoscopioPillarASTextStringAdapter,
#superclass : #ProtoObject,
#instVars : [
'text'
],
#category : #'Grafoscopio-Pillar'
}
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> allRangesOfSubstring: aSubstring [
^ Array streamContents: [:s | | start subSize |
start := 1.
subSize := aSubstring size.
[start isZero]
whileFalse: [ start := self findString: aSubstring startingAt: start.
start > 0
ifTrue: [s nextPut: (start to: start + subSize - 1).
start := start + subSize]]]
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> asString [
^ self
]
{ #category : #accessing }
GrafoscopioPillarASTextStringAdapter >> at: aNumber [
^ text at: aNumber
]
{ #category : #accessing }
GrafoscopioPillarASTextStringAdapter >> at: aNumber put: aChar [
self halt
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> copyFrom: one to: two [
^ text copyFrom: one to: two
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> findString: key startingAt: start [
^ self findString: key startingAt: start caseSensitive: true
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> findString: key startingAt: start caseSensitive: caseSensitive [
"Answer the index in this String at which the substring key first occurs,
at or beyond start. The match can be case-sensitive or not. If no match
is found, zero will be returned."
"IMPLEMENTATION NOTE: do not use CaseSensitiveOrder because it is broken for WideString
This is a temporary work around until Wide CaseSensitiveOrder search is fixed
Code should revert to:
caseSensitive
ifTrue: [^ self findSubstring: key in: self startingAt: start matchTable: CaseSensitiveOrder]
ifFalse: [^ self findSubstring: key in: self startingAt: start matchTable: CaseInsensitiveOrder]"
^ caseSensitive
ifTrue: [ WideString new
findSubstring: key
in: self
startingAt: start
matchTable: nil ]
ifFalse: [ WideString new
findSubstring: key
in: self
startingAt: start
matchTable: String newCaseInsensitiveOrder ]
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> ifEmpty: aBlock [
"Evaluate the given block, answering its value if the receiver is empty, otherwise answer the receiver."
"Note that the fact that this method returns its receiver in case the receiver is not empty allows one to write expressions like the following ones: self classifyMethodAs: (myProtocol ifEmpty: ['As yet unclassified'])"
^ self isEmpty
ifTrue: [ aBlock value ]
ifFalse: [ self ]
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> ifEmpty: emptyBlock ifNotEmpty: notEmptyBlock [
"Evaluate emptyBlock if I'm empty, notEmptyBlock otherwise"
"If the notEmptyBlock has an argument, eval with the receiver as its argument"
^ self isEmpty
ifTrue: [ emptyBlock value ]
ifFalse: [ notEmptyBlock cull: self ]
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> indexOf: aCharacter startingAt: anInteger ifAbsent: aBlockClosure [
| current index |
current := text detectAstNodeFor: anInteger.
index := current text
indexOf: aCharacter
startingAt: anInteger - current textStart + 1.
current := current next.
[ current isNotNil ]
whileTrue: [ index := current text indexOf: aCharacter.
index = 0
ifTrue: [ current := current next ]
ifFalse: [ ^ current textStart + index ] ].
^ aBlockClosure value
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> isByteString [
^ false
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> isEmpty [
^ text isEmpty
]
{ #category : #accessing }
GrafoscopioPillarASTextStringAdapter >> isReadOnlyObject [
"Answer if the receiver is read-only.
If the VM supports read-only objects it will not write to read-only objects.
An attempt to write to an instance variable of a read-only object will
cause the VM to send attemptToAssign:withIndex: to the read-only object.
An attempt to modify a read-only object in a primitive will cause the
primitive to fail with a #'no modification' error code."
<primitive: 163 error: ec>
^self class isImmediateClass
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> isString [
^ true
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> isWideString [
^ true
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> lastIndexOf: anElement startingAt: lastIndex ifAbsent: exceptionBlock [
"Answer the index of the last occurence of anElement within the
receiver. If the receiver does not contain anElement, answer the
result of evaluating the argument, exceptionBlock."
lastIndex to: 1 by: -1 do: [ :index |
(self at: index) = anElement
ifTrue: [ ^ index ] ].
^ exceptionBlock value
]
{ #category : #accessing }
GrafoscopioPillarASTextStringAdapter >> notEmpty [
^ text notEmpty
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> printOn: aStream [
aStream
nextPutAll: 'StringAdaptor(';
nextPutAll: self size asString;
nextPutAll: ')'
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> printString [
^ String streamContents: [ :str | self printOn: str ]
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> readStream [
^ ReadStream on: self
]
{ #category : #accessing }
GrafoscopioPillarASTextStringAdapter >> size [
^ text size
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> string [
^ text extractStringFrom: 1 to: self size
]
{ #category : #accessing }
GrafoscopioPillarASTextStringAdapter >> text: aGFPText [
text := aGFPText
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> trimBoth [
^ self
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> yourself [
^ self
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringAdapter >> ~= anOther [
^ (self == anOther) not
]

View File

@ -1,74 +0,0 @@
Class {
#name : #GrafoscopioPillarASTextStringDecorator,
#superclass : #Object,
#instVars : [
'text'
],
#category : #'Grafoscopio-Pillar'
}
{ #category : #accessing }
GrafoscopioPillarASTextStringDecorator >> at: aNumber [
^ text at: aNumber
]
{ #category : #accessing }
GrafoscopioPillarASTextStringDecorator >> at: aNumber put: aChar [
self halt
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringDecorator >> copyFrom: one to: two [
^ text copyFrom: one to: two
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringDecorator >> indexOf: aCharacter startingAt: anInteger ifAbsent: aBlockClosure [
| current index |
current := text detectAstNodeFor: anInteger.
index := current text
indexOf: aCharacter
startingAt: anInteger - current textStart + 1.
current := current next.
[ current isNotNil ]
whileTrue: [ index := current text indexOf: aCharacter.
index = 0
ifTrue: [ current := current next ]
ifFalse: [ ^ current textStart + index ] ].
^ aBlockClosure value
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringDecorator >> isByteString [
^ false
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringDecorator >> isEmpty [
^ text isEmpty
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringDecorator >> isWideString [
^ true
]
{ #category : #accessing }
GrafoscopioPillarASTextStringDecorator >> notEmpty [
^ text notEmpty
]
{ #category : #accessing }
GrafoscopioPillarASTextStringDecorator >> size [
^ text size
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringDecorator >> string [
self shouldBeImplemented.
]
{ #category : #accessing }
GrafoscopioPillarASTextStringDecorator >> text: aGFPText [
text := aGFPText
]

View File

@ -0,0 +1,69 @@
Class {
#name : #GrafoscopioPillarASTextStringProjectionAdapter,
#superclass : #GrafoscopioPillarASTextStringAdapter,
#instVars : [
'from',
'to',
'cached'
],
#category : #'Grafoscopio-Pillar'
}
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringProjectionAdapter >> asText [
^ self string asText
]
{ #category : #accessing }
GrafoscopioPillarASTextStringProjectionAdapter >> at: anInteger [
^ self cached at: anInteger
]
{ #category : #accessing }
GrafoscopioPillarASTextStringProjectionAdapter >> cached [
^ cached ifNil: [ cached := text extractStringFrom: from to: to ]
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringProjectionAdapter >> copyFrom: one to: two [
^ self class new
text: text;
from: from + one;
to: from + two;
yourself
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringProjectionAdapter >> from: anInteger [
from := anInteger
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringProjectionAdapter >> isEmpty [
^ to <= from
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringProjectionAdapter >> printOn: aStream [
aStream
nextPutAll: 'SubStringAdapter(';
nextPutAll: from asString;
nextPutAll: ':';
nextPutAll: to asString;
nextPutAll: ')'
]
{ #category : #accessing }
GrafoscopioPillarASTextStringProjectionAdapter >> size [
^ to - from
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringProjectionAdapter >> string [
^ text extractStringFrom: from to: to
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringProjectionAdapter >> to: anInteger [
to := anInteger
]

View File

@ -1,64 +0,0 @@
Class {
#name : #GrafoscopioPillarASTextStringProjectionDecorator,
#superclass : #GrafoscopioPillarASTextStringDecorator,
#instVars : [
'from',
'to',
'cached'
],
#category : #'Grafoscopio-Pillar'
}
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringProjectionDecorator >> allRangesOfSubstring: aString [
^ { }
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringProjectionDecorator >> asText [
^ self string asText
]
{ #category : #accessing }
GrafoscopioPillarASTextStringProjectionDecorator >> at: anInteger [
^ self cached at: anInteger
]
{ #category : #accessing }
GrafoscopioPillarASTextStringProjectionDecorator >> cached [
^ cached ifNil: [ cached := text extractStringFrom: from to: to ]
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringProjectionDecorator >> copyFrom: one to: two [
^ self class new
text: text;
from: from + one;
to: from + two;
yourself
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringProjectionDecorator >> from: anInteger [
from := anInteger
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringProjectionDecorator >> isEmpty [
^ from <= to
]
{ #category : #accessing }
GrafoscopioPillarASTextStringProjectionDecorator >> size [
^ to - from
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringProjectionDecorator >> string [
^ text extractStringFrom: from to: to
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarASTextStringProjectionDecorator >> to: anInteger [
to := anInteger
]

View File

@ -0,0 +1,40 @@
Class {
#name : #GrafoscopioPillarNode,
#superclass : #GrafoscopioLeafNode,
#instVars : [
'ast',
'astText'
],
#category : #'Grafoscopio-Model'
}
{ #category : #testing }
GrafoscopioPillarNode class >> icon [
^ self iconNamed: #workspace
]
{ #category : #testing }
GrafoscopioPillarNode class >> nameForSelection [
^ 'New Pillar node'
]
{ #category : #testing }
GrafoscopioPillarNode class >> showInMenu [
^ true
]
{ #category : #accessing }
GrafoscopioPillarNode >> acceptVisitor: aGrafoscopioVisitor [
aGrafoscopioVisitor visitPillarNode: self.
]
{ #category : #accessing }
GrafoscopioPillarNode >> text [
^ astText
]
{ #category : #accessing }
GrafoscopioPillarNode >> text: anAst [
astText := anAst
]

View File

@ -1,80 +1,74 @@
Class { Class {
#name : #GrafoscopioPillarRuns, #name : #GrafoscopioPillarRuns,
#superclass : #Object, #superclass : #Object,
#instVars : [ #instVars : [
'ast', 'ast',
'lastBranch', 'lastBranch',
'lastAttributes', 'lastAttributes',
'visitor' 'visitor'
], ],
#category : #'Grafoscopio-Pillar-Style' #category : #'Grafoscopio-Pillar-Style'
} }
{ #category : #accessing } { #category : #accessing }
GrafoscopioPillarRuns >> ast: anAst [ GrafoscopioPillarRuns >> ast: anAst [
ast := anAst. ast := anAst.
visitor := GrafoscopioAttributeBranchVisitor new. visitor := GrafoscopioAttributeBranchVisitor new.
visitor text: ast visitor text: ast
] ]
{ #category : #'basic api' } { #category : #'basic api' }
GrafoscopioPillarRuns >> at: anIndex [ GrafoscopioPillarRuns >> at: anIndex [
| newBranch | | newBranch |
anIndex > ast size anIndex > ast size
ifTrue: [ ^ Array empty ]. ifTrue: [ ^ Array empty ].
newBranch := ast detectFullBranchFor: anIndex. newBranch := ast detectFullBranchFor: anIndex.
newBranch = lastBranch "newBranch = lastBranch
ifTrue: [ ^ lastAttributes ]. ifTrue: [ ^ lastAttributes ]."
lastAttributes := self lastAttributes := self
calculateAttributesForBranch: newBranch calculateAttributesForBranch: newBranch
at: anIndex. at: anIndex.
lastBranch := (newBranch lastBranch := (newBranch
anySatisfy: [ :n | n isMemberOf: PRCodeblock ]) anySatisfy: [ :n | n isMemberOf: PRCodeblock ])
ifTrue: [ nil ] ifTrue: [ nil ]
ifFalse: [ newBranch ]. ifFalse: [ newBranch ].
^ lastAttributes ^ lastAttributes
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPillarRuns >> calculateAttributesForBranch: aCollection at: anIndex [ GrafoscopioPillarRuns >> calculateAttributesForBranch: aCollection at: anIndex [
^ visitor analyzeBranch: aCollection at: anIndex. ^ visitor analyzeBranch: aCollection at: anIndex.
] ]
{ #category : #'basic api' } { #category : #'basic api' }
GrafoscopioPillarRuns >> isEmpty [ GrafoscopioPillarRuns >> isEmpty [
^ ast isNil or: [ ast isEmpty ] ^ ast isNil or: [ ast isEmpty ]
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPillarRuns >> rangeOf: aTextURL startingAt: anInteger [ GrafoscopioPillarRuns >> rangeOf: aTextURL startingAt: anInteger [
self assert: (aTextURL isKindOf: TextAction). self assert: (aTextURL isKindOf: TextAction).
((self at: anInteger) contains: [ : a | (a isKindOf: TextAction)]) ifTrue: [ ((self at: anInteger) contains: [ : a | (a isKindOf: TextAction)]) ifTrue: [
(ast extractStringFrom: anInteger to: (ast detectAstNodeFor: anInteger ) textStop) traceCr. (ast extractStringFrom: anInteger to: (ast detectAstNodeFor: anInteger ) textStop) traceCr.
^ anInteger to: (ast detectAstNodeFor: anInteger ) textStop ^ anInteger to: (ast detectAstNodeFor: anInteger ) textStop
]. ].
^ 0 to: 0 ^ 0 to: 0
] ]
{ #category : #'basic api' } { #category : #'as yet unclassified' }
GrafoscopioPillarRuns >> reset [ GrafoscopioPillarRuns >> runLengthFor: anInteger [
lastAttributes := nil. | node |
lastBranch := nil. anInteger > ast size
] ifTrue: [ ^ 0 ].
node := ast detectAstNodeFor: anInteger.
{ #category : #'as yet unclassified' } ^ (node isKindOf: PRCodeblock)
GrafoscopioPillarRuns >> runLengthFor: anInteger [ ifTrue: [ 1 ]
| node | ifFalse: [ node textStop - anInteger ]
anInteger > ast size ]
ifTrue: [ ^ 0 ].
node := ast detectAstNodeFor: anInteger. { #category : #'as yet unclassified' }
^ (node isKindOf: PRCodeblock) GrafoscopioPillarRuns >> withStartStopAndValueDo: aBlockClosure [
ifTrue: [ 1 ] thisContext sender asString traceCr.
ifFalse: [ node textStop - anInteger ] 'Should implement' traceCr.
] ]
{ #category : #'as yet unclassified' }
GrafoscopioPillarRuns >> withStartStopAndValueDo: aBlockClosure [
thisContext sender asString traceCr.
'Should implement' traceCr.
]

View File

@ -1,104 +1,104 @@
Class { Class {
#name : #GrafoscopioPillarStyler, #name : #GrafoscopioPillarStyler,
#superclass : #Object, #superclass : #Object,
#instVars : [ #instVars : [
'pharoStyler' 'pharoStyler'
], ],
#category : #'Grafoscopio-Pillar-Style' #category : #'Grafoscopio-Pillar-Style'
} }
{ #category : #accessing } { #category : #accessing }
GrafoscopioPillarStyler class >> defaultStyler [ GrafoscopioPillarStyler class >> defaultStyler [
^ self new ^ self new
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPillarStyler >> attributesForCodeBlock: aPRCodeblock at: index [ GrafoscopioPillarStyler >> attributesForCodeBlock: aPRCodeblock at: index [
aPRCodeblock language originalName = 'pharo-image' aPRCodeblock language originalName = 'pharo-image'
ifTrue: [ ^ {(TextAnchor new ifTrue: [ ^ {(TextAnchor new
anchoredMorph: (self class compiler evaluate: (aPRCodeblock propertyAt: #text)))} ]. anchoredMorph: (self class compiler evaluate: (aPRCodeblock propertyAt: #text)))} ].
aPRCodeblock language originalName = 'pharo' aPRCodeblock language originalName = 'pharo'
ifTrue: [ | runs | ifTrue: [ | runs |
runs := (self pharoStyler runs := (self pharoStyler
privateStyle: aPRCodeblock text asText , '.') runs. privateStyle: aPRCodeblock text asText , '.') runs.
^ runs at: index - aPRCodeblock textStart ]. ^ runs at: index - aPRCodeblock textStart ].
^{} ^{}
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPillarStyler >> attributesForDocument: aDocument [ GrafoscopioPillarStyler >> attributesForDocument: aDocument [
^ self default ^ self default
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPillarStyler >> attributesForExternalLink: aPRExternalLink [ GrafoscopioPillarStyler >> attributesForExternalLink: aPRExternalLink [
^ {(TextColor new color: (Color fromHexString: '03A9F4')). ^ {(TextColor new color: (Color fromHexString: '03A9F4')).
TextEmphasis underlined. TextEmphasis underlined.
(TextAction new (TextAction new
actOnClickBlock: [ self inform: 'Should be going to ' , aPRExternalLink reference ])} actOnClickBlock: [ self inform: 'Should be going to ' , aPRExternalLink reference ])}
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPillarStyler >> attributesForFigure: aPRFigure [ GrafoscopioPillarStyler >> attributesForFigure: aPRFigure [
^ self default ^ self default
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPillarStyler >> attributesForFormatText: aGrafoscopioFormatTextNode [ GrafoscopioPillarStyler >> attributesForFormatText: aGrafoscopioFormatTextNode [
^ self attributesForText: aGrafoscopioFormatTextNode ^ self attributesForText: aGrafoscopioFormatTextNode
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPillarStyler >> attributesForHeader: aPRHeader [ GrafoscopioPillarStyler >> attributesForHeader: aPRHeader [
^ {(TextFontReference ^ {(TextFontReference
toFont: toFont:
(LogicalFont (LogicalFont
familyName: 'Source Code Pro' familyName: 'Source Code Pro'
pointSize: (20 - (aPRHeader level * 5) max: 10))) . TextEmphasis bold} pointSize: (20 - (aPRHeader level * 5) max: 10))) . TextEmphasis bold}
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPillarStyler >> attributesForInternalLink: aPRInternalLink [ GrafoscopioPillarStyler >> attributesForInternalLink: aPRInternalLink [
^ self attributesForExternalLink: aPRInternalLink ^ self attributesForExternalLink: aPRInternalLink
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPillarStyler >> attributesForLineBreak: aPRLineBreak [ GrafoscopioPillarStyler >> attributesForLineBreak: aPRLineBreak [
^ self default ^ self default
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPillarStyler >> attributesForListItem: aPRListItem at: index [ GrafoscopioPillarStyler >> attributesForListItem: aPRListItem at: index [
^ (aPRListItem text at: index - aPRListItem textStart + 1) = Character home ^ (aPRListItem text at: index - aPRListItem textStart + 1) = Character home
ifTrue: [ {(TextIndent tabs: aPRListItem level). ifTrue: [ {(TextIndent tabs: aPRListItem parent level).
(TextAnchor new (TextAnchor new
anchoredMorph: (self iconNamed: #menuPin); anchoredMorph: (self iconNamed: #menuPin);
yourself)} ] ifFalse: [ { } ] yourself)} ] ifFalse: [ { } ]
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPillarStyler >> attributesForParagraph: aParagraph [ GrafoscopioPillarStyler >> attributesForParagraph: aParagraph [
^ self default ^ self default
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPillarStyler >> attributesForText: aText [ GrafoscopioPillarStyler >> attributesForText: aText [
^ self default ^ self default
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPillarStyler >> attributesForUnorderedList: aList [ GrafoscopioPillarStyler >> attributesForUnorderedList: aList [
^ self default ^ self default
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPillarStyler >> default [ GrafoscopioPillarStyler >> default [
^ Array empty ^ Array empty
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPillarStyler >> pharoStyler [ GrafoscopioPillarStyler >> pharoStyler [
^ pharoStyler ^ pharoStyler
ifNil: [ pharoStyler := SHRBTextStyler new isForWorkspace: true; yourself] ifNil: [ pharoStyler := SHRBTextStyler new isForWorkspace: true; yourself]
] ]

View File

@ -1,65 +1,65 @@
Class { Class {
#name : #GrafoscopioPillarTextAnnotator, #name : #GrafoscopioPillarTextAnnotator,
#superclass : #PRVisitor, #superclass : #PRVisitor,
#instVars : [ #instVars : [
'texts', 'texts',
'formatter', 'formatter',
'lastStop' 'lastStop'
], ],
#category : #'Grafoscopio-Pillar' #category : #'Grafoscopio-Pillar'
} }
{ #category : #'visiting-document' } { #category : #'visiting-document' }
GrafoscopioPillarTextAnnotator >> formatter: aFormatter [ GrafoscopioPillarTextAnnotator >> formatter: aFormatter [
formatter := aFormatter formatter := aFormatter
] ]
{ #category : #'visiting-document' } { #category : #'visiting-document' }
GrafoscopioPillarTextAnnotator >> initialize [ GrafoscopioPillarTextAnnotator >> initialize [
super initialize. super initialize.
texts := OrderedCollection new. texts := OrderedCollection new.
formatter := GrafoscopioTextFormatter default. formatter := GrafoscopioTextFormatter default.
] ]
{ #category : #'visiting-document' } { #category : #'visiting-document' }
GrafoscopioPillarTextAnnotator >> visitCodeblock: aTextObject [ GrafoscopioPillarTextAnnotator >> visitCodeblock: aTextObject [
self visitText: aTextObject self visitText: aTextObject
] ]
{ #category : #'visiting-document' } { #category : #'visiting-document' }
GrafoscopioPillarTextAnnotator >> visitCommentedLine: aTextObject [ GrafoscopioPillarTextAnnotator >> visitCommentedLine: aTextObject [
self visitText: aTextObject self visitText: aTextObject
] ]
{ #category : #'visiting-document' } { #category : #'visiting-document' }
GrafoscopioPillarTextAnnotator >> visitDocument: aDoc [ GrafoscopioPillarTextAnnotator >> visitDocument: aDoc [
lastStop := 1 . lastStop := 1 .
aDoc accept: formatter. aDoc accept: formatter.
super visitDocument: aDoc. super visitDocument: aDoc.
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioPillarTextAnnotator >> visitFormatText: aGrafoscopioFormatTextNode [ GrafoscopioPillarTextAnnotator >> visitFormatText: aGrafoscopioFormatTextNode [
" for the annotator, a format text is a much as regular text" " for the annotator, a format text is a much as regular text"
self visitText: aGrafoscopioFormatTextNode self visitText: aGrafoscopioFormatTextNode
] ]
{ #category : #'visiting-document' } { #category : #'visiting-document' }
GrafoscopioPillarTextAnnotator >> visitLineBreak: anObject [ GrafoscopioPillarTextAnnotator >> visitLineBreak: anObject [
^ self visitText: anObject ^ self visitText: anObject
] ]
{ #category : #'visiting-document' } { #category : #'visiting-document' }
GrafoscopioPillarTextAnnotator >> visitRaw: aTextObject [ GrafoscopioPillarTextAnnotator >> visitRaw: aTextObject [
self visitText: aTextObject self visitText: aTextObject
] ]
{ #category : #'visiting-document' } { #category : #'visiting-document' }
GrafoscopioPillarTextAnnotator >> visitText: aTextObject [ GrafoscopioPillarTextAnnotator >> visitText: aTextObject [
texts ifNotEmpty: [ texts last next: aTextObject ]. texts ifNotEmpty: [ texts last next: aTextObject ].
texts add: aTextObject. texts add: aTextObject.
aTextObject propertyAt: #textStart put: lastStop. aTextObject propertyAt: #textStart put: lastStop.
lastStop := lastStop + aTextObject text size. lastStop := lastStop + aTextObject text size.
aTextObject propertyAt: #textStop put: lastStop . aTextObject propertyAt: #textStop put: lastStop .
] ]

View File

@ -0,0 +1,37 @@
Class {
#name : #GrafoscopioPillarToTextDecorator,
#superclass : #Object,
#instVars : [
'pillarNode'
],
#category : #'Grafoscopio-Pillar'
}
{ #category : #'instance creation' }
GrafoscopioPillarToTextDecorator class >> on: aGFPillarNode [
^ self new
pillarNode: aGFPillarNode;
yourself
]
{ #category : #'as yet unclassified' }
GrafoscopioPillarToTextDecorator >> name [
^ pillarNode name
]
{ #category : #accessing }
GrafoscopioPillarToTextDecorator >> pillarNode: aNode [
pillarNode := aNode
]
{ #category : #accessing }
GrafoscopioPillarToTextDecorator >> text [
^ pillarNode text pillarText
]
{ #category : #accessing }
GrafoscopioPillarToTextDecorator >> text: aText [
| parsed |
parsed := PRPillarParser parse: aText.
^ pillarNode text ast: parsed
]

View File

@ -1,26 +1,31 @@
Class { Class {
#name : #GrafoscopioProject, #name : #GrafoscopioProject,
#superclass : #Object, #superclass : #Object,
#instVars : [ #instVars : [
'document', 'document',
'dictionary' 'dictionary'
], ],
#category : #'Grafoscopio-Model' #category : #'Grafoscopio-Model'
} }
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioProject >> document [ GrafoscopioProject >> acceptVisitor: aGrafoscopioViewportTextVisitor [
^ document aGrafoscopioViewportTextVisitor visitGrafoscopioProject: self
] ]
{ #category : #initialization } { #category : #'as yet unclassified' }
GrafoscopioProject >> initialize [ GrafoscopioProject >> document [
super initialize. ^ document
document := GrafoscopioRootNode new. ]
dictionary := GrafoscopioRootNode new
] { #category : #initialization }
GrafoscopioProject >> initialize [
{ #category : #initialization } super initialize.
GrafoscopioProject >> name: aName [ document := GrafoscopioRootNode new.
document name: aName dictionary := GrafoscopioRootNode new
] ]
{ #category : #initialization }
GrafoscopioProject >> name: aName [
document name: aName
]

View File

@ -1,122 +1,122 @@
" "
I'm a tool for finding and replacing text ocurrences in notebook I'm a tool for finding and replacing text ocurrences in notebook
nodes. nodes.
" "
Class { Class {
#name : #GrafoscopioReplace, #name : #GrafoscopioReplace,
#superclass : #ComposablePresenter, #superclass : #ComposablePresenter,
#instVars : [ #instVars : [
'find', 'find',
'replace', 'replace',
'ok', 'ok',
'cancel' 'cancel'
], ],
#category : #'Grafoscopio-UI' #category : #'Grafoscopio-UI'
} }
{ #category : #specs } { #category : #specs }
GrafoscopioReplace class >> defaultSpec [ GrafoscopioReplace class >> defaultSpec [
^ SpecLayout composed ^ SpecLayout composed
newColumn: [ :column | newColumn: [ :column |
column column
add: #find; add: #find;
add: #replace; add: #replace;
newRow: [ :row | row add: #ok; add: #cancel ] height: self toolbarHeight ]; newRow: [ :row | row add: #ok; add: #cancel ] height: self toolbarHeight ];
yourself yourself
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioReplace >> cancel [ GrafoscopioReplace >> cancel [
^ cancel ^ cancel
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioReplace >> cancel: anObject [ GrafoscopioReplace >> cancel: anObject [
cancel := anObject cancel := anObject
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioReplace >> find [ GrafoscopioReplace >> find [
^ find ^ find
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioReplace >> find: anObject [ GrafoscopioReplace >> find: anObject [
find := anObject find := anObject
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioReplace >> initializePresenter [ GrafoscopioReplace >> initializePresenter [
"Here we need to deal with changes in the OK button to send messages about the "Here we need to deal with changes in the OK button to send messages about the
state of the 'find' and 'replace' variables or do nothing if 'Cancel' is pressed." state of the 'find' and 'replace' variables or do nothing if 'Cancel' is pressed."
ok whenStateChangedDo: [ ok whenStateChangedDo: [
Transcript show: 'OK Clicked!' ] Transcript show: 'OK Clicked!' ]
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioReplace >> initializeWidgets [ GrafoscopioReplace >> initializeWidgets [
find := self newTextInput find := self newTextInput
ghostText: 'Text to find...'; ghostText: 'Text to find...';
autoAccept: true. autoAccept: true.
replace := self newTextInput replace := self newTextInput
ghostText: 'Text to replace...'; ghostText: 'Text to replace...';
autoAccept: true. autoAccept: true.
ok := self newButton ok := self newButton
label: 'OK'; label: 'OK';
state: false; state: false;
action: [ action: [
ok state: true. ok state: true.
self window close. ] . self window close. ] .
cancel := self newButton cancel := self newButton
label: 'Cancel'; label: 'Cancel';
action: [ action: [
cancel state: true. cancel state: true.
self window close ]. self window close ].
self focusOrder self focusOrder
add: find; add: find;
add: replace; add: replace;
add: ok; add: ok;
add: cancel. add: cancel.
self askOkToClose: true self askOkToClose: true
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioReplace >> ok [ GrafoscopioReplace >> ok [
^ ok ^ ok
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioReplace >> ok: anObject [ GrafoscopioReplace >> ok: anObject [
ok := anObject ok := anObject
] ]
{ #category : #private } { #category : #private }
GrafoscopioReplace >> okToChange [ GrafoscopioReplace >> okToChange [
^ true ^ true
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioReplace >> replace [ GrafoscopioReplace >> replace [
^ replace ^ replace
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioReplace >> replace: anObject [ GrafoscopioReplace >> replace: anObject [
replace := anObject replace := anObject
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioReplace >> returnValues [ GrafoscopioReplace >> returnValues [
self ok state self ok state
ifFalse: [ ^ self ] ifFalse: [ ^ self ]
ifTrue: [^ Dictionary new ifTrue: [^ Dictionary new
at: 'find' put: find getText; at: 'find' put: find getText;
at: 'replace' put: replace getText; at: 'replace' put: replace getText;
yourself] yourself]
] ]
{ #category : #api } { #category : #api }
GrafoscopioReplace >> title [ GrafoscopioReplace >> title [
^ 'Find & Replace' ^ 'Find & Replace'
] ]

View File

@ -1,68 +1,68 @@
" "
This is a root node. It represents a document. This is a root node. It represents a document.
" "
Class { Class {
#name : #GrafoscopioRootNode, #name : #GrafoscopioRootNode,
#superclass : #GrafoscopioAbstractNode, #superclass : #GrafoscopioAbstractNode,
#instVars : [ #instVars : [
'children' 'children'
], ],
#category : #'Grafoscopio-Model' #category : #'Grafoscopio-Model'
} }
{ #category : #accessing } { #category : #accessing }
GrafoscopioRootNode >> acceptVisitor: aGrafoscopioVisitor [ GrafoscopioRootNode >> acceptVisitor: aGrafoscopioVisitor [
aGrafoscopioVisitor visitRootNode: self. aGrafoscopioVisitor visitRootNode: self.
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioRootNode >> acceptsChildsOfClass: aClass [ GrafoscopioRootNode >> acceptsChildsOfClass: aClass [
^ {GrafoscopioUnitNode} includes: aClass ^ {GrafoscopioUnitNode} includes: aClass
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioRootNode >> addAtBeginningChild: aBlock ofClass: aClass [ GrafoscopioRootNode >> addAtBeginningChild: aBlock ofClass: aClass [
(self acceptsChildsOfClass: aClass) (self acceptsChildsOfClass: aClass)
ifTrue: [ | child | ifTrue: [ | child |
child := aBlock value. child := aBlock value.
child parent: self. child parent: self.
self children addFirst: child ] self children addFirst: child ]
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioRootNode >> addChild: aBlock ofClass: aClass [ GrafoscopioRootNode >> addChild: aBlock ofClass: aClass [
(self acceptsChildsOfClass: aClass) (self acceptsChildsOfClass: aClass)
ifTrue: [ | child | ifTrue: [ | child |
child := aBlock value. child := aBlock value.
child parent: self. child parent: self.
self children add: child ] self children add: child ]
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioRootNode >> children [ GrafoscopioRootNode >> children [
^ children ^ children
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioRootNode >> initialize [ GrafoscopioRootNode >> initialize [
super initialize. super initialize.
children := SortedCollection new children := SortedCollection new
sortBlock: [ :a :b | a order < b order ]; sortBlock: [ :a :b | a order < b order ];
yourself yourself
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioRootNode >> level [ GrafoscopioRootNode >> level [
^ 1 ^ 1
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioRootNode >> text [ GrafoscopioRootNode >> text [
^ name ^ name
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioRootNode >> text: aText [ GrafoscopioRootNode >> text: aText [
name := aText name := aText
] ]

View File

@ -1,124 +1,124 @@
" "
I am in charge of formatting a document in terms of text. I am in charge of formatting a document in terms of text.
Our text model does not support break lines or tabbings as text attribute, but as text content. (By example, our header needs to have a line break before and after by default. This kind of things can be done in rubbric by adding the character cr. Still, our pillar AST does not have this breakline for the header, and we do not wan to add it, since it would affect the parsing. No, what we want is to be able to format and modify the text before returning it when being displayed, composed, scanned, etc. So for doing so we add the text formatter. Our text model does not support break lines or tabbings as text attribute, but as text content. (By example, our header needs to have a line break before and after by default. This kind of things can be done in rubbric by adding the character cr. Still, our pillar AST does not have this breakline for the header, and we do not wan to add it, since it would affect the parsing. No, what we want is to be able to format and modify the text before returning it when being displayed, composed, scanned, etc. So for doing so we add the text formatter.
This text formatter contains a dictionary that allows the user to add as many as needed for each class. This text formatter contains a dictionary that allows the user to add as many as needed for each class.
This class provides as extention point: This class provides as extention point:
#formatsFor: anObject > Returning a collection of formats for the given object (the default behaviour stores it by class). #formatsFor: anObject > Returning a collection of formats for the given object (the default behaviour stores it by class).
#Redefine the specific visit methods for specific class behaviour. #Redefine the specific visit methods for specific class behaviour.
) )
" "
Class { Class {
#name : #GrafoscopioTextFormatter, #name : #GrafoscopioTextFormatter,
#superclass : #PRVisitor, #superclass : #PRVisitor,
#instVars : [ #instVars : [
'formats', 'formats',
'stack' 'stack'
], ],
#classInstVars : [ #classInstVars : [
'default' 'default'
], ],
#category : #'Grafoscopio-Pillar-TextFormat' #category : #'Grafoscopio-Pillar-TextFormat'
} }
{ #category : #accessing } { #category : #accessing }
GrafoscopioTextFormatter class >> buildDefault [ GrafoscopioTextFormatter class >> buildDefault [
| new | | new |
new := self new. new := self new.
new registerFormat: GrafoscopioFmtDoubleLinebreak instance forClass: PRHeader. new registerFormat: GrafoscopioFmtDoubleLinebreak instance forClass: PRHeader.
new registerFormat: GrafoscopioFmtAnchorOnTheLeft instance forClass: PRListItem. new registerFormat: GrafoscopioFmtAnchorOnTheLeft instance forClass: PRListItem.
new registerFormat: GrafoscopioFmtBeginningLinebreak instance forClass: PRListItem. new registerFormat: GrafoscopioFmtBeginningLinebreak instance forClass: PRListItem.
" new registerFormat: GrafoscopioFmtDoubleLinebreak instance forClass: PRCodeblock ." " new registerFormat: GrafoscopioFmtDoubleLinebreak instance forClass: PRCodeblock ."
new registerFormat: GrafoscopioFmtAnchorOnTheLeft2 instance forClass: PRCodeblock . new registerFormat: GrafoscopioFmtAnchorOnTheLeft2 instance forClass: PRCodeblock .
new registerFormat: GrafoscopioFmtEndingLinebreak instance forClass: PRParagraph . new registerFormat: GrafoscopioFmtEndingLinebreak instance forClass: PRParagraph .
new registerFormat: GrafoscopioFmtBeginningLinebreak instance forClass: PRList. new registerFormat: GrafoscopioFmtBeginningLinebreak instance forClass: PRList.
new registerFormat: GrafoscopioFmtUrlAsBody instance forClass: PRExternalLink . new registerFormat: GrafoscopioFmtUrlAsBody instance forClass: PRExternalLink .
new registerFormat: GrafoscopioFmtEndingSpace instance forClass: PRExternalLink. new registerFormat: GrafoscopioFmtEndingSpace instance forClass: PRExternalLink.
new registerFormat: GrafoscopioFmtUrlAsBody instance forClass: PRMailLink. new registerFormat: GrafoscopioFmtUrlAsBody instance forClass: PRMailLink.
new registerFormat: GrafoscopioFmtEndingSpace instance forClass: PRMailLink. new registerFormat: GrafoscopioFmtEndingSpace instance forClass: PRMailLink.
new registerFormat: GrafoscopioFmtAnchorAsBody instance forClass: PRInternalLink. new registerFormat: GrafoscopioFmtAnchorAsBody instance forClass: PRInternalLink.
new registerFormat: GrafoscopioFmtEndingSpace instance forClass: PRInternalLink. new registerFormat: GrafoscopioFmtEndingSpace instance forClass: PRInternalLink.
^ new ^ new
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioTextFormatter class >> buildEmpty [ GrafoscopioTextFormatter class >> buildEmpty [
| new | | new |
new := self new. new := self new.
^ new ^ new
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioTextFormatter class >> default [ GrafoscopioTextFormatter class >> default [
^ self buildDefault ^ self buildDefault
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioTextFormatter >> format: aNode [ GrafoscopioTextFormatter >> format: aNode [
(self formatsFor: aNode) do: [ :f | f beInstalledIn: aNode ] (self formatsFor: aNode) do: [ :f | f beInstalledIn: aNode ]
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioTextFormatter >> formatsFor: aNode [ GrafoscopioTextFormatter >> formatsFor: aNode [
^ formats at: aNode ifAbsent: [ self formatsForClass: aNode class ] ^ formats at: aNode ifAbsent: [ self formatsForClass: aNode class ]
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioTextFormatter >> formatsForClass: aNodeClass [ GrafoscopioTextFormatter >> formatsForClass: aNodeClass [
^ formats at: aNodeClass ifAbsent: [ Array empty ] ^ formats at: aNodeClass ifAbsent: [ Array empty ]
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioTextFormatter >> initialize [ GrafoscopioTextFormatter >> initialize [
super initialize . super initialize .
formats := Dictionary new. formats := Dictionary new.
stack := Stack new. stack := Stack new.
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioTextFormatter >> registerFormat: aFormat for: aNode [ GrafoscopioTextFormatter >> registerFormat: aFormat for: aNode [
^ (formats at: aNode ifAbsentPut: [ OrderedCollection new ]) ^ (formats at: aNode ifAbsentPut: [ OrderedCollection new ])
add: aFormat add: aFormat
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioTextFormatter >> registerFormat: aFormat forClass: aNodeClass [ GrafoscopioTextFormatter >> registerFormat: aFormat forClass: aNodeClass [
^ self registerFormat: aFormat for: aNodeClass ^ self registerFormat: aFormat for: aNodeClass
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioTextFormatter >> visitDocument: aDocument [ GrafoscopioTextFormatter >> visitDocument: aDocument [
self assert: stack isEmpty. self assert: stack isEmpty.
super visitDocument: aDocument. super visitDocument: aDocument.
self assert: stack isEmpty self assert: stack isEmpty
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioTextFormatter >> visitDocumentGroup: aNode [ GrafoscopioTextFormatter >> visitDocumentGroup: aNode [
aNode parent: (stack ifNotEmpty: [stack first] ifEmpty:[ nil ]). aNode parent: (stack ifNotEmpty: [stack first] ifEmpty:[ nil ]).
self format: aNode. self format: aNode.
stack push: aNode. stack push: aNode.
super visitDocumentGroup: aNode. super visitDocumentGroup: aNode.
stack pop stack pop
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioTextFormatter >> visitDocumentItem: anItem [ GrafoscopioTextFormatter >> visitDocumentItem: anItem [
self format: anItem. self format: anItem.
anItem parent: stack first. anItem parent: stack first.
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioTextFormatter >> visitEmptyParagraph: aParagraph [ GrafoscopioTextFormatter >> visitEmptyParagraph: aParagraph [
stack top children last = aParagraph stack top children last = aParagraph
ifTrue: [ stack top children: stack top children allButLast ]. ifTrue: [ stack top children: stack top children allButLast ].
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioTextFormatter >> visitFormatText: aGrafoscopioFormatTextNode [ GrafoscopioTextFormatter >> visitFormatText: aGrafoscopioFormatTextNode [
" No way we format the formatted text. " " No way we format the formatted text. "
] ]

View File

@ -1,39 +1,39 @@
" "
I represent a text node inside a Grafoscopio notebook. I represent a text node inside a Grafoscopio notebook.
Usually my content is markdown text. Usually my content is markdown text.
" "
Class { Class {
#name : #GrafoscopioTextModel, #name : #GrafoscopioTextModel,
#superclass : #ComposablePresenter, #superclass : #ComposablePresenter,
#instVars : [ #instVars : [
'body' 'body'
], ],
#category : #'Grafoscopio-UI' #category : #'Grafoscopio-UI'
} }
{ #category : #specs } { #category : #specs }
GrafoscopioTextModel class >> defaultSpec [ GrafoscopioTextModel class >> defaultSpec [
^ SpecLayout composed add: #body ^ SpecLayout composed add: #body
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioTextModel >> body [ GrafoscopioTextModel >> body [
^ body ^ body
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioTextModel >> body: anObject [ GrafoscopioTextModel >> body: anObject [
body := anObject body := anObject
] ]
{ #category : #API } { #category : #API }
GrafoscopioTextModel >> content: aGrafoscopioNodeContent [ GrafoscopioTextModel >> content: aGrafoscopioNodeContent [
body text: aGrafoscopioNodeContent body text: aGrafoscopioNodeContent
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioTextModel >> initializeWidgets [ GrafoscopioTextModel >> initializeWidgets [
body := self newText. body := self newText.
body autoAccept: true. body autoAccept: true.
] ]

View File

@ -1,42 +1,42 @@
" "
This kind of a leafNodes holds plain text. This kind of a leafNodes holds plain text.
" "
Class { Class {
#name : #GrafoscopioTextNode, #name : #GrafoscopioTextNode,
#superclass : #GrafoscopioLeafNode, #superclass : #GrafoscopioLeafNode,
#instVars : [ #instVars : [
'text' 'text'
], ],
#category : #'Grafoscopio-Model' #category : #'Grafoscopio-Model'
} }
{ #category : #accessing } { #category : #accessing }
GrafoscopioTextNode class >> icon [ GrafoscopioTextNode class >> icon [
^ self iconNamed: #workspace ^ self iconNamed: #workspace
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioTextNode class >> nameForSelection [ GrafoscopioTextNode class >> nameForSelection [
^ 'New text node' ^ 'New text node'
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioTextNode class >> showInMenu [ GrafoscopioTextNode class >> showInMenu [
^ true ^ true
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioTextNode >> acceptVisitor: aGrafoscopioVisitor [ GrafoscopioTextNode >> acceptVisitor: aGrafoscopioVisitor [
aGrafoscopioVisitor visitTextNode: self. aGrafoscopioVisitor visitTextNode: self.
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioTextNode >> text [ GrafoscopioTextNode >> text [
^ text ^ text
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioTextNode >> text: aString [ GrafoscopioTextNode >> text: aString [
text := aString text := aString
] ]

View File

@ -1,80 +1,86 @@
Class { Class {
#name : #GrafoscopioTreeNotebook, #name : #GrafoscopioTreeNotebook,
#superclass : #SpPresenterWithModel, #superclass : #SpPresenterWithModel,
#instVars : [ #instVars : [
'sidebar', 'sidebar',
'viewport', 'viewport',
'model', 'model',
'empty', 'empty',
'perspectives' 'perspectives'
], ],
#category : #'Grafoscopio-New-UI' #category : #'Grafoscopio-New-UI'
} }
{ #category : #specs } { #category : #specs }
GrafoscopioTreeNotebook class >> defaultSpec [ GrafoscopioTreeNotebook class >> defaultSpec [
^ SpBoxLayout newHorizontal ^ SpBoxLayout newHorizontal
add: add:
(SpBoxLayout newVertical (SpBoxLayout newVertical
add: #empty height: self toolbarHeight; add: #empty height: self toolbarHeight;
add: #sidebar; add: #sidebar;
yourself) yourself)
width: 51; width: 51;
add: #viewport; add: #viewport;
yourself yourself
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioTreeNotebook >> basicInstallPerspective: aPerspective [ GrafoscopioTreeNotebook >> basicInstallPerspective: aPerspective [
viewport ifNotNil: [ viewport aboutToBeUninstalledFrom: self ]. viewport ifNotNil: [ viewport aboutToBeUninstalledFrom: self ].
viewport := self perspectives viewport := self perspectives
at: aPerspective at: aPerspective
ifAbsentPut: [ self instantiate: aPerspective on: model document ]. ifAbsentPut: [ self instantiate: aPerspective on: model document ].
] viewport aboutToBeInstalled: self.
]
{ #category : #initialization }
GrafoscopioTreeNotebook >> createDefaultComponent [ { #category : #initialization }
^ self basicInstallPerspective: GrafoscopioPerspective defaultPerspective GrafoscopioTreeNotebook >> createDefaultComponent [
] ^ self basicInstallPerspective: GrafoscopioPerspective defaultPerspective
]
{ #category : #initialization }
GrafoscopioTreeNotebook >> initializeWidgets [ { #category : #initialization }
super initializeWidgets. GrafoscopioTreeNotebook >> initializeWidgets [
sidebar := self sidebar. super initializeWidgets.
self createDefaultComponent. sidebar := self sidebar.
empty := self newLabel. self createDefaultComponent.
] empty := self newLabel.
]
{ #category : #initialization }
GrafoscopioTreeNotebook >> installPerspective: aPerspective [ { #category : #initialization }
self basicInstallPerspective: aPerspective . GrafoscopioTreeNotebook >> installPerspective: aPerspective [
self modelChanged self basicInstallPerspective: aPerspective .
] self modelChanged
]
{ #category : #initialization }
GrafoscopioTreeNotebook >> modelChanged [ { #category : #initialization }
viewport modelChanged. GrafoscopioTreeNotebook >> modelChanged [
self needRebuild: false. viewport modelChanged.
self buildWithSpec self needRebuild: false.
] self buildWithSpec
]
{ #category : #initialization }
GrafoscopioTreeNotebook >> perspectives [ { #category : #initialization }
^ perspectives ifNil: [ perspectives := Dictionary new ] GrafoscopioTreeNotebook >> perspectives [
] ^ perspectives ifNil: [ perspectives := Dictionary new ]
]
{ #category : #'as yet unclassified' }
GrafoscopioTreeNotebook >> setModelBeforeInitialization: aDomainObject [ { #category : #'as yet unclassified' }
super setModelBeforeInitialization: aDomainObject. GrafoscopioTreeNotebook >> removePerspective: aPerspective [
model := aDomainObject perspectives removeKeyAtValue: aPerspective
] ]
{ #category : #initialization } { #category : #'as yet unclassified' }
GrafoscopioTreeNotebook >> sidebar [ GrafoscopioTreeNotebook >> setModelBeforeInitialization: aDomainObject [
| bar | super setModelBeforeInitialization: aDomainObject.
bar := self instantiate: SpSidebar. model := aDomainObject
GrafoscopioPerspective perspectives ]
do:
[ :p | bar addAction: [ self installPerspective: p ] icon: p icon ]. { #category : #initialization }
^ bar GrafoscopioTreeNotebook >> sidebar [
] | bar |
bar := self instantiate: SpSidebar.
GrafoscopioPerspective perspectives
do:
[ :p | bar addAction: [ self installPerspective: p ] icon: p icon ].
^ bar
]

View File

@ -1,41 +1,41 @@
Class { Class {
#name : #GrafoscopioUnitNode, #name : #GrafoscopioUnitNode,
#superclass : #GrafoscopioBranchNode, #superclass : #GrafoscopioBranchNode,
#category : #'Grafoscopio-Model' #category : #'Grafoscopio-Model'
} }
{ #category : #'instance creation' } { #category : #'instance creation' }
GrafoscopioUnitNode class >> icon [ GrafoscopioUnitNode class >> icon [
^ self iconNamed: #smallHierarchyBrowser ^ self iconNamed: #smallHierarchyBrowser
] ]
{ #category : #'instance creation' } { #category : #'instance creation' }
GrafoscopioUnitNode class >> nameForSelection [ GrafoscopioUnitNode class >> nameForSelection [
^ 'New unit' ^ 'New unit'
] ]
{ #category : #'instance creation' } { #category : #'instance creation' }
GrafoscopioUnitNode class >> showInMenu [ GrafoscopioUnitNode class >> showInMenu [
^ true ^ true
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioUnitNode >> acceptVisitor: aGrafoscopioVisitor [ GrafoscopioUnitNode >> acceptVisitor: aGrafoscopioVisitor [
aGrafoscopioVisitor visitUnitNode: self. aGrafoscopioVisitor visitUnitNode: self.
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioUnitNode >> acceptsChildsOfClass: aClass [ GrafoscopioUnitNode >> acceptsChildsOfClass: aClass [
^ aClass isLeaf or: [ aClass = self class ] ^ aClass isLeaf or: [ aClass = self class ]
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioUnitNode >> text [ GrafoscopioUnitNode >> text [
^ name ^ name
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioUnitNode >> text: aText [ GrafoscopioUnitNode >> text: aText [
name := aText name := aText
] ]

View File

@ -1,97 +0,0 @@
"
URL Node downloads content for rendering.
"
Class {
#name : #GrafoscopioUrlNode,
#superclass : #GrafoscopioLeafNode,
#instVars : [
'link'
],
#category : #'Grafoscopio-Model'
}
{ #category : #'instance creation' }
GrafoscopioUrlNode class >> icon [
^ self iconNamed: #remote
]
{ #category : #'instance creation' }
GrafoscopioUrlNode class >> nameForSelection [
^ 'New URL Node'
]
{ #category : #'instance creation' }
GrafoscopioUrlNode class >> new [
^ super new
content;
yourself
]
{ #category : #'instance creation' }
GrafoscopioUrlNode class >> showInMenu [
^ true
]
{ #category : #'as yet unclassified' }
GrafoscopioUrlNode >> acceptVisitor: aGrafoscopioVisitor [
aGrafoscopioVisitor visitUrlNode: self.
]
{ #category : #'as yet unclassified' }
GrafoscopioUrlNode >> content [
^ (self url
ifNil: [ ' Invalid url ' ]
ifNotNil: [ :url | self fetchContent: url ])
]
{ #category : #'as yet unclassified' }
GrafoscopioUrlNode >> fetchContent: anUrl [
^ (ZnEasy get: anUrl) entity contents
]
{ #category : #'as yet unclassified' }
GrafoscopioUrlNode >> getUrl [
| url |
url := UIManager default
request: 'Please insert a url '
initialAnswer: 'http://'
title: 'URL Node'.
url ifNil: [ ^ nil ].
url := url asZnUrl.
(url host isEmptyOrNil
or: [ url scheme isEmptyOrNil or: [ url authority isEmptyOrNil ] ])
ifTrue: [ ^ nil ].
^ url
]
{ #category : #accessing }
GrafoscopioUrlNode >> link: aZnUrl [
link := aZnUrl
]
{ #category : #'as yet unclassified' }
GrafoscopioUrlNode >> openIn: aNotebook [
super openIn: aNotebook.
aNotebook links text: (link ifNil: 'Invalid url') asString
]
{ #category : #'as yet unclassified' }
GrafoscopioUrlNode >> shouldAskBeforeRemove [
^ false
]
{ #category : #content }
GrafoscopioUrlNode >> text [
^ self content
]
{ #category : #'as yet unclassified' }
GrafoscopioUrlNode >> text: aString [
]
{ #category : #'as yet unclassified' }
GrafoscopioUrlNode >> url [
^ link ifNil: [ link := self getUrl ]
]

View File

@ -0,0 +1,18 @@
Class {
#name : #GrafoscopioViewportRichTextVisitor,
#superclass : #GrafoscopioViewportTextVisitor,
#category : #'Grafoscopio-New-UI'
}
{ #category : #'as yet unclassified' }
GrafoscopioViewportRichTextVisitor >> visitPillarNode: aNode [
self
showPageFor: aNode
ifProviderDoestExistInstall: [ | text |
text := presenter instantiate: GrafoscopioNewTextModel on: aNode.
text
contextMenuFromCommandsGroup: [ presenter rootCommandsGroup / 'Context Menu' ].
text
onModifyNodeLocationDo: [ presenter informNodeHasChanged: aNode ].
text ]
]

View File

@ -0,0 +1,60 @@
Class {
#name : #GrafoscopioViewportTextVisitor,
#superclass : #GrafoscopioVisitor,
#instVars : [
'viewport',
'stack',
'presenter',
'pages'
],
#category : #'Grafoscopio-New-UI'
}
{ #category : #visiting }
GrafoscopioViewportTextVisitor >> createViewportFor: aDocumentNode into: aPresenter [
presenter := aPresenter.
aDocumentNode acceptVisitor: self.
^ viewport
]
{ #category : #visiting }
GrafoscopioViewportTextVisitor >> initialize [
super initialize.
pages := Dictionary new
]
{ #category : #'as yet unclassified' }
GrafoscopioViewportTextVisitor >> renamePageFor: aNode [
pages at: aNode ifPresent: [ : p | p title: aNode name ]
]
{ #category : #'as yet unclassified' }
GrafoscopioViewportTextVisitor >> showPageFor: aNode ifProviderDoestExistInstall: aBlock [
| page |
page := pages at: aNode ifAbsentPut: [ aBlock value ].
presenter viewport: page
]
{ #category : #'as yet unclassified' }
GrafoscopioViewportTextVisitor >> visitPillarNode: aGrafoscopioPillarNode [
self
showPageFor: aGrafoscopioPillarNode
ifProviderDoestExistInstall: [ | text |
text := presenter
instantiate: GrafoscopioNewTextModel
on: (GrafoscopioPillarToTextDecorator on: aGrafoscopioPillarNode).
text
onModifyNodeLocationDo: [ :model | model model text: model body text ].
text ]
]
{ #category : #visiting }
GrafoscopioViewportTextVisitor >> visitTextNode: aNode [
self
showPageFor: aNode
ifProviderDoestExistInstall: [ | text |
text := presenter instantiate: GrafoscopioNewTextModel on: aNode.
text
onModifyNodeLocationDo: [ :model | model model text: model body text ].
text ]
]

View File

@ -1,77 +0,0 @@
Class {
#name : #GrafoscopioViewportVisitor,
#superclass : #GrafoscopioVisitor,
#instVars : [
'viewport',
'stack',
'items',
'presenter'
],
#category : #'Grafoscopio-New-UI'
}
{ #category : #visiting }
GrafoscopioViewportVisitor >> createViewportFor: aDocumentNode into: aPresenter [
presenter := aPresenter.
items := OrderedCollection new.
aDocumentNode acceptVisitor: self.
viewport := aPresenter viewport
ifNil: [ aPresenter instantiate: SpComponentListPresenter ].
viewport items: items.
^ viewport
]
{ #category : #visiting }
GrafoscopioViewportVisitor >> visitCodeNode: aNode [
| code |
code := presenter instantiate: GrafoscopioNewCodeModel.
code onModifyNodeLocationDo: [ presenter informNodeHasChanged: aNode ].
code model: aNode.
items add: code.
]
{ #category : #visiting }
GrafoscopioViewportVisitor >> visitRootNode: aNode [
| text |
text := presenter instantiate: GrafoscopioNewTextInputModel.
text model: aNode.
text onModifyNodeLocationDo: [ presenter informNodeHasChanged: aNode ].
items add: text.
super visitRootNode: aNode.
]
{ #category : #visiting }
GrafoscopioViewportVisitor >> visitTextNode: aNode [
| text |
text := presenter instantiate: GrafoscopioNewTextModel.
text onModifyNodeLocationDo: [ presenter informNodeHasChanged: aNode ].
text model: aNode.
items add: text.
]
{ #category : #visiting }
GrafoscopioViewportVisitor >> visitUnitNode: aNode [
| text |
text := presenter instantiate: GrafoscopioNewTextInputModel.
text model: aNode.
text onModifyNodeLocationDo: [ presenter informNodeHasChanged: aNode ].
items add: text.
items add: (presenter newButton
label: ' Add node on the beginning ';
action: [ presenter addNewNodeAtBeginningOf: aNode ];
yourself).
super visitUnitNode: aNode.
items add: (presenter newButton
label: ' Add node on the end ';
action: [ presenter addNewNodeAtLastOf: aNode ];
yourself)
]
{ #category : #visiting }
GrafoscopioViewportVisitor >> visitUrlNode: aNode [
| text |
text := presenter instantiate: GrafoscopioNewTextInputModel.
text onModifyNodeLocationDo: [ presenter informNodeHasChanged: aNode ].
text model: aNode.
items add: text.
]

View File

@ -1,48 +1,44 @@
Class { Class {
#name : #GrafoscopioVisitor, #name : #GrafoscopioVisitor,
#superclass : #Object, #superclass : #Object,
#category : #'Grafoscopio-Model' #category : #'Grafoscopio-Model'
} }
{ #category : #visiting } { #category : #visiting }
GrafoscopioVisitor >> visitBranchNode: aNode [ GrafoscopioVisitor >> visitBranchNode: aNode [
self visitNode: aNode. self visitNode: aNode.
aNode children do: [ : c | c acceptVisitor: self ]. aNode children do: [ : c | c acceptVisitor: self ].
] ]
{ #category : #visiting } { #category : #'as yet unclassified' }
GrafoscopioVisitor >> visitCodeNode: aNode [ GrafoscopioVisitor >> visitGrafoscopioProject: aGrafoscopioProject [
self visitNode: aNode self visitNode: aGrafoscopioProject .
] aGrafoscopioProject document acceptVisitor: self.
]
{ #category : #visiting }
GrafoscopioVisitor >> visitLeafNode: aNode [ { #category : #visiting }
self visitNode: aNode GrafoscopioVisitor >> visitLeafNode: aNode [
] self visitNode: aNode
]
{ #category : #visiting }
GrafoscopioVisitor >> visitNode: aNode [ { #category : #visiting }
" nothing to do here" GrafoscopioVisitor >> visitNode: aNode [
] " nothing to do here"
]
{ #category : #visiting }
GrafoscopioVisitor >> visitRootNode: aNode [ { #category : #visiting }
self visitNode: aNode. GrafoscopioVisitor >> visitRootNode: aNode [
aNode children do: [ : c | c acceptVisitor: self ]. self visitNode: aNode.
] aNode children do: [ : c | c acceptVisitor: self ].
]
{ #category : #visiting }
GrafoscopioVisitor >> visitTextNode: aNode [ { #category : #visiting }
self visitNode: aNode GrafoscopioVisitor >> visitTextNode: aNode [
] self visitNode: aNode
]
{ #category : #visiting }
GrafoscopioVisitor >> visitUnitNode: aNode [ { #category : #visiting }
self visitNode: aNode. GrafoscopioVisitor >> visitUnitNode: aNode [
aNode children do: [ : c | c acceptVisitor: self ]. self visitNode: aNode.
] aNode children do: [ : c | c acceptVisitor: self ].
]
{ #category : #visiting }
GrafoscopioVisitor >> visitUrlNode: aNode [
self visitNode: aNode
]

View File

@ -1,15 +1,15 @@
Class { Class {
#name : #GrafoscopioZoaPediaPerspective, #name : #GrafoscopioZoaPediaPerspective,
#superclass : #GrafoscopioPerspective, #superclass : #GrafoscopioPerspective,
#category : #'Grafoscopio-New-UI' #category : #'Grafoscopio-New-UI'
} }
{ #category : #accessing } { #category : #accessing }
GrafoscopioZoaPediaPerspective class >> icon [ GrafoscopioZoaPediaPerspective class >> icon [
^ self iconNamed: #edit ^ self iconNamed: #edit
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioZoaPediaPerspective >> createViewport [ GrafoscopioZoaPediaPerspective >> createViewport [
^ self newLabel ^ self newLabel
] ]

View File

@ -1,63 +1,63 @@
" "
I store metadata for this package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser I store metadata for this package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser
" "
Class { Class {
#name : #ManifestGrafoscopio, #name : #ManifestGrafoscopio,
#superclass : #PackageManifest, #superclass : #PackageManifest,
#category : #Grafoscopio #category : #Grafoscopio
} }
{ #category : #'code-critics' } { #category : #'code-critics' }
ManifestGrafoscopio class >> ruleRBAssignmentInIfTrueRuleV1FalsePositive [ ManifestGrafoscopio class >> ruleRBAssignmentInIfTrueRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#GrafoscopioTextNode #embedNodes #false)) #'2017-02-16T20:07:02.600781-05:00') #(#(#RGMethodDefinition #(#GrafoscopioNewNotebook #navigateRelativePathFor: #false)) #'2017-03-28T22:30:53.541042-05:00') ) ^ #(#(#(#RGMethodDefinition #(#GrafoscopioTextNode #embedNodes #false)) #'2017-02-16T20:07:02.600781-05:00') #(#(#RGMethodDefinition #(#GrafoscopioNewNotebook #navigateRelativePathFor: #false)) #'2017-03-28T22:30:53.541042-05:00') )
] ]
{ #category : #'code-critics' } { #category : #'code-critics' }
ManifestGrafoscopio class >> ruleRBBadMessageRuleV1FalsePositive [ ManifestGrafoscopio class >> ruleRBBadMessageRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#'GrafoscopioDocumentation class' #openNotebookFrom:At: #true)) #'2017-04-05T18:01:21.892153-05:00') ) ^ #(#(#(#RGMethodDefinition #(#'GrafoscopioDocumentation class' #openNotebookFrom:At: #true)) #'2017-04-05T18:01:21.892153-05:00') )
] ]
{ #category : #'code-critics' } { #category : #'code-critics' }
ManifestGrafoscopio class >> ruleRBBooleanPrecedenceRuleV1FalsePositive [ ManifestGrafoscopio class >> ruleRBBooleanPrecedenceRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#'GrafoscopioNode class' #cleanTreeRootReferences #true)) #'2017-03-27T22:18:17.447627-05:00') ) ^ #(#(#(#RGMethodDefinition #(#'GrafoscopioNode class' #cleanTreeRootReferences #true)) #'2017-03-27T22:18:17.447627-05:00') )
] ]
{ #category : #'code-critics' } { #category : #'code-critics' }
ManifestGrafoscopio class >> ruleRBCascadedNextPutAllsRuleV1FalsePositive [ ManifestGrafoscopio class >> ruleRBCascadedNextPutAllsRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#GrafoscopioTextNode #metadataAsYamlIn: #false)) #'2017-04-20T19:01:59.286212-05:00') ) ^ #(#(#(#RGMethodDefinition #(#GrafoscopioTextNode #metadataAsYamlIn: #false)) #'2017-04-20T19:01:59.286212-05:00') )
] ]
{ #category : #'code-critics' } { #category : #'code-critics' }
ManifestGrafoscopio class >> ruleRBClassNameInSelectorRuleV1FalsePositive [ ManifestGrafoscopio class >> ruleRBClassNameInSelectorRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#'Documentation class' #current #true)) #'2016-10-07T19:39:23.013722-05:00') ) ^ #(#(#(#RGMethodDefinition #(#'Documentation class' #current #true)) #'2016-10-07T19:39:23.013722-05:00') )
] ]
{ #category : #'code-critics' } { #category : #'code-critics' }
ManifestGrafoscopio class >> ruleRBEqualsTrueRuleV1FalsePositive [ ManifestGrafoscopio class >> ruleRBEqualsTrueRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#'GrafoscopioDocumentation class' #listOutdated #true)) #'2016-10-09T10:16:31.841951-05:00') #(#(#RGMethodDefinition #(#'GrafoscopioDocumentation class' #listOutdatedDocsIn: #true)) #'2017-04-05T17:50:59.032741-05:00') ) ^ #(#(#(#RGMethodDefinition #(#'GrafoscopioDocumentation class' #listOutdated #true)) #'2016-10-09T10:16:31.841951-05:00') #(#(#RGMethodDefinition #(#'GrafoscopioDocumentation class' #listOutdatedDocsIn: #true)) #'2017-04-05T17:50:59.032741-05:00') )
] ]
{ #category : #'code-critics' } { #category : #'code-critics' }
ManifestGrafoscopio class >> ruleRBLongMethodsRuleV1FalsePositive [ ManifestGrafoscopio class >> ruleRBLongMethodsRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#GrafoscopioNewNotebook #topBar #false)) #'2016-12-17T18:51:33.99062-05:00') #(#(#RGMethodDefinition #(#GrafoscopioNewNotebook #notebookSubMenu #false)) #'2017-02-02T11:43:53.106456-05:00') ) ^ #(#(#(#RGMethodDefinition #(#GrafoscopioNewNotebook #topBar #false)) #'2016-12-17T18:51:33.99062-05:00') #(#(#RGMethodDefinition #(#GrafoscopioNewNotebook #notebookSubMenu #false)) #'2017-02-02T11:43:53.106456-05:00') )
] ]
{ #category : #'code-critics' } { #category : #'code-critics' }
ManifestGrafoscopio class >> ruleRBSentNotImplementedRuleV1FalsePositive [ ManifestGrafoscopio class >> ruleRBSentNotImplementedRuleV1FalsePositive [
^ #(#(#(#RGMetaclassDefinition #(#'GrafoscopioGUI class' #GfUIHelpers)) #'2015-12-23T10:38:16.706667-05:00') #(#(#RGClassDefinition #(#GfUIHelpers)) #'2016-01-06T18:53:45.844051-05:00') #(#(#RGMethodDefinition #(#GrafoscopioNewNotebook #topBar #false)) #'2016-12-17T18:51:40.617924-05:00') ) ^ #(#(#(#RGMetaclassDefinition #(#'GrafoscopioGUI class' #GfUIHelpers)) #'2015-12-23T10:38:16.706667-05:00') #(#(#RGClassDefinition #(#GfUIHelpers)) #'2016-01-06T18:53:45.844051-05:00') #(#(#RGMethodDefinition #(#GrafoscopioNewNotebook #topBar #false)) #'2016-12-17T18:51:40.617924-05:00') )
] ]
{ #category : #'code-critics' } { #category : #'code-critics' }
ManifestGrafoscopio class >> ruleRBShouldntRaiseErrorRuleV1FalsePositive [ ManifestGrafoscopio class >> ruleRBShouldntRaiseErrorRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#GrafoscopioNodeTest #testInitializeIsOk #false)) #'2017-01-31T12:49:28.199769-05:00') ) ^ #(#(#(#RGMethodDefinition #(#GrafoscopioNodeTest #testInitializeIsOk #false)) #'2017-01-31T12:49:28.199769-05:00') )
] ]
{ #category : #'code-critics' } { #category : #'code-critics' }
ManifestGrafoscopio class >> ruleRBStringConcatenationRuleV1FalsePositive [ ManifestGrafoscopio class >> ruleRBStringConcatenationRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#'FileUtils class' #createFilesNamed:endingWith:intoFolder: #true)) #'2017-01-01T21:48:26.712639-05:00') ) ^ #(#(#(#RGMethodDefinition #(#'FileUtils class' #createFilesNamed:endingWith:intoFolder: #true)) #'2017-01-01T21:48:26.712639-05:00') )
] ]
{ #category : #'code-critics' } { #category : #'code-critics' }
ManifestGrafoscopio class >> ruleSmTMethodTestedRuleV1FalsePositive [ ManifestGrafoscopio class >> ruleSmTMethodTestedRuleV1FalsePositive [
^ #(#(#(#RGClassDefinition #(#GrafoscopioTextNode)) #'2017-10-31T19:59:03.294735-05:00') ) ^ #(#(#(#RGClassDefinition #(#GrafoscopioTextNode)) #'2017-10-31T19:59:03.294735-05:00') )
] ]

View File

@ -1,220 +1,220 @@
" "
Please comment me using the following template inspired by Class Responsibility Collaborator (CRC) design: Please comment me using the following template inspired by Class Responsibility Collaborator (CRC) design:
I'm MendaIcons the provider of this icons on this environment. I'm MendaIcons the provider of this icons on this environment.
My main responsibility is to support some menda icons insideCallback pharo environment, for that I convert and package png images to the pharo image. My main responsibility is to support some menda icons insideCallback pharo environment, for that I convert and package png images to the pharo image.
For the Collaborators Part: State my main collaborators and one line about how I interact with them. For the Collaborators Part: State my main collaborators and one line about how I interact with them.
Public API and Key Messages Public API and Key Messages
- message one - message one
- message two - message two
- what is the way to create instances is a plus. - what is the way to create instances is a plus.
One simple example is simply gorgeous. One simple example is simply gorgeous.
Internal Representation and Key Implementation Points. Internal Representation and Key Implementation Points.
Implementation Points Implementation Points
" "
Class { Class {
#name : #MendaIcons, #name : #MendaIcons,
#superclass : #Object, #superclass : #Object,
#instVars : [ #instVars : [
'icons' 'icons'
], ],
#classVars : [ #classVars : [
'Current' 'Current'
], ],
#category : #'Grafoscopio-UI' #category : #'Grafoscopio-UI'
} }
{ #category : #'instance creation' } { #category : #'instance creation' }
MendaIcons class >> current [ MendaIcons class >> current [
^ Current ifNil: [ Current := self new ] ^ Current ifNil: [ Current := self new ]
] ]
{ #category : #'accessing - icons' } { #category : #'accessing - icons' }
MendaIcons >> arrowDownIcon [ MendaIcons >> arrowDownIcon [
"Private - Generated method" "Private - Generated method"
^Form fromBinaryStream: (self arrowDownIconContents base64Decoded readStream) ^Form fromBinaryStream: (self arrowDownIconContents base64Decoded readStream)
] ]
{ #category : #'private - contents' } { #category : #'private - contents' }
MendaIcons >> arrowDownIconContents [ MendaIcons >> arrowDownIconContents [
"Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/arrowDown.png" "Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/arrowDown.png"
^ 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAAICAYAAADJEc7MAAAABHNCSVQICAgIfAhkiAAAAAlw ^ 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAAICAYAAADJEc7MAAAABHNCSVQICAgIfAhkiAAAAAlw
SFlzAAAOxAAADsQBlSsOGwAAALJJREFUGJV9zjEKwkAUBND5i3ZaeJBAcgavIIjX2GwK8QbZ SFlzAAAOxAAADsQBlSsOGwAAALJJREFUGJV9zjEKwkAUBND5i3ZaeJBAcgavIIjX2GwK8QbZ
/bmGjSDYaq5gE/Aa9hIyNkZkXf0w1fCGD5IIIexUNSOJf6nrOvfeb0lCXuBK8m6MWVprOyTO /bmGjSDYaq5gE/Aa9hIyNkZkXf0w1fCGD5IIIexUNSOJf6nrOvfeb0lCXuBK8m6MWVprOyTO
e5+LSAtgDiA31tqO5EZEFsMwtE3TZDFS1WJEJNfOuZsBAOfc4RdW1YLkZURVVR0BQEi+l0MI e5+LSAtgDiA31tqO5EZEFsMwtE3TZDFS1WJEJNfOuZsBAOfc4RdW1YLkZURVVR0BQEi+l0MI
KxHZj2/3fT81xpxj9AVjLCITkrMYJWGEmUI/4Qd+lGV5SvVPkLiZ0qKAa5MAAAAASUVORK5C KxHZj2/3fT81xpxj9AVjLCITkrMYJWGEmUI/4Qd+lGV5SvVPkLiZ0qKAa5MAAAAASUVORK5C
YII=' YII='
] ]
{ #category : #'accessing - icons' } { #category : #'accessing - icons' }
MendaIcons >> arrowLeftIcon [ MendaIcons >> arrowLeftIcon [
"Private - Generated method" "Private - Generated method"
^Form fromBinaryStream: (self arrowLeftIconContents base64Decoded readStream) ^Form fromBinaryStream: (self arrowLeftIconContents base64Decoded readStream)
] ]
{ #category : #'private - contents' } { #category : #'private - contents' }
MendaIcons >> arrowLeftIconContents [ MendaIcons >> arrowLeftIconContents [
"Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/arrowLeft.png" "Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/arrowLeft.png"
^ 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAOCAYAAAASVl2WAAAABHNCSVQICAgIfAhkiAAAAAlw ^ 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAOCAYAAAASVl2WAAAABHNCSVQICAgIfAhkiAAAAAlw
SFlzAAAOxAAADsQBlSsOGwAAAK1JREFUGJV9kcFpAmEQhb835rpo2giYHsSLBQhiH3NLCf/+ SFlzAAAOxAAADsQBlSsOGwAAAK1JREFUGJV9kcFpAmEQhb835rpo2giYHsSLBQhiH3NLCf/+
20XIRexAy7CLkAKEfZ42xNXswJy+j4H3Bts821rr0jayzXhqrTvbn8DHgzBASd+2VzEFM/MS 20XIRexAy7CLkAKEfZ42xNXswJy+j4H3Bts821rr0jayzXhqrTvbn8DHgzBASd+2VzEFM/MS
UxAgpiDArGmafyFA2L5KMjCz/TJOFJl5tL0H5hFxLqW83wkAmXkYJEmnv9JvikGStJB06rpu UxAgpiDArGmafyFA2L5KMjCz/TJOFJl5tL0H5hFxLqW83wkAmXkYJEmnv9JvikGStJB06rpu
CTw22bbtVtKX7Z+IWN8VNbr02vf95umjbFNKebPNDbaypHslWRyiAAAAAElFTkSuQmCC' CTw22bbtVtKX7Z+IWN8VNbr02vf95umjbFNKebPNDbaypHslWRyiAAAAAElFTkSuQmCC'
] ]
{ #category : #'accessing - icons' } { #category : #'accessing - icons' }
MendaIcons >> arrowRightIcon [ MendaIcons >> arrowRightIcon [
"Private - Generated method" "Private - Generated method"
^Form fromBinaryStream: (self arrowRightIconContents base64Decoded readStream) ^Form fromBinaryStream: (self arrowRightIconContents base64Decoded readStream)
] ]
{ #category : #'private - contents' } { #category : #'private - contents' }
MendaIcons >> arrowRightIconContents [ MendaIcons >> arrowRightIconContents [
"Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/arrowRight.png" "Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/arrowRight.png"
^ 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAOCAYAAAASVl2WAAAABHNCSVQICAgIfAhkiAAAAAlw ^ 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAOCAYAAAASVl2WAAAABHNCSVQICAgIfAhkiAAAAAlw
SFlzAAAOxAAADsQBlSsOGwAAAMVJREFUGJV9kTFqw0AQRf/M2pWsQK4RMDit2lTpDSbXkFCV SFlzAAAOxAAADsQBlSsOGwAAAMVJREFUGJV9kTFqw0AQRf/M2pWsQK4RMDit2lTpDSbXkFCV
I6xW13AZcK20ukAgOYb7IPTSxMFWLH8YGHgPZpgRoJTSGtC1Cnmev0ra933/VRTFpyZxMzsA I6xW13AZcK20ukAgOYb7IPTSxMFWLH8YGHgPZpgRoJTSGtC1Cnmev0ra933/VRTFpyZxMzsA
RzPbN02z/SeUZfnh7k9zkkvSLclPzZxkwMXMtm3X4zi+m9k98OKaZBiGpZktAMzs+0JIKT2G RzPbN02z/SeUZfnh7k9zkkvSLclPzZxkwMXMtm3X4zi+m9k98OKaZBiGpZktAMzs+0JIKT2G
EDpgBeyqqjosziHQSVoBu7qu3/6WjDFufmF+DiUpZFm2cfdO0t0Uni75DFyFkiRAMcaHuWf9 EDpgBeyqqjosziHQSVoBu7qu3/6WjDFufmF+DiUpZFm2cfdO0t0Uni75DFyFkiRAMcaHuWf9
APv6mfGc3+HbAAAAAElFTkSuQmCC' APv6mfGc3+HbAAAAAElFTkSuQmCC'
] ]
{ #category : #'accessing - icons' } { #category : #'accessing - icons' }
MendaIcons >> arrowUpIcon [ MendaIcons >> arrowUpIcon [
"Private - Generated method" "Private - Generated method"
^Form fromBinaryStream: (self arrowUpIconContents base64Decoded readStream) ^Form fromBinaryStream: (self arrowUpIconContents base64Decoded readStream)
] ]
{ #category : #'private - contents' } { #category : #'private - contents' }
MendaIcons >> arrowUpIconContents [ MendaIcons >> arrowUpIconContents [
"Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/arrowUp.png" "Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/arrowUp.png"
^ 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAAICAYAAADJEc7MAAAABHNCSVQICAgIfAhkiAAAAAlw ^ 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAAICAYAAADJEc7MAAAABHNCSVQICAgIfAhkiAAAAAlw
SFlzAAAOxAAADsQBlSsOGwAAAJRJREFUGJWNy8EJQjEQBNCdVGAdwtca/LYg2EdIsIjNliHi SFlzAAAOxAAADsQBlSsOGwAAAJRJREFUGJWNy8EJQjEQBNCdVGAdwtca/LYg2EdIsIjNliHi
xQ6sQfRgF4L/LOx4EnJIPg7MaeaBpLRiZnuSn5TSpbWHGXQEcC6l7P6CFXqJyATg1MKhh0hu xQ6sQfRgF4L/LOx4EnJIPg7MaeaBpLRiZnuSn5TSpbWHGXQEcC6l7P6CFXqJyATg1MKhh0hu
AGx7OPRQSukZY7y7+9jCoYd+h5zzw91Hku8aw8wGd7+1UB1VXQG4AliQXAtJUdWDqi5JylzN AGx7OPRQSukZY7y7+9jCoYd+h5zzw91Hku8aw8wGd7+1UB1VXQG4AliQXAtJUdWDqi5JylzN
bFDVTFK+Zz+PhDBK0j8AAAAASUVORK5CYII=' bFDVTFK+Zz+PhDBK0j8AAAAASUVORK5CYII='
] ]
{ #category : #'gt-inspector' } { #category : #'gt-inspector' }
MendaIcons >> gtInspectorIconsIn: composite [ MendaIcons >> gtInspectorIconsIn: composite [
<gtInspectorPresentationOrder: 40> <gtInspectorPresentationOrder: 40>
composite list composite list
title: 'Icons'; title: 'Icons';
display: [ display: [
self iconSelectors asSortedCollection self iconSelectors asSortedCollection
collect: [ :each | each -> (self perform: each) ] ]; collect: [ :each | each -> (self perform: each) ] ];
icon: [ :each | each value ]; icon: [ :each | each value ];
format: [ :each | each key ] format: [ :each | each key ]
] ]
{ #category : #initialization } { #category : #initialization }
MendaIcons >> iconSelectors [ MendaIcons >> iconSelectors [
^ self class selectors select: [ :each | '*Icon' match: each asString ] ^ self class selectors select: [ :each | '*Icon' match: each asString ]
] ]
{ #category : #initialization } { #category : #initialization }
MendaIcons >> initialize [ MendaIcons >> initialize [
super initialize. super initialize.
self initializeIcons self initializeIcons
] ]
{ #category : #initialization } { #category : #initialization }
MendaIcons >> initializeIcons [ MendaIcons >> initializeIcons [
icons := LRUCache new icons := LRUCache new
maximumWeight: 64; maximumWeight: 64;
factory: [ :key | self perform: key ]; factory: [ :key | self perform: key ];
yourself yourself
] ]
{ #category : #'accessing - icons' } { #category : #'accessing - icons' }
MendaIcons >> minusIcon [ MendaIcons >> minusIcon [
"Private - Generated method" "Private - Generated method"
^Form fromBinaryStream: (self minusIconContents base64Decoded readStream) ^Form fromBinaryStream: (self minusIconContents base64Decoded readStream)
] ]
{ #category : #'private - contents' } { #category : #'private - contents' }
MendaIcons >> minusIconContents [ MendaIcons >> minusIconContents [
"Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/minus.png" "Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/minus.png"
^ 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAADCAYAAACj1j4PAAAABHNCSVQICAgIfAhkiAAAAAlw ^ 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAADCAYAAACj1j4PAAAABHNCSVQICAgIfAhkiAAAAAlw
SFlzAAAOxAAADsQBlSsOGwAAADhJREFUCJlj7O7uDmNgYEhjIAEwMTFNZ2FkZJRjYGBwJkXj SFlzAAAOxAAADsQBlSsOGwAAADhJREFUCJlj7O7uDmNgYEhjIAEwMTFNZ2FkZJRjYGBwJkXj
379/t7D8////AQMDw05SNDIwMDwEANK6DIovD6CyAAAAAElFTkSuQmCC' 379/t7D8////AQMDw05SNDIwMDwEANK6DIovD6CyAAAAAElFTkSuQmCC'
] ]
{ #category : #'accessing - icons' } { #category : #'accessing - icons' }
MendaIcons >> plusIcon [ MendaIcons >> plusIcon [
"Private - Generated method" "Private - Generated method"
^Form fromBinaryStream: (self plusIconContents base64Decoded readStream) ^Form fromBinaryStream: (self plusIconContents base64Decoded readStream)
] ]
{ #category : #'private - contents' } { #category : #'private - contents' }
MendaIcons >> plusIconContents [ MendaIcons >> plusIconContents [
"Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/plus.png" "Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/plus.png"
^ 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlw ^ 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlw
SFlzAAAOxAAADsQBlSsOGwAAAKVJREFUKJHVkjEOgkAQRd9suIFcxUhvZeJpCA2FhoJ2uYyN SFlzAAAOxAAADsQBlSsOGwAAAKVJREFUKJHVkjEOgkAQRd9suIFcxUhvZeJpCA2FhoJ2uYyN
nEE9CZ5hP4WQkHVJjIWJv5r5839m83dMEjG6ritCCO3U1lVV3WJN9uYCJOVmtgcws01K41Lk nEE9CZ5hP4WQkHVJjIWJv5r5839m83dMEjG6ritCCO3U1lVV3WJN9uYCJOVmtgcws01K41Lk
J/i90bz3haQ84rfAeaob4LEcShqyEEI7B7GCJsH1Xz81A+o4ckm7eZOZnYD7cu6ce1rqALz3 J/i90bz3haQ84rfAeaob4LEcShqyEEI7B7GCJsH1Xz81A+o4ckm7eZOZnYD7cu6ce1rqALz3
R+AyGQ9lWV5jzR/949qtDkAPryBSmhE5/jJyCd+z1gAAAABJRU5ErkJggg==' R+AyGQ9lWV5jzR/949qtDkAPryBSmhE5/jJyCd+z1gAAAABJRU5ErkJggg=='
] ]
{ #category : #'accessing - icons' } { #category : #'accessing - icons' }
MendaIcons >> smalltalkCodeIcon [ MendaIcons >> smalltalkCodeIcon [
"Private - Generated method" "Private - Generated method"
^Form fromBinaryStream: (self smalltalkCodeIconContents base64Decoded readStream) ^Form fromBinaryStream: (self smalltalkCodeIconContents base64Decoded readStream)
] ]
{ #category : #'private - contents' } { #category : #'private - contents' }
MendaIcons >> smalltalkCodeIconContents [ MendaIcons >> smalltalkCodeIconContents [
"Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/smalltalkCode.png" "Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/smalltalkCode.png"
^ 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlw ^ 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlw
SFlzAAAOxAAADsQBlSsOGwAAAQhJREFUKJHtkrFOw0AQRGfOJ1FdkSB6pLgN+QAaJCQkfsS1 SFlzAAAOxAAADsQBlSsOGwAAAQhJREFUKJHtkrFOw0AQRGfOJ1FdkSB6pLgN+QAaJCQkfsS1
ZbcUDm18EvK/UOQPEA1ROiy+gDQBdxz20BwSsiho0jHV7urN7BbLuq4fJc0kbUn2xpiboige ZbcUDm18EvK/UOQPEA1ROiy+gDQBdxz20BwSsiho0jHV7urN7BbLuq4fJc0kbUn2xpiboige
6rq+JdmXZblcrVbnJJeSLMk5ydZKmpGckrwAAEl3AEDyTNInABhjTgBckkRkUkNyG5vTJEkm 6rq+JdmXZblcrVbnJJeSLMk5ydZKmpGckrwAAEl3AEDyTNInABhjTgBckkRkUkNyG5vTJEkm
zrk1RnLO3SdJMhmGIY2hGyupJwlr7Vue5/uxCQCyLAsA9t57G5f05jfwL/o3HsJo4xshhHDs zrk1RnLO3SdJMhmGIY2hGyupJwlr7Vue5/uxCQCyLAsA9t57G5f05jfwL/o3HsJo4xshhHDs
vbdd171XVfXxE2qa5iiE4ABMv32G5BwAjDEvAHbOuatxegjhGsAOwHMcLSzJVlJKciOpjwAA vbdd171XVfXxE2qa5iiE4ABMv32G5BwAjDEvAHbOuatxegjhGsAOwHMcLSzJVlJKciOpjwAA
PAHoY/0qaR2vW0hqvwBnzXKb8TsomwAAAABJRU5ErkJggg==' PAHoY/0qaR2vW0hqvwBnzXKb8TsomwAAAABJRU5ErkJggg=='
] ]
{ #category : #'accessing - icons' } { #category : #'accessing - icons' }
MendaIcons >> tagAddIcon [ MendaIcons >> tagAddIcon [
"Private - Generated method" "Private - Generated method"
^Form fromBinaryStream: (self tagAddIconContents base64Decoded readStream) ^Form fromBinaryStream: (self tagAddIconContents base64Decoded readStream)
] ]
{ #category : #'private - contents' } { #category : #'private - contents' }
MendaIcons >> tagAddIconContents [ MendaIcons >> tagAddIconContents [
"Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/tagAdd.png" "Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/tagAdd.png"
^ 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlw ^ 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlw
SFlzAAAOxAAADsQBlSsOGwAAATFJREFUKJF90DFPAjEcBfD3GuByGg1qiH4FRyOrDhjipl9B SFlzAAAOxAAADsQBlSsOGwAAATFJREFUKJF90DFPAjEcBfD3GuByGg1qiH4FRyOrDhjipl9B
HR25+whu0NldJ0dmHJ2c1U0HY6KigKLJwYE8F8GjAf5Jk+bf/tq+slwunwDIwymSNgiCmtsf HR25+whu0NldJ0dmHJ2c1U0HY6KigKLJwYE8F8GjAf5Jk+bf/tq+slwunwDIwymSNgiCmtsf
lgGQJ7nrDklVa21xFgQASGpKOpXU/bvRn4VNYn4RhuExgKvEc6fiJDyqVCqXAApO1onYJDZ4 lgGQJ7nrDklVa21xFgQASGpKOpXU/bvRn4VNYn4RhuExgKvEc6fiJDyqVCqXAApO1onYJDZ4
JHdI0j19EjYkraRoUo71zXcsZOOJmJJgrS1KqpL0k3B77xG31zk0Xv7bkiKS+5QEAGM4X3hG JHdI0j19EjYkraRoUo71zXcsZOOJmJJgrS1KqpL0k3B77xG31zk0Xv7bkiKS+5QEAGM4X3hG
OvODldUOvj4yiLsG9zfLqD/NAcBA0sEIJvFSrusbI2xsveLhLovPhofvdhpxJzUgeVgqlc6S OvODldUOvj4yiLsG9zfLqD/NAcBA0sEIJvFSrusbI2xsveLhLovPhofvdhpxJzUgeVgqlc6S
v4ogCGok91tvXtSs++j1DNotD826P4ZGGd0a3jy/2PPjKIV+34yhqdDJ7LloJkzgtTAMz921 v4ogCGok91tvXtSs++j1DNotD826P4ZGGd0a3jy/2PPjKIV+34yhqdDJ7LloJkzgtTAMz921
X92gun92K18+AAAAAElFTkSuQmCC' X92gun92K18+AAAAAElFTkSuQmCC'
] ]
{ #category : #'accessing - icons' } { #category : #'accessing - icons' }
MendaIcons >> tagMinusIcon [ MendaIcons >> tagMinusIcon [
"Private - Generated method" "Private - Generated method"
^Form fromBinaryStream: (self tagMinusIconContents base64Decoded readStream) ^Form fromBinaryStream: (self tagMinusIconContents base64Decoded readStream)
] ]
{ #category : #'private - contents' } { #category : #'private - contents' }
MendaIcons >> tagMinusIconContents [ MendaIcons >> tagMinusIconContents [
"Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/tagMinus.png" "Private - Method generated with the content of the file File @ /home/offray/Programas/Grafoscopio/Dev/Common/Icons/Menda/Png/tagMinus.png"
^ 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlw ^ 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlw
SFlzAAAOxAAADsQBlSsOGwAAAPhJREFUKJGF0bFKQzEUBuD/D9Zy3RQKPsh9gkpx7Cuoo+NN SFlzAAAOxAAADsQBlSsOGwAAAPhJREFUKJGF0bFKQzEUBuD/D9Zy3RQKPsh9gkpx7Cuoo+NN
HqHbvZm76+TYuY4+gqubIDg4iFBbaP8u9ZIcrrcHAiHJl5NzwrquZwBKmCAZvfdLu/4XDkBJ HqHbvZm76+TYuY4+gqubIDg4iFBbaP8u9ZIcrrcHAiHJl5NzwrquZwBKmCAZvfdLu/4XDkBJ
8toOSYsY46QPAgAkfUmaS1ofMhZ92CXzpxDCPYCX5Ln/4hTeNU3zDGBsau3ELjkwJHlFkvb2 8toOSYsY46QPAgAkfUmaS1ofMhZ92CXzpxDCPYCX5Ln/4hTeNU3zDGBsau3ELjkwJHlFkvb2
LuxIRkmrrjr6MCUhxjiRtCBZHLtA0orklJIAIMPl+AOD020G3l4v8Pl+BgA7STctTPH5aF04 LuxIRkmrrjr6MCUhxjiRtCBZHLtA0orklJIAIMPl+AOD020G3l4v8Pl+BgA7STctTPH5aF04
pwz+fA+w+T3ZkbytquohgzazeWWLgPw7AADe+yXJqWlYhtrmdEWSeWhRL0zwZQjh0e7tAVcM pwz+fA+w+T3ZkbytquohgzazeWWLgPw7AADe+yXJqWlYhtrmdEWSeWhRL0zwZQjh0e7tAVcM
m6R0vbZ+AAAAAElFTkSuQmCC' m6R0vbZ+AAAAAElFTkSuQmCC'
] ]

View File

@ -1,185 +1,185 @@
" "
I provide support for minmapping Freemind import and d3js export. I provide support for minmapping Freemind import and d3js export.
In the future I'll plan to support exporting from Grafoscopio notebooks In the future I'll plan to support exporting from Grafoscopio notebooks
to javascript enabled web presentations. to javascript enabled web presentations.
" "
Class { Class {
#name : #MindMap, #name : #MindMap,
#superclass : #Object, #superclass : #Object,
#category : #'Grafoscopio-Model' #category : #'Grafoscopio-Model'
} }
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
MindMap class >> d3CSS [ MindMap class >> d3CSS [
"I define the nodes geometrical form, their text and the links between them." "I define the nodes geometrical form, their text and the links between them."
^ ' .node circle { ^ ' .node circle {
fill: #fff; fill: #fff;
stroke: steelblue; stroke: steelblue;
stroke-width: 3px; stroke-width: 3px;
} }
.node text { font: 12px sans-serif; } .node text { font: 12px sans-serif; }
.link { .link {
fill: none; fill: none;
stroke: #ccc; stroke: #ccc;
stroke-width: 2px; stroke-width: 2px;
}' }'
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
MindMap class >> d3SVGAppender [ MindMap class >> d3SVGAppender [
"I append the SVG working area to the body of our web page and create a group elements "I append the SVG working area to the body of our web page and create a group elements
(<g>) that will contain the SVG objects (the nodes, text and links)" (<g>) that will contain the SVG objects (the nodes, text and links)"
^'var svg = d3.select("body").append("svg") ^'var svg = d3.select("body").append("svg")
.attr("width", width + margin.right + margin.left) .attr("width", width + margin.right + margin.left)
.attr("height", height + margin.top + margin.bottom) .attr("height", height + margin.top + margin.bottom)
.append("g") .append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");' .attr("transform", "translate(" + margin.left + "," + margin.top + ")");'
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
MindMap class >> d3TreeDemoData [ MindMap class >> d3TreeDemoData [
"I'm demo data for the tutorial contain at: https://blog.pixelingene.com/2011/07/building-a-tree-diagram-in-d3-js/" "I'm demo data for the tutorial contain at: https://blog.pixelingene.com/2011/07/building-a-tree-diagram-in-d3-js/"
^ 'var treeData = { ^ 'var treeData = {
name: "/", name: "/",
contents: [ contents: [
{ {
name: "Applications", name: "Applications",
contents: [ contents: [
{ name: "Mail.app" }, { name: "Mail.app" },
{ name: "iPhoto.app" }, { name: "iPhoto.app" },
{ name: "Keynote.app" }, { name: "Keynote.app" },
{ name: "iTunes.app" }, { name: "iTunes.app" },
{ name: "XCode.app" }, { name: "XCode.app" },
{ name: "Numbers.app" }, { name: "Numbers.app" },
{ name: "Pages.app" } { name: "Pages.app" }
] ]
}, },
{ {
name: "System", name: "System",
contents: [] contents: []
}, },
{ {
name: "Library", name: "Library",
contents: [ contents: [
{ {
name: "Application Support", name: "Application Support",
contents: [ contents: [
{ name: "Adobe" }, { name: "Adobe" },
{ name: "Apple" }, { name: "Apple" },
{ name: "Google" }, { name: "Google" },
{ name: "Microsoft" } { name: "Microsoft" }
] ]
}, },
{ {
name: "Languages", name: "Languages",
contents: [ contents: [
{ name: "Ruby" }, { name: "Ruby" },
{ name: "Python" }, { name: "Python" },
{ name: "Javascript" }, { name: "Javascript" },
{ name: "C#" } { name: "C#" }
] ]
}, },
{ {
name: "Developer", name: "Developer",
contents: [ contents: [
{ name: "4.2" }, { name: "4.2" },
{ name: "4.3" }, { name: "4.3" },
{ name: "5.0" }, { name: "5.0" },
{ name: "Documentation" } { name: "Documentation" }
] ]
} }
] ]
}, },
{ {
name: "opt", name: "opt",
contents: [] contents: []
}, },
{ {
name: "Users", name: "Users",
contents: [ contents: [
{ name: "pavanpodila" }, { name: "pavanpodila" },
{ name: "admin" }, { name: "admin" },
{ name: "test-user" } { name: "test-user" }
] ]
} }
] ]
};' };'
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
MindMap class >> d3TreeDiagramProperties [ MindMap class >> d3TreeDiagramProperties [
^ 'var margin = {top: 20, right: 120, bottom: 20, left: 120}, ^ 'var margin = {top: 20, right: 120, bottom: 20, left: 120},
width = 960 - margin.right - margin.left, width = 960 - margin.right - margin.left,
height = 500 - margin.top - margin.bottom; height = 500 - margin.top - margin.bottom;
var i = 0; var i = 0;
var tree = d3.layout.tree() var tree = d3.layout.tree()
.size([height, width]);' .size([height, width]);'
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
MindMap class >> d3TreeLinksDrawerFunction [ MindMap class >> d3TreeLinksDrawerFunction [
^ 'var diagonal = d3.svg.diagonal() ^ 'var diagonal = d3.svg.diagonal()
.projection(function(d) { return [d.y, d.x]; });' .projection(function(d) { return [d.y, d.x]; });'
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
MindMap class >> d3TreeRootDefinition [ MindMap class >> d3TreeRootDefinition [
"For an excellent explanation on whi this, look at: "For an excellent explanation on whi this, look at:
http://www.d3noob.org/2014/01/tree-diagrams-in-d3js_11.html" http://www.d3noob.org/2014/01/tree-diagrams-in-d3js_11.html"
^ 'root = treeData[0];' ^ 'root = treeData[0];'
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
MindMap class >> d3TreeUpdater [ MindMap class >> d3TreeUpdater [
^ 'function update (source) { ^ 'function update (source) {
// Compute the new tree layout. // Compute the new tree layout.
var nodes = tree.nodes(root).reverse(), var nodes = tree.nodes(root).reverse(),
links = tree.links(nodes); links = tree.links(nodes);
// Normalize for fixed-depth. // Normalize for fixed-depth.
nodes.forEach(function(d) { d.y = d.depth * 180 }); nodes.forEach(function(d) { d.y = d.depth * 180 });
// Declare the nodes // Declare the nodes
var node = svg.selectAll("g.node") var node = svg.selectAll("g.node")
.data(nodes, function(d) { return d.id || (d.id = ++i); }); .data(nodes, function(d) { return d.id || (d.id = ++i); });
// Enter the nodes. // Enter the nodes.
var nodeEnter = node.enter().append("g") var nodeEnter = node.enter().append("g")
.attr("class", "node") .attr("class", "node")
.attr("transform", function(d) { .attr("transform", function(d) {
return "translate(" + d.y + "," + d.x + ")";}); return "translate(" + d.y + "," + d.x + ")";});
nodeEnter.append("circle") nodeEnter.append("circle")
.attr("r",10) .attr("r",10)
.style("fill", "#fff"); .style("fill", "#fff");
nodeEnter.append("text") nodeEnter.append("text")
.attr("x", function (d) { .attr("x", function (d) {
return d.children || d._children ? -13 : 13; }) return d.children || d._children ? -13 : 13; })
.attr("dy", ".35em") .attr("dy", ".35em")
.attr("text-anchor", function(d) { .attr("text-anchor", function(d) {
return d.children || d._children ? "end" : "start"; }) return d.children || d._children ? "end" : "start"; })
.text(function(d) { return d.name; }) .text(function(d) { return d.name; })
.style ("fill-opacity", 1); .style ("fill-opacity", 1);
// Declare the links // Declare the links
var link = svg.selectAll("path.link") var link = svg.selectAll("path.link")
.data(links, function(d) { return d.targed.id }); .data(links, function(d) { return d.targed.id });
// Enter the links. // Enter the links.
link.enter().insert("path","g") link.enter().insert("path","g")
.attr("class", "link") .attr("class", "link")
.attr("d", diagonal); .attr("d", diagonal);
}' }'
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
MindMap class >> d3TreeUpdaterCaller [ MindMap class >> d3TreeUpdaterCaller [
^ 'update(root)' ^ 'update(root)'
] ]

View File

@ -1,13 +1,13 @@
Extension { #name : #PRCodeblock } Extension { #name : #PRCodeblock }
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRCodeblock >> children [ PRCodeblock >> children [
^ self ^ self
propertyAt: #children propertyAt: #children
ifAbsentPut: [ { PRText new text: text; parent: self ;yourself } asOrderedCollection ] ifAbsentPut: [ { PRText new text: text; parent: self ;yourself } asOrderedCollection ]
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRCodeblock >> children: aCollection [ PRCodeblock >> children: aCollection [
self propertyAt:#children put: aCollection. self propertyAt:#children put: aCollection.
] ]

View File

@ -1,8 +1,8 @@
Extension { #name : #PRDocumentGroup } Extension { #name : #PRDocumentGroup }
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRDocumentGroup >> children: anArrayOfChildren [ PRDocumentGroup >> children: anArrayOfChildren [
"Answer the children of the receiver." "Answer the children of the receiver."
children := anArrayOfChildren asArray children := anArrayOfChildren asArray
] ]

View File

@ -1,63 +1,63 @@
Extension { #name : #PRDocumentItem } Extension { #name : #PRDocumentItem }
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRDocumentItem >> formats [ PRDocumentItem >> formats [
| ancestors | | ancestors |
ancestors := (self parent ifNil: [ {} ] ifNotNil: [ self parent formats ]). ancestors := (self parent ifNil: [ {} ] ifNotNil: [ self parent formats ]).
^ ancestors , (self propertyAt: #gfpFormat ifAbsent: [ Array empty ]) ^ ancestors , (self propertyAt: #gfpFormat ifAbsent: [ Array empty ])
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRDocumentItem >> installFormat: aFormat [ PRDocumentItem >> installFormat: aFormat [
(self propertyAt: #gfpFormat ifAbsentPut: [ OrderedCollection new ]) add: aFormat. (self propertyAt: #gfpFormat ifAbsentPut: [ OrderedCollection new ]) add: aFormat.
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRDocumentItem >> isLineBreak [ PRDocumentItem >> isLineBreak [
^ false ^ false
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRDocumentItem >> isTextOrLineBreak [ PRDocumentItem >> isTextOrLineBreak [
^ false ^ false
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRDocumentItem >> markAsDirty [ PRDocumentItem >> markAsDirty [
self parent ifNotNil: [ :p | p markAsDirty ]. self parent ifNotNil: [ :p | p markAsDirty ].
properties removeKey: #textStart ifAbsent: [ ]. properties removeKey: #textStart ifAbsent: [ ].
properties removeKey: #textStop ifAbsent: [ ] properties removeKey: #textStop ifAbsent: [ ]
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRDocumentItem >> parent [ PRDocumentItem >> parent [
^ self propertyAt: #parent ifAbsent: [ nil ] ^ self propertyAt: #parent ifAbsent: [ nil ]
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRDocumentItem >> parent: aParent [ PRDocumentItem >> parent: aParent [
self propertyAt: #parent put: aParent self propertyAt: #parent put: aParent
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRDocumentItem >> textSize [ PRDocumentItem >> textSize [
^ self textStop - self textStart ^ self textStop - self textStart
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRDocumentItem >> textStart [ PRDocumentItem >> textStart [
^ self ^ self
propertyAt: #textStart propertyAt: #textStart
ifAbsentPut: [ self hasChildren ifAbsentPut: [ self hasChildren
ifTrue: [ self children first textStart ] ifTrue: [ self children first textStart ]
ifFalse: [ 0 ] ] ifFalse: [ 0 ] ]
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRDocumentItem >> textStop [ PRDocumentItem >> textStop [
^ self ^ self
propertyAt: #textStop propertyAt: #textStop
ifAbsentPut: [ self hasChildren ifAbsentPut: [ self hasChildren
ifTrue: [ self children last textStop ] ifTrue: [ self children last textStop ]
ifFalse: [ 0 ] ] ifFalse: [ 0 ] ]
] ]

View File

@ -1,70 +1,70 @@
Extension { #name : #PRLineBreak } Extension { #name : #PRLineBreak }
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRLineBreak >> formattedText [ PRLineBreak >> formattedText [
^ OSPlatform current lineEnding ^ OSPlatform current lineEnding
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRLineBreak >> isLineBreak [ PRLineBreak >> isLineBreak [
^ true ^ true
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRLineBreak >> isTextOrLineBreak [ PRLineBreak >> isTextOrLineBreak [
^ true ^ true
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRLineBreak >> markAsDirty [ PRLineBreak >> markAsDirty [
self parent ifNotNil: [ :p | p markAsDirty ] self parent ifNotNil: [ :p | p markAsDirty ]
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRLineBreak >> next [ PRLineBreak >> next [
^ self propertyAt: #next ifAbsent: [ nil ] ^ self propertyAt: #next ifAbsent: [ nil ]
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRLineBreak >> next: aText [ PRLineBreak >> next: aText [
self propertyAt: #next put: aText self propertyAt: #next put: aText
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRLineBreak >> text [ PRLineBreak >> text [
^ OSPlatform current lineEnding ^ OSPlatform current lineEnding
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRLineBreak >> text: aString [ PRLineBreak >> text: aString [
self shouldBeImplemented. self shouldBeImplemented.
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRLineBreak >> textSize [ PRLineBreak >> textSize [
^ self text size ^ 1
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRLineBreak >> textStart [ PRLineBreak >> textStart [
^ self propertyAt: #textStart ^ self propertyAt: #textStart
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRLineBreak >> textStart: aValue [ PRLineBreak >> textStart: aValue [
^ self ^ self
propertyAt: #textStart propertyAt: #textStart
put: aValue put: aValue
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRLineBreak >> textStop [ PRLineBreak >> textStop [
^ self propertyAt: #textStop ^ self propertyAt: #textStop
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRLineBreak >> textStop: aValue [ PRLineBreak >> textStop: aValue [
^ self ^ self
propertyAt: #textStop propertyAt: #textStop
put: aValue put: aValue
] ]

View File

@ -1,16 +1,16 @@
Extension { #name : #PRList } Extension { #name : #PRList }
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRList >> level [ PRList >> level [
| current level | | current level |
current := self. current := self.
level := 0. level := 0.
[ current notNil ] [ current notNil ]
whileTrue: [ whileTrue: [
(current isKindOf: PRList) ifTrue: [ (current isKindOf: PRList) ifTrue: [
level := level + 1. level := level + 1.
]. ].
current := current parent current := current parent
]. ].
^ level ^ level
] ]

View File

@ -1,6 +1,6 @@
Extension { #name : #PRPillarWriter } Extension { #name : #PRPillarWriter }
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRPillarWriter >> visitFormatText: aGrafoscopioFormatTextNode [ PRPillarWriter >> visitFormatText: aGrafoscopioFormatTextNode [
" Do nothing " " Do nothing "
] ]

View File

@ -1,45 +1,45 @@
Extension { #name : #PRText } Extension { #name : #PRText }
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRText >> isTextOrLineBreak [ PRText >> isTextOrLineBreak [
^ true ^ true
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRText >> markAsDirty [ PRText >> markAsDirty [
self parent ifNotNil: [ :p | p markAsDirty ] self parent ifNotNil: [ :p | p markAsDirty ]
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRText >> next [ PRText >> next [
^ self propertyAt: #next ifAbsent: [ nil ] ^ self propertyAt: #next ifAbsent: [ nil ]
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRText >> next: aText [ PRText >> next: aText [
self propertyAt: #next put: aText. self propertyAt: #next put: aText.
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRText >> textStart [ PRText >> textStart [
^ self propertyAt: #textStart ^ self propertyAt: #textStart
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRText >> textStart: aValue [ PRText >> textStart: aValue [
^ self ^ self
propertyAt: #textStart propertyAt: #textStart
put: aValue put: aValue
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRText >> textStop [ PRText >> textStop [
^ self propertyAt: #textStop ^ self propertyAt: #textStop
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
PRText >> textStop: aValue [ PRText >> textStop: aValue [
^ self ^ self
propertyAt: #textStop propertyAt: #textStop
put: aValue put: aValue
] ]

View File

@ -1,44 +1,44 @@
Class { Class {
#name : #SpSidebar, #name : #SpSidebar,
#superclass : #SpPresenter, #superclass : #SpPresenter,
#instVars : [ #instVars : [
'container' 'container'
], ],
#category : #'Grafoscopio-New-UI' #category : #'Grafoscopio-New-UI'
} }
{ #category : #specs } { #category : #specs }
SpSidebar class >> defaultSpec [ SpSidebar class >> defaultSpec [
^ SpBoxLayout newHorizontal ^ SpBoxLayout newHorizontal
add: #container ; add: #container ;
yourself yourself
] ]
{ #category : #initialization } { #category : #initialization }
SpSidebar >> addAction: aBlock icon: anIcon [ SpSidebar >> addAction: aBlock icon: anIcon [
container container
addPresenter: addPresenter:
(self createDefaultPresenter (self createDefaultPresenter
parent: self; parent: self;
action: [ :state | action: [ :state |
container unselectAll. container unselectAll.
aBlock cull: state ]; aBlock cull: state ];
icon: anIcon; icon: anIcon;
yourself) yourself)
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
SpSidebar >> buttons [ SpSidebar >> buttons [
^ container items ^ container items
] ]
{ #category : #initialization } { #category : #initialization }
SpSidebar >> createDefaultPresenter [ SpSidebar >> createDefaultPresenter [
^ self instantiate: SpSquareButton. ^ self instantiate: SpSquareButton.
] ]
{ #category : #initialization } { #category : #initialization }
SpSidebar >> initializeWidgets [ SpSidebar >> initializeWidgets [
super initializeWidgets. super initializeWidgets.
container := self instantiate: SpComponentListPresenter. container := self instantiate: SpComponentListPresenter.
] ]

View File

@ -1,52 +1,52 @@
Class { Class {
#name : #SpSquareButton, #name : #SpSquareButton,
#superclass : #SpPresenter, #superclass : #SpPresenter,
#instVars : [ #instVars : [
'button', 'button',
'parent' 'parent'
], ],
#category : #'Grafoscopio-New-UI' #category : #'Grafoscopio-New-UI'
} }
{ #category : #specs } { #category : #specs }
SpSquareButton class >> defaultSpec [ SpSquareButton class >> defaultSpec [
^ SpBoxLayout newVertical ^ SpBoxLayout newVertical
add: (SpBoxLayout newHorizontal add: #button width: 50; yourself) height: 50; add: (SpBoxLayout newHorizontal add: #button width: 50; yourself) height: 50;
yourself yourself
] ]
{ #category : #initialization } { #category : #initialization }
SpSquareButton >> action: anAction [ SpSquareButton >> action: anAction [
button button
action: [ :state | action: [ :state |
state state
ifTrue: [ parent buttons ifTrue: [ parent buttons
reject: [ :b | b = self ] reject: [ :b | b = self ]
thenDo: [ :b | b toggleOff ]. thenDo: [ :b | b toggleOff ].
anAction cull: state ] anAction cull: state ]
ifFalse: [ ] ] ifFalse: [ ] ]
] ]
{ #category : #initialization } { #category : #initialization }
SpSquareButton >> icon: icon [ SpSquareButton >> icon: icon [
button icon: icon button icon: icon
] ]
{ #category : #initialization } { #category : #initialization }
SpSquareButton >> initializeWidgets [ SpSquareButton >> initializeWidgets [
super initializeWidgets. super initializeWidgets.
button := self newToggleButton button := self newToggleButton
extent: 90 @ 50; extent: 90 @ 50;
color: Color transparent; color: Color transparent;
yourself yourself
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
SpSquareButton >> parent: aSpSidebar [ SpSquareButton >> parent: aSpSidebar [
parent := aSpSidebar parent := aSpSidebar
] ]
{ #category : #initialization } { #category : #initialization }
SpSquareButton >> toggleOff [ SpSquareButton >> toggleOff [
button state: false. button state: false.
] ]

View File

@ -1,6 +1,6 @@
Extension { #name : #Text } Extension { #name : #Text }
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
Text >> allSegmentsOfLinesDo: aBlockClosure [ Text >> allSegmentsOfLinesDo: aBlockClosure [
] ]

View File

@ -1,9 +1,9 @@
Extension { #name : #TextPresenter } Extension { #name : #TextPresenter }
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
TextPresenter >> beForGrafoscopio [ TextPresenter >> beForGrafoscopio [
self self
isCodeCompletionAllowed: true; isCodeCompletionAllowed: true;
menuHolder: [ self getMenu ]; menuHolder: [ self getMenu ];
isForSmalltalkCode: true isForSmalltalkCode: true
] ]

View File

@ -1,17 +1,17 @@
Extension { #name : #TreePresenter } Extension { #name : #TreePresenter }
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
TreePresenter >> selectedIndex [ TreePresenter >> selectedIndex [
^ selectedItem value ^ selectedItem value
ifNil: [ 1 min: rootsHolder value size ] ifNil: [ 1 min: rootsHolder value size ]
ifNotNil: [ rootsHolder value indexOf: selectedItem value ] ifNotNil: [ rootsHolder value indexOf: selectedItem value ]
] ]
{ #category : #'*Grafoscopio' } { #category : #'*Grafoscopio' }
TreePresenter >> selectedIndex: anInteger [ TreePresenter >> selectedIndex: anInteger [
anInteger = 0 anInteger = 0
ifTrue: [ self resetSelection. ifTrue: [ self resetSelection.
self highlightedItem: nil ] self highlightedItem: nil ]
ifFalse: [ self selectedItem: (rootsHolder value at: anInteger). ifFalse: [ self selectedItem: (rootsHolder value at: anInteger).
self highlightedItem: (rootsHolder value at: anInteger) ] self highlightedItem: (rootsHolder value at: anInteger) ]
] ]

View File

@ -1 +1 @@
Package { #name : #Grafoscopio } Package { #name : #Grafoscopio }