First minimalist configuration of the project to ease installation for upcoming data week and beyond :-)

This commit is contained in:
Offray Vladimir Luna Cárdenas 2016-02-17 11:48:57 +00:00
parent 483ac2acc9
commit da91cb4eb9
4 changed files with 29 additions and 321 deletions

View File

@ -1,107 +0,0 @@
"
I'm just a way to explore Spec and its documentation for learning purposes.
"
Class {
#name : #DynamicDict,
#superclass : #ComposableModel,
#instVars : [
'list',
'content'
],
#category : #'Grafoscopio-UI'
}
{ #category : #'as yet unclassified' }
DynamicDict class >> defaultSpec [
<spec: #default>
^ SpecLayout composed
newRow: [:row |
row
add: #list right: 0.7;
add: #content left: 0.3];
yourself
]
{ #category : #accessing }
DynamicDict >> content [
^ content
]
{ #category : #accessing }
DynamicDict >> content: anObject [
content := anObject
]
{ #category : #'as yet unclassified' }
DynamicDict >> initializePresenter [
list whenSelectedItemChanged: [:item |
item = 'first'
ifTrue: [ self rebuildWithTextLayout ].
item = 'second'
ifTrue: [ self rebuildWithCodeLayout ].
]
]
{ #category : #initialization }
DynamicDict >> initializeWidgets [
| data |
data := { 'first' -> 'I\"m just text' . 'second' -> 'ProfStef openPharoZenWorkspace'} asOrderedDictionary.
list := self newList.
list items: data keys.
content := self newText.
self focusOrder
add: list;
add: content.
]
{ #category : #accessing }
DynamicDict >> list [
^ list
]
{ #category : #accessing }
DynamicDict >> list: anObject [
list := anObject
]
{ #category : #'as yet unclassified' }
DynamicDict >> rebuildWithCodeLayout [
| newLayout |
content := self instantiate: (GlamourPresentationModel).
newLayout := SpecLayout composed
newRow: [:row |
row
add: #list right: 0.7;
add: #content left: 0.3];
yourself.
self needRebuild: false.
content needRebuild: true.
Transcript show: 'código + ', self content asString, String cr.
self buildWithSpecLayout: newLayout.
]
{ #category : #'as yet unclassified' }
DynamicDict >> rebuildWithTextLayout [
| newLayout |
content := self newText.
newLayout := SpecLayout composed
newRow: [:row |
row
add: #list right: 0.7;
add: #content left: 0.3];
yourself.
self needRebuild: false.
list needRebuild: false.
content needRebuild: true.
Transcript show: 'texto + ', self content asString, String cr..
self buildWithSpecLayout: newLayout.
]
{ #category : #api }
DynamicDict >> title [
^'Dynamic UI | test'
]

View File

@ -89,35 +89,18 @@ GrafoscopioBrowser class >> messageAbout [
"Shows the author, license, sponsors and main contributors to the project and point to further documentation on the web" "Shows the author, license, sponsors and main contributors to the project and point to further documentation on the web"
UIManager default alert: UIManager default alert:
'_.:| Grafoscopio |:._', 'Grafosocpio',
(String with: Character cr), (String with: Character cr),
'(c) Copyright 2014-2016 by Offray Vladimir Luna Cárdenas', '(c) Copyright 2014 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 ', '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),
(String with: Character cr), (String with: Character cr),
'For further details and versions go to:', 'For further details and versions go to:',
@ -639,8 +622,8 @@ GrafoscopioBrowser >> bodyIn: constructor [
{ #category : #'graphical interface' } { #category : #'graphical interface' }
GrafoscopioBrowser >> bodyIn: constructor for: aNode [ GrafoscopioBrowser >> bodyIn: constructor for: aNode [
"Shows the body in a constructor for selected node, if node is not tagged. "Shows the body in a constructor for selected node, if node is not tagged. If it is tagged it will return itself, so it can be rendered
If it is tagged it will return itself, so it can be rendered properly for other messages" properly for other messages"
| specialTags | | specialTags |

View File

@ -8,12 +8,12 @@ My main responsability is to provide grafoscopio with graphical widgets and othe
" "
Class { Class {
#name : #GrafoscopioGUI, #name : #GrafoscopioGUI,
#superclass : #DynamicComposableModel, #superclass : #ComposableModel,
#instVars : [ #instVars : [
'windowMainMenu', 'windowMainMenu',
'tree', 'tree',
'nodeHeader', 'nodeHeader',
'nodeBody', 'nodeDetails',
'headerRefreshProcess', 'headerRefreshProcess',
'selected' 'selected'
], ],
@ -40,158 +40,12 @@ GrafoscopioGUI class >> defaultSpec [
] right: 0.7; ] right: 0.7;
addSplitter; addSplitter;
newColumn: [ :nodePart | newColumn: [ :nodePart |
nodePart add: #nodeBody] left: 0.3. nodePart add: #nodeDetails] left: 0.3.
]. ].
]; ];
yourself yourself
] ]
{ #category : #examples }
GrafoscopioGUI class >> exampleBootstrapDynamicUI1 [
"Starting from an example UI from the Spec-Glamour, to customize towards the grafoscopio
UI and get some ideas"
|notebook leftUpperPanel leftPanel treeBrowser |
"Creating a notebook-tree with dummy data"
notebook := GrafoscopioNode new becomeDefaultTestTree.
"Defining the tree roots part"
leftUpperPanel := DynamicComposableModel new.
leftUpperPanel instantiateModels: #(tree TreeModel).
leftUpperPanel tree
roots: notebook children;
childrenBlock: [:node | node children ];
displayBlock: [:node | node title ].
leftUpperPanel layout: (SpecLayout composed
add: #tree;
yourself).
"to debug upto here uncomment the next line, and comment all other 'openWithSpec' ones"
"leftUpperPanel openWithSpec."
"Integrating the previous tree with the node header and creating the body according to
the tags on the node"
leftPanel := DynamicComposableModel new.
leftPanel assign: leftUpperPanel to: #roots.
leftPanel instantiateModels: #(header TextInputFieldModel).
treeBrowser := DynamicComposableModel new.
leftUpperPanel tree
whenSelectedItemChanged: [:node |
node
ifNil:[
leftPanel header text: ''.
treeBrowser instantiateModels: #(body TextModel).
Transcript show: 'Nada que mostrar', String cr]
ifNotNil: [
leftPanel header text: (leftUpperPanel tree selectedItem content header).
leftUpperPanel tree selectedItem content tags = 'código'
ifTrue: [
treeBrowser instantiateModels: #(body GlamourPresentationModel).
Transcript show: 'I am code', String cr.
Transcript show: treeBrowser body asString, String cr.
]
ifFalse: [
treeBrowser instantiateModels: #(body TextModel).
treeBrowser body text: (leftUpperPanel tree selectedItem content body).
Transcript show: 'I am NOT code', String cr.
Transcript show: treeBrowser body asString, String cr.
]
]
].
leftPanel layout:
(SpecLayout composed
newColumn: [:column |
column
add: #roots;
add: #header height: 35];
yourself).
"Integrating the previous tree with node body content"
treeBrowser assign: leftPanel to: #leftTree.
treeBrowser layout:
(SpecLayout composed
newRow: [:r | r add: #leftTree; add: #body ];
yourself
).
treeBrowser openWithSpec.
]
{ #category : #examples }
GrafoscopioGUI class >> exampleBootstrapDynamicUI2 [
"Starting from an example UI from the Spec-Glamour, to customize towards the grafoscopio
UI and get some ideas"
|notebook leftUpperPanel leftPanel treeBrowser |
"Creating a notebook-tree with dummy data"
notebook := GrafoscopioNode new becomeDefaultTestTree.
"Defining the tree roots part"
leftUpperPanel := DynamicComposableModel new.
leftUpperPanel instantiateModels: #(tree TreeModel).
leftUpperPanel tree
roots: notebook children;
childrenBlock: [:node | node children ];
displayBlock: [:node | node title ].
leftUpperPanel layout: (SpecLayout composed
add: #tree;
yourself).
"to debug upto here uncomment the next line, and comment all other 'openWithSpec' ones"
"leftUpperPanel openWithSpec."
"Integrating the previous tree with the node header and creating the body according to
the tags on the node"
leftPanel := DynamicComposableModel new.
leftPanel assign: leftUpperPanel to: #roots.
leftPanel instantiateModels: #(header TextInputFieldModel).
treeBrowser := DynamicComposableModel new.
leftUpperPanel tree
whenSelectedItemChanged: [:node |
node
ifNil:[
leftPanel header text: ''.
treeBrowser instantiateModels: #(body TextModel).
Transcript show: 'Nada que mostrar', String cr]
ifNotNil: [
leftPanel header text: (leftUpperPanel tree selectedItem content header).
leftUpperPanel tree selectedItem content tags = 'código'
ifTrue: [
treeBrowser instantiateModels: #(body GlamourPresentationModel).
treeBrowser assign: leftPanel to: #leftTree.
treeBrowser layout:
(SpecLayout composed
newRow: [:r | r add: #leftTree; add: #body ];
yourself
).
Transcript show: 'I am code', String cr.
Transcript show: treeBrowser body asString, String cr.
]
ifFalse: [
treeBrowser instantiateModels: #(body TextModel).
treeBrowser body text: (leftUpperPanel tree selectedItem content body).
treeBrowser assign: leftPanel to: #leftTree.
treeBrowser layout:
(SpecLayout composed
newRow: [:r | r add: #leftTree; add: #body ];
yourself
).
Transcript show: 'I am NOT code', String cr.
Transcript show: treeBrowser body asString, String cr.
]
]
].
leftPanel layout:
(SpecLayout composed
newColumn: [:column |
column
add: #roots;
add: #header height: 35];
yourself).
"Integrating the previous tree with node body content"
treeBrowser openWithSpec.
]
{ #category : #examples } { #category : #examples }
GrafoscopioGUI class >> exampleBootstrapUI [ GrafoscopioGUI class >> exampleBootstrapUI [
"Starting from an example UI from the Spec-Glamour, to customize towards the grafoscopio "Starting from an example UI from the Spec-Glamour, to customize towards the grafoscopio
@ -203,9 +57,8 @@ GrafoscopioGUI class >> exampleBootstrapUI [
ui title: 'new | Grafoscopio'. ui title: 'new | Grafoscopio'.
ui instantiateModels: #( ui instantiateModels: #(
tree TreeModel tree TreeModel
header TextInputFieldModel header TextModel
bodyWhenMarkup TextModel play GlamourPresentationModel).
bodyWhenCode GlamourPresentationModel).
notebook := GrafoscopioNode new becomeDefaultTestTree. notebook := GrafoscopioNode new becomeDefaultTestTree.
ui tree ui tree
roots: notebook children; roots: notebook children;
@ -221,7 +74,7 @@ GrafoscopioGUI class >> exampleBootstrapUI [
addHSplitter; addHSplitter;
newRow: #header bottom: 0.8] right: 0.7; newRow: #header bottom: 0.8] right: 0.7;
addVSplitter; addVSplitter;
newColumn: #bodyWhenCode]; newColumn: #play];
yourself. yourself.
ui openWithSpecLayout: lay. ui openWithSpecLayout: lay.
@ -247,26 +100,23 @@ GrafoscopioGUI >> initializeWidgets [
windowMainMenu := self windowMainMenu. windowMainMenu := self windowMainMenu.
tree := self tree. tree := self tree.
nodeHeader := self newTextInput. nodeHeader := self newTextInput.
nodeBody := nodeDetails := self newText.
tree selectedItem
ifNotNil: [ self updateBody ]
ifNil: [nodeBody := self newText].
windowMainMenu applyTo: self. windowMainMenu applyTo: self.
self focusOrder self focusOrder
add: windowMainMenu; add: windowMainMenu;
add: tree; add: tree;
add: nodeHeader; add: nodeHeader;
add: nodeBody. add: nodeDetails.
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioGUI >> nodeBody [ GrafoscopioGUI >> nodeDetails [
^ nodeBody ^ nodeDetails
] ]
{ #category : #accessing } { #category : #accessing }
GrafoscopioGUI >> nodeBody: anObject [ GrafoscopioGUI >> nodeDetails: anObject [
nodeBody := anObject nodeDetails := anObject
] ]
{ #category : #accessing } { #category : #accessing }
@ -383,9 +233,8 @@ GrafoscopioGUI >> tree [
tree whenHighlightedItemChanged: tree whenHighlightedItemChanged:
[tree selectedItem notNil [tree selectedItem notNil
ifTrue: [ ifTrue: [
self updateHeader. Transcript show: tree selectedItem content header, String cr.
self updateBody. self updateHeader]
]
]. ].
^ tree ^ tree
] ]
@ -395,25 +244,9 @@ GrafoscopioGUI >> tree: anObject [
tree := anObject tree := anObject
] ]
{ #category : #update }
GrafoscopioGUI >> updateBody [
"update the displayed content associated to the body of a node"
(tree selectedItem content tags = 'código')
ifTrue: [
^ nodeBody text: 'I should be playground because I am tagged as ', tree selectedItem content tags
]
ifFalse: [
"nodeBody := self newText."
^ nodeBody text: tree selectedItem content body
]
]
{ #category : #update } { #category : #update }
GrafoscopioGUI >> updateHeader [ GrafoscopioGUI >> updateHeader [
"update the displayed text associated to the header of a node" "update the displayed text associated to the header"
^ nodeHeader text: tree selectedItem content header. ^ nodeHeader text: tree selectedItem content header.

View File

@ -149,16 +149,15 @@ GrafoscopioNode >> becomeDefaultTestTree [
| node1 node2 node3 | | node1 node2 node3 |
self level: 0. self level: 0.
self header: 'Arbol principal'. self header: 'Arbol principal'.
node1 := GrafoscopioNode new node1 := GrafoscopioNode
header: 'Nodo 1'; header: 'Nodo 1'
body: 'Texto 1'. body: 'Texto 1'.
node2 := GrafoscopioNode new node2 := GrafoscopioNode
header: 'Nodo 2'; header: 'Nodo 2'
body: 'Texto 2'. body: 'Texto 2'.
node3 := GrafoscopioNode new node3 := GrafoscopioNode
header: 'Nodo 3'; header: 'Nodo 3'
body: 'ProfStef openPharoZenWorkspace'; body: 'Texto 3'.
tagAs: 'código'.
self self
addNode: node1; addNode: node1;
addNode: node2. addNode: node2.