Annotation.st
changeset 23242 7f3b0c84697e
parent 23225 5449dbd3cc02
child 23315 40e61e9592e9
--- 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 <jan.vrany@fit.cvut.cz>"
     "Modified: / 02-07-2010 / 16:22:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "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 <jan.vrany@fit.cvut.cz>"
     "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 <jan.vrany@fit.cvut.cz>"
 !
 
-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 <jan.vrany@fit.cvut.cz>"
     "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 <jan.vrany@fit.cvut.cz>"
     "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 <jan.vrany@fit.cvut.cz>"
 ! !
 
+!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