|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WPainter
public class WPainter
Vector graphics painting class.
The painter class provides a vector graphics interface for painting. It needs
to be used in conjunction with a WPaintDevice, onto which it paints.
To start painting on a device, either pass the device through the
constructor, or use begin().
A typical use is to instantiate a WPainter from within a specialized
WPaintedWidget#paintEvent() implementation, to paint on the given paint
device, but you can also use a painter to paint directly to a particular
paint device of choice, for example to create SVG, PDF or PNG images (as
resources).
The painter maintains state such as the current
pen, brush, font, shadow, transformation and clipping
settings (see setClipping() and
setClipPath()). A
particular state can be saved using save() and later
restored using restore().
The painting system distinguishes between device coordinates, logical
coordinates, and local coordinates. The device coordinate system ranges from
(0, 0) in the top left corner of the device, to (device.width().toPixels(),
device.height().toPixels()) for the bottom right corner. The logical
coordinate system defines a coordinate system that may be chosen independent
of the geometry of the device, which is convenient to make abstraction of the
actual device size. Finally, the current local coordinate system may be
different from the logical coordinate system because of a transformation set
(using translate(),
rotate(), and
scale()). Initially, the local
coordinate system coincides with the logical coordinate system, which
coincides with the device coordinate system.
The device coordinates are defined in terms of pixels. Even though most
underlying devices are actual vector graphics formats, when used in
conjunction with a WPaintedWidget, these vector graphics are rendered
by the browser onto a pixel-based canvas (like the rest of the
user-interface). The coordinates are defined such that integer values
correspond to an imaginary raster which separates the individual pixels, as
in the figure below.
The device coordinate system for a 6x5 pixel device
By setting a getViewPort() and a
getWindow(), a viewPort transformation is
defined which maps logical coordinates onto device coordinates. By changing
the world transformation (using
setWorldTransform(), or translate(),
rotate(),
scale() operations), it is
defined how current local coordinates map onto logical coordinates.
The painter provides support for clipping using an arbitrary
path, but not that the VmlImage only has limited support
for clipping.
WPaintedWidget.paintEvent(WPaintDevice paintDevice)| Nested Class Summary | |
|---|---|
static class |
WPainter.Image
An image that can be rendered on a WPainter. |
static class |
WPainter.RenderHint
Enumeration for render hints. |
| Constructor Summary | |
|---|---|
WPainter()
Default constructor. |
|
WPainter(WPaintDevice device)
Creates a painter on a given paint device. |
|
| Method Summary | |
|---|---|
boolean |
begin(WPaintDevice device)
Begins painting on a paint device. |
void |
drawArc(double x,
double y,
double width,
double height,
int startAngle,
int spanAngle)
Draws an arc. |
void |
drawArc(WRectF rectangle,
int startAngle,
int spanAngle)
Draws an arc. |
void |
drawChord(double x,
double y,
double width,
double height,
int startAngle,
int spanAngle)
Draws a chord. |
void |
drawChord(WRectF rectangle,
int startAngle,
int spanAngle)
Draws a chord. |
void |
drawEllipse(double x,
double y,
double width,
double height)
Draws an ellipse. |
void |
drawEllipse(WRectF rectangle)
Draws an ellipse. |
void |
drawImage(double x,
double y,
WPainter.Image image)
Draws part of an image. |
void |
drawImage(double x,
double y,
WPainter.Image image,
double sx)
Draws part of an image. |
void |
drawImage(double x,
double y,
WPainter.Image image,
double sx,
double sy)
Draws part of an image. |
void |
drawImage(double x,
double y,
WPainter.Image image,
double sx,
double sy,
double sw)
Draws part of an image. |
void |
drawImage(double x,
double y,
WPainter.Image image,
double sx,
double sy,
double sw,
double sh)
Draws part of an image. |
void |
drawImage(WPointF point,
WPainter.Image image)
Draws an image. |
void |
drawImage(WPointF point,
WPainter.Image image,
WRectF sourceRect)
Draws part of an image. |
void |
drawImage(WRectF rect,
WPainter.Image image)
Draws an image inside a rectangle. |
void |
drawImage(WRectF rect,
WPainter.Image image,
WRectF sourceRect)
Draws part of an image inside a rectangle. |
void |
drawLine(double x1,
double y1,
double x2,
double y2)
Draws a line. |
void |
drawLine(WLineF line)
Draws a line. |
void |
drawLine(WPointF p1,
WPointF p2)
Draws a line. |
void |
drawLines(WLineF[] lines,
int lineCount)
Draws an array of lines. |
void |
drawLines(WPointF[] pointPairs,
int lineCount)
Draws an array of lines. |
void |
drawLinesLine(java.util.List<WLineF> lines)
Draws an array of lines. |
void |
drawLinesPoint(java.util.List<WPointF> pointPairs)
Draws an array of lines. |
void |
drawPath(WPainterPath path)
Draws a (complex) path. |
void |
drawPie(double x,
double y,
double width,
double height,
int startAngle,
int spanAngle)
Draws a pie. |
void |
drawPie(WRectF rectangle,
int startAngle,
int spanAngle)
Draws a pie. |
void |
drawPoint(double x,
double y)
Draws a point. |
void |
drawPoint(WPointF point)
Draws a point. |
void |
drawPoints(WPointF[] points,
int pointCount)
Draws a number of points. |
void |
drawPolygon(WPointF[] points,
int pointCount)
Draws a polygon. |
void |
drawPolyline(WPointF[] points,
int pointCount)
Draws a polyline. |
void |
drawRect(double x,
double y,
double width,
double height)
Draws a rectangle. |
void |
drawRect(WRectF rectangle)
Draws a rectangle. |
void |
drawRects(java.util.List<WRectF> rectangles)
Draws a number of rectangles. |
void |
drawRects(WRectF[] rectangles,
int rectCount)
Draws a number of rectangles. |
void |
drawText(double x,
double y,
double width,
double height,
java.util.EnumSet<AlignmentFlag> flags,
java.lang.CharSequence text)
Draws text. |
void |
drawText(double x,
double y,
double width,
double height,
java.util.EnumSet<AlignmentFlag> alignmentFlags,
TextFlag textFlag,
java.lang.CharSequence text)
Draws text. |
void |
drawText(WRectF rectangle,
java.util.EnumSet<AlignmentFlag> flags,
java.lang.CharSequence text)
Draws text. |
void |
drawText(WRectF rectangle,
java.util.EnumSet<AlignmentFlag> alignmentFlags,
TextFlag textFlag,
java.lang.CharSequence text)
Draws text. |
boolean |
end()
Ends painting. |
void |
fillPath(WPainterPath path,
WBrush b)
Fills a (complex) path. |
void |
fillRect(double x,
double y,
double width,
double height,
WBrush brush)
Fills a rectangle. |
void |
fillRect(WRectF rectangle,
WBrush b)
Fills a rectangle. |
WBrush |
getBrush()
Returns the current brush. |
WPainterPath |
getClipPath()
Returns the clip path. |
WTransform |
getCombinedTransform()
Returns the combined transformation matrix. |
WPaintDevice |
getDevice()
Returns the device on which this painter is active (or 0 if not active). |
WFont |
getFont()
Returns the current font. |
WPen |
getPen()
Returns the current pen. |
int |
getRenderHints()
Returns the current render hints. |
WShadow |
getShadow()
Returns the current shadow effect. |
WRectF |
getViewPort()
Returns the viewport. |
WRectF |
getWindow()
Returns the current window. |
WTransform |
getWorldTransform()
Returns the current world transformation matrix. |
boolean |
hasClipping()
Returns whether clipping is enabled. |
boolean |
isActive()
Returns whether this painter is active on a paint device. |
void |
resetTransform()
Resets the current transformation. |
void |
restore()
Returns the last save state. |
void |
rotate(double angle)
Rotates the logical coordinate system. |
void |
save()
Saves the current state. |
void |
scale(double sx,
double sy)
Scales the logical coordinate system. |
void |
setBrush(WBrush b)
Sets the fill style. |
void |
setClipPath(WPainterPath clipPath)
Sets the clip path. |
void |
setClipping(boolean enable)
Enables or disables clipping. |
void |
setFont(WFont f)
Sets the font. |
void |
setPen(WPen p)
Sets the pen. |
void |
setRenderHint(WPainter.RenderHint hint)
Sets a render hint. |
void |
setRenderHint(WPainter.RenderHint hint,
boolean on)
Sets a render hint. |
void |
setShadow(WShadow shadow)
Sets a shadow effect. |
void |
setViewPort(double x,
double y,
double width,
double height)
Sets the viewport. |
void |
setViewPort(WRectF viewPort)
Sets the viewport. |
void |
setWindow(double x,
double y,
double width,
double height)
Sets the window. |
void |
setWindow(WRectF window)
Sets the window. |
void |
setWorldTransform(WTransform matrix)
Sets a transformation for the logical coordinate system. |
void |
setWorldTransform(WTransform matrix,
boolean combine)
Sets a transformation for the logical coordinate system. |
void |
strokePath(WPainterPath path,
WPen p)
Strokes a path. |
void |
translate(double dx,
double dy)
Translates the origin of the logical coordinate system. |
void |
translate(WPointF p)
Translates the origin of the logical coordinate system. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WPainter()
Before painting, you must invoke
begin() on a paint device.
WPainter(WPaintDevice device)public WPainter(WPaintDevice device)
| Method Detail |
|---|
public boolean begin(WPaintDevice device)
end(),
isActive()public boolean isActive()
begin(WPaintDevice device),
end()public boolean end()
public WPaintDevice getDevice()
begin(WPaintDevice device),
WPainter(WPaintDevice device),
isActive()
public void setRenderHint(WPainter.RenderHint hint,
boolean on)
Renderers may ignore particular hints for which they have no support.
public final void setRenderHint(WPainter.RenderHint hint)
Calls setRenderHint(hint, true)
public int getRenderHints()
Returns the logical OR of render hints currently set.
setRenderHint(WPainter.RenderHint hint, boolean on)
public void drawArc(WRectF rectangle,
int startAngle,
int spanAngle)
Draws an arc using the current pen, and fills using the current brush.
The arc is defined as a segment from an ellipse, which fits in the
rectangle. The segment starts at startAngle, and
spans an angle given by spanAngle. These angles have as unit
1/16th of a degree, and are measured counter-clockwise starting from the
3 o'clock position.
drawEllipse(WRectF rectangle),
drawChord(WRectF rectangle, int startAngle, int spanAngle),
drawArc(double x, double y, double width, double height,
int startAngle, int spanAngle)
public void drawArc(double x,
double y,
double width,
double height,
int startAngle,
int spanAngle)
This is an overloaded method for convenience.
drawArc(WRectF rectangle, int startAngle, int spanAngle)
public void drawChord(WRectF rectangle,
int startAngle,
int spanAngle)
Draws an arc using the current pen, and connects start and end point with a line. The area is filled using the current brush.
The arc is defined as a segment from an ellipse, which fits in the
rectangle. The segment starts at startAngle, and
spans an angle given by spanAngle. These angles have as unit
1/16th of a degree, and are measured counter-clockwise starting at 3
o'clock.
drawEllipse(WRectF rectangle),
drawArc(WRectF rectangle, int startAngle, int spanAngle),
drawChord(double x, double y, double width, double height,
int startAngle, int spanAngle)
public void drawChord(double x,
double y,
double width,
double height,
int startAngle,
int spanAngle)
This is an overloaded method for convenience.
drawChord(WRectF rectangle, int startAngle, int spanAngle)public void drawEllipse(WRectF rectangle)
Draws an ellipse using the current pen and fills it using the current brush.
The ellipse is defined as being bounded by the rectangle.
drawArc(WRectF rectangle, int startAngle, int spanAngle),
drawEllipse(double x, double y, double width, double
height)
public void drawEllipse(double x,
double y,
double width,
double height)
This is an overloaded method for convenience.
drawEllipse(WRectF rectangle)
public void drawImage(WPointF point,
WPainter.Image image)
Draws the image so that the top left corner corresponds to
point.
This is an overloaded method provided for convenience.
public void drawImage(WPointF point,
WPainter.Image image,
WRectF sourceRect)
Draws the sourceRect rectangle from an image to the location
point.
This is an overloaded method provided for convenience.
public void drawImage(WRectF rect,
WPainter.Image image)
Draws the image inside rect (If necessary, the image
is scaled to fit into the rectangle).
This is an overloaded method provided for convenience.
public void drawImage(WRectF rect,
WPainter.Image image,
WRectF sourceRect)
Draws the sourceRect rectangle from an image inside
rect (If necessary, the image is scaled to fit into the
rectangle).
public void drawImage(double x,
double y,
WPainter.Image image,
double sx,
double sy,
double sw,
double sh)
Draws the sourceRect rectangle with top left corner
(sx, sy) and size sw x sh from an image
to the location (x, y).
public final void drawImage(double x,
double y,
WPainter.Image image)
Calls
drawImage(x, y, image, 0, 0, - 1, - 1)
public final void drawImage(double x,
double y,
WPainter.Image image,
double sx)
Calls
drawImage(x, y, image, sx, 0, - 1, - 1)
public final void drawImage(double x,
double y,
WPainter.Image image,
double sx,
double sy)
Calls
drawImage(x, y, image, sx, sy, - 1, - 1)
public final void drawImage(double x,
double y,
WPainter.Image image,
double sx,
double sy,
double sw)
Calls
drawImage(x, y, image, sx, sy, sw, - 1)
public void drawLine(WLineF line)
Draws a line using the current pen.
drawLine(WPointF p1, WPointF p2),
drawLine(double x1, double y1, double x2, double y2)
public void drawLine(WPointF p1,
WPointF p2)
Draws a line defined by two points.
drawLine(WLineF line),
drawLine(double x1, double y1, double x2, double y2)
public void drawLine(double x1,
double y1,
double x2,
double y2)
Draws a line defined by two points.
drawLine(WLineF line),
drawLine(WPointF p1, WPointF p2)
public void drawLines(WLineF[] lines,
int lineCount)
Draws the lineCount first lines from the given array of
lines.
public void drawLines(WPointF[] pointPairs,
int lineCount)
Draws lineCount lines, where each line is specified using a
begin and end point that are read from an array. Thus, the
pointPairs array must have at least 2*lineCount
points.
public void drawLinesLine(java.util.List<WLineF> lines)
Draws the lines given in the vector.
public void drawLinesPoint(java.util.List<WPointF> pointPairs)
Draws a number of lines that are specified by pairs of begin- and endpoints. The vector should hold a number of points that is a multiple of two.
public void drawPath(WPainterPath path)
Draws and fills the given path using the current pen and brush.
strokePath(WPainterPath path, WPen p),
fillPath(WPainterPath path, WBrush b)
public void drawPie(WRectF rectangle,
int startAngle,
int spanAngle)
Draws an arc using the current pen, and connects start and end point with the center of the corresponding ellipse. The area is filled using the current brush.
The arc is defined as a segment from an ellipse, which fits in the
rectangle. The segment starts at startAngle, and
spans an angle given by spanAngle. These angles have as unit
1/16th of a degree, and are measured counter-clockwise starting at 3
o'clock.
drawEllipse(WRectF rectangle),
drawArc(WRectF rectangle, int startAngle, int spanAngle),
drawPie(double x, double y, double width, double height,
int startAngle, int spanAngle)
public void drawPie(double x,
double y,
double width,
double height,
int startAngle,
int spanAngle)
This is an overloaded method for convenience.
drawPie(WRectF rectangle, int startAngle, int spanAngle)public void drawPoint(WPointF point)
Draws a single point using the current pen. This is implemented by
drawing a very short line, centered around the given
position. To get the result of a single point, you should
use a pen with a PenCapStyle.SquareCap or
PenCapStyle.RoundCap pen cap style.
drawPoint(double x, double y)
public void drawPoint(double x,
double y)
This is an overloaded method for convenience.
drawPoint(WPointF point)
public void drawPoints(WPointF[] points,
int pointCount)
Draws the pointCount first points from the given array of
points.
drawPoint(WPointF point)
public void drawPolygon(WPointF[] points,
int pointCount)
Draws a polygon that is specified by a list of points, using the current pen. The polygon is closed by connecting the last point with the first point, and filled using the current brush.
drawPath(WPainterPath path),
drawPolyline(WPointF[] points, int pointCount)
public void drawPolyline(WPointF[] points,
int pointCount)
Draws a polyline that is specified by a list of points, using the current pen.
drawPath(WPainterPath path),
drawPolygon(WPointF[] points, int pointCount)public void drawRect(WRectF rectangle)
Draws and fills a rectangle using the current pen and brush.
drawRect(double x, double y, double width, double height)
public void drawRect(double x,
double y,
double width,
double height)
This is an overloaded method for convenience.
drawRect(WRectF rectangle)
public void drawRects(WRectF[] rectangles,
int rectCount)
Draws and fills the rectCount first rectangles from the
given array, using the current pen and brush.
drawRect(WRectF rectangle)public void drawRects(java.util.List<WRectF> rectangles)
Draws and fills a list of rectangles using the current pen and brush.
drawRect(WRectF rectangle)
public void drawText(WRectF rectangle,
java.util.EnumSet<AlignmentFlag> alignmentFlags,
TextFlag textFlag,
java.lang.CharSequence text)
Draws text using inside the rectangle, using the current font. The text
is aligned inside the rectangle following alignment indications given in
flags. The text is drawn using the current transformation,
pen color (getPen()) and font settings (
getFont()).
AlignmentFlags is the logical OR of a horizontal and vertical alignment. Horizontal alignment may be one of AlignLeft, AlignCenter, or AlignRight. Vertical alignment is one of AlignTop, AlignMiddle or AlignBottom.
TextFlag determines how the text is rendered in the rectangle. Text can be rendered on one line or by wrapping the words within the rectangle.
Note: HtmlCanvas: on older browsers implementing Html5 canvas, text will be rendered horizontally (unaffected by rotation and unaffected by the scaling component of the transformation matrix). In that case, text is overlayed on top of painted shapes (in DOM div's), and is not covered by shapes that are painted after the text. Use the SVG and VML renderers (WPaintedWidget::inlineSvgVml) for the most accurate font rendering. Native HTML5 text rendering is supported on Firefox3+, Chrome2+ and Safari4+.
TextWordWrap: using the TextWordWrap TextFlag is currently only supported by the SVG backend. The code generated by the SVG backend uses features currently only supported by Inkscape. Inkscape currently supports only Top vertical alignments.
public void drawText(WRectF rectangle,
java.util.EnumSet<AlignmentFlag> flags,
java.lang.CharSequence text)
This is an overloaded method for convenience, it will render text on a single line.
drawText(WRectF rectangle, EnumSet alignmentFlags, TextFlag
textFlag, CharSequence text)
public void drawText(double x,
double y,
double width,
double height,
java.util.EnumSet<AlignmentFlag> flags,
java.lang.CharSequence text)
This is an overloaded method for convenience.
drawText(WRectF rectangle, EnumSet flags, CharSequence
text)
public void drawText(double x,
double y,
double width,
double height,
java.util.EnumSet<AlignmentFlag> alignmentFlags,
TextFlag textFlag,
java.lang.CharSequence text)
This is an overloaded method for convenience.
drawText(WRectF rectangle, EnumSet alignmentFlags, TextFlag
textFlag, CharSequence text),
WRectF,
TextFlag,
WString
public void fillPath(WPainterPath path,
WBrush b)
Like drawPath(), but does
not stroke the path, and fills the path with the given brush.
drawPath(WPainterPath path),
strokePath(WPainterPath path, WPen p)
public void fillRect(WRectF rectangle,
WBrush b)
Like drawRect(), but does not
stroke the rect, and fills the rect with the given brush.
drawRect(WRectF rectangle)
public void fillRect(double x,
double y,
double width,
double height,
WBrush brush)
This is an overloaded method for convenience.
fillRect(WRectF rectangle, WBrush b)
public void strokePath(WPainterPath path,
WPen p)
Like drawPath(), but does
not fill the path, and strokes the path with the given pen.
drawPath(WPainterPath path),
fillPath(WPainterPath path, WBrush b)public void setShadow(WShadow shadow)
The shadow effect is applied to all things drawn (paths, text and images).
Note: With the VML backend (IE), the shadow is not applied to images, and the shadow color is always black; only the opacity (alpha) channel is taken into account.
WPainter.RenderHint.LowQualityShadowspublic WShadow getShadow()
setShadow(WShadow shadow)public void setBrush(WBrush b)
Changes the fills style for subsequent draw operations.
getBrush(),
setPen(WPen p)public void setFont(WFont f)
Changes the font for subsequent text rendering. Note that only font sizes
that are defined as an explicit size (see WFont.Size.FixedSize)
will render correctly in all devices (SVG, VML, and HtmlCanvas).
The list of fonts that will render correctly with VML (on IE<9) are limited to the following: http://www.ampsoft.net/webdesign-l/WindowsMacFonts.html
Careful, for a font family that contains a space, you need to add quotes,
to
WFont#setFamily() e.g.
WFont mono;
mono.setFamily(WFont::Monospace, "'Courier New'");
mono.setSize(18);
getFont(),
drawText(WRectF rectangle, EnumSet alignmentFlags, TextFlag
textFlag, CharSequence text)public void setPen(WPen p)
Changes the pen used for stroking subsequent draw operations.
getPen(),
setBrush(WBrush b)public WBrush getBrush()
Returns the brush style that is currently used for filling.
setBrush(WBrush b)public WFont getFont()
Returns the font that is currently used for rendering text. The default font is a 10pt sans serif font.
setFont(WFont f)public WPen getPen()
Returns the pen that is currently used for stroking.
setPen(WPen p)public void setClipping(boolean enable)
Enables are disables clipping for subsequent operations using the current
clip path set using setClipPath().
Note: Clipping is not supported for the VML renderer.
hasClipping(),
setClipPath(WPainterPath clipPath)public boolean hasClipping()
Note: Clipping is not supported for the VML renderer.
setClipping(boolean enable),
setClipPath(WPainterPath clipPath)public void setClipPath(WPainterPath clipPath)
Sets the path that is used for clipping subsequent drawing operations.
The clip path is only used when clipping is enabled using
setClipping(). The path is
specified in local coordinates.
Note: Only clipping with a rectangle is supported for the VML renderer
(see WPainterPath#addRect()). The rectangle must, after applying the combined
transformation system, be aligned with the window.
getClipPath(),
setClipping(boolean enable)public WPainterPath getClipPath()
The clip path is returned as it was defined: in the local coordinates at time of definition.
setClipPath(WPainterPath clipPath)public void resetTransform()
Resets the current transformation to the identity transformation matrix, so that the logical coordinate system coincides with the device coordinate system.
public void rotate(double angle)
Rotates the logical coordinate system around its origin. The
angle is specified in degrees, and positive values are
clock-wise.
scale(double sx, double sy),
translate(double dx, double dy),
resetTransform()
public void scale(double sx,
double sy)
Scales the logical coordinate system around its origin, by a factor in the X and Y directions.
rotate(double angle),
translate(double dx, double dy),
resetTransform()public void translate(WPointF p)
Translates the origin of the logical coordinate system to a new location relative to the current logical coordinate system.
translate(double dx, double dy),
rotate(double angle),
scale(double sx, double sy),
resetTransform()
public void translate(double dx,
double dy)
Translates the origin of the logical coordinate system to a new location relative to the logical coordinate system.
translate(WPointF p),
rotate(double angle),
scale(double sx, double sy),
resetTransform()
public void setWorldTransform(WTransform matrix,
boolean combine)
Sets a new transformation which transforms logical coordinates to device
coordinates. When combine is true, the
transformation is combined with the current world transformation matrix.
getWorldTransform(),
rotate(double angle),
scale(double sx, double sy),
translate(double dx, double dy),
resetTransform()public final void setWorldTransform(WTransform matrix)
Calls setWorldTransform(matrix, false)
public WTransform getWorldTransform()
setWorldTransform(WTransform matrix, boolean combine)public void save()
A copy of the current state is saved on a stack. This state will may
later be restored by popping this state from the stack using
restore().
The state that is saved is the current pen, brush,
font, shadow, transformation and clipping
settings (see setClipping()
and setClipPath()).
restore()public void restore()
Pops the last saved state from the state stack.
save()public void setViewPort(WRectF viewPort)
Selects the part of the device that will correspond to the logical coordinate system.
By default, the viewport spans the entire device: it is the rectangle (0, 0) to (device.width(), device.height()). The window defines how the viewport is mapped to logical coordinates.
getViewPort(),
setWindow(WRectF window)
public void setViewPort(double x,
double y,
double width,
double height)
This is an overloaded method for convenience.
setViewPort(WRectF viewPort)public WRectF getViewPort()
setViewPort(WRectF viewPort)public void setWindow(WRectF window)
Defines the viewport rectangle in logical coordinates, and thus how logical coordinates map onto the viewPort.
By default, is (0, 0) to (device.width(), device.height()). Thus, the default window and viewport leave logical coordinates identical to device coordinates.
getWindow(),
setViewPort(WRectF viewPort)
public void setWindow(double x,
double y,
double width,
double height)
This is an overloaded method for convenience.
setWindow(WRectF window)public WRectF getWindow()
setViewPort(WRectF viewPort)public WTransform getCombinedTransform()
Returns the transformation matrix that maps coordinates to device coordinates. It is the combination of the current world transformation (which defines the transformation within the logical coordinate system) and the window/viewport transformation (which transforms logical coordinates to device coordinates).
setWorldTransform(WTransform matrix, boolean combine),
setViewPort(WRectF viewPort),
setWindow(WRectF window)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||