From b9f52f2f873553588e1dd4dbc301e04ad4057a50 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Thu, 21 Jul 2016 12:19:22 +0000 Subject: [PATCH] Starting deprecation of GrafoscopioBrowser: Moving class methods to GrafoscopioGUI. --- .../Grafoscopio/GrafoscopioBrowser.class.st | 164 ----------------- .../Grafoscopio/GrafoscopioGUI.class.st | 166 +++++++++++++++++- .../Grafoscopio/GrafoscopioNotebook.class.st | 55 ++++-- 3 files changed, 195 insertions(+), 190 deletions(-) diff --git a/repository/Grafoscopio/GrafoscopioBrowser.class.st b/repository/Grafoscopio/GrafoscopioBrowser.class.st index 5c71a41..ef01fde 100644 --- a/repository/Grafoscopio/GrafoscopioBrowser.class.st +++ b/repository/Grafoscopio/GrafoscopioBrowser.class.st @@ -29,170 +29,6 @@ Class { #category : #'Grafoscopio-UI' } -{ #category : #'graphical interface' } -GrafoscopioBrowser class >> downloadingFrom: downloadUrl withMessage: aString into: location [ - - [: bar | - bar title: aString. - [ZnClient new - enforceHttpSuccess: true; - url: downloadUrl; - downloadTo: location; - signalProgress: true - ] - on: HTTPProgress - do: [ :progress | - progress isEmpty ifFalse: [ bar current: progress percentage ]. - progress resume ]. - ] asJob run. -] - -{ #category : #'graphical interface' } -GrafoscopioBrowser class >> messageAbout [ - "Shows the author, license, sponsors and main contributors to the project and point to further documentation on the web" - - LongMessageDialogWindow new - entryText: - '_.:| Grafoscopio |:._', - (String with: Character cr), - '(c) Copyright 2014-2016 by Offray Vladimir Luna Cárdenas', - (String with: Character cr), - 'Covered under MIT license.', - (String with: Character cr), - (String with: Character cr), - '[ Sponsors ]', - (String with: Character cr), - 'mutabiT | www.mutabit.com ', - (String with: Character cr), - 'HiTec Lab, Fundación Universitaria Los Libertadores | www.ulibertadores.edu.co ', - (String with: Character cr), - (String with: Character cr), - '[ Thanks to ]', - (String with: Character cr), - 'HackBo, Hackerspace Bogota | http://hackbo.co', - (String with: Character cr), - '// Regular workshops attendees \\ - Rafael Medida, Iván Pulido, Camilo Hurtado', - (String with: Character cr), - '// Coffe talk (mostly about grafoscopio) \\ - Yanneth Gil, Andrés Calderón, Luis Alejandro Bernal', - (String with: Character cr), - '// Pharo, Moose and Agile Visualization communities \\ - Tudor Girba, Alexandre Bergel, Nicolai Hess, Peter Uhnák, Milton Mamani ', - (String with: Character cr), - '// Family support while writing, coding & travelling (among others!) \\ - Divian Luna, Hilda Cárdenas', - (String with: Character cr), - (String with: Character cr), - 'For further details and versions go to:', - (String with: Character cr), - (String with: Character cr), - 'http://mutabit.com/grafoscopio'; - title: 'About Grafoscopio'; - open. -] - -{ #category : #'graphical interface' } -GrafoscopioBrowser class >> messageNoRecentDocuments [ - "Shows that a feature is not implemeted and point to further documentation on the web" - - UIManager default abort: - 'No hay documentos recientes.', - (String with: Character cr), - 'Abra un documento usando el menú:', - (String with: Character cr), - (String with: Character cr), - '"Lanzar > Documento interactivo desde archivo"', - (String with: Character cr), - (String with: Character cr) - title: 'No hay documentos recientes'. -] - -{ #category : #'graphical interface' } -GrafoscopioBrowser class >> messageNotImplementedYet [ - "Shows that a feature is not implemeted and point to further documentation on the web" - - UIManager default abort: - 'Esta funcionalidad aún no está implementada!', - (String with: Character cr), - 'Para información sobre futuras versiones, por favor visite: ', - (String with: Character cr), - (String with: Character cr), - 'http://mutabit.com/grafoscopio', - (String with: Character cr), - (String with: Character cr) - title: 'No implementado aún'. -] - -{ #category : #'graphical interface' } -GrafoscopioBrowser class >> open [ - ^ self new open -] - -{ #category : #'graphical interface' } -GrafoscopioBrowser class >> openFromRecentlyUsed [ - "Opens a recent notebooks list" - | selection | - - recentTrees isNil - ifFalse: [ - selection := UIManager default chooseFrom: recentTrees title: 'Elija una documento'. - GrafoscopioBrowser new openFromFile: (recentTrees at: selection) - ] - ifTrue: [self messageNoRecentDocuments]. - "browser update". - - - -] - -{ #category : #'graphical interface' } -GrafoscopioBrowser class >> openHelpInHtml [ - "Launches the help manual in PDF format in an external viewer." - - | htmlHelpFileLocation | - htmlHelpFileLocation := (FileSystem disk workingDirectory parent / 'Docs' /'Es' / 'Manual' / 'manual-grafoscopio.html') fullName. - Smalltalk platform name = 'unix' - ifTrue: [OSProcess command: 'xdg-open ', htmlHelpFileLocation]. - Smalltalk platform name = 'Win32' - ifTrue: [OSProcess command: 'explorer ', htmlHelpFileLocation]. - Smalltalk platform name = 'Mac OS' - ifTrue: [OSProcess command: 'open ', htmlHelpFileLocation]. - -] - -{ #category : #'graphical interface' } -GrafoscopioBrowser class >> openHelpInPdf [ - "Launches the help manual in PDF format in an external viewer." - - | pdfHelpFileLocation | - pdfHelpFileLocation := (FileSystem disk workingDirectory parent / 'Docs' /'Es' / 'Manual' / 'manual-grafoscopio.pdf') fullName. - Smalltalk platform name = 'unix' - ifTrue: [OSProcess command: 'xdg-open ', pdfHelpFileLocation]. - Smalltalk platform name = 'Win32' - ifTrue: [OSProcess command: 'explorer ', pdfHelpFileLocation]. - Smalltalk platform name = 'Mac OS' - ifTrue: [OSProcess command: 'open ', pdfHelpFileLocation]. -] - -{ #category : #configuration } -GrafoscopioBrowser class >> showSettings [ - "Shows the settings in a Transcript. This should return a dictionary for better management of the settings. For the moment - is a quick a dirty hack" - - Transcript show: fossil; cr. - Transcript show: pandoc -] - -{ #category : #updating } -GrafoscopioBrowser class >> updateUI [ - "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" - - dockingBar delete. - GrafoscopioGUI startDockingBar. -] - { #category : #tags } GrafoscopioBrowser >> addTagTo: aNode [ "Tags the node passed as argument with a value from the collection of tags available" diff --git a/repository/Grafoscopio/GrafoscopioGUI.class.st b/repository/Grafoscopio/GrafoscopioGUI.class.st index 05e4e18..f14da8c 100644 --- a/repository/Grafoscopio/GrafoscopioGUI.class.st +++ b/repository/Grafoscopio/GrafoscopioGUI.class.st @@ -127,6 +127,24 @@ GrafoscopioGUI class >> dockingBar: anObject [ dockingBar := anObject ] +{ #category : #'graphical interface' } +GrafoscopioGUI class >> downloadingFrom: downloadUrl withMessage: aString into: location [ + + [: bar | + bar title: aString. + [ZnClient new + enforceHttpSuccess: true; + url: downloadUrl; + downloadTo: location; + signalProgress: true + ] + on: HTTPProgress + do: [ :progress | + progress isEmpty ifFalse: [ bar current: progress percentage ]. + progress resume ]. + ] asJob run. +] + { #category : #examples } GrafoscopioGUI class >> exampleBootstrapDynamicUI1 [ "Starting from an example UI from the Spec-Glamour, to customize towards the grafoscopio @@ -339,6 +357,134 @@ GrafoscopioGUI class >> isDocUpdatedFor: aDocumentType [ ] +{ #category : #'graphical interface' } +GrafoscopioGUI class >> messageAbout [ + "Shows the author, license, sponsors and main contributors to the project and point to further documentation on the web" + + LongMessageDialogWindow new + entryText: + '_.:| Grafoscopio |:._', + (String with: Character cr), + '(c) Copyright 2014-2016 by Offray Vladimir Luna Cárdenas', + (String with: Character cr), + 'Covered under MIT license.', + (String with: Character cr), + (String with: Character cr), + '[ Sponsors ]', + (String with: Character cr), + 'mutabiT | www.mutabit.com ', + (String with: Character cr), + 'HiTec Lab, Fundación Universitaria Los Libertadores | www.ulibertadores.edu.co ', + (String with: Character cr), + (String with: Character cr), + '[ Thanks to ]', + (String with: Character cr), + 'HackBo, Hackerspace Bogota | http://hackbo.co', + (String with: Character cr), + '// Regular workshops attendees \\ + Rafael Medida, Iván Pulido, Camilo Hurtado', + (String with: Character cr), + '// Coffe talk (mostly about grafoscopio) \\ + Yanneth Gil, Andrés Calderón, Luis Alejandro Bernal', + (String with: Character cr), + '// Pharo, Moose and Agile Visualization communities \\ + Tudor Girba, Alexandre Bergel, Nicolai Hess, Peter Uhnák, Milton Mamani ', + (String with: Character cr), + '// Family support while writing, coding & travelling (among others!) \\ + Divian Luna, Hilda Cárdenas', + (String with: Character cr), + (String with: Character cr), + 'For further details and versions go to:', + (String with: Character cr), + (String with: Character cr), + 'http://mutabit.com/grafoscopio'; + title: 'About Grafoscopio'; + open. +] + +{ #category : #'graphical interface' } +GrafoscopioGUI class >> messageNoRecentDocuments [ + "Shows that a feature is not implemeted and point to further documentation on the web" + + UIManager default abort: + 'No hay documentos recientes.', + (String with: Character cr), + 'Abra un documento usando el menú:', + (String with: Character cr), + (String with: Character cr), + '"Lanzar > Documento interactivo desde archivo"', + (String with: Character cr), + (String with: Character cr) + title: 'No hay documentos recientes'. +] + +{ #category : #'graphical interface' } +GrafoscopioGUI class >> messageNotImplementedYet [ + "Shows that a feature is not implemeted and point to further documentation on the web" + + UIManager default abort: + 'Esta funcionalidad aún no está implementada!', + (String with: Character cr), + 'Para información sobre futuras versiones, por favor visite: ', + (String with: Character cr), + (String with: Character cr), + 'http://mutabit.com/grafoscopio', + (String with: Character cr), + (String with: Character cr) + title: 'No implementado aún'. +] + +{ #category : #'graphical interface' } +GrafoscopioGUI class >> open [ + ^ self new open +] + +{ #category : #'graphical interface' } +GrafoscopioGUI class >> openFromRecentlyUsed [ + "Opens a recent notebooks list" + | selection | + + recentTrees isNil + ifFalse: [ + selection := UIManager default chooseFrom: recentTrees title: 'Elija una documento'. + GrafoscopioBrowser new openFromFile: (recentTrees at: selection) + ] + ifTrue: [self messageNoRecentDocuments]. + "browser update". + + + +] + +{ #category : #'graphical interface' } +GrafoscopioGUI class >> openHelpInHtml [ + "Launches the help manual in PDF format in an external viewer." + + | htmlHelpFileLocation | + htmlHelpFileLocation := (FileSystem disk workingDirectory parent / 'Docs' /'Es' / 'Manual' / 'manual-grafoscopio.html') fullName. + Smalltalk platform name = 'unix' + ifTrue: [OSProcess command: 'xdg-open ', htmlHelpFileLocation]. + Smalltalk platform name = 'Win32' + ifTrue: [OSProcess command: 'explorer ', htmlHelpFileLocation]. + Smalltalk platform name = 'Mac OS' + ifTrue: [OSProcess command: 'open ', htmlHelpFileLocation]. + +] + +{ #category : #'graphical interface' } +GrafoscopioGUI class >> openHelpInPdf [ + "Launches the help manual in PDF format in an external viewer." + + | pdfHelpFileLocation | + pdfHelpFileLocation := (FileSystem disk workingDirectory parent / 'Docs' /'Es' / 'Manual' / 'manual-grafoscopio.pdf') fullName. + Smalltalk platform name = 'unix' + ifTrue: [OSProcess command: 'xdg-open ', pdfHelpFileLocation]. + Smalltalk platform name = 'Win32' + ifTrue: [OSProcess command: 'explorer ', pdfHelpFileLocation]. + Smalltalk platform name = 'Mac OS' + ifTrue: [OSProcess command: 'open ', pdfHelpFileLocation]. +] + { #category : #accessing } GrafoscopioGUI class >> recentNotebooks [ ^ recentNotebooks ifNil: [ ^ OrderedCollection new ] @@ -349,6 +495,15 @@ GrafoscopioGUI class >> recentNotebooks: anObject [ recentNotebooks := anObject ] +{ #category : #configuration } +GrafoscopioGUI class >> showSettings [ + "Shows the settings in a Transcript. This should return a dictionary for better management of the settings. For the moment + is a quick a dirty hack" + + Transcript show: fossil; cr. + Transcript show: pandoc +] + { #category : #'graphical interface' } GrafoscopioGUI class >> startDockingBar [ "Creates a custom docking bar for grafoscopio on top, with shorcuts for most used actions, and a fixed place for asking for help. @@ -380,7 +535,7 @@ GrafoscopioGUI class >> startDockingBar [ helpMenu := MenuMorph new. helpMenu - add: 'Tutorial in Grafoscopio' target: (self new) selector: #openTutorialInGrafoscopio; + add: 'Tutorial in Grafoscopio' target: (GrafoscopioNotebook new) selector: #openTutorial; add: 'PDF Manual' target: self selector: #openHelpInPdf; add: 'HTML Manual' target: self selector: #openHelpInHtml; add: 'Manual in grafoscopio' target: (self new) selector: #openHelpInGrafoscopio; @@ -581,16 +736,13 @@ GrafoscopioGUI class >> updateSystem [ ] ] -{ #category : #'graphical interface' } +{ #category : #updating } GrafoscopioGUI class >> updateUI [ "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" - self dockingBar - ifNil: [^ self ] - ifNotNil: [ - self dockingBar delete. - self startDockingBar] + dockingBar delete. + GrafoscopioGUI startDockingBar. ] { #category : #initialization } diff --git a/repository/Grafoscopio/GrafoscopioNotebook.class.st b/repository/Grafoscopio/GrafoscopioNotebook.class.st index 1930e2d..02dacf7 100644 --- a/repository/Grafoscopio/GrafoscopioNotebook.class.st +++ b/repository/Grafoscopio/GrafoscopioNotebook.class.st @@ -44,6 +44,13 @@ GrafoscopioNotebook class >> defaultSpec [ row newColumn: [ :bc | bc newRow: [ :bcr | bcr add: #header ] height: self toolbarHeight. bc add: #body ]]] +] + +{ #category : #operation } +GrafoscopioNotebook >> addNode [ + + + ] { #category : #accessing } @@ -111,7 +118,10 @@ GrafoscopioNotebook >> initializePresenter [ (tree selectedItem content header) = arg ifFalse: [ (tree selectedItem) content header: header text. - tree roots: tree roots]] + tree roots: tree roots]]. + body whenTextChanged: [ :arg | + (tree selectedItem) content body: body text + ] ] { #category : #initialization } @@ -169,37 +179,37 @@ GrafoscopioNotebook >> newWindowMainMenu [ name: nil; description: 'Add nodo'; icon: MendaIcons new plusIcon; - action: [ self inform: 'To be implemented...' ] ]. + action: [ self addNode ] ]. group addItem: [ :item | item name: nil; description: 'Delete node'; icon: MendaIcons new minusIcon; - action: [ self inform: 'To be implemented...' ] ]. + action: [ self removeNode ] ]. group addItem: [ :item | item name: nil; description: 'Move up node'; icon: MendaIcons new arrowUpIcon; - action: [ self inform: 'To be implemented...' ] ]. + action: [ self moveNodeBefore ] ]. group addItem: [ :item | item name: nil; description: 'Move down node'; icon: MendaIcons new arrowDownIcon; - action: [ self inform: 'To be implemented...' ] ]. + action: [ self moveNodeAfter ] ]. group addItem: [ :item | item name: nil; description: 'Move node left'; icon: MendaIcons new arrowLeftIcon; - action: [ self inform: 'To be implemented...' ] ]. + action: [ self promoteNode ] ]. group addItem: [ :item | item name: nil; description: 'Move node right'; icon: MendaIcons new arrowRightIcon; - action: [ self inform: 'To be implemented...' ] ]]; + action: [ self demoteNode ] ]]; addGroup: [ :group | group addItem: [ :item | item @@ -321,6 +331,13 @@ GrafoscopioNotebook >> openFromFileSelector [ nb openFromFile: self workingFile. ] +{ #category : #persistence } +GrafoscopioNotebook >> openTutorial [ + | tutorial | + tutorial := (FileLocator documents / 'Grafoscopio/Docs/Es/Turiales/tutorial.ston' ) asFileReference. + self class new openFromFile: tutorial. +] + { #category : #initialization } GrafoscopioNotebook >> projectSubMenu [ @@ -328,34 +345,34 @@ GrafoscopioNotebook >> projectSubMenu [ addGroup: [ :group | group addItem: [ :item | item - name: 'Activar repositorio remoto...'; + name: 'Activate remote repository...'; icon: Smalltalk ui icons smallPushpinIcon; - action: [ self inform: 'Por implementar ...' ] ]. + action: [ self inform: 'To be implemented ...' ] ]. group addItem: [ :item | item - name: 'Activar repositorio local...'; + name: 'Activate local repository...'; icon: Smalltalk ui icons homeIcon; - action: [ self inform: 'Por implementar ...' ] ]. + action: [ self inform: 'To be implemented ...' ] ]. group addItem: [ :item | item - name: 'Agregar archivo...'; + name: 'Add file...'; icon: Smalltalk ui icons newerPackagesAvailableIcon; - action: [ self inform: 'Por implementar ...' ] ]. + action: [ self inform: 'To be implemented ...' ] ]. group addItem: [ :item | item - name: 'Eliminar archivo...'; + name: 'Delete file...'; icon: Smalltalk ui icons packageDeleteIcon; - action: [ self inform: 'Por implementar ...' ] ]. + action: [ self inform: 'To be implemented ...' ] ]. group addItem: [ :item | item - name: 'Enviar al histórico'; + name: 'Commit to repository'; icon: Smalltalk ui icons smallScreenshotIcon; - action: [ self inform: 'Por implementar ...' ] ]. + action: [ self inform: 'To be implemented ...' ] ]. group addItem: [ :item | item - name: 'Acreditarse'; + name: 'Credentials'; icon: Smalltalk ui icons userIcon; - action: [ self inform: 'Por implementar ...' ] ] ] + action: [ self inform: 'To be implemented ...' ] ] ] ]