MappedPalette.st
author matilk
Wed, 13 Sep 2017 09:40:34 +0200
changeset 8174 2704c965b97b
parent 7954 975dd74ad78f
permissions -rw-r--r--
#BUGFIX by Maren class: DeviceGraphicsContext changed: #displayDeviceOpaqueForm:x:y: nil check
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3847
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
7954
975dd74ad78f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7837
diff changeset
     2
 COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG 
975dd74ad78f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7837
diff changeset
     3
              All Rights Reserved
3847
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
7837
2af7483d8ef9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3876
diff changeset
    12
"{ Package: 'stx:libview' }"
3847
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
7837
2af7483d8ef9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3876
diff changeset
    14
"{ NameSpace: Smalltalk }"
3847
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
ColorPalette subclass:#MappedPalette
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:''
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
3848
84597432b833 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
    20
	category:'Graphics-Images-Support'
3847
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!MappedPalette class methodsFor:'documentation'!
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
copyright
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"
7954
975dd74ad78f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7837
diff changeset
    27
 COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG 
975dd74ad78f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7837
diff changeset
    28
              All Rights Reserved
3847
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 This software is furnished under a license and may be used
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 only in accordance with the terms of that license and with the
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 be provided or otherwise made available to, or used by, any
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 other person.  No title to or ownership of the software is
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 hereby transferred.
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
"
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
documentation
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
3848
84597432b833 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
    41
    This class will (sooner or later) take over and/or redefine some of the Colormap functionality.
84597432b833 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
    42
    This migration will be done both to cleanup the code and for VW compatibility.
3847
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
3848
84597432b833 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
    44
    Notice: For now, the whole functionality is still in Colormap
84597432b833 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
    45
84597432b833 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
    46
    [see also:]
84597432b833 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
    47
	Color Image Form
3847
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
"
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
! !
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
!MappedPalette class methodsFor:'instance creation'!
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
blackWhite
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    "ST-80 compatibility"
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
3873
1f62ad46a04a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3865
diff changeset
    56
    ^ self withColors:(Array with:(Color black) with:(Color white))
3847
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
!
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
monochromeDefault
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    "ST-80 compatibility"
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    ^ self whiteBlack
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    "Modified: 25.2.1997 / 18:57:34 / cg"
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
!
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
whiteBlack
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
    "ST-80 compatibility"
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
3873
1f62ad46a04a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3865
diff changeset
    70
    ^ self withColors:(Array with:(Color white) with:(Color black))
3847
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
3876
f4dc6267a30a getting rid of colorMap
Claus Gittinger <cg@exept.de>
parents: 3873
diff changeset
    72
    "
f4dc6267a30a getting rid of colorMap
Claus Gittinger <cg@exept.de>
parents: 3873
diff changeset
    73
     self whiteBlack
f4dc6267a30a getting rid of colorMap
Claus Gittinger <cg@exept.de>
parents: 3873
diff changeset
    74
    "
f4dc6267a30a getting rid of colorMap
Claus Gittinger <cg@exept.de>
parents: 3873
diff changeset
    75
3847
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    "Created: 7.10.1996 / 11:29:01 / cg"
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
    "Modified: 14.2.1997 / 17:43:31 / cg"
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
! !
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
7837
2af7483d8ef9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3876
diff changeset
    80
!MappedPalette methodsFor:'testing'!
2af7483d8ef9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3876
diff changeset
    81
2af7483d8ef9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3876
diff changeset
    82
isMappedPalette
2af7483d8ef9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3876
diff changeset
    83
    ^ true
2af7483d8ef9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3876
diff changeset
    84
2af7483d8ef9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3876
diff changeset
    85
    "Created: / 03-02-2017 / 21:41:06 / cg"
2af7483d8ef9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3876
diff changeset
    86
! !
2af7483d8ef9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3876
diff changeset
    87
3847
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
!MappedPalette class methodsFor:'documentation'!
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
version
7837
2af7483d8ef9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3876
diff changeset
    91
    ^ '$Header$'
3847
288ab85676aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
! !
7837
2af7483d8ef9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3876
diff changeset
    93