Skip to content

Commit

Permalink
Added style methods
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Nov 13, 2024
1 parent bdbf5e7 commit 0a7ed9b
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 7 deletions.
36 changes: 36 additions & 0 deletions repository/OpenPonk-Core/OPCoreIcons.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,30 @@ cICBgeEKAwODArKEBQkG/WBgYLBmYGCYwsDA0MDAwNDIwsDA4E+iN/5D2cEMDAyNpHolF2pA
LkyAhQTNdxgYGJ7gixFCQGc0NWMHAKweDmH+UsOrAAAAAElFTkSuQmCC'
]

{ #category : 'as yet unclassified' }
OPCoreIcons class >> opHideLabelsContents [

^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAOklEQVQoz2NkYGD4/5+RASdgYWBgYGBk4EcT/sjwH1nBf9wGMDAxEACjCqilgAVCCaAJf4CzGAlFNwAbkwgipGLcfgAAAABJRU5ErkJggg=='
]

{ #category : 'as yet unclassified' }
OPCoreIcons class >> opHideLabelsIcon [

^ Form fromBinaryStream: self opHideLabelsContents base64Decoded asByteArray readStream
]

{ #category : 'as yet unclassified' }
OPCoreIcons class >> opHideSameLabelsContents [

^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAPElEQVQoz2NkYGD4/5+RASdgYWBgYGBk4Gdl+I0s/JHhP5TFSMgEJgYCYFQBtRSwQCiB/6jCH+CxQzCyAP9OCx+tRQshAAAAAElFTkSuQmCC'
]

{ #category : 'as yet unclassified' }
OPCoreIcons class >> opHideSameLabelsIcon [

^ Form fromBinaryStream: self opHideSameLabelsContents base64Decoded asByteArray readStream
]

{ #category : 'as yet unclassified' }
OPCoreIcons class >> opMcDiagramIcon [

Expand Down Expand Up @@ -1193,6 +1217,18 @@ PAEf7Xb7qtFooEAggBiGOQbv36xNa8wQkUgkXhVQOp0WwWABYroDY42LxSLv9XofarXaMxhr
v/dmQSaCxb50u11+8hs/gG99/Qf21bg5RlgkZQAAAABJRU5ErkJggg=='
]

{ #category : 'as yet unclassified' }
OPCoreIcons class >> opShowLabelsContents [

^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAPUlEQVQoz2NkYGD4/5+RASdgYWBgYGBk4P+PKvyR8T+ygv8MDDjNYGIgAEYVUEsBC4QSQIusD/C4YSQU3QA+VwojR7FvAAAAAABJRU5ErkJggg=='
]

{ #category : 'as yet unclassified' }
OPCoreIcons class >> opShowLabelsIcon [

^ Form fromBinaryStream: self opShowLabelsContents base64Decoded asByteArray readStream
]

{ #category : 'accessing - icons' }
OPCoreIcons class >> opZoomIcon [

Expand Down
20 changes: 13 additions & 7 deletions repository/OpenPonk-Core/OPDiagramElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ OPDiagramElement >> createOwnedElementsWithoutController [

]

{ #category : 'testing' }
OPDiagramElement >> exists [

^ true
]

{ #category : 'instance creation' }
OPDiagramElement >> fromSton: stonReader [

Expand Down Expand Up @@ -417,6 +423,13 @@ OPDiagramElement >> remove [
self owningElement: nil
]

{ #category : 'accessing' }
OPDiagramElement >> removeLocalStylePropertyNamed: aName [

self localStyle ifNotNil: [ :style |
style removeKeyIfPresent: aName asSymbol ]
]

{ #category : 'removing' }
OPDiagramElement >> removeRender [

Expand All @@ -427,13 +440,6 @@ OPDiagramElement >> removeRender [
roassalShape := nil
]

{ #category : 'accessing' }
OPDiagramElement >> removeStylePropertyNamed: aName [

self localStyle ifNotNil: [ :style |
style removeKey: aName ifAbsent: [ ] ]
]

{ #category : 'rendering' }
OPDiagramElement >> renderBasicShape [

Expand Down
6 changes: 6 additions & 0 deletions repository/OpenPonk-Core/OPNoShape.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ OPNoShape >> doesNotExist [
^ true
]

{ #category : 'conditions' }
OPNoShape >> exists [

^ false
]

{ #category : 'conditions' }
OPNoShape >> ifExists: aFullBlockClosure [

Expand Down
21 changes: 21 additions & 0 deletions repository/OpenPonk-Core/OPShapeStyle.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,25 @@ OPShapeStyle >> at: aSymbol ifPresent: aBlock [
^ properties at: aSymbol ifPresent: aBlock
]

{ #category : 'accessing' }
OPShapeStyle >> at: aSymbol ifPresent: aBlock ifAbsent: anAbsentBlock [

^ properties at: aSymbol ifPresent: aBlock ifAbsent: anAbsentBlock
]

{ #category : 'accessing' }
OPShapeStyle >> at: aSymbol put: aValue [

properties at: aSymbol put: aValue.
self styledElements do: #styleChanged
]

{ #category : 'accessing' }
OPShapeStyle >> includesKey: aSymbol [

^ properties includesKey: aSymbol
]

{ #category : 'initialization' }
OPShapeStyle >> initialize [

Expand All @@ -87,6 +99,15 @@ OPShapeStyle >> removeKey: aSymbol ifAbsent: aBlock [
^ result
]

{ #category : 'removing' }
OPShapeStyle >> removeKeyIfPresent: aSymbol [

| result |
result := properties removeKey: aSymbol ifAbsent: [ ^ nil ].
self styledElements do: #styleChanged.
^ result
]

{ #category : 'accessing' }
OPShapeStyle >> removedFromStyledElement: aDiagramElement [

Expand Down

0 comments on commit 0a7ed9b

Please sign in to comment.