--- a/TranslWrpr.st Mon Feb 10 14:49:00 1997 +0100
+++ b/TranslWrpr.st Mon Feb 10 19:29:26 1997 +0100
@@ -216,22 +216,15 @@
!TranslatingWrapper methodsFor:'displaying'!
displayOn:aGC
- |oldTranslation oldPaint oldBgPaint|
+ |oldTranslation|
oldTranslation := aGC translation.
- oldPaint := aGC paint.
- oldBgPaint := aGC backgroundPaint.
-
- aGC translation:(origin + aGC translation).
- aGC paint:fgColor on:bgColor.
-
+ aGC translateBy:origin.
component displayOn:aGC.
-
aGC translation:oldTranslation.
- aGC paint:oldPaint on:oldBgPaint.
"Created: 26.5.1996 / 15:27:54 / cg"
- "Modified: 26.5.1996 / 16:13:44 / cg"
+ "Modified: 10.2.1997 / 19:29:21 / cg"
! !
!TranslatingWrapper methodsFor:'initialization'!
@@ -260,5 +253,5 @@
!TranslatingWrapper class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview2/Attic/TranslWrpr.st,v 1.4 1997-01-14 17:00:41 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview2/Attic/TranslWrpr.st,v 1.5 1997-02-10 18:29:26 cg Exp $'
! !
--- a/TranslatingWrapper.st Mon Feb 10 14:49:00 1997 +0100
+++ b/TranslatingWrapper.st Mon Feb 10 19:29:26 1997 +0100
@@ -216,22 +216,15 @@
!TranslatingWrapper methodsFor:'displaying'!
displayOn:aGC
- |oldTranslation oldPaint oldBgPaint|
+ |oldTranslation|
oldTranslation := aGC translation.
- oldPaint := aGC paint.
- oldBgPaint := aGC backgroundPaint.
-
- aGC translation:(origin + aGC translation).
- aGC paint:fgColor on:bgColor.
-
+ aGC translateBy:origin.
component displayOn:aGC.
-
aGC translation:oldTranslation.
- aGC paint:oldPaint on:oldBgPaint.
"Created: 26.5.1996 / 15:27:54 / cg"
- "Modified: 26.5.1996 / 16:13:44 / cg"
+ "Modified: 10.2.1997 / 19:29:21 / cg"
! !
!TranslatingWrapper methodsFor:'initialization'!
@@ -260,5 +253,5 @@
!TranslatingWrapper class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview2/TranslatingWrapper.st,v 1.4 1997-01-14 17:00:41 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview2/TranslatingWrapper.st,v 1.5 1997-02-10 18:29:26 cg Exp $'
! !
--- a/VComponent.st Mon Feb 10 14:49:00 1997 +0100
+++ b/VComponent.st Mon Feb 10 19:29:26 1997 +0100
@@ -13,7 +13,7 @@
Object subclass:#VisualComponent
- instanceVariableNames:'bounds fgColor bgColor'
+ instanceVariableNames:'bounds'
classVariableNames:''
poolDictionaries:''
category:'Graphics-Display Objects'
@@ -164,26 +164,6 @@
"Created: 19.7.1996 / 17:24:58 / cg"
! !
-!VisualComponent methodsFor:'accessing - look'!
-
-backgroundColor:aColor
- "set my backgroundColor"
-
- bgColor := aColor
-
- "Created: 8.5.1996 / 23:47:11 / cg"
- "Modified: 9.5.1996 / 00:13:33 / cg"
-!
-
-foregroundColor:aColor
- "set my foregroundColor"
-
- fgColor := aColor
-
- "Created: 8.5.1996 / 23:47:05 / cg"
- "Modified: 9.5.1996 / 00:13:39 / cg"
-! !
-
!VisualComponent methodsFor:'accessing-mvc'!
model
@@ -196,18 +176,36 @@
!VisualComponent methodsFor:'displaying'!
-displayOn:aGC x:x y:y
+displayOn:aGC
+ "display the receiver on some graphicsContext.
+ The sender is repsonsible for restoring the GC's state
+ (i.e. it may be left in any undefined state)"
+
+ self subclassResponsibility
+
+ "Modified: 10.2.1997 / 13:53:03 / cg"
+!
+
+displayOn:aGC at:aPoint
+ "display the receiver translated by some amount on some graphicsContext"
+
|oldTranslation|
oldTranslation := aGC translation.
- aGC translation:(x @ y).
-
+ aGC translateBy:aPoint.
self displayOn:aGC.
-
aGC translation:oldTranslation
- "Created: 13.5.1996 / 10:18:43 / cg"
- "Modified: 13.5.1996 / 11:18:24 / cg"
+ "Created: 10.2.1997 / 13:47:18 / cg"
+ "Modified: 10.2.1997 / 13:52:53 / cg"
+!
+
+displayOn:aGC x:x y:y
+ "display the receiver translated by some amount on some graphicsContext"
+
+ ^ self displayOn:aGC at:(x @ y).
+
+ "Modified: 10.2.1997 / 13:52:57 / cg"
! !
!VisualComponent methodsFor:'event handling'!
@@ -262,10 +260,8 @@
!VisualComponent methodsFor:'initialization'!
initialize
- fgColor := Color black.
- bgColor := Color white.
- "Created: 8.5.1996 / 23:49:54 / cg"
+ "Modified: 10.2.1997 / 19:28:11 / cg"
! !
!VisualComponent methodsFor:'queries'!
@@ -340,5 +336,5 @@
!VisualComponent class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview2/Attic/VComponent.st,v 1.13 1997-01-14 17:02:37 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview2/Attic/VComponent.st,v 1.14 1997-02-10 18:28:29 cg Exp $'
! !
--- a/VisualComponent.st Mon Feb 10 14:49:00 1997 +0100
+++ b/VisualComponent.st Mon Feb 10 19:29:26 1997 +0100
@@ -13,7 +13,7 @@
Object subclass:#VisualComponent
- instanceVariableNames:'bounds fgColor bgColor'
+ instanceVariableNames:'bounds'
classVariableNames:''
poolDictionaries:''
category:'Graphics-Display Objects'
@@ -164,26 +164,6 @@
"Created: 19.7.1996 / 17:24:58 / cg"
! !
-!VisualComponent methodsFor:'accessing - look'!
-
-backgroundColor:aColor
- "set my backgroundColor"
-
- bgColor := aColor
-
- "Created: 8.5.1996 / 23:47:11 / cg"
- "Modified: 9.5.1996 / 00:13:33 / cg"
-!
-
-foregroundColor:aColor
- "set my foregroundColor"
-
- fgColor := aColor
-
- "Created: 8.5.1996 / 23:47:05 / cg"
- "Modified: 9.5.1996 / 00:13:39 / cg"
-! !
-
!VisualComponent methodsFor:'accessing-mvc'!
model
@@ -196,18 +176,36 @@
!VisualComponent methodsFor:'displaying'!
-displayOn:aGC x:x y:y
+displayOn:aGC
+ "display the receiver on some graphicsContext.
+ The sender is repsonsible for restoring the GC's state
+ (i.e. it may be left in any undefined state)"
+
+ self subclassResponsibility
+
+ "Modified: 10.2.1997 / 13:53:03 / cg"
+!
+
+displayOn:aGC at:aPoint
+ "display the receiver translated by some amount on some graphicsContext"
+
|oldTranslation|
oldTranslation := aGC translation.
- aGC translation:(x @ y).
-
+ aGC translateBy:aPoint.
self displayOn:aGC.
-
aGC translation:oldTranslation
- "Created: 13.5.1996 / 10:18:43 / cg"
- "Modified: 13.5.1996 / 11:18:24 / cg"
+ "Created: 10.2.1997 / 13:47:18 / cg"
+ "Modified: 10.2.1997 / 13:52:53 / cg"
+!
+
+displayOn:aGC x:x y:y
+ "display the receiver translated by some amount on some graphicsContext"
+
+ ^ self displayOn:aGC at:(x @ y).
+
+ "Modified: 10.2.1997 / 13:52:57 / cg"
! !
!VisualComponent methodsFor:'event handling'!
@@ -262,10 +260,8 @@
!VisualComponent methodsFor:'initialization'!
initialize
- fgColor := Color black.
- bgColor := Color white.
- "Created: 8.5.1996 / 23:49:54 / cg"
+ "Modified: 10.2.1997 / 19:28:11 / cg"
! !
!VisualComponent methodsFor:'queries'!
@@ -340,5 +336,5 @@
!VisualComponent class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview2/VisualComponent.st,v 1.13 1997-01-14 17:02:37 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview2/VisualComponent.st,v 1.14 1997-02-10 18:28:29 cg Exp $'
! !