nicer message / changed category
authorClaus Gittinger <cg@exept.de>
Thu, 07 Mar 1996 19:37:30 +0100
changeset 173 6bb37093ea47
parent 172 ee7d84977c86
child 174 7fafcc56378d
nicer message / changed category
Icon.st
--- a/Icon.st	Thu Mar 07 19:28:20 1996 +0100
+++ b/Icon.st	Thu Mar 07 19:37:30 1996 +0100
@@ -10,19 +10,27 @@
  hereby transferred.
 "
 
-'From Smalltalk/X, Version:2.10.5 on 14-apr-1995 at 11:13:06 am'!
-
 Object subclass:#Icon
-	 instanceVariableNames:'image mask'
-	 classVariableNames:'KnownIcons'
-	 poolDictionaries:''
-	 category:'Graphics-Support'
+	instanceVariableNames:'image mask'
+	classVariableNames:'KnownIcons'
+	poolDictionaries:''
+	category:'Graphics-Images'
 !
 
 !Icon class methodsFor:'documentation'!
 
-version
-    ^ '$Header: /cvs/stx/stx/libview2/Icon.st,v 1.6 1996-01-27 18:36:37 cg Exp $'
+copyright
+"
+ COPYRIGHT (c) 1995 by Claus Gittinger
+	      All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
 !
 
 documentation
@@ -41,24 +49,29 @@
     Caveat:
 	masks are not yet implemented
 "
-!
-
-copyright
-"
- COPYRIGHT (c) 1995 by Claus Gittinger
-	      All Rights Reserved
-
- This software is furnished under a license and may be used
- only in accordance with the terms of that license and with the
- inclusion of the above copyright notice.   This software may not
- be provided or otherwise made available to, or used by, any
- other person.  No title to or ownership of the software is
- hereby transferred.
-"
 ! !
 
 !Icon class methodsFor:'initialization'!
 
+initialize
+    KnownIcons isNil ifTrue:[
+	KnownIcons := IdentityDictionary new
+    ]
+
+    "
+     Icon initialize
+    "
+!
+
+replacementNameFor:aName
+    "return a replacement ST/X name for an ST80 icon name."
+
+    self replacementNames do:[:aPair |
+	(aPair at:1) == aName ifTrue:[^ aPair at:2].
+    ].
+    ^ nil
+!
+
 replacementNames
     "return an ST-80 constant name to ST/X file name translation."
 
@@ -76,51 +89,28 @@
 	#(inspector        Inspector)
 	#(default          SmalltalkX)
        )
-!
-
-replacementNameFor:aName
-    "return a replacement ST/X name for an ST80 icon name."
-
-    self replacementNames do:[:aPair |
-	(aPair at:1) == aName ifTrue:[^ aPair at:2].
-    ].
-    ^ nil
-!
-
-initialize
-    KnownIcons isNil ifTrue:[
-	KnownIcons := IdentityDictionary new
-    ]
-
-    "
-     Icon initialize
-    "
 ! !
 
 !Icon class methodsFor:'instance creation'!
 
-constantNamed:aName put:anIcon
-    KnownIcons at:aName put:anIcon
-!
-
 constantNamed:aName
     |icon nm|
 
     icon := KnownIcons at:aName ifAbsent:[].
     icon isNil ifTrue:[
-	nm := self replacementNameFor:aName.
-	nm notNil ifTrue:[
-	    icon := Image fromFile:('bitmaps/' , nm , '.xbm').
-	].
-	icon isNil ifTrue:[
-	    icon := Image fromFile:('bitmaps/' , aName , '.xbm').
-	    icon isNil ifTrue:[
-		('ICON: no icon named ' , aName) errorPrintNL.
-		^ nil
-	    ].
-	    icon := icon on:Screen default.
-	].
-	KnownIcons at:aName put:icon.
+        nm := self replacementNameFor:aName.
+        nm notNil ifTrue:[
+            icon := Image fromFile:('bitmaps/' , nm , '.xbm').
+        ].
+        icon isNil ifTrue:[
+            icon := Image fromFile:('bitmaps/' , aName , '.xbm').
+            icon isNil ifTrue:[
+                ('ICON: no icon named ' , aName) infoPrintNL.
+                ^ nil
+            ].
+            icon := icon on:Screen default.
+        ].
+        KnownIcons at:aName put:icon.
     ].
     ^ icon
 
@@ -131,6 +121,17 @@
      Icon constantNamed:#SBrowser     
      Icon constantNamed:#SBrowser     
     "
+
+    "Modified: 7.3.1996 / 19:17:15 / cg"
+!
+
+constantNamed:aName put:anIcon
+    KnownIcons at:aName put:anIcon
 ! !
 
+!Icon class methodsFor:'documentation'!
+
+version
+    ^ '$Header: /cvs/stx/stx/libview2/Icon.st,v 1.7 1996-03-07 18:37:30 cg Exp $'
+! !
 Icon initialize!