Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 0 additions & 94 deletions src/Pyramid-Bloc/PyramidBlocGeometryPlugin.class.st

This file was deleted.

158 changes: 158 additions & 0 deletions src/Pyramid-Bloc/PyramidEditorPlugin.class.st
Original file line number Diff line number Diff line change
@@ -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.
]
2 changes: 1 addition & 1 deletion src/Pyramid-Bloc/PyramidGeometryCommand.class.st
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #PyramidGeometryCommand,
#superclass : #PyramidAbstractBlocCommand,
#category : #'Pyramid-Bloc-plugin-bloc-geometry'
#category : #'Pyramid-Bloc-plugin-bloc-editor'
}

{ #category : #getter }
Expand Down
13 changes: 13 additions & 0 deletions src/Pyramid-Bloc/PyramidLibraryElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Class {
'name',
'icon',
'block',
'provider',
'status'
],
#category : #'Pyramid-Bloc-plugin-navigation'
Expand Down Expand Up @@ -103,6 +104,18 @@ PyramidLibraryElement >> name: anObject [
name := anObject
]

{ #category : #accessing }
PyramidLibraryElement >> provider [

^ provider
]

{ #category : #accessing }
PyramidLibraryElement >> provider: aClass [

provider := aClass
]

{ #category : #accessing }
PyramidLibraryElement >> status [

Expand Down
43 changes: 37 additions & 6 deletions src/Pyramid-Bloc/PyramidMainExtension.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ Class {
'currentGridWindowSize',
'currentGridVisibility',
'currentGridSpacing',
'currentGridColor'
'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 [

Expand Down Expand Up @@ -73,6 +79,29 @@ 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 [

Expand Down Expand Up @@ -296,26 +325,28 @@ PyramidMainExtension >> informTransformationChanged [
{ #category : #initialization }
PyramidMainExtension >> initialize [
"Set the default parameter value of the grid"

self class currentGridWindowSize: self defaultExtent.
self class currentGridVisibility: self defaultGridVisibility.
self class currentGridSpacing: self defaultGridSpacing.
self class currentGridColor: self defaultGridColor.

self class resetCurrentProjectIcons.

gridWindowSize := self defaultExtent.
gridVisibility := self defaultGridVisibility.
gridSpacing := self defaultGridSpacing.
gridColor := self defaultGridColor.

"Set up the graphical parameter windows of the grid and the space extension"
workplacePropertiesView := PyramidWorkplacePropertiesPresenter new
workplaceSizeValue: self defaultExtent;
workplaceSizeValue: self defaultExtent;
whenWorkplaceValuesChangedDo: [ :point |
self extent: point ];
whenVisibilityChangedDo: [
gridVisibility := workplacePropertiesView
visibilityButton
state.
state.

self class currentGridVisibility:
gridVisibility.
self createGrid ];
Expand All @@ -341,7 +372,7 @@ PyramidMainExtension >> initialize [
self class currentGridColor: color.
self createGrid ];
yourself.
workplacePropertiesView visibilityButton state: gridVisibility.
workplacePropertiesView visibilityButton state: gridVisibility.


self defaultGridSpacing <= 0 ifTrue: [ gridSpacing := 1 ].
Expand Down
Loading
Loading