158 |
setTransform( current ); |
setTransform( current ); |
159 |
} |
} |
160 |
|
|
161 |
// NOTE: Image here must be a QImage or wrapper! |
protected native void initImage(QtImage image); |
162 |
protected native void initImage(Image image); |
protected native void initVolatileImage(QtVolatileImage image); |
163 |
|
|
164 |
// Creates a new native QPainter object on the same context. |
// Creates a new native QPainter object on the same context. |
165 |
private native void cloneNativeContext( QtGraphics parent ); |
private native void cloneNativeContext( QtGraphics parent ); |
208 |
|
|
209 |
public void setColor(Color c) |
public void setColor(Color c) |
210 |
{ |
{ |
211 |
this.color = c; |
if( c == null ) |
212 |
|
c = Color.white; |
213 |
|
this.color = c; |
214 |
int alpha = (int)(c.getAlpha() * currentAlpha); |
int alpha = (int)(c.getAlpha() * currentAlpha); |
215 |
setColor(c.getRed(), c.getGreen(), c.getBlue(), alpha); |
setColor(c.getRed(), c.getGreen(), c.getBlue(), alpha); |
216 |
} |
} |
254 |
|
|
255 |
public void setFont(Font font) |
public void setFont(Font font) |
256 |
{ |
{ |
257 |
|
if( font == null ) |
258 |
|
return; |
259 |
this.font = font; |
this.font = font; |
260 |
if(font.getPeer() != null && font.getPeer() instanceof QtFontPeer) |
if(font.getPeer() != null && font.getPeer() instanceof QtFontPeer) |
261 |
setFontNative( (QtFontPeer)font.getPeer() ); |
setFontNative( (QtFontPeer)font.getPeer() ); |