# HG changeset patch # User Claus Gittinger # Date 1532869395 -7200 # Node ID 7f3b0c84697e1efc7e7a4e579cc057f2f9cae3a9 # Parent af9e126e2855235e7b7ee520ee123f0f16b4dc43 #TUNING by cg class: Annotation class save some memory by sharing instances comment/format in: #HGRevision: #ignore:rationale: #ignore:rationale:author: #ignoreLintRule:rationale:author: #lint:rationale:author: #resource: changed: #key:arguments: #nameSpace: #resource:values: class: Annotation::NameSpace class added: #nameSpaceName: class: Annotation::Resource class definition class: Annotation::Resource class added: #documentation #type:value: class: Annotation::Unknown class added: #key:arguments: diff -r af9e126e2855 -r 7f3b0c84697e Annotation.st --- a/Annotation.st Sat Jul 28 12:02:42 2018 +0200 +++ b/Annotation.st Sun Jul 29 15:03:15 2018 +0200 @@ -1,3 +1,5 @@ +"{ Encoding: utf8 }" + " COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague All Rights Reserved @@ -43,7 +45,7 @@ Annotation subclass:#Resource instanceVariableNames:'' - classVariableNames:'' + classVariableNames:'SharedSimpleResources' poolDictionaries:'' privateIn:Annotation ! @@ -171,20 +173,21 @@ perform: key withArguments: arguments ]. - ^ Annotation::Unknown new - key: key arguments: arguments + ^ Annotation::Unknown key:key arguments:arguments "Created: / 19-05-2010 / 16:47:13 / Jan Vrany " "Modified: / 02-07-2010 / 16:22:17 / Jan Vrany " "Modified (format): / 16-07-2017 / 13:23:00 / cg" + "Modified: / 29-07-2018 / 14:52:13 / Claus Gittinger" ! -nameSpace: aString +nameSpace:aString - ^Annotation::NameSpace new nameSpaceName: aString + ^Annotation::NameSpace nameSpaceName:aString "Created: / 19-05-2010 / 16:01:51 / Jan Vrany " "Created: / 26-07-2012 / 23:05:28 / cg" + "Modified (format): / 29-07-2018 / 14:55:44 / Claus Gittinger" ! namespace: aString @@ -195,24 +198,26 @@ "Created: / 19-05-2010 / 16:01:51 / Jan Vrany " ! -resource: type +resource:type "resource method - returns menu, spec or image, or accesses/uses the viewStyle" - ^Annotation::Resource new type: type value:nil + ^Annotation::Resource type:type value:nil "Created: / 16-07-2010 / 11:31:37 / Jan Vrany " "Modified (comment): / 16-07-2017 / 13:23:47 / cg" + "Modified (format): / 29-07-2018 / 14:55:50 / Claus Gittinger" ! resource:type values:value "resource method - returns menu, spec or image, or accesses/uses the viewStyle" - ^ Annotation::Resource new type:type value:value + ^ Annotation::Resource type:type value:value "Created: / 16-07-2010 / 11:31:49 / Jan Vrany " "Modified (comment): / 16-07-2017 / 13:23:53 / cg" + "Modified: / 29-07-2018 / 14:50:49 / Claus Gittinger" ! ! !Annotation class methodsFor:'finding'! @@ -567,6 +572,14 @@ ^ false ! ! +!Annotation::NameSpace class methodsFor:'instance creation'! + +nameSpaceName:aString + ^ self new nameSpaceName:aString + + "Created: / 29-07-2018 / 14:51:26 / Claus Gittinger" +! ! + !Annotation::NameSpace methodsFor:'accessing'! key @@ -621,6 +634,38 @@ "Modified: / 20-05-2010 / 11:18:40 / Jan Vrany " ! ! +!Annotation::Resource class methodsFor:'documentation'! + +documentation +" + documentation to be added. + + [author:] + Claus Gittinger + + [instance variables:] + + [class variables:] + + [see also:] + +" +! ! + +!Annotation::Resource class methodsFor:'instance creation'! + +type:type value:value + (value isNil) ifTrue:[ + SharedSimpleResources isNil ifTrue:[ + SharedSimpleResources := IdentityDictionary new. + ]. + ^ SharedSimpleResources at:type ifAbsentPut:[self new type:type value:value] + ]. + ^ self new type:type value:value + + "Created: / 29-07-2018 / 14:50:33 / Claus Gittinger" +! ! + !Annotation::Resource methodsFor:'accessing'! type @@ -684,6 +729,14 @@ "Created: / 18-07-2012 / 19:28:46 / cg" ! ! +!Annotation::Unknown class methodsFor:'instance creation'! + +key:key arguments:arguments + ^ self new key:key arguments:arguments + + "Created: / 29-07-2018 / 14:52:00 / Claus Gittinger" +! ! + !Annotation::Unknown methodsFor:'accessing'! method