Class: IWGraphicsRenderer

IWGraphicsRenderer

A super class for rendering vector graphics.

This class is part of the module graphics.


new IWGraphicsRenderer(drawContainer)

Parameters:
Name Type Description
drawContainer DOMElement

Methods


clearContainer()

Removes all DOM nodes from container.
Returns:
Type
void

drawCircle(point, radius, width, lineColor, fillColor, className)

Draws a circle in container. Pixel coordinates are relative to the container.
Parameters:
Name Type Description
point IWPoint The center of the circle.
radius Number The radius of the circle.
width Number The width of the circle.
lineColor String The color of the line.
fillColor String The color to fill the circle.
className String The CSS class name (optional)
Returns:
circle
Type
Object

drawEllipse(center, size, width, lineColor, fillColor, className)

Draws an ellipse in container Pixel coordinates are relative to the container. If no fillColor is given only the border will be drawn.
Parameters:
Name Type Description
center IWPoint Specifies the center of the circle
size IWSize Specifies the diameter for x- & y-axis
width Number The width of the border
lineColor String The color of the border line
fillColor String The color to fill the ellipse (optional)
className String The CSS class name (optional)
Returns:
ellipse
Type
Object

drawLine(point1, point2, width, color, className)

Draws a line in container. Pixel coordinates are relative to the container.
Parameters:
Name Type Description
point1 IWPoint Point where line starts
point2 IWPoint Point where line ends
width Number The width of the line
color String The color of the line
className String The CSS class name (optional)
Returns:
line
Type
Object

drawPolygon(points, width, lineColor, fillColor, className)

Draws a polygon in container. Pixel coordinates are relative to the container.
Parameters:
Name Type Description
points String whitespace separated list of pixel points.
width Number The width of the line
lineColor String The color of the line
fillColor String The color to fill the polygon
className String The CSS class name (optional)
Returns:
polygon
Type
Object

drawPolyline(points, width, lineColor, fillColor, className)

Draws a polyline in container. Pixel coordinates are relative to the container.
Parameters:
Name Type Description
points String whitespace separated list of pixel points.
width Number The width of the line
lineColor String The color of the line
fillColor String The color to fill the polyline
className String The CSS class name (optional)
Returns:
polyline
Type
Object

drawRectangle(center, size, width, lineColor, fillColor, className)

Draws a rectangle in container Pixel coordinates are relative to the container. If no fillColor is given only the border will be drawn.
Parameters:
Name Type Description
center IWPoint Specifies the upper left corner of the rectangle
size IWSize Specifies the size of the rectangle
width Number The width of the border
lineColor String The color of the border line
fillColor String The color to fill the rectangle (optional)
className String The CSS class name (optional)
Returns:
rectangle
Type
Object

drawRoundedRectangle(point, radiusX, size, width, lineColor, fillColor, className)

Draws a rounded rectangle in container Pixel coordinates are relative to the container. If no fillColor is given only the border will be drawn.
Parameters:
Name Type Description
point IWPoint Specifies the upper left corner of the rectangle
radiusX Number The x any y radius.
size IWSize Specifies the size of the rectangle
width Number The width of the border
lineColor String The color of the border line
fillColor String The color to fill the rectangle (optional)
className String The CSS class name (optional)
Returns:
rectangle
Type
Object

drawText(point, text, className, attributes)

Renders a text. The pixel coordinate is relative to the container.
Parameters:
Name Type Description
point IWPoint where to render the text
text String the text to render
className String The CSS class name (optional)
attributes Object CSS attributes to render the text (optional)
Returns:
the text node
Type
Object

drawTextBox(point, text, className, attributes, boxAttributes)

Renders a text in a box. The pixel coordinate is relative to the container.
Parameters:
Name Type Description
point IWPoint where to render the text
text String the text to render
className String The CSS class name (optional)
attributes Object CSS attributes to render the text (optional)
boxAttributes Object CSS attributes to render the box (optional)
Returns:
the text node
Type
Object

getContainer()

Returns the DIV container which is used for drawing.
Returns:
container
Type
DOMElement

getPosition(element)

Moves an element to specific position
Parameters:
Name Type Description
element Object The vector object (lines are not supported!)
Returns:
position The point relative to the container element
Type
IWPoint

move(element, position1 [, position2])

Moves an element to specific position
Parameters:
Name Type Argument Description
element Object The vector object
position1 IWPoint Position where shall be moved to
position2 IWPoint <optional>
Only necessary for line segment
Returns:
Type
void

moveToBottom(element)

Moves the element to the bottom by setting it to the first child in the DOM-structure.
Parameters:
Name Type Description
element DOMElement
Returns:
Type
void

moveToTop(element)

Moves the element to the top by setting it the to last child in the DOM-structure.
Parameters:
Name Type Description
element DOMElement
Returns:
Type
void

removeElement(element)

Removes a given DOM element from container
Parameters:
Name Type Description
element DOMElement
Returns:
Type
void