Package pyjamas :: Package Canvas :: Module VMLContext
[hide private]
[frames] | no frames]

Source Code for Module pyjamas.Canvas.VMLContext

 1  """ 
 2  * Copyright 2008 Google Inc. 
 3  * 
 4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not 
 5  * use this file except in compliance with the License. You may obtain a copy of 
 6  * the License at 
 7  * 
 8  * http:#www.apache.org/licenses/LICENSE-2.0 
 9  * 
10  * Unless required by applicable law or agreed to in writing, software 
11  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 
13  * License for the specific language governing permissions and limitations under 
14  * the License. 
15  """ 
16   
17   
18  from pyjamas.Canvas import GWTCanvasConsts 
19  from pyjamas.Canvas import GWTCanvasImplIEConsts 
20   
21  """* 
22  * The VML context abstraction for the Internet Explorer implementation. 
23  """ 
24 -class VMLContext:
25
26 - def __init__(self, ctx=None):
27 28 29 if ctx is None: 30 31 # load identity matrix 32 self.matrix = [1, 0, 0, 33 0, 1, 0, 34 0, 0, 1] 35 36 # init other stuff 37 self.arcScaleX = 1 38 self.arcScaleY = 1 39 self.globalAlpha = 1 40 self.strokeAlpha = 1 41 self.fillAlpha = 1 42 self.miterLimit = 10 43 self.lineWidth = 1 44 self.lineCap = GWTCanvasImplIEConsts.BUTT 45 self.lineJoin = GWTCanvasConsts.MITER 46 self.strokeStyle = "#000" 47 self.fillStyle = "#000" 48 self.fillGradient = None 49 self.strokeGradient = None 50 self.globalCompositeOperation = GWTCanvasImplIEConsts.SOURCE_OVER 51 52 return 53 54 # copy the matrix 55 self.matrix = [] 56 for i in range(9): 57 self.matrix.append(ctx.matrix[i]) 58 59 # copy other stuff 60 self.arcScaleX = ctx.arcScaleX 61 self.arcScaleY = ctx.arcScaleY 62 self.globalAlpha = ctx.globalAlpha 63 self.strokeAlpha = ctx.strokeAlpha 64 self.fillAlpha = ctx.fillAlpha 65 self.miterLimit = ctx.miterLimit 66 self.lineWidth = ctx.lineWidth 67 self.lineCap = ctx.lineCap 68 self.lineJoin = ctx.lineJoin 69 self.strokeStyle = ctx.strokeStyle 70 self.fillStyle = ctx.fillStyle 71 self.fillGradient = ctx.fillGradient 72 self.strokeGradient = ctx.strokeGradient 73 self.globalCompositeOperation = ctx.globalCompositeOperation
74