663 ^group |
664 ^group |
664 ! |
665 ! |
665 |
666 |
666 iconOn:aGC |
667 iconOn:aGC |
667 |
668 |
668 (aGC registeredImageAt:iconKey) isNil |
669 |icon| |
|
670 iconKey isNil |
|
671 ifTrue: |
|
672 [ |
|
673 self validateAttributes. |
|
674 (imageFromFile isNil and: [iconKey == #imageFileIcon]) |
|
675 ifTrue: [icon := self retrieveImageFromFileAndRegisterOn: aGC] |
|
676 ]. |
|
677 imageFromFile |
|
678 ifFalse: [icon := aGC registerImage: (self class perform: iconKey) key: iconKey] |
|
679 ifTrue: [icon := aGC registeredImageAt: iconKey]. |
|
680 ^icon |
|
681 ! |
|
682 |
|
683 modified |
|
684 |
|
685 ^modified |
|
686 ! |
|
687 |
|
688 owner |
|
689 |
|
690 ^owner |
|
691 ! |
|
692 |
|
693 permissions |
|
694 |
|
695 ^permissions |
|
696 ! |
|
697 |
|
698 retrieveImageFromFileAndRegisterOn: aGC |
|
699 |
|
700 |image| |
|
701 imageFromFile := false. |
|
702 (image := aGC registeredImageAt: fileName name asSymbol) isNil |
669 ifTrue: |
703 ifTrue: |
670 [ |
704 [ |
671 self validateAttributes. |
705 size < 5000 |
672 ((iconKey == #imageFileIcon) and: [size < 5000]) |
|
673 ifTrue: |
706 ifTrue: |
674 [ |
707 [ |
675 Object errorSignal handle: [:ex|] |
708 Object errorSignal handle: [:ex|] |
676 do: |
709 do: |
677 [ |
710 [ |
678 |image| |
|
679 (image := Image fromFile: fileName name) notNil |
711 (image := Image fromFile: fileName name) notNil |
680 ifTrue: |
712 ifTrue: |
681 [ |
713 [ |
682 image extent y > 22 |
714 image extent y > 22 |
683 ifTrue: |
715 ifTrue: |
684 [ |
716 [ |
685 image := image magnifiedBy: 22/image extent y |
717 image := image magnifiedBy: 22/image extent y |
686 ]. |
718 ]. |
687 (aGC registeredImageAt: (iconKey := fileName name asSymbol)) isNil |
719 image := aGC registerImage: image key: fileName name asSymbol. |
688 ifTrue: |
|
689 [ |
|
690 aGC registerImage: image key: iconKey |
|
691 ] |
|
692 ] |
720 ] |
693 ] |
721 ] |
694 ] |
722 ]. |
695 ifFalse: |
723 ]. |
696 [ |
724 image notNil ifTrue: [imageFromFile := true. iconKey := fileName name asSymbol]. |
697 aGC registerImage: (self class perform: iconKey) key: iconKey |
725 ^image |
698 ] |
726 |
699 ]. |
727 |
700 ^aGC registeredImageAt: iconKey |
728 |
701 |
|
702 |
|
703 |
|
704 |
|
705 ! |
|
706 |
|
707 modified |
|
708 |
|
709 ^modified |
|
710 ! |
|
711 |
|
712 owner |
|
713 |
|
714 ^owner |
|
715 ! |
|
716 |
|
717 permissions |
|
718 |
|
719 ^permissions |
|
720 ! |
729 ! |
721 |
730 |
722 size |
731 size |
723 size isNumber ifFalse:[^ size]. |
732 size isNumber ifFalse:[^ size]. |
724 size < 1000 ifTrue: [^ size printString]. |
733 size < 1000 ifTrue: [^ size printString]. |