SimpleBorder.st
author Claus Gittinger <cg@exept.de>
Sat, 24 Oct 2009 16:03:56 +0200
changeset 5417 b4a2fe418cce
parent 5410 03d42dd62a01
child 5432 983983b0c312
permissions -rw-r--r--
*** empty log message ***

"
 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
    ^ color
!

color:aColor
    "set the width"

    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.4 2009-10-24 14:03:56 cg Exp $'
! !