--- a/StrokingWrapper.st Wed May 06 09:29:31 2009 +0200
+++ b/StrokingWrapper.st Wed May 06 09:29:41 2009 +0200
@@ -9,12 +9,10 @@
other person. No title to or ownership of the software is
hereby transferred.
"
-
-
"{ Package: 'stx:libview2' }"
-GeometricWrapper subclass:#StrokingWrapper
- instanceVariableNames:'lineWidth lineStyle capStyle joinStyle'
+StrokingOrFillingWrapper subclass:#StrokingWrapper
+ instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
category:'Compatibility-ST80-Graphics-Display Objects'
@@ -163,145 +161,16 @@
"
! !
-!StrokingWrapper methodsFor:'accessing'!
-
-bounds
- "return the boundary rectangle - here, must take care of the lineWidth"
-
- ^ (component bounds insetBy:(lineWidth // 2 + 1) negated) rounded
-
- "Created: 8.5.1996 / 23:22:43 / cg"
- "Modified: 5.6.1996 / 20:30:39 / cg"
-!
-
-capStyle
- "return the capStyle"
-
- ^ capStyle
-
- "Created: 8.5.1996 / 23:22:04 / cg"
- "Modified: 9.5.1996 / 00:09:12 / cg"
-!
-
-capStyle:aSymbol
- "set the capStyle"
-
- capStyle := aSymbol
-
- "Created: 8.5.1996 / 23:22:13 / cg"
- "Modified: 9.5.1996 / 00:09:17 / cg"
-!
-
-joinStyle
- "return the joinStyle"
-
- ^ joinStyle
-
- "Created: 8.5.1996 / 23:22:04 / cg"
- "Modified: 9.5.1996 / 00:09:12 / cg"
-!
-
-joinStyle:aSymbol
- "set the joinStyle"
-
- joinStyle := aSymbol
-
- "Created: 8.5.1996 / 23:22:13 / cg"
- "Modified: 9.5.1996 / 00:09:17 / cg"
-!
-
-lineStyle
- "return the lineStyle"
-
- ^ lineStyle
-
- "Created: 8.5.1996 / 23:22:04 / cg"
- "Modified: 9.5.1996 / 00:09:12 / cg"
-!
-
-lineStyle:aSymbol
- "set the lineStyle"
-
- lineStyle := aSymbol
-
- "Created: 8.5.1996 / 23:22:13 / cg"
- "Modified: 9.5.1996 / 00:09:17 / cg"
-!
-
-lineWidth
- "return the lineWidth"
-
- ^ lineWidth
-
- "Created: 8.5.1996 / 23:22:04 / cg"
- "Modified: 9.5.1996 / 00:09:12 / cg"
-!
-
-lineWidth:aNumber
- "set the lineWidth"
-
- lineWidth := aNumber
-
- "Created: 8.5.1996 / 23:22:13 / cg"
- "Modified: 9.5.1996 / 00:09:17 / cg"
-!
-
-preferredBounds
- "return the components bounds as preferredBounds"
-
- ^ (component bounds insetBy:(lineWidth / 2 + 1) negated) rounded
-
- "Created: 8.5.1996 / 23:23:00 / cg"
- "Modified: 5.6.1996 / 20:32:36 / cg"
-! !
-
!StrokingWrapper methodsFor:'displaying'!
displayOn:aGC
"display myself - here, display the geometric object asStroked"
- |prevLineWidth prevLineStyle prevCapStyle prevJoinStyle
- prevFg prevBg|
-
- prevLineWidth := aGC lineWidth.
- prevLineStyle := aGC lineStyle.
- prevJoinStyle := aGC joinStyle.
- prevCapStyle := aGC capStyle.
- prevFg := aGC paint.
- prevBg := aGC backgroundPaint.
-
- aGC lineWidth:lineWidth.
- aGC lineStyle:lineStyle.
- aGC joinStyle:joinStyle.
- aGC capStyle:capStyle.
- aGC paint:foregroundColor on:backgroundColor.
-
- component displayStrokedOn:aGC.
-
- aGC lineWidth:prevLineWidth.
- aGC lineStyle:prevLineStyle.
- aGC joinStyle:prevJoinStyle.
- aGC capStyle:prevCapStyle.
- aGC paint:prevFg on:prevBg.
-
- "Created: 8.5.1996 / 23:24:04 / cg"
- "Modified: 10.2.1997 / 14:21:33 / cg"
-! !
-
-!StrokingWrapper methodsFor:'initialization'!
-
-initialize
- "default my lineWidth to one pixel"
-
- super initialize.
- lineWidth := 1.
-
- "Created: 8.5.1996 / 23:49:27 / cg"
- "Modified: 9.5.1996 / 00:11:51 / cg"
+ self displayStrokedOn:aGC
! !
!StrokingWrapper class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview2/StrokingWrapper.st,v 1.15 2003-08-18 12:12:39 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview2/StrokingWrapper.st,v 1.16 2009-05-06 07:29:41 cg Exp $'
! !