Base class for the different graphics. You should never construct objects of this class. Instead us goog.graphics.createGraphics
extends goog.ui.ComponentInstance Method Summary | |
clear() Remove all drawing elements from the graphics. | |
createGroup(?goog.graphics.GroupElement= opt_group) ⇒ ?goog.graphics.GroupElement Create an empty group of drawing elements. | |
createPath() ⇒ ?goog.graphics.Path Create an empty path. | |
drawCircle(number cx, number cy, number r, ?goog.graphics.Stroke stroke, ?goog.graphics.Fill fill, ?goog.graphics.GroupElement= opt_group) ⇒ ?goog.graphics.EllipseElement Draw a circle | |
drawEllipse(number cx, number cy, number rx, number ry, ?goog.graphics.Stroke stroke, ?goog.graphics.Fill fill, ?goog.graphics.GroupElement= opt_group) ⇒ ?goog.graphics.EllipseElement Draw an ellipse | |
drawPath(?goog.graphics.Path path, ?goog.graphics.Stroke stroke, ?goog.graphics.Fill fill, ?goog.graphics.GroupElement= opt_group) ⇒ ?goog.graphics.PathElement Draw a path. | |
drawRect(number x, number y, number width, number height, ?goog.graphics.Stroke stroke, ?goog.graphics.Fill fill, ?goog.graphics.GroupElement= opt_group) ⇒ ?goog.graphics.RectElement Draw a rectangle | |
drawText(string text, number x, number y, number width, number height, string align, string vAlign, ?goog.graphics.Font font, ?goog.graphics.Stroke stroke, ?goog.graphics.Fill fill, ?goog.graphics.GroupElement= opt_group) ⇒ ?goog.graphics.TextElement Draw a text string within a rectangle (drawing is horizontal) | |
drawTextOnLine(string text, number x1, number y1, number x2, number y2, string align, ?goog.graphics.Font font, ?goog.graphics.Stroke stroke, ?goog.graphics.Fill fill, ?goog.graphics.GroupElement= opt_group) ⇒ ?goog.graphics.TextElement Draw a text string vertically centered on a given line. | |
getCanvasElement() ⇒ ?goog.graphics.GroupElement | |
getCoordOrigin() ⇒ ?goog.math.Coordinate | |
getCoordSize() ⇒ ?goog.math.Size | |
getPixelScaleX() ⇒ number | |
getPixelScaleY() ⇒ number | |
getPixelSize() ⇒ ?goog.math.Size | |
getSize() ⇒ ?goog.math.Size | |
getTextWidth(string text, ?goog.graphics.Font font) ⇒ number Measure and return the width (in pixels) of a given text string. Text measurement is needed to make sure a text can fit in the allocated area. The way text length is measured is by writing it into a div that is after the visible area, measure the div width, and immediatly erase the written value. | |
isDomClonable() ⇒ boolean | |
removeElement(?goog.graphics.Element element) Remove a single drawing element from the surface. The default implementation assumes a DOM based drawing surface. | |
resume() Stop preventing redraws. If any redraws had been prevented, a redraw will be done now. | |
setCoordOrigin(number left, number top) Changes the coordinate system position. | |
setCoordSize(number coordWidth, number coordHeight) Changes the coordinate size. | |
setElementFill(?goog.graphics.StrokeAndFillElement element, ?goog.graphics.Fill fill) Sets the fill for the given element. | |
setElementStroke(?goog.graphics.StrokeAndFillElement element, ?goog.graphics.Stroke stroke) Sets the stroke for the given element. | |
setElementTransform(?goog.graphics.Element element, number x, number y, number angle, number centerX, number centerY) Set the transformation of an element. | |
setSize(number pixelWidth, number pixelHeight) Change the size of the canvas. | |
suspend() Start preventing redraws - useful for chaining large numbers of changes together. Not guaranteed to do anything - i.e. only use this for optimization of a single code path. |