QSwingGraphics Class Reference

Extended QPainter. More...

#include <QSwingGraphics.h>

List of all members.

Public Member Functions

 QSwingGraphics (QPaintDevice *device)
 Constructs new QSwingGraphics object.
 QSwingGraphics (QPaintDevice *device, jint x, jint y, jint width, jint height)
 Constructs new QSwingGraphics object.
jobject getColor ()
 Returns current color of the graphics.
void setColor (jint argb)
 Sets current color of the graphics.
jobject getFont ()
 Returns current font of the graphics.
void setFont (jobject font)
 Sets current font of the graphics.
void setLinearGradient (jint x1, jint y1, jint argb1, jint x2, jint y2, jint argb2, jboolean cyclic)
 Sets linear gradient.
void setTextureGradient (QPixmap *image)
 Sets texture gradient.
void setBasicStroke (jfloat width, jint cap, jint join, jfloat miterLimit, jfloatArray dash, jfloat dashPhase)
 Sets basic stroke.
void push ()
 Pushes the state of the graphics.
void pop ()
 Pops the state of the graphics.
void drawImage (jbyteArray imageData, jint length, jint x, jint y)
 Pops the state of the graphics.
void fillRect (jint x, jint y, jint w, jint h)
 Fills rectangle.
void fillOval (jint x, jint y, jint w, jint h)
 Fills oval.

Static Public Member Functions

static bool canPaint (JNIEnv *env, jlong graphicsPointer)
 Tests if specifed graphics can paint.


Detailed Description

Extended QPainter.

Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)
Version:
0.2.0

Constructor & Destructor Documentation

QSwingGraphics::QSwingGraphics ( QPaintDevice *  device  ) 

Constructs new QSwingGraphics object.

Parameters:
device the QPaintDevice

QSwingGraphics::QSwingGraphics ( QPaintDevice *  device,
jint  x,
jint  y,
jint  width,
jint  height 
)

Constructs new QSwingGraphics object.

Parameters:
device the QPaintDevice
x the x coordinate of the clipping region
y the y coordinate of the clipping region
width the width of the clipping region
height the height of the clipping region


Member Function Documentation

jobject QSwingGraphics::getColor (  ) 

Returns current color of the graphics.

Returns:
current color of the graphics

void QSwingGraphics::setColor ( jint  argb  ) 

Sets current color of the graphics.

Parameters:
argb the argb value of the color

jobject QSwingGraphics::getFont (  ) 

Returns current font of the graphics.

Returns:
current font of the graphics

void QSwingGraphics::setFont ( jobject  font  ) 

Sets current font of the graphics.

Parameters:
font the QSwing font object

void QSwingGraphics::setLinearGradient ( jint  x1,
jint  y1,
jint  argb1,
jint  x2,
jint  y2,
jint  argb2,
jboolean  cyclic 
)

Sets linear gradient.

Parameters:
x1 the x coordinate of the gradient's start point
y1 the y coordinate of the gradient's start point
argb1 the argb value of the first color
x2 the x coordinate of the gradient's end point
y2 the y coordinate of the gradient's end point
argb2 the argb value of the second color
cyclic true if the gradient is cyclic

void QSwingGraphics::setTextureGradient ( QPixmap *  image  ) 

Sets texture gradient.

Parameters:
image the patern image

void QSwingGraphics::setBasicStroke ( jfloat  width,
jint  cap,
jint  join,
jfloat  miterLimit,
jfloatArray  dash,
jfloat  dashPhase 
)

Sets basic stroke.

Parameters:
width the stroke width
cap the stroke cap
join the stroke join
miterLimit the stroke miter limit
dash the stroke dash
dashPhase the stroke dash phase

void QSwingGraphics::drawImage ( jbyteArray  imageData,
jint  length,
jint  x,
jint  y 
)

Pops the state of the graphics.

Parameters:
imageData the image data
length the length of the image data
x the x coordinate of the image
y the y coordinate of the image

void QSwingGraphics::fillRect ( jint  x,
jint  y,
jint  w,
jint  h 
)

Fills rectangle.

Parameters:
x the x coordinate of the rectangle
y the y coordinate of the rectangle
w the width of the rectangle
h the height of the rectangle

void QSwingGraphics::fillOval ( jint  x,
jint  y,
jint  w,
jint  h 
)

Fills oval.

Parameters:
x the x coordinate of the oval
y the y coordinate of the oval
w the width of the oval
h the height of the oval

bool QSwingGraphics::canPaint ( JNIEnv *  env,
jlong  graphicsPointer 
) [inline, static]

Tests if specifed graphics can paint.

Parameters:
env the JNIEnv pointer
graphicsPointer the graphics pointer
Returns:
true if graphics object can paint


Copyright © 2007 ETF and contributors. All Rights Reserved.