-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from hpi-swa-teaching/master
Version 0.2
- Loading branch information
Showing
115 changed files
with
634 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/BaselineOfPresenter.package/BaselineOfPresenter.class/instance/postLoad.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
baseline | ||
postLoad | ||
|
||
PSPresentationTool initialize. |
2 changes: 1 addition & 1 deletion
2
packages/BaselineOfPresenter.package/BaselineOfPresenter.class/instance/preLoad.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
as yet unclassified | ||
baseline | ||
preLoad | ||
|
||
(TextStyle named: 'BitstreamVeraSans') fontArray do: [:font | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/Presenter-Core.package/PSContentContainer.class/instance/enablePresentationMode.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
presentation mode | ||
enablePresentationMode | ||
|
||
self removeResizeHandles | ||
self removeResizeHandles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/Presenter-Core.package/PSPresentationTool.class/class/initialize.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
instance creation | ||
initialize | ||
|
||
super initialize. | ||
self registerInWorldMenu |
4 changes: 4 additions & 0 deletions
4
packages/Presenter-Core.package/PSPresentationTool.class/class/registerInWorldMenu.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
instance creation | ||
registerInWorldMenu | ||
|
||
TheWorldMenu registerOpenCommand: {'PowerSqueak'. {self. #open}} |
5 changes: 5 additions & 0 deletions
5
packages/Presenter-Core.package/PSPresentationTool.class/instance/abandonMorph..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
presentation loading | ||
abandonMorph: aMorph | ||
|
||
aMorph ifNotNil: [aMorph abandon]. | ||
^ nil |
4 changes: 4 additions & 0 deletions
4
packages/Presenter-Core.package/PSPresentationTool.class/instance/askForPresentationName.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
presentation saving | ||
askForPresentationName | ||
|
||
^ UIManager default request: 'Please enter a presentation name: ' initialAnswer: 'Presentation' centerAt: World center |
8 changes: 8 additions & 0 deletions
8
packages/Presenter-Core.package/PSPresentationTool.class/instance/buildErrorReportString..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
notifications | ||
buildErrorReportString: aDictionary | ||
|
||
| errorString | | ||
errorString := 'I could not load all slides completely.'. | ||
aDictionary keysAndValuesDo: [:key :value | | ||
errorString := errorString, Character cr, key, ' is missing ', value, ' morph(s).']. | ||
^ errorString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/Presenter-Core.package/PSPresentationTool.class/instance/createDirectory.in..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
presentation saving | ||
createDirectory: aString in: aFileDirectory | ||
|
||
aFileDirectory createDirectory: aString. | ||
^ aFileDirectory / aString | ||
|
||
|
6 changes: 6 additions & 0 deletions
6
packages/Presenter-Core.package/PSPresentationTool.class/instance/defaultDirectory.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
accessing | ||
defaultDirectory | ||
|
||
^ (FileDirectory default / self defaultDirectoryName) | ||
assureExistence; | ||
yourself |
4 changes: 4 additions & 0 deletions
4
packages/Presenter-Core.package/PSPresentationTool.class/instance/defaultDirectoryName.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
defaultDirectoryName | ||
|
||
^ 'PSPresentations' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...ges/Presenter-Core.package/PSPresentationTool.class/instance/getValidPresentationName..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
presentation saving | ||
getValidPresentationName: aFileDirectory | ||
|
||
| presentationName directory | | ||
presentationName := self askForPresentationName. | ||
presentationName = '' | ||
ifTrue: [^ nil]. | ||
directory := (aFileDirectory / presentationName). | ||
^ directory exists | ||
ifTrue: [self validateUsageOf: presentationName inDirectory: aFileDirectory] | ||
ifFalse: [directory assureExistence] | ||
|
6 changes: 6 additions & 0 deletions
6
...Presenter-Core.package/PSPresentationTool.class/instance/isValidPresentationDirectory..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
presentation loading | ||
isValidPresentationDirectory: aDirectory | ||
|
||
| slidesDirectory | | ||
slidesDirectory := aDirectory / self slidesDirectoryName. | ||
^ slidesDirectory exists and: [slidesDirectory directoryNames isEmpty not] |
4 changes: 4 additions & 0 deletions
4
packages/Presenter-Core.package/PSPresentationTool.class/instance/loadMorphFromFile..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
presentation loading | ||
loadMorphFromFile: aFileDirectory | ||
"This was copied from Morph(class)>>#fromFileName:" | ||
^ self loadMorphFromStream: (MultiByteBinaryOrTextStream with: ((FileStream readOnlyFileNamed: aFileDirectory fullName) binary contentsOfEntireFile)) binary reset |
4 changes: 4 additions & 0 deletions
4
packages/Presenter-Core.package/PSPresentationTool.class/instance/loadMorphFromStream..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
presentation loading | ||
loadMorphFromStream: aStream | ||
|
||
^ self loadMorphFromStream: aStream testIn: World. |
11 changes: 11 additions & 0 deletions
11
...s/Presenter-Core.package/PSPresentationTool.class/instance/loadMorphFromStream.testIn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
presentation loading | ||
loadMorphFromStream: aStream testIn: aWorld | ||
|
||
| morph | | ||
[morph := aStream fileInObjectAndCode] | ||
on: Error | ||
do: [:error | | ||
morph := self abandonMorph: morph]. | ||
(morph isNil not and: [self morph: morph survivesOneCycleIn: aWorld]) | ||
ifFalse: [morph := self abandonMorph: morph]. | ||
^ morph |
15 changes: 15 additions & 0 deletions
15
packages/Presenter-Core.package/PSPresentationTool.class/instance/loadPresentation.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
presentation loading | ||
loadPresentation | ||
|
||
| presentations presentationName | | ||
self | ||
warn: self riskyOperationMessage | ||
trueChoice: [] | ||
falseChoice: [^ self]. | ||
presentations := self defaultDirectory directoryNames. | ||
presentationName := UIManager default | ||
chooseFrom: presentations | ||
values: presentations | ||
title: 'Which presentation do you want me to load?'. | ||
presentationName ifNotNil: [self loadPresentationFromDirectory: self defaultDirectory / presentationName] | ||
|
7 changes: 7 additions & 0 deletions
7
...resenter-Core.package/PSPresentationTool.class/instance/loadPresentationFromDirectory..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
presentation loading | ||
loadPresentationFromDirectory: aDirectory | ||
|
||
(self isValidPresentationDirectory: aDirectory) | ||
ifTrue: [self loadPresentationUnchecked: aDirectory] | ||
ifFalse: [UIManager default inform: 'I could not load the presentation. | ||
It''s directory might be corrupted.'] |
12 changes: 12 additions & 0 deletions
12
...es/Presenter-Core.package/PSPresentationTool.class/instance/loadPresentationUnchecked..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
presentation loading | ||
loadPresentationUnchecked: aDirectory | ||
|
||
| slidesDirectory errorReport | | ||
errorReport := Dictionary new. | ||
self slides removeAll. | ||
slidesDirectory := aDirectory / self slidesDirectoryName. | ||
slidesDirectory directoryNames do: [:each | | ||
errorReport at: each put: (self loadSlideFromDirectory: slidesDirectory / each)]. | ||
self | ||
selectSlide: 1; | ||
showErrorReport: errorReport |
14 changes: 14 additions & 0 deletions
14
packages/Presenter-Core.package/PSPresentationTool.class/instance/loadSlideFromDirectory..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
presentation loading | ||
loadSlideFromDirectory: aDirectory | ||
|
||
| slide corruptedMorphs | | ||
corruptedMorphs := 0. | ||
slide := PSSlide new. | ||
aDirectory fileNames do: [:each | | ||
| morph | | ||
morph := self loadMorphFromFile: aDirectory / each. | ||
morph | ||
ifNil: [corruptedMorphs := corruptedMorphs + 1] | ||
ifNotNil: [slide addMorph: morph]]. | ||
self slides addLast: slide. | ||
^ corruptedMorphs |
8 changes: 8 additions & 0 deletions
8
packages/Presenter-Core.package/PSPresentationTool.class/instance/loadingButtonData.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
toolbuilder | ||
loadingButtonData | ||
|
||
^ Dictionary withAll: { | ||
#frame -> (0.6@0.0 corner: 0.7@1.0). | ||
#name -> #loadingButton. | ||
#label -> 'Load'. | ||
#action -> #loadPresentation} |
14 changes: 14 additions & 0 deletions
14
...ges/Presenter-Core.package/PSPresentationTool.class/instance/morph.survivesOneCycleIn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
presentation loading | ||
morph: aMorph survivesOneCycleIn: aWorld | ||
"Some morphs may be loaded successfully but throw errors every world cycle therefore crashing the image." | ||
"World doOneCycle consumes all errors and opens the corresponding debuggers. Therefore we cannot do normal error checking but we can compare the debuggers." | ||
| debuggersBefore newDebuggers | | ||
debuggersBefore := Debugger allInstances. | ||
aMorph openInWorld: aWorld. | ||
World doOneCycle. | ||
newDebuggers := Debugger allInstances reject: [:each | | ||
debuggersBefore includes: each]. | ||
newDebuggers do: [:each | each abandon]. | ||
newDebuggers size > 0 | ||
ifTrue: [^ false]. | ||
^ true |
4 changes: 4 additions & 0 deletions
4
packages/Presenter-Core.package/PSPresentationTool.class/instance/overwriteQuestion.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
overwriteQuestion | ||
|
||
^ 'The name you chose is already used. Do you want to overwrite the Presentation?' |
4 changes: 4 additions & 0 deletions
4
packages/Presenter-Core.package/PSPresentationTool.class/instance/riskyOperationMessage.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
as yet unclassified | ||
riskyOperationMessage | ||
|
||
^ 'This operation is risky as it might crash your image.', Character cr, 'Do you want me to proceed?' |
8 changes: 8 additions & 0 deletions
8
packages/Presenter-Core.package/PSPresentationTool.class/instance/saveButtonData.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
toolbuilder | ||
saveButtonData | ||
|
||
^ Dictionary withAll: { | ||
#frame -> (0.5@0.0 corner: 0.6@1.0). | ||
#name -> #savingButton. | ||
#label -> 'Save'. | ||
#action -> #savingConfirmation} |
15 changes: 15 additions & 0 deletions
15
packages/Presenter-Core.package/PSPresentationTool.class/instance/savePresentation.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
presentation saving | ||
savePresentation | ||
|
||
| directory | | ||
directory := self defaultDirectory. | ||
|
||
directory := self getValidPresentationName: directory. | ||
directory ifNil: [^ self]. | ||
directory := self createDirectory: 'slides' in: directory. | ||
|
||
self slides doWithIndex: [:each :index | | ||
| directoryName | | ||
directoryName := 'slide', index asString. | ||
directory createDirectory: directoryName. | ||
each saveInDirectory: directory / directoryName ] |
4 changes: 4 additions & 0 deletions
4
packages/Presenter-Core.package/PSPresentationTool.class/instance/savingConfirmation.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
presentation saving | ||
savingConfirmation | ||
|
||
self warn: self riskyOperationMessage trueChoice: [self savePresentation] |
8 changes: 8 additions & 0 deletions
8
packages/Presenter-Core.package/PSPresentationTool.class/instance/showErrorReport..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
notifications | ||
showErrorReport: aDictionary | ||
|
||
| corruptedSlides | | ||
corruptedSlides := aDictionary select: [:each | each > 0]. | ||
corruptedSlides isEmpty | ||
ifTrue: [UIManager inform: 'I successfully loaded the presentation.'] | ||
ifFalse: [UIManager inform: (self buildErrorReportString: corruptedSlides)] |
4 changes: 4 additions & 0 deletions
4
packages/Presenter-Core.package/PSPresentationTool.class/instance/slidesDirectoryName.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
slidesDirectoryName | ||
|
||
^ 'slides' |
9 changes: 9 additions & 0 deletions
9
.../Presenter-Core.package/PSPresentationTool.class/instance/validateUsageOf.inDirectory..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
presentation saving | ||
validateUsageOf: aString inDirectory: aFileDirectory | ||
|
||
| directory | | ||
directory := aFileDirectory / aString. | ||
self warn: self overwriteQuestion | ||
trueChoice: [directory recursiveDelete. | ||
^ self createDirectory: aString in: aFileDirectory] | ||
falseChoice: [^ self getValidPresentationName: aFileDirectory] |
4 changes: 4 additions & 0 deletions
4
packages/Presenter-Core.package/PSPresentationTool.class/instance/warn.trueChoice..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
notifications | ||
warn: aString trueChoice: aBlock | ||
|
||
self warn: aString trueChoice: aBlock falseChoice: [] |
6 changes: 6 additions & 0 deletions
6
.../Presenter-Core.package/PSPresentationTool.class/instance/warn.trueChoice.falseChoice..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
notifications | ||
warn: aString trueChoice: trueBlock falseChoice: falseBlock | ||
|
||
(UIManager default confirm: aString) | ||
ifTrue: trueBlock | ||
ifFalse: falseBlock |
Oops, something went wrong.