SimpleBorder.st
author Claus Gittinger <cg@exept.de>
Thu, 29 Oct 2009 16:13:32 +0100
changeset 5432 983983b0c312
parent 5417 b4a2fe418cce
child 5437 75f2638be06f
permissions -rw-r--r--
comment/format in: #color: changed: #color

"
 COPYRIGHT (c) 1997 by eXept Software AG
 COPYRIGHT (c) 2009 by eXept Software AG
	      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.
"
"{ Package: 'stx:libview' }"

AbstractBorder subclass:#SimpleBorder
	instanceVariableNames:'color'
	classVariableNames:''
	poolDictionaries:''
	category:'Graphics-Support'
!

!SimpleBorder class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1997 by eXept Software AG
 COPYRIGHT (c) 2009 by eXept Software AG
	      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
"
    a simple border, where all four sides are drawn in the same solid color

    [author:]
        Claus Gittinger
"
! !

!SimpleBorder methodsFor:'accessing'!

color
    "the color of the border"

    ^ color
!

color:aColor
    "set the color of the border"

    width ~~ 0 ifTrue:[
        self assert:aColor notNil.
    ].
    color := aColor
! !

!SimpleBorder methodsFor:'displaying'!

displayOn:aGC forDisplayBox:aRectangle
    |oldPaint|

    color isNil ifTrue:[ ^ self].

    oldPaint := aGC paint.
    aGC paint:color.
    aGC displayRectangle:aRectangle.
    aGC paint:oldPaint.
! !

!SimpleBorder class methodsFor:'documentation'!

version_CVS
    ^ '$Header: /cvs/stx/stx/libview/SimpleBorder.st,v 1.5 2009-10-29 15:13:32 cg Exp $'
! !