equal
deleted
inserted
replaced
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 package org.eclipse.swt.widgets; |
17 package org.eclipse.swt.widgets; |
18 |
18 |
19 // this package is removed from Qt import org.eclipse.swt.internal.symbian. |
19 |
20 /*import org.eclipse.swt.internal.symbian.*;*/ |
|
21 import org.eclipse.swt.internal.*; |
20 import org.eclipse.swt.internal.*; |
22 import org.eclipse.swt.widgets.Control; |
21 import org.eclipse.swt.widgets.Control; |
23 import javax.microedition.m2g.*; |
22 import javax.microedition.m2g.*; |
24 import com.nokia.microedition.m2g.*; |
23 import com.nokia.microedition.m2g.*; |
25 import java.util.*; |
24 import java.util.*; |
27 import org.eclipse.swt.graphics.GC; |
26 import org.eclipse.swt.graphics.GC; |
28 import org.eclipse.swt.graphics.Rectangle; |
27 import org.eclipse.swt.graphics.Rectangle; |
29 import org.eclipse.swt.events.*; |
28 import org.eclipse.swt.events.*; |
30 import com.nokia.mj.impl.utils.Logger; |
29 import com.nokia.mj.impl.utils.Logger; |
31 import org.eclipse.swt.widgets.Internal_PackageSupport; |
30 import org.eclipse.swt.widgets.Internal_PackageSupport; |
32 import org.eclipse.swt.graphics.Internal_GfxPackageSupport; |
31 import org.eclipse.swt.graphics.Internal_GfxPackageSupport; |
33 |
32 |
34 |
33 |
35 |
34 |
36 /** |
35 /** |
37 * Control |
36 * Control |
69 /** |
68 /** |
70 * @see |
69 * @see |
71 */ |
70 */ |
72 public SVGAnimatorControl(SVGImage aSVGImage) |
71 public SVGAnimatorControl(SVGImage aSVGImage) |
73 { |
72 { |
74 |
|
75 |
|
76 iSVGImage = aSVGImage; |
73 iSVGImage = aSVGImage; |
77 iState = STATE_STOPPED; |
74 iState = STATE_STOPPED; |
78 // Create render context, use M2GScalableGraphics |
75 // Create render context, use M2GScalableGraphics |
79 // directly to get access to render method with native |
76 // directly to get access to render method with native |
80 // side clearing parameter |
77 // side clearing parameter |
92 parent = aParent; |
89 parent = aParent; |
93 display = aParent.display; |
90 display = aParent.display; |
94 |
91 |
95 // Init widget after parent and display are known |
92 // Init widget after parent and display are known |
96 //Have to create Widget. |
93 //Have to create Widget. |
97 //Workaround for Qt changes this method is now in with one int argument.L:\sf\app\jrt\javauis\eswt_qt\org.eclipse.swt\Eclipse SWT\qt\org\eclipse\swt\widgets\Control.java |
|
98 // int i =10; |
|
99 // createWidget(i); |
|
100 // internal_createWidget(); |
|
101 |
94 |
102 // Add this to necessary listeners |
95 // Add this to necessary listeners |
103 addControlListener(this); |
96 addControlListener(this); |
104 addKeyListener(this); |
97 addKeyListener(this); |
105 addMouseListener(this); |
98 addMouseListener(this); |
111 } |
104 } |
112 |
105 |
113 /** |
106 /** |
114 * @see org.eclipse.swt.widgets.Control#paint() |
107 * @see org.eclipse.swt.widgets.Control#paint() |
115 */ |
108 */ |
116 public void paintControl(PaintEvent e) { |
109 public void paintControl(PaintEvent e) |
|
110 { |
117 GC gc = e.gc; |
111 GC gc = e.gc; |
118 |
|
119 // Render image |
112 // Render image |
120 try |
113 try |
121 { |
114 { |
122 iSg.bindTarget(gc); |
115 iSg.bindTarget(gc); |
123 // Parameter true to use native side clearing |
116 // Parameter true to use native side clearing |
124 // -> animator background is always white |
117 // -> animator background is always white |
125 iSg.render(0, 0, iSVGImage, true); |
118 iSg.render(0, 0, iSVGImage, true); |
126 } |
119 } |
127 finally |
120 finally |
128 { |
121 { |
129 |
|
130 iSg.releaseTarget(); |
122 iSg.releaseTarget(); |
131 } |
123 } |
132 } |
124 } |
133 |
125 |
134 /** |
126 /** |