class: UIPainterView
authorStefan Vogel <sv@exept.de>
Tue, 18 Feb 2014 18:15:19 +0100
changeset 3083 0d6e497eb85f
parent 3082 e4df13b1a968
child 3084 02c5bb5ce4ee
class: UIPainterView changed: #create #newGrid #pasteSpecifications:into:beforeIndex:keepLayout:keepPosition:at: #rebuildView:fromSpec:withBuilder:forceNewView: get device via method call
UIPainterView.st
--- a/UIPainterView.st	Tue Feb 18 18:14:06 2014 +0100
+++ b/UIPainterView.st	Tue Feb 18 18:15:19 2014 +0100
@@ -413,7 +413,7 @@
         "/ ignore the selection and paste where we drop!!
         pastePoint := aPointOrNilOrKeep.
         pastePoint isNil ifTrue:[
-            pastePoint := device 
+            pastePoint := self graphicsDevice 
                                 translatePoint:(sensor mousePoint)
                                 fromView:nil
                                 toView:self.
@@ -493,14 +493,14 @@
             ] ifFalse:[
                 thisAbsOrigin := uiPainterAttributes at:#absOrigin.
 
-                newOrigin := device 
+                newOrigin := self graphicsDevice 
                                     translatePoint:thisAbsOrigin
                                     fromView:self
                                     toView:containerToPasteInto.
             ].
         ] ifFalse:[
             pastePoint isNil ifTrue:[ pastePoint := 0@0 ].
-            newOrigin := device 
+            newOrigin := self graphicsDevice 
                                 translatePoint:pastePoint
                                 fromView:self
                                 toView:containerToPasteInto.
@@ -1830,22 +1830,21 @@
     defaultViewBackground := self class defaultViewBackgroundColor.
 
     shown ifTrue:[
-	self viewBackground: (defaultViewBackground isColor
-	    ifTrue: [defaultViewBackground]
-	    ifFalse:[Black]).
-	self clear.
+        self viewBackground: (defaultViewBackground isColor
+            ifTrue: [defaultViewBackground]
+            ifFalse:[self blackColor]).
+        self clear.
     ].
 
     gridShown ifTrue:[
-	self defineGrid.
-	gridPixmap colorMap: (defaultViewBackground isColor
-	    ifTrue: [Array with:defaultViewBackground with:Color darkGray]
-	    ifFalse:[Array with:White with:Black]).
-	self viewBackground:gridPixmap.
+        self defineGrid.
+        gridPixmap colorMap: (defaultViewBackground isColor
+            ifTrue: [Array with:defaultViewBackground with:Color darkGray]
+            ifFalse:[Array with:self whiteColor with:self blackColor]).
+        self viewBackground:gridPixmap.
     ].
 
     self invalidate
-
 ! !
 
 !UIPainterView methodsFor:'group & ungroup'!
@@ -1979,9 +1978,9 @@
     "colors on device"
     
     super create.
-    handleColorBlack := handleColorBlack onDevice:device.
-    handleColorWhite := handleColorWhite onDevice:device.
-    handleMasterColor := handleMasterColor onDevice:device.
+    handleColorBlack := handleColorBlack onDevice:self graphicsDevice.
+    handleColorWhite := handleColorWhite onDevice:self graphicsDevice.
+    handleMasterColor := handleMasterColor onDevice:self graphicsDevice.
 !
 
 initialize
@@ -2576,8 +2575,7 @@
         v := aSpec buildViewWithLayoutFor:builder in:(self findContainerOfView:aView).
         v realize.
         aView destroy.
-        device sync.
-        device flush.
+        self sync.
         aView becomeSameAs:v.
         "/ inputView raise.
     ] ifFalse:[