From 0a8eeb028a6c4993bb7047237783c5ea5bec7f69 Mon Sep 17 00:00:00 2001 From: LesageYann Date: Mon, 16 May 2022 14:49:45 +0200 Subject: [PATCH] Provide facilities when a TLStyleSheet doesn't have all properties fill --- src/Telescope-Core/TLStyleSheet.class.st | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Telescope-Core/TLStyleSheet.class.st b/src/Telescope-Core/TLStyleSheet.class.st index c7ff824..9301738 100644 --- a/src/Telescope-Core/TLStyleSheet.class.st +++ b/src/Telescope-Core/TLStyleSheet.class.st @@ -172,6 +172,11 @@ TLStyleSheet >> connectionStyle: aConnectionStyle [ ^ self at: #connectionStyle put: aConnectionStyle ] +{ #category : #copying } +TLStyleSheet >> copySafeWithout: aCollectionOfProperties [ + ^ self copy removeSafeAll: aCollectionOfProperties; yourself +] + { #category : #connection } TLStyleSheet >> curveStyle [ ^ self get: #curveStyle @@ -342,6 +347,20 @@ TLStyleSheet >> position: aPosition [ self at: #position put: aPosition ] +{ #category : #removing } +TLStyleSheet >> removeIfPresent: aString [ + [self remove: #shape] on: KeyNotFound do: [] +] + +{ #category : #removing } +TLStyleSheet >> removeSafeAll: aCollectionOfAttributes [ + aCollectionOfAttributes + do: [ :anAttribute | + [ self remove: anAttribute ] + on: KeyNotFound + do: [ ] ] +] + { #category : #shape } TLStyleSheet >> shape [ ^ self get: #shape