diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7e368702..85a1d649 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -15,11 +15,16 @@ jobs: strategy: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - smalltalk: [ Pharo64-11, Pharo64-12, Pharo64-13 ] + smalltalk: [ Pharo64-12, Pharo64-13, Pharo64-14 ] ston: [ .smalltalkci.default.ston ] + #Specific case for Pharo14 (experimental): ignore failures + include: + - smalltalk: Pharo64-14 + experimental: true runs-on: ${{ matrix.os }} name: > ${{ matrix.smalltalk }} • ${{ matrix.os }} + continue-on-error: ${{ matrix.experimental == true }} steps: - uses: actions/checkout@v3 @@ -30,4 +35,4 @@ jobs: - name: Run ${{ matrix.ston == '.smalltalkci.default.ston' && 'Full' || 'Core' }} tests run: smalltalkci -s ${{ matrix.smalltalk }} ${{ matrix.ston }} shell: bash - timeout-minutes: 30 \ No newline at end of file + timeout-minutes: 30 diff --git a/README.md b/README.md index 94ef5ca9..94e82e8a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -[![Pharo 11](https://img.shields.io/badge/Pharo-11-%23aac9ff.svg)](https://pharo.org/download) [![Pharo 12](https://img.shields.io/badge/Pharo-12-%23aac9ff.svg)](https://pharo.org/download) [![Pharo 13](https://img.shields.io/badge/Pharo-13-%23aac9ff.svg)](https://pharo.org/download) +[![Pharo 14](https://img.shields.io/badge/Pharo-14-%23aac9ff.svg)](https://pharo.org/download) [![License](https://img.shields.io/github/license/OpenSmock/Pyramid.svg)](./LICENSE) [![Unit tests](https://github.com/OpenSmock/Pyramid/actions/workflows/CI.yml/badge.svg)](https://github.com/OpenSmock/Pyramid/actions/workflows/CI.yml) diff --git a/src/Pyramid-Bloc/PyramidAbstractBorderCommand.class.st b/src/Pyramid-Bloc/PyramidAbstractBorderCommand.class.st index d95e6834..d355e19a 100644 --- a/src/Pyramid-Bloc/PyramidAbstractBorderCommand.class.st +++ b/src/Pyramid-Bloc/PyramidAbstractBorderCommand.class.st @@ -20,7 +20,7 @@ PyramidAbstractBorderCommand >> borderBuilderOf: aBlElement [ ^ builder ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidAbstractBorderCommand >> setValueFor: aBlElement with: anArgument [ | builder | diff --git a/src/Pyramid-Bloc/PyramidAbstractChangeDrawOrderCommand.class.st b/src/Pyramid-Bloc/PyramidAbstractChangeDrawOrderCommand.class.st index 38ee07cb..a6616327 100644 --- a/src/Pyramid-Bloc/PyramidAbstractChangeDrawOrderCommand.class.st +++ b/src/Pyramid-Bloc/PyramidAbstractChangeDrawOrderCommand.class.st @@ -16,7 +16,7 @@ PyramidAbstractChangeDrawOrderCommand >> canBeUsedFor: anObject [ ^ (super canBeUsedFor: anObject) and: [ anObject hasParent] ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidAbstractChangeDrawOrderCommand >> getValueFor: aBlElement [ "return current index for testing." diff --git a/src/Pyramid-Bloc/PyramidAddChildCommand.class.st b/src/Pyramid-Bloc/PyramidAddChildCommand.class.st index 5b13af98..a9031835 100644 --- a/src/Pyramid-Bloc/PyramidAddChildCommand.class.st +++ b/src/Pyramid-Bloc/PyramidAddChildCommand.class.st @@ -4,14 +4,27 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc' } -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidAddChildCommand >> commandInverse [ ^ PyramidRemoveChildCommand new ] -{ #category : #'as yet unclassified' } +{ #category : #private } +PyramidAddChildCommand >> savedIndexFor: aChild in: aParent [ + + | index | + index := aChild userData at: #pyramidRemovedAtIndex ifAbsent: [ 0 ]. + (index = 0 or: [ index > aParent children size ]) + ifTrue: [ ^ aParent children size + 1 ] + ifFalse: [ ^ index ] +] + +{ #category : #setter } PyramidAddChildCommand >> setValueFor: aBlElement with: aChildToAdd [ - aBlElement addChild: aChildToAdd + aBlElement + addChild: aChildToAdd + at: (self savedIndexFor: aChildToAdd in: aBlElement). + aChildToAdd userData removeKey: #pyramidRemovedAtIndex ifAbsent: [ ] ] diff --git a/src/Pyramid-Bloc/PyramidAddChildrenCommand.class.st b/src/Pyramid-Bloc/PyramidAddChildrenCommand.class.st index 1c146561..d03a1e21 100644 --- a/src/Pyramid-Bloc/PyramidAddChildrenCommand.class.st +++ b/src/Pyramid-Bloc/PyramidAddChildrenCommand.class.st @@ -4,14 +4,14 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc' } -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidAddChildrenCommand >> commandInverse [ ^ PyramidRemoveChildrenCommand new ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidAddChildrenCommand >> setValueFor: aBlElement with: aChildrenToAdd [ - aBlElement addChildren: aChildrenToAdd + aBlElement addChildren: aChildrenToAdd ] diff --git a/src/Pyramid-Bloc/PyramidBackgroundBlocPlugin.class.st b/src/Pyramid-Bloc/PyramidBackgroundBlocPlugin.class.st index e2702d10..1f36a867 100644 --- a/src/Pyramid-Bloc/PyramidBackgroundBlocPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidBackgroundBlocPlugin.class.st @@ -671,6 +671,86 @@ PyramidBackgroundBlocPlugin class >> outskirts [ ^ property ] +{ #category : #accessing } +PyramidBackgroundBlocPlugin class >> shadow [ + + | property | + property := PyramidProperty new + name: 'Shadow Effect'; + command: PyramidShadowCommand current; + inputPresenterClass: PyramidMagicButtonsInputPresenter; + yourself. + property inputPresenterModel + addButtonModel: (PyramidMagicButtonModel new + icon: (Smalltalk ui icons iconNamed: #blank); + helpSelected: 'No shadow.'; + helpNotSelected: 'Remove shadow.'; + label: 'None'; + inputValue: [ BlNullEffect new ]; + inputValidation: [ :value | value class = BlNullEffect ]; + yourself); + addButtonModel: (PyramidMagicButtonModel new + icon: (Smalltalk ui icons iconNamed: #windowMaximize); + helpSelected: 'Shadow type is simple.'; + helpNotSelected: 'Set shadow type to simple.'; + label: 'Simple'; + inputValue: [ PyramidShadowCommand current lastSimpleShadow ]; + inputValidation: [ :value | value class = BlSimpleShadowEffect ]; + yourself); + addButtonModel: (PyramidMagicButtonModel new + icon: (Smalltalk ui icons iconNamed: #radioButtonUnselected); + helpSelected: 'Shadow type is gaussian.'; + helpNotSelected: 'Set shadow type to gaussian.'; + label: 'Gaussian'; + inputValue: [ PyramidShadowCommand current lastGaussianShadow ]; + inputValidation: [ :value | value class = BlGaussianShadowEffect ]; + yourself). + ^ property +] + +{ #category : #accessing } +PyramidBackgroundBlocPlugin class >> shadowColor [ + + | property | + property := PyramidProperty new + name: 'Shadow Color'; + command: PyramidShadowColorCommand new; + inputPresenterClass: + PyramidColorInputSingleLineWithPickupButtonPresenter; + yourself. + ^ property + + +] + +{ #category : #accessing } +PyramidBackgroundBlocPlugin class >> shadowOffset [ + + | property | + property := PyramidProperty new + name: 'Shadow Offset'; + command: PyramidShadowOffsetCommand new; + inputPresenterClass: + PyramidPointInputPresenter; + yourself. + property inputPresenterModel help: + 'Set the position x and y for the shadow offset'. + ^ property +] + +{ #category : #accessing } +PyramidBackgroundBlocPlugin class >> shadowWidthGaussian [ + + | property | + property := PyramidProperty new + name: 'Shadow Width'; + command: PyramidShadowGaussianWidthCommand new; + inputPresenterClass: PyramidNumberInputPresenter; + yourself. + property inputPresenterModel help: 'Set the width value'. + ^ property +] + { #category : #adding } PyramidBackgroundBlocPlugin >> addPanelsOn: aPyramidSimpleWindow [ @@ -747,7 +827,14 @@ PyramidBackgroundBlocPlugin >> initialize [ propertiesManager addProperty: self class borderRadialInnerCenter. propertiesManager addProperty: self class borderRadialInnerRadius. propertiesManager addProperty: self class borderRadialOuterCenter. - propertiesManager addProperty: self class borderRadialOuterRadius + propertiesManager addProperty: self class borderRadialOuterRadius. + + "Shadow" + PyramidShadowCommand resetShadowCommand. + propertiesManager addProperty: self class shadow. + propertiesManager addProperty: self class shadowColor. + propertiesManager addProperty: self class shadowOffset. + propertiesManager addProperty: self class shadowWidthGaussian ] { #category : #adding } diff --git a/src/Pyramid-Bloc/PyramidBackgroundImageCommand.class.st b/src/Pyramid-Bloc/PyramidBackgroundImageCommand.class.st index e8d958a4..42bda929 100644 --- a/src/Pyramid-Bloc/PyramidBackgroundImageCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBackgroundImageCommand.class.st @@ -11,13 +11,13 @@ PyramidBackgroundImageCommand >> canBeUsedFor: anObject [ anObject background isKindOf: BlImageBackground ] ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBackgroundImageCommand >> getValueFor: aBlElement [ ^ aBlElement background image ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidBackgroundImageCommand >> setValueFor: aBlElement with: anArgument [ aBlElement background: (BlBackground image: anArgument) diff --git a/src/Pyramid-Bloc/PyramidBackgroundOpacityCommand.class.st b/src/Pyramid-Bloc/PyramidBackgroundOpacityCommand.class.st index f5093b8e..5521f475 100644 --- a/src/Pyramid-Bloc/PyramidBackgroundOpacityCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBackgroundOpacityCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBackgroundOpacityCommand >> getValueFor: aBlElement [ ^ aBlElement background opacity ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidBackgroundOpacityCommand >> setValueFor: aBlElement with: anArgument [ | background | diff --git a/src/Pyramid-Bloc/PyramidBackgroundPaintColorCommand.class.st b/src/Pyramid-Bloc/PyramidBackgroundPaintColorCommand.class.st index d2249ff9..0a63dd0d 100644 --- a/src/Pyramid-Bloc/PyramidBackgroundPaintColorCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBackgroundPaintColorCommand.class.st @@ -12,13 +12,13 @@ PyramidBackgroundPaintColorCommand >> canBeUsedFor: anObject [ anObject background paint isKindOf: BlColorPaint ] ] ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBackgroundPaintColorCommand >> getValueFor: aBlElement [ ^ aBlElement background paint color ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidBackgroundPaintColorCommand >> setValueFor: aBlElement with: anArgument [ aBlElement background: (BlBackground paint: anArgument asBlPaint) diff --git a/src/Pyramid-Bloc/PyramidBackgroundPaintCommand.class.st b/src/Pyramid-Bloc/PyramidBackgroundPaintCommand.class.st index 95c0fd85..45a5f776 100644 --- a/src/Pyramid-Bloc/PyramidBackgroundPaintCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBackgroundPaintCommand.class.st @@ -11,19 +11,19 @@ PyramidBackgroundPaintCommand >> canBeUsedFor: anObject [ anObject background isKindOf: BlPaintBackground ] ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBackgroundPaintCommand >> getGroupedValueFor: aBlElement [ ^ aBlElement background paint class ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBackgroundPaintCommand >> getValueFor: aBlElement [ ^ aBlElement background paint ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidBackgroundPaintCommand >> setValueFor: aBlElement with: anArgument [ aBlElement background: (BlBackground paint: anArgument value) diff --git a/src/Pyramid-Bloc/PyramidBackgroundPaintLinearEndCommand.class.st b/src/Pyramid-Bloc/PyramidBackgroundPaintLinearEndCommand.class.st index 4201cb78..54897472 100644 --- a/src/Pyramid-Bloc/PyramidBackgroundPaintLinearEndCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBackgroundPaintLinearEndCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBackgroundPaintLinearEndCommand >> getValueFor: aBlElement [ ^ aBlElement background paint end ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidBackgroundPaintLinearEndCommand >> setValueFor: aBlElement with: anArgument [ aBlElement background paint end: anArgument diff --git a/src/Pyramid-Bloc/PyramidBackgroundPaintLinearStartCommand.class.st b/src/Pyramid-Bloc/PyramidBackgroundPaintLinearStartCommand.class.st index c62bbd9f..317cd3a6 100644 --- a/src/Pyramid-Bloc/PyramidBackgroundPaintLinearStartCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBackgroundPaintLinearStartCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBackgroundPaintLinearStartCommand >> getValueFor: aBlElement [ ^ aBlElement background paint start ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidBackgroundPaintLinearStartCommand >> setValueFor: aBlElement with: anArgument [ aBlElement background paint start: anArgument diff --git a/src/Pyramid-Bloc/PyramidBackgroundPaintRadialInnerCenterCommand.class.st b/src/Pyramid-Bloc/PyramidBackgroundPaintRadialInnerCenterCommand.class.st index e85efec8..3e5181ee 100644 --- a/src/Pyramid-Bloc/PyramidBackgroundPaintRadialInnerCenterCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBackgroundPaintRadialInnerCenterCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBackgroundPaintRadialInnerCenterCommand >> getValueFor: aBlElement [ ^ aBlElement background paint innerCenter ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidBackgroundPaintRadialInnerCenterCommand >> setValueFor: aBlElement with: anArgument [ aBlElement background paint innerCenter: anArgument diff --git a/src/Pyramid-Bloc/PyramidBackgroundPaintRadialInnerRadiusCommand.class.st b/src/Pyramid-Bloc/PyramidBackgroundPaintRadialInnerRadiusCommand.class.st index a2c2888d..2416e8c1 100644 --- a/src/Pyramid-Bloc/PyramidBackgroundPaintRadialInnerRadiusCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBackgroundPaintRadialInnerRadiusCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBackgroundPaintRadialInnerRadiusCommand >> getValueFor: aBlElement [ ^ aBlElement background paint innerRadius ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidBackgroundPaintRadialInnerRadiusCommand >> setValueFor: aBlElement with: anArgument [ aBlElement background paint innerRadius: anArgument diff --git a/src/Pyramid-Bloc/PyramidBackgroundPaintRadialOuterCenterCommand.class.st b/src/Pyramid-Bloc/PyramidBackgroundPaintRadialOuterCenterCommand.class.st index 8d8deac9..352d4e4c 100644 --- a/src/Pyramid-Bloc/PyramidBackgroundPaintRadialOuterCenterCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBackgroundPaintRadialOuterCenterCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBackgroundPaintRadialOuterCenterCommand >> getValueFor: aBlElement [ ^ aBlElement background paint outerCenter ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidBackgroundPaintRadialOuterCenterCommand >> setValueFor: aBlElement with: anArgument [ aBlElement background paint outerCenter: anArgument diff --git a/src/Pyramid-Bloc/PyramidBackgroundPaintRadialOuterRadiusCommand.class.st b/src/Pyramid-Bloc/PyramidBackgroundPaintRadialOuterRadiusCommand.class.st index f1ba79b4..c313f420 100644 --- a/src/Pyramid-Bloc/PyramidBackgroundPaintRadialOuterRadiusCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBackgroundPaintRadialOuterRadiusCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBackgroundPaintRadialOuterRadiusCommand >> getValueFor: aBlElement [ ^ aBlElement background paint outerRadius ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidBackgroundPaintRadialOuterRadiusCommand >> setValueFor: aBlElement with: anArgument [ aBlElement background paint outerRadius: anArgument diff --git a/src/Pyramid-Bloc/PyramidBackgroundPaintStopsCommand.class.st b/src/Pyramid-Bloc/PyramidBackgroundPaintStopsCommand.class.st index faebbb2a..57073903 100644 --- a/src/Pyramid-Bloc/PyramidBackgroundPaintStopsCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBackgroundPaintStopsCommand.class.st @@ -12,7 +12,7 @@ PyramidBackgroundPaintStopsCommand >> canBeUsedFor: anObject [ anObject background paint isKindOf: BlGradientPaint ] ] ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBackgroundPaintStopsCommand >> getValueFor: aBlElement [ "We ensure that we are working with a copy of the associations." @@ -20,7 +20,7 @@ PyramidBackgroundPaintStopsCommand >> getValueFor: aBlElement [ asso key copy -> asso value copy ] ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidBackgroundPaintStopsCommand >> setValueFor: aBlElement with: anArgument [ "We ensure that we are working with a copy of the associations." diff --git a/src/Pyramid-Bloc/PyramidBackgroundTypeCommand.class.st b/src/Pyramid-Bloc/PyramidBackgroundTypeCommand.class.st index 9031fa54..77e77faa 100644 --- a/src/Pyramid-Bloc/PyramidBackgroundTypeCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBackgroundTypeCommand.class.st @@ -4,19 +4,19 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBackgroundTypeCommand >> getGroupedValueFor: aBlElement [ ^ aBlElement background class ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBackgroundTypeCommand >> getValueFor: aBlElement [ ^ aBlElement background ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidBackgroundTypeCommand >> setValueFor: aBlElement with: anArgument [ "Must be a blockClosure to ensure no background are created." diff --git a/src/Pyramid-Bloc/PyramidBasicExactHorizontalConstraintsBlocCommand.class.st b/src/Pyramid-Bloc/PyramidBasicExactHorizontalConstraintsBlocCommand.class.st index 0988c930..cbd6cff3 100644 --- a/src/Pyramid-Bloc/PyramidBasicExactHorizontalConstraintsBlocCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBasicExactHorizontalConstraintsBlocCommand.class.st @@ -11,13 +11,13 @@ PyramidBasicExactHorizontalConstraintsBlocCommand >> canBeUsedFor: anObject [ anObject constraints horizontal resizer isExact ] ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBasicExactHorizontalConstraintsBlocCommand >> getValueFor: anObject [ ^ anObject constraints horizontal resizer size ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidBasicExactHorizontalConstraintsBlocCommand >> setValueFor: anObject with: anArgument [ ^ anObject constraintsDo: [ :c | c horizontal exact: anArgument ] diff --git a/src/Pyramid-Bloc/PyramidBasicExactVerticalConstraintsBlocCommand.class.st b/src/Pyramid-Bloc/PyramidBasicExactVerticalConstraintsBlocCommand.class.st index 664cf61e..34b3f184 100644 --- a/src/Pyramid-Bloc/PyramidBasicExactVerticalConstraintsBlocCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBasicExactVerticalConstraintsBlocCommand.class.st @@ -11,13 +11,13 @@ PyramidBasicExactVerticalConstraintsBlocCommand >> canBeUsedFor: anObject [ anObject constraints vertical resizer isExact ] ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBasicExactVerticalConstraintsBlocCommand >> getValueFor: anObject [ ^ anObject constraints vertical resizer size ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidBasicExactVerticalConstraintsBlocCommand >> setValueFor: anObject with: anArgument [ ^ anObject constraintsDo: [ :c | c vertical exact: anArgument ] diff --git a/src/Pyramid-Bloc/PyramidBasicHorizontalConstraintsBlocCommand.class.st b/src/Pyramid-Bloc/PyramidBasicHorizontalConstraintsBlocCommand.class.st index 1c1af430..3286df52 100644 --- a/src/Pyramid-Bloc/PyramidBasicHorizontalConstraintsBlocCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBasicHorizontalConstraintsBlocCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-layout' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBasicHorizontalConstraintsBlocCommand >> getValueFor: anObject [ ^ anObject constraints horizontal ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidBasicHorizontalConstraintsBlocCommand >> saveStatesOf: aCollection withCommand: aCommand withArguments: anArguments [ | mementos | @@ -26,7 +26,7 @@ PyramidBasicHorizontalConstraintsBlocCommand >> saveStatesOf: aCollection withCo yourself ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidBasicHorizontalConstraintsBlocCommand >> setValueFor: anObject with: anArgument [ anArgument isSymbol diff --git a/src/Pyramid-Bloc/PyramidBasicVerticalConstraintsBlocCommand.class.st b/src/Pyramid-Bloc/PyramidBasicVerticalConstraintsBlocCommand.class.st index b68c7202..db8daf3f 100644 --- a/src/Pyramid-Bloc/PyramidBasicVerticalConstraintsBlocCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBasicVerticalConstraintsBlocCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-layout' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBasicVerticalConstraintsBlocCommand >> getValueFor: anObject [ ^ anObject constraints vertical ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidBasicVerticalConstraintsBlocCommand >> saveStatesOf: aCollection withCommand: aCommand withArguments: anArguments [ | mementos | @@ -27,7 +27,7 @@ PyramidBasicVerticalConstraintsBlocCommand >> saveStatesOf: aCollection withComm yourself ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidBasicVerticalConstraintsBlocCommand >> setValueFor: anObject with: anArgument [ anArgument isSymbol diff --git a/src/Pyramid-Bloc/PyramidBlocGeometryPlugin.class.st b/src/Pyramid-Bloc/PyramidBlocGeometryPlugin.class.st deleted file mode 100644 index 63799cd9..00000000 --- a/src/Pyramid-Bloc/PyramidBlocGeometryPlugin.class.st +++ /dev/null @@ -1,94 +0,0 @@ -Class { - #name : #PyramidBlocGeometryPlugin, - #superclass : #Object, - #traits : 'TPyramidPlugin', - #classTraits : 'TPyramidPlugin classTrait', - #instVars : [ - 'propertiesManager' - ], - #category : #'Pyramid-Bloc-plugin-bloc-geometry' -} - -{ #category : #accessing } -PyramidBlocGeometryPlugin class >> cornerRadii [ - - | property | - property := PyramidProperty new - name: 'Corner radius'; - command: PyramidRoundedRectangleCornerRadiiCommand new; - inputPresenterClass: - PyramidCornerRadiiInputPresenter; - yourself. - property inputPresenterModel help: - 'Change the corner radius of the geometry. For example: - - "10" to set a radius of 10 px on each corner. - - "10 20" to set a radius of 10 px on the top-left and bottom-right corner and 20 px on the top-right and bottom-left corner. - - "10 20 30 40" to set a radius of 10 px on top-left, 20 px on top-right, 30 px on bottom-right and 40 px on bottom-left.'. - ^ property -] - -{ #category : #accessing } -PyramidBlocGeometryPlugin class >> geometry [ - - | property | - property := PyramidProperty new - name: 'Geo'; - command: PyramidGeometryCommand new; - inputPresenterClass: PyramidMagicButtonsInputPresenter; - yourself. - self geometryClasses do: [ :each | - property inputPresenterModel addButtonModel: - each asPyramidMagicButton ]. - ^ property -] - -{ #category : #'as yet unclassified' } -PyramidBlocGeometryPlugin class >> geometryClasses [ - - ^ { - BlRectangleGeometry. - BlRoundedRectangleGeometry. - BlSquareGeometry. - BlEllipseGeometry. - BlCircleGeometry. - BlAnnulusSectorGeometry. - BlTriangleGeometry. - BlLineGeometry . - BlPolylineGeometry. - BlBezierCurveGeometry. - BlPolygonGeometry } -] - -{ #category : #adding } -PyramidBlocGeometryPlugin >> addPanelsOn: aPyramidSimpleWindow [ - - aPyramidSimpleWindow at: #tabRight addItem: [ :builder | - builder - makeTab: self propertiesManager mainPresenter - label: 'Geo' - icon: (Smalltalk ui icons iconNamed: #box) - order: 4 ] -] - -{ #category : #connecting } -PyramidBlocGeometryPlugin >> connectOn: aPyramidEditor [ - - propertiesManager projectModel: aPyramidEditor projectModel. - propertiesManager commandExecutor: - aPyramidEditor commandExecutor -] - -{ #category : #initialization } -PyramidBlocGeometryPlugin >> initialize [ - - propertiesManager := PyramidPropertiesManagerForSelection new. - - propertiesManager addProperty: self class geometry. - propertiesManager addProperty: self class cornerRadii. -] - -{ #category : #adding } -PyramidBlocGeometryPlugin >> propertiesManager [ - - ^ propertiesManager -] diff --git a/src/Pyramid-Bloc/PyramidBorderDashArrayCommand.class.st b/src/Pyramid-Bloc/PyramidBorderDashArrayCommand.class.st index c8d064ae..009c994b 100644 --- a/src/Pyramid-Bloc/PyramidBorderDashArrayCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBorderDashArrayCommand.class.st @@ -4,7 +4,7 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBorderDashArrayCommand >> getValueFor: aBlElement [ ^ aBlElement border style dashArray diff --git a/src/Pyramid-Bloc/PyramidBorderDashOffsetCommand.class.st b/src/Pyramid-Bloc/PyramidBorderDashOffsetCommand.class.st index a30514b4..ca51c9d2 100644 --- a/src/Pyramid-Bloc/PyramidBorderDashOffsetCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBorderDashOffsetCommand.class.st @@ -11,7 +11,7 @@ PyramidBorderDashOffsetCommand >> canBeUsedFor: anObject [ anObject border style dashArray isNotEmpty ] ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBorderDashOffsetCommand >> getValueFor: aBlElement [ ^ aBlElement border style dashOffset diff --git a/src/Pyramid-Bloc/PyramidBorderLineCapCommand.class.st b/src/Pyramid-Bloc/PyramidBorderLineCapCommand.class.st index 90ae60e9..f9c10852 100644 --- a/src/Pyramid-Bloc/PyramidBorderLineCapCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBorderLineCapCommand.class.st @@ -4,7 +4,7 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBorderLineCapCommand >> getValueFor: aBlElement [ ^ aBlElement border style lineCap diff --git a/src/Pyramid-Bloc/PyramidBorderLineJoinCommand.class.st b/src/Pyramid-Bloc/PyramidBorderLineJoinCommand.class.st index 3ea1dbb1..3b461432 100644 --- a/src/Pyramid-Bloc/PyramidBorderLineJoinCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBorderLineJoinCommand.class.st @@ -4,7 +4,7 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBorderLineJoinCommand >> getValueFor: aBlElement [ ^ aBlElement border style lineJoin diff --git a/src/Pyramid-Bloc/PyramidBorderMiterLimitCommand.class.st b/src/Pyramid-Bloc/PyramidBorderMiterLimitCommand.class.st index e70e6d41..c6f86446 100644 --- a/src/Pyramid-Bloc/PyramidBorderMiterLimitCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBorderMiterLimitCommand.class.st @@ -11,7 +11,7 @@ PyramidBorderMiterLimitCommand >> canBeUsedFor: anObject [ (anObject border style lineJoin isKindOf: BlStrokeLineMiterJoin) ] ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBorderMiterLimitCommand >> getValueFor: aBlElement [ ^ aBlElement border style miterLimit diff --git a/src/Pyramid-Bloc/PyramidBorderOpacityCommand.class.st b/src/Pyramid-Bloc/PyramidBorderOpacityCommand.class.st index e1d6b44e..5c818acf 100644 --- a/src/Pyramid-Bloc/PyramidBorderOpacityCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBorderOpacityCommand.class.st @@ -4,7 +4,7 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBorderOpacityCommand >> getValueFor: aBlElement [ ^ aBlElement border opacity diff --git a/src/Pyramid-Bloc/PyramidBorderPaintColorCommand.class.st b/src/Pyramid-Bloc/PyramidBorderPaintColorCommand.class.st index 10eeb2d7..de5ff490 100644 --- a/src/Pyramid-Bloc/PyramidBorderPaintColorCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBorderPaintColorCommand.class.st @@ -11,7 +11,7 @@ PyramidBorderPaintColorCommand >> canBeUsedFor: anObject [ anObject border paint isKindOf: BlColorPaint ] ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBorderPaintColorCommand >> getValueFor: aBlElement [ ^ aBlElement border paint color diff --git a/src/Pyramid-Bloc/PyramidBorderPaintCommand.class.st b/src/Pyramid-Bloc/PyramidBorderPaintCommand.class.st index 44fb1a6d..85ac677c 100644 --- a/src/Pyramid-Bloc/PyramidBorderPaintCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBorderPaintCommand.class.st @@ -4,7 +4,7 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBorderPaintCommand >> getValueFor: aBlElement [ ^ aBlElement border paint diff --git a/src/Pyramid-Bloc/PyramidBorderPaintLinearDirectionEndCommand.class.st b/src/Pyramid-Bloc/PyramidBorderPaintLinearDirectionEndCommand.class.st index 1b18eb86..5b30c8b9 100644 --- a/src/Pyramid-Bloc/PyramidBorderPaintLinearDirectionEndCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBorderPaintLinearDirectionEndCommand.class.st @@ -4,7 +4,7 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBorderPaintLinearDirectionEndCommand >> getValueFor: aBlElement [ ^ aBlElement border paint end diff --git a/src/Pyramid-Bloc/PyramidBorderPaintLinearDirectionStartCommand.class.st b/src/Pyramid-Bloc/PyramidBorderPaintLinearDirectionStartCommand.class.st index 4f08a8a9..ca09f43d 100644 --- a/src/Pyramid-Bloc/PyramidBorderPaintLinearDirectionStartCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBorderPaintLinearDirectionStartCommand.class.st @@ -4,7 +4,7 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBorderPaintLinearDirectionStartCommand >> getValueFor: aBlElement [ ^ aBlElement border paint start diff --git a/src/Pyramid-Bloc/PyramidBorderPaintRadialInnerCenterCommand.class.st b/src/Pyramid-Bloc/PyramidBorderPaintRadialInnerCenterCommand.class.st index bdb47e7b..e95c8e32 100644 --- a/src/Pyramid-Bloc/PyramidBorderPaintRadialInnerCenterCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBorderPaintRadialInnerCenterCommand.class.st @@ -4,7 +4,7 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBorderPaintRadialInnerCenterCommand >> getValueFor: aBlElement [ ^ aBlElement border paint innerCenter diff --git a/src/Pyramid-Bloc/PyramidBorderPaintRadialInnerRadiusCommand.class.st b/src/Pyramid-Bloc/PyramidBorderPaintRadialInnerRadiusCommand.class.st index 8f6a2812..a2f83c29 100644 --- a/src/Pyramid-Bloc/PyramidBorderPaintRadialInnerRadiusCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBorderPaintRadialInnerRadiusCommand.class.st @@ -4,7 +4,7 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBorderPaintRadialInnerRadiusCommand >> getValueFor: aBlElement [ ^ aBlElement border paint innerRadius diff --git a/src/Pyramid-Bloc/PyramidBorderPaintRadialOuterCenterCommand.class.st b/src/Pyramid-Bloc/PyramidBorderPaintRadialOuterCenterCommand.class.st index 5a32a29a..9cc5cc8d 100644 --- a/src/Pyramid-Bloc/PyramidBorderPaintRadialOuterCenterCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBorderPaintRadialOuterCenterCommand.class.st @@ -4,7 +4,7 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBorderPaintRadialOuterCenterCommand >> getValueFor: aBlElement [ ^ aBlElement border paint outerCenter diff --git a/src/Pyramid-Bloc/PyramidBorderPaintRadialOuterRadiusCommand.class.st b/src/Pyramid-Bloc/PyramidBorderPaintRadialOuterRadiusCommand.class.st index 43c5b541..95a573e0 100644 --- a/src/Pyramid-Bloc/PyramidBorderPaintRadialOuterRadiusCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBorderPaintRadialOuterRadiusCommand.class.st @@ -4,7 +4,7 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBorderPaintRadialOuterRadiusCommand >> getValueFor: aBlElement [ ^ aBlElement border paint outerRadius diff --git a/src/Pyramid-Bloc/PyramidBorderPaintStopsCommand.class.st b/src/Pyramid-Bloc/PyramidBorderPaintStopsCommand.class.st index 2626a3dd..da994230 100644 --- a/src/Pyramid-Bloc/PyramidBorderPaintStopsCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBorderPaintStopsCommand.class.st @@ -11,7 +11,7 @@ PyramidBorderPaintStopsCommand >> canBeUsedFor: anObject [ anObject border paint isKindOf: BlGradientPaint ] ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBorderPaintStopsCommand >> getValueFor: aBlElement [ "We ensure that we are working with a copy of the associations." diff --git a/src/Pyramid-Bloc/PyramidBorderWidthCommand.class.st b/src/Pyramid-Bloc/PyramidBorderWidthCommand.class.st index b943532a..f7ed7450 100644 --- a/src/Pyramid-Bloc/PyramidBorderWidthCommand.class.st +++ b/src/Pyramid-Bloc/PyramidBorderWidthCommand.class.st @@ -4,7 +4,7 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidBorderWidthCommand >> getValueFor: aBlElement [ ^ aBlElement border width diff --git a/src/Pyramid-Bloc/PyramidBreakpoint.class.st b/src/Pyramid-Bloc/PyramidBreakpoint.class.st deleted file mode 100644 index af3771cc..00000000 --- a/src/Pyramid-Bloc/PyramidBreakpoint.class.st +++ /dev/null @@ -1,64 +0,0 @@ -Class { - #name : #PyramidBreakpoint, - #superclass : #Breakpoint, - #instVars : [ - 'whenHitDo' - ], - #category : #'Pyramid-Bloc-plugin-edit-on-running' -} - -{ #category : #removing } -PyramidBreakpoint class >> removeAllPyramidBreakpoint [ - - - | pyramidBreakpoints | - pyramidBreakpoints := self all select: [ :each | each class = self ]. - pyramidBreakpoints ifEmpty: [ ^ self ]. - pyramidBreakpoints do: [ :each | each remove ] -] - -{ #category : #removing } -PyramidBreakpoint class >> removeAllPyramidBreakpointExceptOne [ - - - | pyramidBreakpoints | - pyramidBreakpoints := self all select: [ :each | each class = self ]. - pyramidBreakpoints ifEmpty: [ ^ self ]. - pyramidBreakpoints allButFirstDo: [ :each | each remove ] -] - -{ #category : #api } -PyramidBreakpoint >> breakInContext: aContext node: aNode [ - - self class notifyBreakpointHit: self inContext: aContext node: aNode. - self isEnabled ifFalse: [ ^ self ]. - self onCount ifTrue: [ - self increaseCount = self breakOnCount ifFalse: [ ^ self ] ]. - self once ifTrue: [ self disable ]. - self whenHitDo value: aContext. -] - -{ #category : #initialization } -PyramidBreakpoint >> initialize [ - - super initialize. - whenHitDo := [ :c | ] -] - -{ #category : #testing } -PyramidBreakpoint >> isInstalled [ - - ^ self link methods isNotEmpty -] - -{ #category : #accessing } -PyramidBreakpoint >> whenHitDo [ - - ^ whenHitDo -] - -{ #category : #accessing } -PyramidBreakpoint >> whenHitDo: anObject [ - - whenHitDo := anObject -] diff --git a/src/Pyramid-Bloc/PyramidChangeOrderWithIndexCommand.class.st b/src/Pyramid-Bloc/PyramidChangeOrderWithIndexCommand.class.st index f314fb83..9db79209 100644 --- a/src/Pyramid-Bloc/PyramidChangeOrderWithIndexCommand.class.st +++ b/src/Pyramid-Bloc/PyramidChangeOrderWithIndexCommand.class.st @@ -4,7 +4,7 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-order' } -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidChangeOrderWithIndexCommand >> setValueFor: aBlElement with: anArgument [ | currentIndex parent | diff --git a/src/Pyramid-Bloc/PyramidChangeTextCommand.class.st b/src/Pyramid-Bloc/PyramidChangeTextCommand.class.st index 93a2bbda..228a26b3 100644 --- a/src/Pyramid-Bloc/PyramidChangeTextCommand.class.st +++ b/src/Pyramid-Bloc/PyramidChangeTextCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-text' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidChangeTextCommand >> getValueFor: aBlTextElement [ ^ aBlTextElement text asString ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidChangeTextCommand >> setValueFor: aBlTextElement with: aString [ | attributes rope | diff --git a/src/Pyramid-Bloc/PyramidChildrenCommand.class.st b/src/Pyramid-Bloc/PyramidChildrenCommand.class.st index 0331d157..d06778ef 100644 --- a/src/Pyramid-Bloc/PyramidChildrenCommand.class.st +++ b/src/Pyramid-Bloc/PyramidChildrenCommand.class.st @@ -10,13 +10,13 @@ PyramidChildrenCommand class >> isAbstract [ ^ self == PyramidChildrenCommand ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidChildrenCommand >> getValueFor: aBlElement [ ^ nil ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidChildrenCommand >> saveStatesOf: aCollection withCommand: aCommand withArguments: anArguments [ | mementos | diff --git a/src/Pyramid-Bloc/PyramidClipChildrenCommand.class.st b/src/Pyramid-Bloc/PyramidClipChildrenCommand.class.st index a4209f42..df44798a 100644 --- a/src/Pyramid-Bloc/PyramidClipChildrenCommand.class.st +++ b/src/Pyramid-Bloc/PyramidClipChildrenCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidClipChildrenCommand >> getValueFor: aBlElement [ ^ aBlElement clipChildren ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidClipChildrenCommand >> setValueFor: aBlElement with: anArgument [ aBlElement clipChildren: anArgument diff --git a/src/Pyramid-Bloc/PyramidDebugPoint.class.st b/src/Pyramid-Bloc/PyramidDebugPoint.class.st new file mode 100644 index 00000000..85a67407 --- /dev/null +++ b/src/Pyramid-Bloc/PyramidDebugPoint.class.st @@ -0,0 +1,64 @@ +Class { + #name : #PyramidDebugPoint, + #superclass : #DebugPoint, + #instVars : [ + 'whenHitDo' + ], + #category : #'Pyramid-Bloc-plugin-edit-on-running' +} + +{ #category : #removing } +PyramidDebugPoint class >> removeAllPyramidDebugPoint [ + + + | pyramidDebugPoints | + pyramidDebugPoints := PyramidDebugPoint allInstances. + pyramidDebugPoints isEmptyOrNil ifTrue: [ ^ self ]. + pyramidDebugPoints do: [ :each | each link ifNotNil:[ each remove ] ] +] + +{ #category : #API } +PyramidDebugPoint >> hitWithContext: aContext [ + + | result | + result := super hitWithContext: aContext. + result ifTrue:[ self whenHitDo value: aContext ]. + + ^result + +] + +{ #category : #initialization } +PyramidDebugPoint >> initialize [ + + super initialize. + whenHitDo := [ :c | ] +] + +{ #category : #installing } +PyramidDebugPoint >> install [ + + "For compatibility P12" + self link ifNil:[ self link: self metaLink]. + + super install +] + +{ #category : #testing } +PyramidDebugPoint >> isInstalled [ + + self link ifNil:[ ^false ]. + ^ self link methods isNotEmpty +] + +{ #category : #accessing } +PyramidDebugPoint >> whenHitDo [ + + ^ whenHitDo +] + +{ #category : #accessing } +PyramidDebugPoint >> whenHitDo: anObject [ + + whenHitDo := anObject +] diff --git a/src/Pyramid-Bloc/PyramidDynamicResizeCommand.class.st b/src/Pyramid-Bloc/PyramidDynamicResizeCommand.class.st index 816bac00..0808cfe1 100644 --- a/src/Pyramid-Bloc/PyramidDynamicResizeCommand.class.st +++ b/src/Pyramid-Bloc/PyramidDynamicResizeCommand.class.st @@ -11,19 +11,19 @@ PyramidDynamicResizeCommand >> canBeUsedFor: anObject [ anObject size ] ] -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidDynamicResizeCommand >> commandInverse [ ^ PyramidUndoDynamicResizeBlocCommand new ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidDynamicResizeCommand >> getValueFor: anObject [ ^ anObject extent ] -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidDynamicResizeCommand >> saveStatesWithCommandInverseOf: aCollection with: arguments [ | mementos | @@ -39,7 +39,7 @@ PyramidDynamicResizeCommand >> saveStatesWithCommandInverseOf: aCollection with: yourself ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidDynamicResizeCommand >> setValueFor: anObject with: anArgument [ ^ anObject constraintsDo: [ :c | diff --git a/src/Pyramid-Bloc/PyramidEditorPlugin.class.st b/src/Pyramid-Bloc/PyramidEditorPlugin.class.st new file mode 100644 index 00000000..8e2a5911 --- /dev/null +++ b/src/Pyramid-Bloc/PyramidEditorPlugin.class.st @@ -0,0 +1,158 @@ +Class { + #name : #PyramidEditorPlugin, + #superclass : #Object, + #traits : 'TPyramidPlugin', + #classTraits : 'TPyramidPlugin classTrait', + #instVars : [ + 'propertiesManager' + ], + #category : #'Pyramid-Bloc-plugin-bloc-editor' +} + +{ #category : #accessing } +PyramidEditorPlugin class >> cornerRadii [ + + | property | + property := PyramidProperty new + name: 'Corner radius'; + command: PyramidRoundedRectangleCornerRadiiCommand new; + inputPresenterClass: PyramidCornerRadiiInputPresenter; + yourself. + property inputPresenterModel help: + 'Change the corner radius of the geometry. For example: + - "10" to set a radius of 10 px on each corner. + - "10 20" to set a radius of 10 px on the top-left and bottom-right corner and 20 px on the top-right and bottom-left corner. + - "10 20 30 40" to set a radius of 10 px on top-left, 20 px on top-right, 30 px on bottom-right and 40 px on bottom-left.'. + ^ property +] + +{ #category : #accessing } +PyramidEditorPlugin class >> geometry [ + + | property | + property := PyramidProperty new + name: 'Geo'; + command: PyramidGeometryCommand new; + inputPresenterClass: PyramidMagicButtonsInputPresenter; + yourself. + self geometryClasses do: [ :each | + property inputPresenterModel addButtonModel: + each asPyramidMagicButton ]. + ^ property +] + +{ #category : #'as yet unclassified' } +PyramidEditorPlugin class >> geometryClasses [ + + ^ { + BlRectangleGeometry. + BlRoundedRectangleGeometry. + BlSquareGeometry. + BlEllipseGeometry. + BlCircleGeometry. + BlAnnulusSectorGeometry. + BlTriangleGeometry. + BlLineGeometry. + BlPolylineGeometry. + BlBezierCurveGeometry. + BlPolygonGeometry } +] + +{ #category : #'as yet unclassified' } +PyramidEditorPlugin class >> toButtonEndIcon [ + + | property | + property := PyramidProperty new + name: 'End Icon'; + command: PyramidToButtonEndIconCommand new; + inputPresenterClass: PyramidIconInputPresenter; + yourself. + ^ property +] + +{ #category : #'as yet unclassified' } +PyramidEditorPlugin class >> toButtonIcon [ + + | property | + property := PyramidProperty new + name: 'Icon'; + command: PyramidToButtonIconCommand new; + inputPresenterClass: PyramidIconInputPresenter; + yourself. + ^ property +] + +{ #category : #'as yet unclassified' } +PyramidEditorPlugin class >> toButtonLabel [ + + | property | + property := PyramidProperty new + name: 'Text'; + command: PyramidToButtonLabelCommand new; + inputPresenterClass: PyramidTextInputPresenter; + yourself. + ^ property +] + +{ #category : #'as yet unclassified' } +PyramidEditorPlugin class >> toImageInnerImage [ + + | property | + property := PyramidProperty new + name: 'Image'; + command: PyramidToImageInnerImageCommand new; + inputPresenterClass: PyramidIconInputPresenter; + yourself. + ^ property +] + +{ #category : #'as yet unclassified' } +PyramidEditorPlugin class >> toLabelText [ + + | property | + property := PyramidProperty new + name: 'Text'; + command: PyramidToLabelTextCommand new; + inputPresenterClass: PyramidTextInputPresenter; + yourself. + ^ property +] + +{ #category : #adding } +PyramidEditorPlugin >> addPanelsOn: aPyramidSimpleWindow [ + + aPyramidSimpleWindow at: #tabRight addItem: [ :builder | + builder + makeTab: propertiesManager mainPresenter + label: 'Editor' + icon: (Smalltalk ui icons iconNamed: #box) + order: 5 ] +] + +{ #category : #connecting } +PyramidEditorPlugin >> connectOn: aPyramidEditor [ + + propertiesManager projectModel: aPyramidEditor projectModel. + propertiesManager commandExecutor: aPyramidEditor commandExecutor +] + +{ #category : #initialization } +PyramidEditorPlugin >> initialize [ + + propertiesManager := PyramidPropertiesManagerForSelection new. + + "BlElements properties" + propertiesManager addProperty: self class geometry. + propertiesManager addProperty: self class cornerRadii. + + "ToButton properties" + propertiesManager addProperty: self class toButtonLabel. + propertiesManager addProperty: self class toButtonIcon. + propertiesManager addProperty: self class toButtonEndIcon. + + "ToImage properties" + propertiesManager addProperty: self class toImageInnerImage. + + "ToLabel properties" + propertiesManager addProperty: self class toLabelText. +] diff --git a/src/Pyramid-Bloc/PyramidElementIdCommand.class.st b/src/Pyramid-Bloc/PyramidElementIdCommand.class.st index 66f89484..f6c48266 100644 --- a/src/Pyramid-Bloc/PyramidElementIdCommand.class.st +++ b/src/Pyramid-Bloc/PyramidElementIdCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidElementIdCommand >> getValueFor: aBlElement [ ^ aBlElement id ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidElementIdCommand >> setValueFor: aBlElement with: anArgument [ aBlElement id: anArgument diff --git a/src/Pyramid-Bloc/PyramidFontSizeCommand.class.st b/src/Pyramid-Bloc/PyramidFontSizeCommand.class.st index 8dbf1c83..ae3786ae 100644 --- a/src/Pyramid-Bloc/PyramidFontSizeCommand.class.st +++ b/src/Pyramid-Bloc/PyramidFontSizeCommand.class.st @@ -4,7 +4,7 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-text' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidFontSizeCommand >> getValueFor: aBlTextElement [ aBlTextElement text attributesFinder @@ -14,7 +14,7 @@ PyramidFontSizeCommand >> getValueFor: aBlTextElement [ ^ 10 ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidFontSizeCommand >> setValueFor: aBlTextElement with: aNumber [ aBlTextElement text attribute: (BlFontSizeAttribute size: aNumber). diff --git a/src/Pyramid-Bloc/PyramidFontWeightCommand.class.st b/src/Pyramid-Bloc/PyramidFontWeightCommand.class.st index a7c5ba98..5a175d22 100644 --- a/src/Pyramid-Bloc/PyramidFontWeightCommand.class.st +++ b/src/Pyramid-Bloc/PyramidFontWeightCommand.class.st @@ -4,14 +4,14 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-text' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidFontWeightCommand >> getValueFor: aBlTextElement [ aBlTextElement text attributesFinder findAttributesSuchThat: [ :a | a class = BlFontWeightAttribute ] indicesDo: [ :new :old :a | ^ a weight ]. ^ LogicalFont weightRegular ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidFontWeightCommand >> setValueFor: aBlTextElement with: aNumber [ aBlTextElement text attribute: diff --git a/src/Pyramid-Bloc/PyramidFrameHorizontalConstraintsCommand.class.st b/src/Pyramid-Bloc/PyramidFrameHorizontalConstraintsCommand.class.st index 271f6c0e..62753f9b 100644 --- a/src/Pyramid-Bloc/PyramidFrameHorizontalConstraintsCommand.class.st +++ b/src/Pyramid-Bloc/PyramidFrameHorizontalConstraintsCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-layout' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidFrameHorizontalConstraintsCommand >> getValueFor: anObject [ ^ anObject constraints frame horizontal alignment ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidFrameHorizontalConstraintsCommand >> setValueFor: anObject with: anArgument [ anObject constraintsDo: [ :c | diff --git a/src/Pyramid-Bloc/PyramidFrameVerticalConstraintsCommand.class.st b/src/Pyramid-Bloc/PyramidFrameVerticalConstraintsCommand.class.st index 99b53c7a..af0b2905 100644 --- a/src/Pyramid-Bloc/PyramidFrameVerticalConstraintsCommand.class.st +++ b/src/Pyramid-Bloc/PyramidFrameVerticalConstraintsCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-layout' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidFrameVerticalConstraintsCommand >> getValueFor: anObject [ ^ anObject constraints frame vertical alignment ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidFrameVerticalConstraintsCommand >> setValueFor: anObject with: anArgument [ anObject constraintsDo: [ :c | diff --git a/src/Pyramid-Bloc/PyramidGeometryCommand.class.st b/src/Pyramid-Bloc/PyramidGeometryCommand.class.st index 411acf89..d67417ef 100644 --- a/src/Pyramid-Bloc/PyramidGeometryCommand.class.st +++ b/src/Pyramid-Bloc/PyramidGeometryCommand.class.st @@ -1,16 +1,16 @@ Class { #name : #PyramidGeometryCommand, #superclass : #PyramidAbstractBlocCommand, - #category : #'Pyramid-Bloc-plugin-bloc-geometry' + #category : #'Pyramid-Bloc-plugin-bloc-editor' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidGeometryCommand >> getValueFor: aBlElement [ ^ aBlElement geometry ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidGeometryCommand >> setValueFor: aBlElement with: anArgument [ aBlElement geometry: anArgument diff --git a/src/Pyramid-Bloc/PyramidGroupCommand.class.st b/src/Pyramid-Bloc/PyramidGroupCommand.class.st index bfb54ab2..e5292bd5 100644 --- a/src/Pyramid-Bloc/PyramidGroupCommand.class.st +++ b/src/Pyramid-Bloc/PyramidGroupCommand.class.st @@ -20,7 +20,7 @@ PyramidGroupCommand >> canBeUsedFor: aCollectionOfBlElements [ each parent = parent ] ] -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidGroupCommand >> commandInverse [ "Command used to undo the group." @@ -67,7 +67,7 @@ PyramidGroupCommand >> createNewGroupElement: aCollectionOfBlElement [ yourself. ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidGroupCommand >> getValueFor: aBlElement [ ^ self historyCommandArguments @@ -106,7 +106,7 @@ PyramidGroupCommand >> positionGroupElement: groupElement [ child constraints position - (currentLeft @ currentTop) ] ] -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidGroupCommand >> saveStatesOf: aCollection with: arguments [ ^ self @@ -116,7 +116,7 @@ PyramidGroupCommand >> saveStatesOf: aCollection with: arguments [ (self commandRestaurationArgumentsFor: aCollection and: arguments) ] -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidGroupCommand >> saveStatesWithCommandInverseOf: aCollection with: arguments [ ^ self @@ -126,7 +126,7 @@ PyramidGroupCommand >> saveStatesWithCommandInverseOf: aCollection with: argumen (self commandInverseArgumentsFor: aCollection and: arguments) ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidGroupCommand >> setValueFor: aCollectionToGroup with: aCollectionOfFirstLevelElements [ | groupInCorrectOrder parent groupElement removedElementFromFirstLevel | diff --git a/src/Pyramid-Bloc/PyramidLayoutBlocCommand.class.st b/src/Pyramid-Bloc/PyramidLayoutBlocCommand.class.st index 880f6ede..fd6180e7 100644 --- a/src/Pyramid-Bloc/PyramidLayoutBlocCommand.class.st +++ b/src/Pyramid-Bloc/PyramidLayoutBlocCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-layout' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidLayoutBlocCommand >> getValueFor: anObject [ ^ anObject layout ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidLayoutBlocCommand >> setValueFor: anObject with: anArgument [ anObject layout: anArgument diff --git a/src/Pyramid-Bloc/PyramidLayoutChangeOrientationCommand.class.st b/src/Pyramid-Bloc/PyramidLayoutChangeOrientationCommand.class.st index 57cc5aab..26ec48bd 100644 --- a/src/Pyramid-Bloc/PyramidLayoutChangeOrientationCommand.class.st +++ b/src/Pyramid-Bloc/PyramidLayoutChangeOrientationCommand.class.st @@ -11,13 +11,13 @@ PyramidLayoutChangeOrientationCommand >> canBeUsedFor: anObject [ { BlFlowLayout . BlLinearLayout } includes: anObject layout class ] ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidLayoutChangeOrientationCommand >> getValueFor: anObject [ ^ anObject layout orientation ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidLayoutChangeOrientationCommand >> setValueFor: anObject with: anArgument [ anObject layout orientation: anArgument diff --git a/src/Pyramid-Bloc/PyramidLibraryElement.class.st b/src/Pyramid-Bloc/PyramidLibraryElement.class.st index 08385a16..62dd2f0a 100644 --- a/src/Pyramid-Bloc/PyramidLibraryElement.class.st +++ b/src/Pyramid-Bloc/PyramidLibraryElement.class.st @@ -4,11 +4,29 @@ Class { #instVars : [ 'name', 'icon', - 'block' + 'block', + 'provider', + 'status' ], #category : #'Pyramid-Bloc-plugin-navigation' } +{ #category : #accessing } +PyramidLibraryElement class >> statusNotUsable [ + ^ #notUsable +] + +{ #category : #accessing } +PyramidLibraryElement class >> statusOk [ + + ^ #ok +] + +{ #category : #accessing } +PyramidLibraryElement class >> statusUnstable [ + ^ #unstable +] + { #category : #converting } PyramidLibraryElement >> asArray [ @@ -85,3 +103,27 @@ PyramidLibraryElement >> name: anObject [ name := anObject ] + +{ #category : #accessing } +PyramidLibraryElement >> provider [ + + ^ provider +] + +{ #category : #accessing } +PyramidLibraryElement >> provider: aClass [ + +provider := aClass +] + +{ #category : #accessing } +PyramidLibraryElement >> status [ + + ^ status ifNil: [self class statusUnstable] +] + +{ #category : #accessing } +PyramidLibraryElement >> status: aSymbol [ + + status := aSymbol +] diff --git a/src/Pyramid-Bloc/PyramidMainExtension.class.st b/src/Pyramid-Bloc/PyramidMainExtension.class.st index 22978ac1..1b48b841 100644 --- a/src/Pyramid-Bloc/PyramidMainExtension.class.st +++ b/src/Pyramid-Bloc/PyramidMainExtension.class.st @@ -17,9 +17,91 @@ Class { 'gridColor', 'selectionWidgetExtension' ], + #classInstVars : [ + 'currentGridWindowSize', + 'currentGridVisibility', + 'currentGridSpacing', + 'currentGridColor', + 'currentProjectIcons' + ], #category : #'Pyramid-Bloc-plugin-space-extensions' } +{ #category : #adding } +PyramidMainExtension class >> addIconName: aSymbol forElementId: aString [ + self currentProjectIcons at: aString asSymbol put: aSymbol +] + +{ #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 class >> currentProjectIcons [ + + ^ currentProjectIcons ifNil: [ currentProjectIcons := Dictionary new ] +] + +{ #category : #accessing } +PyramidMainExtension class >> currentProjectIcons: aDictionary [ + currentProjectIcons := aDictionary + +] + +{ #category : #accessing } +PyramidMainExtension class >> iconNameForElementId: aString [ + ^ self currentProjectIcons at: aString ifAbsent: [ nil ] +] + +{ #category : #initialization } +PyramidMainExtension class >> resetCurrentProjectIcons [ + + currentProjectIcons := Dictionary new +] + { #category : #accessing } PyramidMainExtension >> borderElement [ @@ -40,23 +122,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 +162,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 +189,7 @@ PyramidMainExtension >> extent: aPoint [ self elementAtWidgets extent: aPoint. self sizeElement extent: aPoint. self gridWindowSize: aPoint. + self class currentGridWindowSize: aPoint. self createGrid ] @@ -185,15 +271,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 +287,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 } @@ -232,6 +326,12 @@ PyramidMainExtension >> informTransformationChanged [ 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. + self class resetCurrentProjectIcons. + gridWindowSize := self defaultExtent. gridVisibility := self defaultGridVisibility. gridSpacing := self defaultGridSpacing. @@ -243,24 +343,38 @@ PyramidMainExtension >> initialize [ 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 +385,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 +400,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 +412,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 +423,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 +434,7 @@ PyramidMainExtension >> initialize [ extent: self defaultExtent; clipChildren: false; addChildren: { - containerElement . + containerElement. borderElement } yourself ] @@ -383,14 +497,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/PyramidMarginCommand.class.st b/src/Pyramid-Bloc/PyramidMarginCommand.class.st index 40950338..c773ea9a 100644 --- a/src/Pyramid-Bloc/PyramidMarginCommand.class.st +++ b/src/Pyramid-Bloc/PyramidMarginCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-layout' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidMarginCommand >> getValueFor: aBlElement [ ^ aBlElement margin ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidMarginCommand >> setValueFor: aBlElement with: anArgument [ aBlElement margin: anArgument diff --git a/src/Pyramid-Bloc/PyramidMoveBackwardOrderCommand.class.st b/src/Pyramid-Bloc/PyramidMoveBackwardOrderCommand.class.st index 4fc68ba7..6003f24b 100644 --- a/src/Pyramid-Bloc/PyramidMoveBackwardOrderCommand.class.st +++ b/src/Pyramid-Bloc/PyramidMoveBackwardOrderCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-order' } -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidMoveBackwardOrderCommand >> commandInverse [ ^ PyramidMoveForwardOrderCommand new ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidMoveBackwardOrderCommand >> setValueFor: aBlElement with: anArgument [ | currentIndex | diff --git a/src/Pyramid-Bloc/PyramidMoveChildInParentCommand.class.st b/src/Pyramid-Bloc/PyramidMoveChildInParentCommand.class.st index 362a3ca1..df0b5e5a 100644 --- a/src/Pyramid-Bloc/PyramidMoveChildInParentCommand.class.st +++ b/src/Pyramid-Bloc/PyramidMoveChildInParentCommand.class.st @@ -7,13 +7,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidMoveChildInParentCommand >> getValueFor: aBlElement [ ^ nil ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidMoveChildInParentCommand >> saveStatesOf: aCollection withCommand: aCommand withArguments: anArguments [ | mementos | diff --git a/src/Pyramid-Bloc/PyramidMoveChildInParentPlugin.class.st b/src/Pyramid-Bloc/PyramidMoveChildInParentPlugin.class.st index 74b2a560..4fe6a43b 100644 --- a/src/Pyramid-Bloc/PyramidMoveChildInParentPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidMoveChildInParentPlugin.class.st @@ -46,22 +46,21 @@ PyramidMoveChildInParentPlugin >> contextMenuMoveChildInParent: aBuilder [ aBuilder addGroupSingleSelection: [ :group :single | - group - addItem: [ :item | - item - icon: (Smalltalk ui icons iconNamed: #up); - name: 'Move index child up'; - action: [ self moveChildIndexUpInParent ]; - yourself ]; - - addItem: [ :item | - item - icon: (Smalltalk ui icons iconNamed: #down); - name: 'Move index child down'; - action: [ self moveChildIndexDownInParent ]; - yourself ]; - yourself ] - order: 10. + group + addItem: [ :item | + item + icon: (Smalltalk ui icons iconNamed: #up); + name: 'Move child up'; + action: [ self moveChildIndexDownInParent ]; + yourself ]; + addItem: [ :item | + item + icon: (Smalltalk ui icons iconNamed: #down); + name: 'Move child down'; + action: [self moveChildIndexUpInParent]; + yourself ]; + yourself ] + order: 10 ] { #category : #accessing } @@ -91,28 +90,23 @@ PyramidMoveChildInParentPlugin >> moveChildIndexDownCommand: aBlElementParent wi PyramidMoveChildInParentPlugin >> moveChildIndexDownInParent [ | childToMoveCollection childToMove childIndexToMove parentChild navigationSelectionPanel | - childToMoveCollection := projectModel selection collection. navigationSelectionPanel := navigationPlugin navigation selectionPanel. - - childToMoveCollection size = 1 - ifFalse: [ ^ self ]. + + childToMoveCollection size = 1 ifFalse: [ ^ self ]. childToMove := childToMoveCollection first. - - childToMove hasParent - ifFalse: [ ^ self ]. + + childToMove hasParent ifFalse: [ ^ self ]. parentChild := childToMove parent. - - childIndexToMove := (parentChild childIndexOf: childToMove). - - childIndexToMove > 1 - ifTrue: [ self moveChildIndexDownCommand: parentChild with: childToMove. - self refreshTreeTable ] - ifFalse: [ self inform: 'Cannot move down' ]. - - + childIndexToMove := parentChild childIndexOf: childToMove. + childIndexToMove > 1 + ifTrue: [ + self moveChildIndexDownCommand: parentChild with: childToMove. + self refreshTreeTable ] + ifFalse: [ "cannot move the child up and the index down" + self inform: 'Cannot move up' ] ] { #category : #'as yet unclassified' } @@ -129,27 +123,23 @@ PyramidMoveChildInParentPlugin >> moveChildIndexUpCommand: aBlElementParent with PyramidMoveChildInParentPlugin >> moveChildIndexUpInParent [ | childToMoveCollection childToMove childIndexToMove parentChild navigationSelectionPanel | - childToMoveCollection := projectModel selection collection. navigationSelectionPanel := navigationPlugin navigation selectionPanel. - - childToMoveCollection size = 1 - ifFalse: [ ^ self ]. + + childToMoveCollection size = 1 ifFalse: [ ^ self ]. childToMove := childToMoveCollection first. - - childToMove hasParent - ifFalse: [ ^ self ]. + + childToMove hasParent ifFalse: [ ^ self ]. parentChild := childToMove parent. - - childIndexToMove := (parentChild childIndexOf: childToMove). - - childIndexToMove < (parentChild children size) - ifTrue: [ self moveChildIndexUpCommand: parentChild with: childToMove. - self refreshTreeTable ] - ifFalse: [ self inform: 'Cannot move up' ]. - - + childIndexToMove := parentChild childIndexOf: childToMove. + + childIndexToMove < parentChild children size + ifTrue: [ + self moveChildIndexUpCommand: parentChild with: childToMove. + self refreshTreeTable ] + ifFalse: [ "cannot move the child down and the index up" + self inform: 'Cannot move down' ] ] { #category : #accessing } diff --git a/src/Pyramid-Bloc/PyramidMoveChildIndexDownCommand.class.st b/src/Pyramid-Bloc/PyramidMoveChildIndexDownCommand.class.st index be0b637d..5742b92f 100644 --- a/src/Pyramid-Bloc/PyramidMoveChildIndexDownCommand.class.st +++ b/src/Pyramid-Bloc/PyramidMoveChildIndexDownCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc' } -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidMoveChildIndexDownCommand >> commandInverse [ ^ PyramidMoveChildIndexUpCommand new ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidMoveChildIndexDownCommand >> setValueFor: aBlElementParent with: aBlElementToMove [ | childIndexToMove | diff --git a/src/Pyramid-Bloc/PyramidMoveChildIndexUpCommand.class.st b/src/Pyramid-Bloc/PyramidMoveChildIndexUpCommand.class.st index 4eabe2dc..bf5c13aa 100644 --- a/src/Pyramid-Bloc/PyramidMoveChildIndexUpCommand.class.st +++ b/src/Pyramid-Bloc/PyramidMoveChildIndexUpCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc' } -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidMoveChildIndexUpCommand >> commandInverse [ ^ PyramidMoveChildIndexDownCommand new ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidMoveChildIndexUpCommand >> setValueFor: aBlElementParent with: aBlElementToMove [ | childIndexToMove | diff --git a/src/Pyramid-Bloc/PyramidMoveForwardOrderCommand.class.st b/src/Pyramid-Bloc/PyramidMoveForwardOrderCommand.class.st index 35008ed9..4eb2ec15 100644 --- a/src/Pyramid-Bloc/PyramidMoveForwardOrderCommand.class.st +++ b/src/Pyramid-Bloc/PyramidMoveForwardOrderCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-order' } -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidMoveForwardOrderCommand >> commandInverse [ ^ PyramidMoveBackwardOrderCommand new ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidMoveForwardOrderCommand >> setValueFor: aBlElement with: anArgument [ | currentIndex | diff --git a/src/Pyramid-Bloc/PyramidOnBackgroundOrderCommand.class.st b/src/Pyramid-Bloc/PyramidOnBackgroundOrderCommand.class.st index 257fd1b4..9a671789 100644 --- a/src/Pyramid-Bloc/PyramidOnBackgroundOrderCommand.class.st +++ b/src/Pyramid-Bloc/PyramidOnBackgroundOrderCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-order' } -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidOnBackgroundOrderCommand >> commandInverse [ ^ PyramidChangeOrderWithIndexCommand new ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidOnBackgroundOrderCommand >> setValueFor: aBlElement with: anArgument [ | currentIndex parent | diff --git a/src/Pyramid-Bloc/PyramidOnForegroundOrderCommand.class.st b/src/Pyramid-Bloc/PyramidOnForegroundOrderCommand.class.st index dda01bb0..41477cf2 100644 --- a/src/Pyramid-Bloc/PyramidOnForegroundOrderCommand.class.st +++ b/src/Pyramid-Bloc/PyramidOnForegroundOrderCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-order' } -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidOnForegroundOrderCommand >> commandInverse [ ^ PyramidChangeOrderWithIndexCommand new ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidOnForegroundOrderCommand >> setValueFor: aBlElement with: anArgument [ | currentIndex parent | diff --git a/src/Pyramid-Bloc/PyramidOpacityCommand.class.st b/src/Pyramid-Bloc/PyramidOpacityCommand.class.st index 31e02fdb..0b8b82d3 100644 --- a/src/Pyramid-Bloc/PyramidOpacityCommand.class.st +++ b/src/Pyramid-Bloc/PyramidOpacityCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidOpacityCommand >> getValueFor: aBlElement [ ^ aBlElement opacity ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidOpacityCommand >> setValueFor: aBlElement with: anArgument [ aBlElement opacity: anArgument diff --git a/src/Pyramid-Bloc/PyramidOutskirtsCommand.class.st b/src/Pyramid-Bloc/PyramidOutskirtsCommand.class.st index 07421899..288e90ed 100644 --- a/src/Pyramid-Bloc/PyramidOutskirtsCommand.class.st +++ b/src/Pyramid-Bloc/PyramidOutskirtsCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-visuals' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidOutskirtsCommand >> getValueFor: aBlElement [ ^ aBlElement outskirts ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidOutskirtsCommand >> setValueFor: aBlElement with: anArgument [ aBlElement outskirts: anArgument diff --git a/src/Pyramid-Bloc/PyramidPaddingCommand.class.st b/src/Pyramid-Bloc/PyramidPaddingCommand.class.st index 50eb962e..8e5c4c09 100644 --- a/src/Pyramid-Bloc/PyramidPaddingCommand.class.st +++ b/src/Pyramid-Bloc/PyramidPaddingCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-layout' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidPaddingCommand >> getValueFor: aBlElement [ ^ aBlElement padding ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidPaddingCommand >> setValueFor: aBlElement with: anArgument [ aBlElement padding: anArgument diff --git a/src/Pyramid-Bloc/PyramidPluginEditOnRunning.class.st b/src/Pyramid-Bloc/PyramidPluginEditOnRunning.class.st index 8c2589c3..19cab6f6 100644 --- a/src/Pyramid-Bloc/PyramidPluginEditOnRunning.class.st +++ b/src/Pyramid-Bloc/PyramidPluginEditOnRunning.class.st @@ -24,7 +24,7 @@ PyramidPluginEditOnRunning class >> breakpoint [ ^ breakpoint ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidPluginEditOnRunning class >> canEditSpace: aSpace [ aSpace ifNil:[ ^ false ]. @@ -54,13 +54,13 @@ PyramidPluginEditOnRunning class >> doShortcutAction: anEvent [ editor window whenClosedDo: [ whenClosedDo value ] ] -{ #category : #'as yet unclassified' } +{ #category : #accessing } PyramidPluginEditOnRunning class >> editOnRunning [ ^ editOnRunning ifNil: [ editOnRunning := true ] ] -{ #category : #'as yet unclassified' } +{ #category : #accessing } PyramidPluginEditOnRunning class >> editOnRunning: aBoolean [ editOnRunning := aBoolean @@ -77,10 +77,10 @@ PyramidPluginEditOnRunning class >> install [ PyramidPluginEditOnRunning class >> installBreakpoint [ | node | - PyramidBreakpoint removeAllPyramidBreakpoint. + PyramidDebugPoint removeAllPyramidDebugPoint. node := (BlParallelUniverse methodNamed: #openSpace:) ast. - breakpoint := PyramidBreakpoint new. + breakpoint := PyramidDebugPoint new. breakpoint node: node. breakpoint whenHitDo: [ :context | self addShortcutInSpace: context arguments first ]. @@ -122,6 +122,6 @@ PyramidPluginEditOnRunning class >> shortcut [ PyramidPluginEditOnRunning class >> uninstall [ "Undo some stuff here when the plugin used class oriented behavior" - PyramidBreakpoint removeAllPyramidBreakpoint. + PyramidDebugPoint removeAllPyramidDebugPoint. breakpoint := nil. ] diff --git a/src/Pyramid-Bloc/PyramidPluginOpenInWindow.class.st b/src/Pyramid-Bloc/PyramidPluginOpenInWindow.class.st new file mode 100644 index 00000000..6404e25f --- /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/PyramidPositionCommand.class.st b/src/Pyramid-Bloc/PyramidPositionCommand.class.st index 7f586f75..96f1ac9f 100644 --- a/src/Pyramid-Bloc/PyramidPositionCommand.class.st +++ b/src/Pyramid-Bloc/PyramidPositionCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-layout' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidPositionCommand >> getValueFor: aBlElement [ ^ aBlElement constraints position ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidPositionCommand >> setValueFor: aBlElement with: anArgument [ anArgument isPoint ifFalse: [ ^ self ]. diff --git a/src/Pyramid-Bloc/PyramidPositionOffsetCommand.class.st b/src/Pyramid-Bloc/PyramidPositionOffsetCommand.class.st index 6abce729..9bef2315 100644 --- a/src/Pyramid-Bloc/PyramidPositionOffsetCommand.class.st +++ b/src/Pyramid-Bloc/PyramidPositionOffsetCommand.class.st @@ -4,25 +4,25 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-layout' } -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidPositionOffsetCommand >> commandInverse [ ^ PyramidPositionCommand new ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidPositionOffsetCommand >> getValueFor: aBlElement [ ^ aBlElement constraints position ] -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidPositionOffsetCommand >> saveStatesOf: aCollection with: arguments [ ^ self saveStatesWithCommandInverseOf: aCollection with: arguments ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidPositionOffsetCommand >> setValueFor: aBlElement with: anArgument [ anArgument isPoint ifFalse: [ ^ self ]. diff --git a/src/Pyramid-Bloc/PyramidProportionalHorizontalConstraintsCommand.class.st b/src/Pyramid-Bloc/PyramidProportionalHorizontalConstraintsCommand.class.st index 61b5aafb..ebd5ca24 100644 --- a/src/Pyramid-Bloc/PyramidProportionalHorizontalConstraintsCommand.class.st +++ b/src/Pyramid-Bloc/PyramidProportionalHorizontalConstraintsCommand.class.st @@ -4,14 +4,14 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-layout' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidProportionalHorizontalConstraintsCommand >> getValueFor: anObject [ ^ anObject constraints proportional horizontal left @ anObject constraints proportional horizontal right ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidProportionalHorizontalConstraintsCommand >> setValueFor: anObject with: anArgument [ anObject constraintsDo: [ :c | diff --git a/src/Pyramid-Bloc/PyramidProportionalVerticalConstraintsCommand.class.st b/src/Pyramid-Bloc/PyramidProportionalVerticalConstraintsCommand.class.st index 466755dd..38324d5f 100644 --- a/src/Pyramid-Bloc/PyramidProportionalVerticalConstraintsCommand.class.st +++ b/src/Pyramid-Bloc/PyramidProportionalVerticalConstraintsCommand.class.st @@ -4,14 +4,14 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-layout' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidProportionalVerticalConstraintsCommand >> getValueFor: anObject [ ^ anObject constraints proportional vertical top @ anObject constraints proportional vertical bottom ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidProportionalVerticalConstraintsCommand >> setValueFor: anObject with: anArgument [ anObject constraintsDo: [ :c | diff --git a/src/Pyramid-Bloc/PyramidRedoGroupCommand.class.st b/src/Pyramid-Bloc/PyramidRedoGroupCommand.class.st index 05c74d6e..a21047ff 100644 --- a/src/Pyramid-Bloc/PyramidRedoGroupCommand.class.st +++ b/src/Pyramid-Bloc/PyramidRedoGroupCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-group' } -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidRedoGroupCommand >> commandInverse [ ^ PyramidUndoGroupCommand new ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidRedoGroupCommand >> getValueFor: aBlElement [ ^ nil @@ -34,7 +34,7 @@ PyramidRedoGroupCommand >> positionGroupElement: groupElement [ child constraints position - (currentLeft @ currentTop) ] ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidRedoGroupCommand >> setValueFor: aCollectionToGroup with: aGroupModel [ | anyElementInFirstLevels | diff --git a/src/Pyramid-Bloc/PyramidRemoveChildCommand.class.st b/src/Pyramid-Bloc/PyramidRemoveChildCommand.class.st index 2288f8f1..5cb81d95 100644 --- a/src/Pyramid-Bloc/PyramidRemoveChildCommand.class.st +++ b/src/Pyramid-Bloc/PyramidRemoveChildCommand.class.st @@ -4,14 +4,24 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc' } -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidRemoveChildCommand >> commandInverse [ ^ PyramidAddChildCommand new ] -{ #category : #'as yet unclassified' } -PyramidRemoveChildCommand >> setValueFor: aBlElement with: aChildToRemove [ +{ #category : #private } +PyramidRemoveChildCommand >> saveIndexOf: anElement [ + + | index | + index := anElement parent + ifNotNil: [ :p | p children indexOf: anElement ] + ifNil: [ 0 ]. + anElement userData at: #pyramidRemovedAtIndex put: index +] - aBlElement removeChild: aChildToRemove +{ #category : #setter } +PyramidRemoveChildCommand >> setValueFor: aBlElement with: aChildToRemove [ + self saveIndexOf: aChildToRemove. + aBlElement removeChild: aChildToRemove. ] diff --git a/src/Pyramid-Bloc/PyramidRemoveChildrenCommand.class.st b/src/Pyramid-Bloc/PyramidRemoveChildrenCommand.class.st index 6d09bbb6..70cdbc18 100644 --- a/src/Pyramid-Bloc/PyramidRemoveChildrenCommand.class.st +++ b/src/Pyramid-Bloc/PyramidRemoveChildrenCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc' } -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidRemoveChildrenCommand >> commandInverse [ ^ PyramidAddChildrenCommand new ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidRemoveChildrenCommand >> setValueFor: aBlElement with: aChildrenToAdd [ aBlElement removeChildren: aChildrenToAdd diff --git a/src/Pyramid-Bloc/PyramidRemoveSelectedElementsCommand.class.st b/src/Pyramid-Bloc/PyramidRemoveSelectedElementsCommand.class.st index 2beae596..7394355f 100644 --- a/src/Pyramid-Bloc/PyramidRemoveSelectedElementsCommand.class.st +++ b/src/Pyramid-Bloc/PyramidRemoveSelectedElementsCommand.class.st @@ -7,21 +7,22 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidRemoveSelectedElementsCommand >> getValueFor: anElementOfSelection [ ^ nil ] -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidRemoveSelectedElementsCommand >> mementoFor: anElement withArguments: anArgument [ + self saveIndexOf: anElement. (anArgument includes: anElement) ifTrue: [ - ^ PyramidCommandMemento new - command: PyramidRemoveFromCollectionCommand new commandInverse; - target: anArgument; - arguments: anElement; - yourself ]. + ^ PyramidCommandMemento new + command: PyramidRemoveFromCollectionCommand new commandInverse; + target: anArgument; + arguments: anElement; + yourself ]. ^ PyramidCommandMemento new command: PyramidRemoveChildCommand new commandInverse; target: anElement parent; @@ -41,14 +42,24 @@ PyramidRemoveSelectedElementsCommand >> mementoInverse: anObject [ mementoInverse := anObject ] -{ #category : #'as yet unclassified' } +{ #category : #private } +PyramidRemoveSelectedElementsCommand >> saveIndexOf: anElement [ + + | index | + index := anElement parent + ifNotNil: [ :p | p children indexOf: anElement ] + ifNil: [ 0 ]. + anElement userData at: #pyramidRemovedAtIndex put: index +] + +{ #category : #history } PyramidRemoveSelectedElementsCommand >> saveStatesOf: aCollection with: aRoots [ "We ignore the state recovery for the redo, we will force the inverse of the undo state." ^ self mementoInverse accept: PyramidMementoInverser new. ] -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidRemoveSelectedElementsCommand >> saveStatesWithCommandInverseOf: aCollection with: aRoots [ | mementos finalMemento | @@ -64,7 +75,7 @@ PyramidRemoveSelectedElementsCommand >> saveStatesWithCommandInverseOf: aCollect ^ finalMemento ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidRemoveSelectedElementsCommand >> setValueFor: aBlElementToRemove with: aRoot [ "Remove the element from its parent" diff --git a/src/Pyramid-Bloc/PyramidRoundedRectangleCornerRadiiCommand.class.st b/src/Pyramid-Bloc/PyramidRoundedRectangleCornerRadiiCommand.class.st index f239660b..f614852f 100644 --- a/src/Pyramid-Bloc/PyramidRoundedRectangleCornerRadiiCommand.class.st +++ b/src/Pyramid-Bloc/PyramidRoundedRectangleCornerRadiiCommand.class.st @@ -1,7 +1,7 @@ Class { #name : #PyramidRoundedRectangleCornerRadiiCommand, #superclass : #PyramidAbstractBlocCommand, - #category : #'Pyramid-Bloc-plugin-bloc-geometry' + #category : #'Pyramid-Bloc-plugin-bloc-editor' } { #category : #testing } @@ -11,14 +11,15 @@ PyramidRoundedRectangleCornerRadiiCommand >> canBeUsedFor: anObject [ anObject geometry class = BlRoundedRectangleGeometry ] ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidRoundedRectangleCornerRadiiCommand >> getValueFor: aBlElement [ ^ aBlElement geometry cornerRadii ] -{ #category : #'as yet unclassified' } +{ #category : #initialization } PyramidRoundedRectangleCornerRadiiCommand >> setValueFor: aBlElement with: anArgument [ - aBlElement geometry: (BlRoundedRectangleGeometry cornerRadii: anArgument) + aBlElement geometry: + (BlRoundedRectangleGeometry cornerRadii: anArgument) ] diff --git a/src/Pyramid-Bloc/PyramidSaveModelVerifier.class.st b/src/Pyramid-Bloc/PyramidSaveModelVerifier.class.st index d8425326..0848f873 100644 --- a/src/Pyramid-Bloc/PyramidSaveModelVerifier.class.st +++ b/src/Pyramid-Bloc/PyramidSaveModelVerifier.class.st @@ -47,9 +47,9 @@ PyramidSaveModelVerifier class >> classPackageIsEqual [ PyramidSaveModelVerifier class >> methodIsValid [ ^ self new - verifyBlock: [ :model | model savingMethodName isValidSelector ]; + verifyBlock: [ :model |model savingMethodName isValidSelector]; showBlock: [ :view | view showMethodIsNotValidError ]; - yourself. + yourself ] { #category : #constructor } diff --git a/src/Pyramid-Bloc/PyramidSavePlugin.class.st b/src/Pyramid-Bloc/PyramidSavePlugin.class.st index f80c61ad..04cb13cf 100644 --- a/src/Pyramid-Bloc/PyramidSavePlugin.class.st +++ b/src/Pyramid-Bloc/PyramidSavePlugin.class.st @@ -18,16 +18,62 @@ Class { { #category : #'instance creation' } PyramidSavePlugin class >> openOn: aCollectionOfBlElement saveModel: aSaveModel [ - | editor savePlugin | + | editor savePlugin metaData mainExtension spacePlugin | + PyramidSavingService currentProjectMetaData: 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: [ + (metaData at: #icons ifAbsent: [ nil ]) ifNotNil: [ :icons | + PyramidMainExtension currentProjectIcons: icons ]. + 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 +181,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 e158c9b0..40028ee0 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,75 @@ PyramidSavingService class >> ston [ yourself ] +{ #category : #private } +PyramidSavingService >> buildMetaDataMethod [ + + | methodName windowSize gridVisibility gridSpacing gridColor icons dictContent nl tab header existingIds | + 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 ]. + existingIds := Set new. + [ + self saveModel projectModel firstLevelElements do: [ :e | + (e respondsTo: #id) ifTrue: [ + e id ifNotNil: [ :anId | existingIds add: anId asString ] ] ] ] + on: Error + do: [ :err | existingIds := Set new ]. + icons := Dictionary new. + PyramidMainExtension currentProjectIcons keysAndValuesDo: [ + :key + :value | + | keyString suffix baseId | + keyString := key asString. + suffix := #( '_icon' '_endIcon' '_innerImage' ) + detect: [ :s | keyString endsWith: s ] + ifNone: [ nil ]. + suffix ifNotNil: [ + baseId := keyString copyFrom: 1 to: keyString size - suffix size. + (existingIds includes: baseId) ifTrue: [ + icons at: key put: value ] ] ] . + (windowSize = (800 @ 600) and: [ + gridVisibility not and: [ + gridSpacing = 10 and: [ + gridColor = Color black and: [ icons isEmpty ] ] ] ]) 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 + , ';' ]. + icons ifNotEmpty: [ + dictContent := dictContent , nl , tab , tab + , 'at: #icons put: (Dictionary new'. + icons keysAndValuesDo: [ :id :symbol | + dictContent := dictContent , nl , tab , tab , tab , 'at: #' , id + , ' put: #' , symbol , ';' ]. + dictContent := dictContent , nl , tab , tab , tab , 'yourself);' ]. + 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 +207,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/PyramidSelectionMakerExtension.class.st b/src/Pyramid-Bloc/PyramidSelectionMakerExtension.class.st index f067f356..8713a645 100644 --- a/src/Pyramid-Bloc/PyramidSelectionMakerExtension.class.st +++ b/src/Pyramid-Bloc/PyramidSelectionMakerExtension.class.st @@ -186,12 +186,15 @@ PyramidSelectionMakerExtension >> selectAllElementsInBound: aBound [ { #category : #'as yet unclassified' } PyramidSelectionMakerExtension >> selectFirstElementAt: aPosition [ - | selectedElements | + | selectedElements filtered | self projectModel ifNil: [ ^ { } ]. selectedElements := self projectModel allElements select: [ :each | each boundsInSpace containsPoint: aPosition ]. selectedElements ifEmpty: [ ^ { } ]. - ^ { selectedElements last } + filtered := selectedElements select: [ :e | + e parentsShouldSerializeChildren ]. + filtered ifEmpty: [ ^ { selectedElements last } ]. + ^ { filtered last } ] { #category : #accessing } diff --git a/src/Pyramid-Bloc/PyramidShadowColorCommand.class.st b/src/Pyramid-Bloc/PyramidShadowColorCommand.class.st new file mode 100644 index 00000000..52bfd00c --- /dev/null +++ b/src/Pyramid-Bloc/PyramidShadowColorCommand.class.st @@ -0,0 +1,30 @@ +Class { + #name : #PyramidShadowColorCommand, + #superclass : #PyramidAbstractBlocCommand, + #category : #'Pyramid-Bloc-plugin-bloc-visuals' +} + +{ #category : #testing } +PyramidShadowColorCommand >> canBeUsedFor: anObject [ + + ^ (super canBeUsedFor: anObject) and: [ + anObject effect class = BlSimpleShadowEffect or: [ + anObject effect class = BlGaussianShadowEffect ] ] +] + +{ #category : #accessing } +PyramidShadowColorCommand >> getValueFor: aBlElement [ + + (aBlElement effect class = BlSimpleShadowEffect or: [ + aBlElement effect class = BlGaussianShadowEffect ]) ifFalse: [ ^ nil ]. + ^ aBlElement effect color +] + +{ #category : #accessing } +PyramidShadowColorCommand >> setValueFor: aBlElement with: aColor [ + + (aBlElement effect class = BlSimpleShadowEffect or: [ + aBlElement effect class = BlGaussianShadowEffect ]) ifFalse: [ ^ nil ]. + aBlElement effect: (aBlElement effect copyWithColor: aColor). + PyramidShadowCommand current syncFromElement: aBlElement +] diff --git a/src/Pyramid-Bloc/PyramidShadowCommand.class.st b/src/Pyramid-Bloc/PyramidShadowCommand.class.st new file mode 100644 index 00000000..6734091f --- /dev/null +++ b/src/Pyramid-Bloc/PyramidShadowCommand.class.st @@ -0,0 +1,61 @@ +Class { + #name : #PyramidShadowCommand, + #superclass : #PyramidAbstractBlocCommand, + #instVars : [ + 'lastSimpleShadow', + 'lastGaussianShadow' + ], + #classInstVars : [ + 'current' + ], + #category : #'Pyramid-Bloc-plugin-bloc-visuals' +} + +{ #category : #accessing } +PyramidShadowCommand class >> current [ + current ifNil: [ current := self new ]. + ^ current +] + +{ #category : #accessing } +PyramidShadowCommand class >> resetShadowCommand [ + + current := nil +] + +{ #category : #accessing } +PyramidShadowCommand >> getValueFor: aBlElement [ + + ^ aBlElement effect +] + +{ #category : #accessing } +PyramidShadowCommand >> lastGaussianShadow [ + ^ lastGaussianShadow ifNil: [ BlGaussianShadowEffect color: Color black width: 2 offset: 2 @ 2 ] +] + +{ #category : #accessing } +PyramidShadowCommand >> lastSimpleShadow [ + + ^ lastSimpleShadow ifNil: [ + BlSimpleShadowEffect color: Color black offset: 2 @ 2 ] +] + +{ #category : #accessing } +PyramidShadowCommand >> setValueFor: aBlElement with: anArgument [ + + anArgument class = BlSimpleShadowEffect ifTrue: [ + lastSimpleShadow := anArgument ]. + anArgument class = BlGaussianShadowEffect ifTrue: [ + lastGaussianShadow := anArgument ]. + aBlElement effect: anArgument +] + +{ #category : #updating } +PyramidShadowCommand >> syncFromElement: aBlElement [ + + aBlElement effect class = BlSimpleShadowEffect ifTrue: [ + lastSimpleShadow := aBlElement effect ]. + aBlElement effect class = BlGaussianShadowEffect ifTrue: [ + lastGaussianShadow := aBlElement effect ] +] diff --git a/src/Pyramid-Bloc/PyramidShadowGaussianWidthCommand.class.st b/src/Pyramid-Bloc/PyramidShadowGaussianWidthCommand.class.st new file mode 100644 index 00000000..c9e8984b --- /dev/null +++ b/src/Pyramid-Bloc/PyramidShadowGaussianWidthCommand.class.st @@ -0,0 +1,29 @@ +Class { + #name : #PyramidShadowGaussianWidthCommand, + #superclass : #PyramidAbstractBlocCommand, + #category : #'Pyramid-Bloc-plugin-bloc-visuals' +} + +{ #category : #testing } +PyramidShadowGaussianWidthCommand >> canBeUsedFor: anObject [ + + ^ (super canBeUsedFor: anObject) and: [ + anObject effect class = BlGaussianShadowEffect ] +] + +{ #category : #accessing } +PyramidShadowGaussianWidthCommand >> getValueFor: aBlElement [ + + (aBlElement effect class = BlSimpleShadowEffect or: [ + aBlElement effect class = BlGaussianShadowEffect ]) ifFalse: [ ^ nil ]. + ^ aBlElement effect width +] + +{ #category : #accessing } +PyramidShadowGaussianWidthCommand >> setValueFor: aBlElement with: aWidth [ + + (aBlElement effect class = BlSimpleShadowEffect or: [ + aBlElement effect class = BlGaussianShadowEffect ]) ifFalse: [ ^ nil ]. + aBlElement effect: (aBlElement effect copyWithWidth: aWidth). + PyramidShadowCommand current syncFromElement: aBlElement +] diff --git a/src/Pyramid-Bloc/PyramidShadowOffsetCommand.class.st b/src/Pyramid-Bloc/PyramidShadowOffsetCommand.class.st new file mode 100644 index 00000000..73737e5e --- /dev/null +++ b/src/Pyramid-Bloc/PyramidShadowOffsetCommand.class.st @@ -0,0 +1,29 @@ +Class { + #name : #PyramidShadowOffsetCommand, + #superclass : #PyramidAbstractBlocCommand, + #category : #'Pyramid-Bloc-plugin-bloc-visuals' +} + +{ #category : #testing } +PyramidShadowOffsetCommand >> canBeUsedFor: anObject [ + + ^ (super canBeUsedFor: anObject) and: [ + anObject effect class = BlSimpleShadowEffect or: [anObject effect class = BlGaussianShadowEffect] ] +] + +{ #category : #accessing } +PyramidShadowOffsetCommand >> getValueFor: aBlElement [ + + (aBlElement effect class = BlSimpleShadowEffect or: [ + aBlElement effect class = BlGaussianShadowEffect ]) ifFalse: [ ^ nil ]. + ^ aBlElement effect offset +] + +{ #category : #accessing } +PyramidShadowOffsetCommand >> setValueFor: aBlElement with: aPoint [ + + (aBlElement effect class = BlSimpleShadowEffect or: [ + aBlElement effect class = BlGaussianShadowEffect ]) ifFalse: [ ^ nil ]. + aBlElement effect: (aBlElement effect copyWithOffset: aPoint). + PyramidShadowCommand current syncFromElement: aBlElement +] diff --git a/src/Pyramid-Bloc/PyramidTextForegroundCommand.class.st b/src/Pyramid-Bloc/PyramidTextForegroundCommand.class.st index ac96ad6e..e904f324 100644 --- a/src/Pyramid-Bloc/PyramidTextForegroundCommand.class.st +++ b/src/Pyramid-Bloc/PyramidTextForegroundCommand.class.st @@ -4,7 +4,7 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-text' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidTextForegroundCommand >> getValueFor: aBlTextElement [ aBlTextElement text attributesFinder @@ -14,7 +14,7 @@ PyramidTextForegroundCommand >> getValueFor: aBlTextElement [ ^ Color black ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidTextForegroundCommand >> setValueFor: aBlTextElement with: aColor [ aBlTextElement text attribute: diff --git a/src/Pyramid-Bloc/PyramidToButtonEndIconCommand.class.st b/src/Pyramid-Bloc/PyramidToButtonEndIconCommand.class.st new file mode 100644 index 00000000..3c9bb5ad --- /dev/null +++ b/src/Pyramid-Bloc/PyramidToButtonEndIconCommand.class.st @@ -0,0 +1,28 @@ +Class { + #name : #PyramidToButtonEndIconCommand, + #superclass : #PyramidAbstractBlocCommand, + #category : #'Pyramid-Bloc-plugin-bloc-editor' +} + +{ #category : #testing } +PyramidToButtonEndIconCommand >> canBeUsedFor: anObject [ + + ^ (super canBeUsedFor: anObject) and: [ anObject class = ToButton ] +] + +{ #category : #getter } +PyramidToButtonEndIconCommand >> getValueFor: aToButton [ + ^ (PyramidMainExtension currentProjectIcons + at: aToButton id , '_endIcon' ifAbsent: [ nil ]) + ifNil: [ '' ] +] + +{ #category : #setter } +PyramidToButtonEndIconCommand >> setValueFor: aToButton with: aSymbol [ + + aToButton endIcon: + (PyramidIconInputPresenter toImageFromName: aSymbol). + PyramidMainExtension + addIconName: aSymbol + forElementId: aToButton id , '_endIcon' +] diff --git a/src/Pyramid-Bloc/PyramidToButtonIconCommand.class.st b/src/Pyramid-Bloc/PyramidToButtonIconCommand.class.st new file mode 100644 index 00000000..dafe7bb7 --- /dev/null +++ b/src/Pyramid-Bloc/PyramidToButtonIconCommand.class.st @@ -0,0 +1,27 @@ +Class { + #name : #PyramidToButtonIconCommand, + #superclass : #PyramidAbstractBlocCommand, + #category : #'Pyramid-Bloc-plugin-bloc-editor' +} + +{ #category : #testing } +PyramidToButtonIconCommand >> canBeUsedFor: anObject [ + + ^ (super canBeUsedFor: anObject) and: [ anObject class = ToButton ] +] + +{ #category : #getter } +PyramidToButtonIconCommand >> getValueFor: aToButton [ + ^ (PyramidMainExtension iconNameForElementId: aToButton id , '_icon') ifNil: [ '' ] + + +] + +{ #category : #setter } +PyramidToButtonIconCommand >> setValueFor: aToButton with: aSymbol [ + + aToButton icon: (PyramidIconInputPresenter toImageFromName: aSymbol). + PyramidMainExtension + addIconName: aSymbol + forElementId: aToButton id , '_icon' +] diff --git a/src/Pyramid-Bloc/PyramidToButtonLabelCommand.class.st b/src/Pyramid-Bloc/PyramidToButtonLabelCommand.class.st new file mode 100644 index 00000000..a73dabbe --- /dev/null +++ b/src/Pyramid-Bloc/PyramidToButtonLabelCommand.class.st @@ -0,0 +1,24 @@ +Class { + #name : #PyramidToButtonLabelCommand, + #superclass : #PyramidAbstractBlocCommand, + #category : #'Pyramid-Bloc-plugin-bloc-editor' +} + +{ #category : #testing } +PyramidToButtonLabelCommand >> canBeUsedFor: anObject [ + + ^ (super canBeUsedFor: anObject) and: [ + anObject class = ToButton ] +] + +{ #category : #getter } +PyramidToButtonLabelCommand >> getValueFor: anObject [ + + ^ anObject labelText ifNil: [ '' ] +] + +{ #category : #setter } +PyramidToButtonLabelCommand >> setValueFor: anObject with: aString [ + + anObject labelText: aString +] diff --git a/src/Pyramid-Bloc/PyramidToImageInnerImageCommand.class.st b/src/Pyramid-Bloc/PyramidToImageInnerImageCommand.class.st new file mode 100644 index 00000000..4925d79d --- /dev/null +++ b/src/Pyramid-Bloc/PyramidToImageInnerImageCommand.class.st @@ -0,0 +1,31 @@ +Class { + #name : #PyramidToImageInnerImageCommand, + #superclass : #PyramidAbstractBlocCommand, + #instVars : [ + 'iconName' + ], + #category : #'Pyramid-Bloc-plugin-bloc-editor' +} + +{ #category : #testing } +PyramidToImageInnerImageCommand >> canBeUsedFor: anObject [ + ^ (super canBeUsedFor: anObject) and: [ anObject class = ToImage ] +] + +{ #category : #getter } +PyramidToImageInnerImageCommand >> getValueFor: aToImage [ + + ^ (PyramidMainExtension currentProjectIcons + at: aToImage id asString, '_innerImage' + ifAbsent: [ nil ]) ifNil: [ '' ] +] + +{ #category : #setter } +PyramidToImageInnerImageCommand >> setValueFor: aToImage with: aSymbol [ + + aToImage innerImage: + (PyramidIconInputPresenter innerElementFromName: aSymbol). + PyramidMainExtension + addIconName: aSymbol + forElementId: aToImage id asString, '_innerImage' +] diff --git a/src/Pyramid-Bloc/PyramidToLabelTextCommand.class.st b/src/Pyramid-Bloc/PyramidToLabelTextCommand.class.st new file mode 100644 index 00000000..2bed4705 --- /dev/null +++ b/src/Pyramid-Bloc/PyramidToLabelTextCommand.class.st @@ -0,0 +1,21 @@ +Class { + #name : #PyramidToLabelTextCommand, + #superclass : #PyramidAbstractBlocCommand, + #category : #'Pyramid-Bloc-plugin-bloc-editor' +} + +{ #category : #testing } +PyramidToLabelTextCommand >> canBeUsedFor: anObject [ + + ^ (super canBeUsedFor: anObject) and: [ anObject class = ToLabel ] +] + +{ #category : #getter } +PyramidToLabelTextCommand >> getValueFor: aToLabel [ + ^ aToLabel text asString ifNil: [ '' ] +] + +{ #category : #setter } +PyramidToLabelTextCommand >> setValueFor: aToLabel with: aString [ + aToLabel text: aString +] diff --git a/src/Pyramid-Bloc/PyramidUndoDynamicResizeBlocCommand.class.st b/src/Pyramid-Bloc/PyramidUndoDynamicResizeBlocCommand.class.st index 6cf5688b..127f7083 100644 --- a/src/Pyramid-Bloc/PyramidUndoDynamicResizeBlocCommand.class.st +++ b/src/Pyramid-Bloc/PyramidUndoDynamicResizeBlocCommand.class.st @@ -11,19 +11,19 @@ PyramidUndoDynamicResizeBlocCommand >> canBeUsedFor: anObject [ anObject size ] ] -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidUndoDynamicResizeBlocCommand >> commandInverse [ ^ PyramidDynamicResizeCommand new ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidUndoDynamicResizeBlocCommand >> getValueFor: anObject [ ^ anObject userData at: #pyramidPreviousDynamicResize ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidUndoDynamicResizeBlocCommand >> setValueFor: anObject with: anArgument [ ^ anObject constraintsDo: [ :c | diff --git a/src/Pyramid-Bloc/PyramidUndoGroupCommand.class.st b/src/Pyramid-Bloc/PyramidUndoGroupCommand.class.st index 8fb36fa9..c6cd082c 100644 --- a/src/Pyramid-Bloc/PyramidUndoGroupCommand.class.st +++ b/src/Pyramid-Bloc/PyramidUndoGroupCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc-group' } -{ #category : #'as yet unclassified' } +{ #category : #history } PyramidUndoGroupCommand >> commandInverse [ ^ PyramidRedoGroupCommand new ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidUndoGroupCommand >> getValueFor: aBlElement [ ^ nil @@ -27,7 +27,7 @@ PyramidUndoGroupCommand >> positionChildrenOfGroupElement: groupElement [ child constraints position + (currentLeft @ currentTop) ] ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidUndoGroupCommand >> setValueFor: aCollectionToGroup with: aGroupModel [ "Remove children of group. Remove children of origin. diff --git a/src/Pyramid-Bloc/PyramidVisibilityCommand.class.st b/src/Pyramid-Bloc/PyramidVisibilityCommand.class.st index bb53e301..fd465919 100644 --- a/src/Pyramid-Bloc/PyramidVisibilityCommand.class.st +++ b/src/Pyramid-Bloc/PyramidVisibilityCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidVisibilityCommand >> getValueFor: aBlElement [ ^ aBlElement visibility ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidVisibilityCommand >> setValueFor: aBlElement with: anArgument [ aBlElement visibility: anArgument diff --git a/src/Pyramid-Bloc/PyramidVisualPystonForCly.class.st b/src/Pyramid-Bloc/PyramidVisualPystonForCly.class.st index bd92ec7f..254c297a 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/PyramidWeightConstraintsCommand.class.st b/src/Pyramid-Bloc/PyramidWeightConstraintsCommand.class.st index 19f60089..2586c90d 100644 --- a/src/Pyramid-Bloc/PyramidWeightConstraintsCommand.class.st +++ b/src/Pyramid-Bloc/PyramidWeightConstraintsCommand.class.st @@ -12,13 +12,13 @@ PyramidWeightConstraintsCommand >> canBeUsedFor: anObject [ { BlFlowLayout . BlLinearLayout } includes: anObject parent layout class ] ] ] -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidWeightConstraintsCommand >> getValueFor: anObject [ ^ anObject constraints linear weight ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidWeightConstraintsCommand >> setValueFor: anObject with: anArgument [ anObject constraints linear weight: anArgument. diff --git a/src/Pyramid-Bloc/PyramidZIndexCommand.class.st b/src/Pyramid-Bloc/PyramidZIndexCommand.class.st index 3e09f726..1ce22820 100644 --- a/src/Pyramid-Bloc/PyramidZIndexCommand.class.st +++ b/src/Pyramid-Bloc/PyramidZIndexCommand.class.st @@ -4,13 +4,13 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc' } -{ #category : #'as yet unclassified' } +{ #category : #getter } PyramidZIndexCommand >> getValueFor: aBlElement [ ^ aBlElement elevation elevation ] -{ #category : #'as yet unclassified' } +{ #category : #setter } PyramidZIndexCommand >> setValueFor: aBlElement with: anArgument [ aBlElement zIndex: anArgument diff --git a/src/Pyramid-Bloc/TPyramidEditorExtension.trait.st b/src/Pyramid-Bloc/TPyramidEditorExtension.trait.st index 231adbff..6dcdca47 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 6866c0ce..2125d066 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 [ -