diff --git a/src/Pyramid-Bloc/PyramidMainExtension.class.st b/src/Pyramid-Bloc/PyramidMainExtension.class.st index 22978ac..78f4d36 100644 --- a/src/Pyramid-Bloc/PyramidMainExtension.class.st +++ b/src/Pyramid-Bloc/PyramidMainExtension.class.st @@ -17,9 +17,62 @@ Class { 'gridColor', 'selectionWidgetExtension' ], + #classInstVars : [ + 'currentGridWindowSize', + 'currentGridVisibility', + 'currentGridSpacing', + 'currentGridColor' + ], #category : #'Pyramid-Bloc-plugin-space-extensions' } +{ #category : #accessing } +PyramidMainExtension class >> currentGridColor [ + + ^ currentGridColor ifNil: [ ^ Color black ] +] + +{ #category : #accessing } +PyramidMainExtension class >> currentGridColor: aColor [ + +currentGridColor := aColor +] + +{ #category : #accessing } +PyramidMainExtension class >> currentGridSpacing [ + + ^ currentGridSpacing ifNil: [ ^ 10 ] +] + +{ #category : #accessing } +PyramidMainExtension class >> currentGridSpacing: anInteger [ + + currentGridSpacing := anInteger +] + +{ #category : #accessing } +PyramidMainExtension class >> currentGridVisibility [ + ^ currentGridVisibility ifNil: [ ^ false ] + + +] + +{ #category : #accessing } +PyramidMainExtension class >> currentGridVisibility: aBoolean [ + currentGridVisibility := aBoolean +] + +{ #category : #accessing } +PyramidMainExtension class >> currentGridWindowSize [ + + ^ currentGridWindowSize ifNil: [ ^ 800 @ 600 ] +] + +{ #category : #accessing } +PyramidMainExtension class >> currentGridWindowSize: aPoint [ + currentGridWindowSize := aPoint +] + { #category : #accessing } PyramidMainExtension >> borderElement [ @@ -40,23 +93,23 @@ PyramidMainExtension >> containerElement [ { #category : #'as yet unclassified' } PyramidMainExtension >> createGrid [ - "Remove the current all the line of the grid" + self gridElement removeChildWithId: #gridHorizontal. self gridElement removeChildWithId: #gridVertical. self gridElement removeChildWithId: #pixelGrid. "Create the grid if gridVisibility is true" - gridVisibility ifTrue: [ self grid: self gridElement - cellSpacing: self gridSpacing - color: self gridColor - width: (self gridWindowSize x) - height: (self gridWindowSize y). - self selectionWidgetExtension movingLap: self gridSpacing - ] - ifFalse: [ self selectionWidgetExtension movingLap: 1 ]. - - + gridVisibility + ifTrue: [ + self + grid: self gridElement + cellSpacing: self gridSpacing + color: self gridColor + width: self gridWindowSize x + height: self gridWindowSize y. + self selectionWidgetExtension movingLap: self gridSpacing ] + ifFalse: [ self selectionWidgetExtension movingLap: 1 ] ] { #category : #accessing } @@ -80,22 +133,25 @@ PyramidMainExtension >> defaultGridColor [ { #category : #'as yet unclassified' } PyramidMainExtension >> defaultGridSpacing [ "Default spacing value of the grid" + ^ 10 ] { #category : #'as yet unclassified' } PyramidMainExtension >> defaultGridVisibility [ - "Default visibility value of the grid" - ^ false + "Default visibility value of the grid" + ^ false ] { #category : #accessing } PyramidMainExtension >> editor: aPyramidEditor [ aPyramidEditor window at: #topRight addItem: [ :buttonBuilder | - buttonBuilder makeButtonWithIcon: self workplacePropertiesButton order: 10 ]. - + buttonBuilder + makeButtonWithIcon: self workplacePropertiesButton + order: 10 ]. self getSelectionWidgetExtension: aPyramidEditor. + ] { #category : #geometry } @@ -104,6 +160,7 @@ PyramidMainExtension >> extent: aPoint [ self elementAtWidgets extent: aPoint. self sizeElement extent: aPoint. self gridWindowSize: aPoint. + self class currentGridWindowSize: aPoint. self createGrid ] @@ -185,15 +242,10 @@ PyramidMainExtension >> gridColor [ ^ gridColor ] -{ #category : #'as yet unclassified' } -PyramidMainExtension >> gridDefaultValueInitializer [ - - "Set the default parameter values of the grid" - gridWindowSize := self defaultExtent. - gridVisibility := self defaultGridVisibility. - gridSpacing := self defaultGridSpacing. - gridColor := self defaultGridColor. - self createGrid. +{ #category : #accessing } +PyramidMainExtension >> gridColor: aColor [ + +gridColor := aColor ] { #category : #accessing } @@ -206,9 +258,22 @@ PyramidMainExtension >> gridSpacing [ ^ gridSpacing ] +{ #category : #accessing } +PyramidMainExtension >> gridSpacing: anInteger [ + + gridSpacing := anInteger. +] + { #category : #accessing } PyramidMainExtension >> gridVisibility [ - ^ gridVisibility + + ^ gridVisibility +] + +{ #category : #accessing } +PyramidMainExtension >> gridVisibility: aBoolean [ + + gridVisibility := aBoolean ] { #category : #accessing } @@ -231,7 +296,11 @@ PyramidMainExtension >> informTransformationChanged [ { #category : #initialization } PyramidMainExtension >> initialize [ "Set the default parameter value of the grid" - + self class currentGridWindowSize: self defaultExtent. + self class currentGridVisibility: self defaultGridVisibility. + self class currentGridSpacing: self defaultGridSpacing. + self class currentGridColor: self defaultGridColor. + gridWindowSize := self defaultExtent. gridVisibility := self defaultGridVisibility. gridSpacing := self defaultGridSpacing. @@ -239,28 +308,42 @@ PyramidMainExtension >> initialize [ "Set up the graphical parameter windows of the grid and the space extension" workplacePropertiesView := PyramidWorkplacePropertiesPresenter new - workplaceSizeValue: self defaultExtent; + workplaceSizeValue: self defaultExtent; whenWorkplaceValuesChangedDo: [ :point | self extent: point ]; whenVisibilityChangedDo: [ - self switchGridvisibility. - self createGrid ]; + gridVisibility := workplacePropertiesView + visibilityButton + state. + + self class currentGridVisibility: + gridVisibility. + self createGrid ]; spacingTextValue: self defaultGridSpacing; whenSpacingTextChangedDo: [ :value | - (self checkZeroOrSubZeroGridSpacingValue: value) - ifTrue: [ - self defaultGridSpacing <= 0 ifTrue: [ - gridSpacing := 1. - ^ self ]. - gridSpacing := self defaultGridSpacing ] - ifFalse: [ gridSpacing := value ]. - self createGrid ]; + (self + checkZeroOrSubZeroGridSpacingValue: + value) + ifTrue: [ + self defaultGridSpacing <= 0 + ifTrue: [ + gridSpacing := 1. + ^ self ]. + gridSpacing := self + defaultGridSpacing ] + ifFalse: [ gridSpacing := value ]. + self class currentGridSpacing: + gridSpacing. + self createGrid ]; gridColorValue: self defaultGridColor; whenColorValuesChangedDo: [ :color | - gridColor := color. - self createGrid ]; + gridColor := color. + self class currentGridColor: color. + self createGrid ]; yourself. - + workplacePropertiesView visibilityButton state: gridVisibility. + + self defaultGridSpacing <= 0 ifTrue: [ gridSpacing := 1 ]. workplacePropertiesView spacingText value: gridSpacing. @@ -271,8 +354,8 @@ PyramidMainExtension >> initialize [ help: 'Edit the properties of the workplace'; action: [ - self workplacePropertiesPopover popup. - self refreshPopupWorkplaceProperties ]; + self workplacePropertiesPopover popup. + self refreshPopupWorkplaceProperties ]; yourself. "Creation of the pop-up" @@ -286,8 +369,8 @@ PyramidMainExtension >> initialize [ containerElement := BlElement new id: #MainExtension_containerElement; constraintsDo: [ :c | - c vertical matchParent. - c horizontal matchParent ]; + c vertical matchParent. + c horizontal matchParent ]; clipChildren: false; zIndex: 0; yourself. @@ -298,8 +381,8 @@ PyramidMainExtension >> initialize [ border: self defaultBorder; outskirts: BlOutskirts outside; constraintsDo: [ :c | - c vertical matchParent. - c horizontal matchParent ]; + c vertical matchParent. + c horizontal matchParent ]; clipChildren: false; zIndex: 1; preventMeAndChildrenMouseEvents; @@ -309,10 +392,10 @@ PyramidMainExtension >> initialize [ gridElement := BlElement new id: #MainExtension_gridElement; constraintsDo: [ :c | - c vertical matchParent. - c horizontal matchParent ]; + c vertical matchParent. + c horizontal matchParent ]; zIndex: 2. - + borderElement addChild: gridElement. sizeElement := BlElement new @@ -320,7 +403,7 @@ PyramidMainExtension >> initialize [ extent: self defaultExtent; clipChildren: false; addChildren: { - containerElement . + containerElement. borderElement } yourself ] @@ -383,14 +466,6 @@ PyramidMainExtension >> sizeElement [ ^ sizeElement ] -{ #category : #'as yet unclassified' } -PyramidMainExtension >> switchGridvisibility [ - "Switch the visibility from true to false or false to true" - gridVisibility := self gridVisibility not. - - ^ self gridVisibility -] - { #category : #accessing } PyramidMainExtension >> workplacePropertiesButton [ diff --git a/src/Pyramid-Bloc/PyramidPluginOpenInWindow.class.st b/src/Pyramid-Bloc/PyramidPluginOpenInWindow.class.st new file mode 100644 index 0000000..6404e25 --- /dev/null +++ b/src/Pyramid-Bloc/PyramidPluginOpenInWindow.class.st @@ -0,0 +1,143 @@ +Class { + #name : #PyramidPluginOpenInWindow, + #superclass : #Object, + #traits : 'TPyramidPlugin + TPyramidEditorExtension', + #classTraits : 'TPyramidPlugin classTrait + TPyramidEditorExtension classTrait', + #instVars : [ + 'button', + 'spacePlugin', + 'builder', + 'projectModel', + 'savePlugin', + 'space' + ], + #classInstVars : [ + 'currentTheme' + ], + #category : #'Pyramid-Bloc-plugin-openinwindow' +} + +{ #category : #adding } +PyramidPluginOpenInWindow >> addPanelsOn: aPyramidSimpleWindow [ + + aPyramidSimpleWindow + at: #topRight + addItem: [ :b | b makeButtonWithIcon: self button order: 1 ]. +] + +{ #category : #private } +PyramidPluginOpenInWindow >> buildSpaceInWindow [ + + | elements container stash currentTheme windowSize newSpace | + + elements := projectModel firstLevelElements asOrderedCollection. + currentTheme := nil. + builder ifNotNil: [ :aBuilder | + aBuilder space ifNotNil: [ :aSpace | + aSpace root ifNotNil: [ :aRoot | currentTheme := aRoot localTheme ] ] ]. + + windowSize := [ + | mainExtension | + mainExtension := builder extensions + detect: [ :e | + e isKindOf: PyramidMainExtension ] + ifNone: [ nil ]. + mainExtension + ifNotNil: [ mainExtension sizeElement extent ] + ifNil: [ 800 @ 600 ] ] + on: Error + do: [ 800 @ 600 ]. + + container := BlElement new + constraintsDo: [ :c | + c horizontal matchParent. + c vertical matchParent ]; + yourself. + elements do: [ :each | + stash := BlSerializer serialize: each with: BlStashSerializer. + container addChild: stash materializeAsBlElement ]. + + newSpace := BlSpace new. + newSpace root addChild: container. + newSpace extent: windowSize. + currentTheme ifNotNil: [ newSpace toTheme: currentTheme ]. + + ^ newSpace +] + +{ #category : #accessing } +PyramidPluginOpenInWindow >> builder [ + ^ builder +] + +{ #category : #accessing } +PyramidPluginOpenInWindow >> builder: anObject [ + +builder := anObject +] + +{ #category : #accessing } +PyramidPluginOpenInWindow >> button [ + + ^ button +] + +{ #category : #connecting } +PyramidPluginOpenInWindow >> connectOn: aPyramidEditor [ + spacePlugin := aPyramidEditor plugins + detect: [ :p | p isKindOf: PyramidSpacePlugin ] + ifNone: [ ]. + spacePlugin ifNotNil: [ builder := spacePlugin builder ]. + projectModel := aPyramidEditor projectModel. + savePlugin := aPyramidEditor plugins + detect: [ :p | p isKindOf: PyramidSavePlugin ] + ifNone: [ ] +] + +{ #category : #initialization } +PyramidPluginOpenInWindow >> initialize [ + button := SpButtonPresenter new + icon: self openInWindowIcon; + help: 'Open interface in a separate window.'; + action: [ self openSpaceInWindow ]; + yourself +] + +{ #category : #private } +PyramidPluginOpenInWindow >> openInWindowIcon [ + + | svgString coloredSvg blElement | + svgString := ToMaterialDesignIconProvider sharp_openinnew. + coloredSvg := svgString + copyReplaceAll: '> openSpaceInWindow [ + + space := self buildSpaceInWindow. + space show. + + ^ space +] + +{ #category : #accessing } +PyramidPluginOpenInWindow >> projectModel [ + ^ projectModel +] + +{ #category : #accessing } +PyramidPluginOpenInWindow >> projectModel: anObject [ + +projectModel := anObject +] + +{ #category : #accessing } +PyramidPluginOpenInWindow >> space [ + +^ space +] diff --git a/src/Pyramid-Bloc/PyramidSavePlugin.class.st b/src/Pyramid-Bloc/PyramidSavePlugin.class.st index f80c61a..6b29766 100644 --- a/src/Pyramid-Bloc/PyramidSavePlugin.class.st +++ b/src/Pyramid-Bloc/PyramidSavePlugin.class.st @@ -18,16 +18,59 @@ Class { { #category : #'instance creation' } PyramidSavePlugin class >> openOn: aCollectionOfBlElement saveModel: aSaveModel [ - | editor savePlugin | + | editor savePlugin metaData mainExtension spacePlugin | + PyramidSavingService currentProjectMetaData: nil. + PyramidMainExtension currentGridWindowSize: nil. editor := PyramidEditor buildEditor. savePlugin := editor plugins select: [ :each | each class = self ]. savePlugin size = 1 ifFalse: [ - Error signal: - 'Wrong installation of SavePlugin. Should only be one instance.' ]. + Error signal: + 'Wrong installation of SavePlugin. Should only be one instance.' ]. savePlugin := savePlugin asArray first. editor projectModel firstLevelElements addAll: aCollectionOfBlElement. + + [ + | metaDataSelector savingClass | + metaDataSelector := (aSaveModel savingMethodName , 'MetaData') + asSymbol. + savingClass := self class environment classNamed: + aSaveModel savingClassName. + aSaveModel isClassSide + ifTrue: [ savingClass perform: metaDataSelector ] + ifFalse: [ savingClass new perform: metaDataSelector ] ] + on: Error + do: [ nil ]. + + metaData := PyramidSavingService currentProjectMetaData. savePlugin openOn: aSaveModel. - editor open + editor open. + + metaData ifNotNil: [ + spacePlugin := editor plugins + detect: [ :p | p isKindOf: PyramidSpacePlugin ] + ifNone: [ nil ]. + spacePlugin ifNotNil: [ + mainExtension := spacePlugin builder extensions + detect: [ :e | + e isKindOf: PyramidMainExtension ] + ifNone: [ nil ]. + mainExtension ifNotNil: [ + (metaData at: #windowSize ifAbsent: [ nil ]) ifNotNil: [ :size | + mainExtension extent: size. + mainExtension workplacePropertiesView workplaceSizeValue: + size ]. + (metaData at: #gridVisibility ifAbsent: [ nil ]) ifNotNil: [ + :visibility | mainExtension gridVisibility: visibility. + mainExtension workplacePropertiesView visibilityButton state: visibility ]. + (metaData at: #gridSpacing ifAbsent: [ nil ]) ifNotNil: [ + :spacing | + mainExtension gridSpacing: spacing. + mainExtension workplacePropertiesView spacingText value: + spacing ]. + (metaData at: #gridColor ifAbsent: [ nil ]) ifNotNil: [ :color | + mainExtension gridColor: color. + mainExtension workplacePropertiesView gridColorValue: color ]. + mainExtension createGrid ] ] ] ] { #category : #adding } @@ -135,31 +178,23 @@ PyramidSavePlugin >> projectModel: aPyramidProjectModel [ { #category : #actions } PyramidSavePlugin >> saveAction [ - "Action executed by a save button from UI, this method catch exceptions when needed to doesn't expose directly a debugger but an info window" - - [ - self savingService save. - self inputsController isSaved. - ] - on: Error - do: [ :e | - - "Pyramid level error" - (e isKindOf: PyramidSaveError) ifTrue:[ - ^ UIManager default - alert: 'Cannot save the project, open project configuration to setup a valid saving location.' - title: 'Project configuration problem' - ]. - - "Serializer level error" - (e isKindOf: BlocSerializationError) ifTrue:[ - (UIManager default - confirm: 'Error when saving the project: ', e messageText asString, ' - Debug this error ?' - label: 'Error') - ifTrue:[e debug] ifFalse:[^ self]. - ]. - ] + [ + self savingService save. + self inputsController isSaved. + PyramidSavingService currentSaveModel: self saveModel ] + on: Error + do: [ :e | + (e isKindOf: PyramidSaveError) ifTrue: [ + ^ UIManager default + alert: 'Cannot save the project, open project configuration to setup a valid saving location.' + title: 'Project configuration problem' ]. + (e isKindOf: BlocSerializationError) ifTrue: [ + (UIManager default + confirm: 'Error when saving the project: ' , e messageText asString , ' + Debug this error ?' + label: 'Error') + ifTrue: [ e debug ] + ifFalse: [ ^ self ] ] ] ] { #category : #accessing } diff --git a/src/Pyramid-Bloc/PyramidSavingService.class.st b/src/Pyramid-Bloc/PyramidSavingService.class.st index e158c9b..7e49cf9 100644 --- a/src/Pyramid-Bloc/PyramidSavingService.class.st +++ b/src/Pyramid-Bloc/PyramidSavingService.class.st @@ -9,7 +9,9 @@ Class { 'currentMethodBuilder', 'stash', 'ston', - 'currentMethodBuilderSelector' + 'currentMethodBuilderSelector', + 'currentSaveModel', + 'currentProjectMetaData' ], #category : #'Pyramid-Bloc-plugin-save' } @@ -41,6 +43,28 @@ PyramidSavingService class >> currentMethodBuilderSelector: anObject [ currentMethodBuilderSelector := anObject ] +{ #category : #accessing } +PyramidSavingService class >> currentProjectMetaData [ + +^ currentProjectMetaData +] + +{ #category : #accessing } +PyramidSavingService class >> currentProjectMetaData: aDictionary [ + +currentProjectMetaData := aDictionary +] + +{ #category : #accessing } +PyramidSavingService class >> currentSaveModel [ + ^ currentSaveModel +] + +{ #category : #accessing } +PyramidSavingService class >> currentSaveModel: aSaveModel [ + currentSaveModel := aSaveModel +] + { #category : #'as yet unclassified' } PyramidSavingService class >> saveMethodBuilderSettingOn: aBuilder [ @@ -91,6 +115,48 @@ PyramidSavingService class >> ston [ yourself ] +{ #category : #private } +PyramidSavingService >> buildMetaDataMethod [ + + | methodName windowSize gridVisibility gridSpacing gridColor dictContent nl tab header | + methodName := self saveModel savingMethodName , 'MetaData'. + windowSize := PyramidMainExtension currentGridWindowSize ifNil: [ + 800 @ 600 ]. + gridVisibility := PyramidMainExtension currentGridVisibility ifNil: [ + false ]. + gridSpacing := PyramidMainExtension currentGridSpacing ifNil: [ 10 ]. + gridColor := PyramidMainExtension currentGridColor ifNil: [ + Color black ]. + (windowSize = (800 @ 600) and: [ + gridVisibility not and: [ + gridSpacing = 10 and: [ gridColor = Color black ] ] ]) ifTrue: [ + ^ nil ]. + + nl := String with: Character cr. + tab := String with: Character tab. + + dictContent := ''. + windowSize = (800 @ 600) ifFalse: [ + dictContent := dictContent , nl , tab , tab , 'at: #windowSize put: ' + , windowSize x printString , ' @ ' + , windowSize y printString , ';' ]. + gridVisibility ifTrue: [ + dictContent := dictContent + , nl , tab , tab , 'at: #gridVisibility put: true;' ]. + gridSpacing = 10 ifFalse: [ + dictContent := dictContent , nl , tab , tab , 'at: #gridSpacing put: ' + , gridSpacing printString , ';' ]. + gridColor = Color black ifFalse: [ + dictContent := dictContent , nl , tab , tab , 'at: #gridColor put: ' + , gridColor printString , ';' ]. + + header := methodName , nl , tab , '"Pyramid project metadata"' , nl , tab. + + ^ header , '' , nl , tab + , 'PyramidSavingService currentProjectMetaData: (Dictionary new' + , dictContent , nl , tab , tab , 'yourself)' +] + { #category : #testing } PyramidSavingService >> canSave [ "Verify: @@ -114,22 +180,40 @@ PyramidSavingService >> methodBuilder [ ^ self class currentMethodBuilder ] -{ #category : #testing } +{ #category : #'as yet unclassified' } PyramidSavingService >> save [ + | class | + self canSave ifFalse: [ self errorCannotSave ]. + class := self saveModel isClassSide + ifTrue: [ self savingClass classSide ] + ifFalse: [ self savingClass ]. + self methodBuilder classifier + ifNil: [ class compile: self savingMethod ] + ifNotNil: [ + class + compile: self savingMethod + classified: self methodBuilder classifier ]. + self saveMetaData +] - | class | - self canSave ifFalse: [ self errorCannotSave ]. +{ #category : #private } +PyramidSavingService >> saveMetaData [ + | class metaDataMethod methodName | + self canSave ifFalse: [ self errorCannotSave ]. class := self saveModel isClassSide ifTrue: [ self savingClass classSide ] ifFalse: [ self savingClass ]. + metaDataMethod := self buildMetaDataMethod. + + metaDataMethod ifNil: [ + methodName := (self saveModel savingMethodName , 'MetaData') + asSymbol. + (class includesSelector: methodName) ifTrue: [ + class removeSelector: methodName ]. + ^ self ]. - self methodBuilder classifier - ifNil: [ class compile: self savingMethod ] - ifNotNil: [ - class - compile: self savingMethod - classified: self methodBuilder classifier ] + class compile: metaDataMethod classified: #'pyramid-metadata' ] { #category : #accessing } diff --git a/src/Pyramid-Bloc/PyramidVisualPystonForCly.class.st b/src/Pyramid-Bloc/PyramidVisualPystonForCly.class.st index bd92ec7..254c297 100644 --- a/src/Pyramid-Bloc/PyramidVisualPystonForCly.class.st +++ b/src/Pyramid-Bloc/PyramidVisualPystonForCly.class.st @@ -3,7 +3,11 @@ Class { #superclass : #ClyBrowserToolMorph, #instVars : [ 'method', - 'imageMorph' + 'imageMorph', + 'builder', + 'spacePlugin', + 'projectModel', + 'savePlugin' ], #category : #'Pyramid-Bloc-plugin-save' } @@ -141,6 +145,19 @@ PyramidVisualPystonForCly >> buttonOpen [ action: [ self openInNewSpace ] ] +{ #category : #connecting } +PyramidVisualPystonForCly >> connectOn: aPyramidEditor [ + + spacePlugin := aPyramidEditor plugins + detect: [ :p | p isKindOf: PyramidSpacePlugin ] + ifNone: [ ]. + spacePlugin ifNotNil: [ builder := spacePlugin builder ]. + projectModel := aPyramidEditor projectModel. + savePlugin := aPyramidEditor plugins + detect: [ :p | p isKindOf: PyramidSavePlugin ] + ifNone: [ ] +] + { #category : #'as yet unclassified' } PyramidVisualPystonForCly >> copyElement [ @@ -207,21 +224,44 @@ PyramidVisualPystonForCly >> openEditor [ { #category : #accessing } PyramidVisualPystonForCly >> openInNewSpace [ - | class elements space | + | class elements theme space windowSize | class := method classBinding value. elements := class isMeta ifTrue: [ - (method classBinding value instanceSide perform: - method selector) materializeAsBlElement ] + (method classBinding value instanceSide perform: + method selector) materializeAsBlElement ] ifFalse: [ - (method classBinding value new perform: method selector) - materializeAsBlElement ]. - + (method classBinding value new perform: + method selector) materializeAsBlElement ]. elements isCollection ifFalse: [ elements := { elements } ]. - elements ifEmpty: [ ^ self ]. - space := elements first openInNewSpace. - space root addChildren: elements allButFirst + + windowSize := [ + | metaDataSelector | + metaDataSelector := (method selector , 'MetaData') + asSymbol. + class isMeta + ifTrue: [ + method classBinding value instanceSide perform: + metaDataSelector ] + ifFalse: [ + method classBinding value new perform: + metaDataSelector ]. + + PyramidSavingService currentProjectMetaData + at: #windowSize + ifAbsent: [ nil ] ] + on: Error + do: [ nil ]. + windowSize ifNil: [ windowSize := 800 @ 600 ]. + + space := BlSpace new. + space extent: windowSize. + theme := PyramidToploThemePlugin defaultTheme. + space toTheme: theme new. + space root addChildren: elements. + space show. + ^ space ] { #category : #initialization } diff --git a/src/Pyramid-Bloc/TPyramidEditorExtension.trait.st b/src/Pyramid-Bloc/TPyramidEditorExtension.trait.st index 231adbf..6dcdca4 100644 --- a/src/Pyramid-Bloc/TPyramidEditorExtension.trait.st +++ b/src/Pyramid-Bloc/TPyramidEditorExtension.trait.st @@ -11,37 +11,37 @@ TPyramidEditorExtension >> currentTransformTranslation [ ^ matrix x @ matrix y ] -{ #category : #'as yet unclassified' } +{ #category : #displaying } TPyramidEditorExtension >> elementAtDisplays [ ^ (self builder elementAt: #displays) ] -{ #category : #'as yet unclassified' } +{ #category : #displaying } TPyramidEditorExtension >> elementAtDisplaysAddons [ ^ self elementAtDisplays childWithId: #displaysAddons ] -{ #category : #'as yet unclassified' } +{ #category : #displaying } TPyramidEditorExtension >> elementAtEvents [ ^ self builder elementAt: #events ] -{ #category : #'as yet unclassified' } +{ #category : #displaying } TPyramidEditorExtension >> elementAtMain [ ^ self builder elementAt: #main ] -{ #category : #'as yet unclassified' } +{ #category : #displaying } TPyramidEditorExtension >> elementAtTransforms [ ^ (self builder elementAt: #transforms) ] -{ #category : #'as yet unclassified' } +{ #category : #displaying } TPyramidEditorExtension >> elementAtWidgets [ ^ self builder elementAt: #widgets diff --git a/src/Pyramid-IDE/PyramidWorld.class.st b/src/Pyramid-IDE/PyramidWorld.class.st index 6866c0c..2125d06 100644 --- a/src/Pyramid-IDE/PyramidWorld.class.st +++ b/src/Pyramid-IDE/PyramidWorld.class.st @@ -1101,8 +1101,8 @@ PyramidWorld class >> startBrowseSources [ { #category : #actions } PyramidWorld class >> startNewDesign [ -