Home

# Class goog.graphics.VmlGraphics

A Graphics implementation for drawing using VML.

extends goog.graphics.AbstractGraphics

Instance Method Summary
| `append_(?goog.graphics.Element element, ?goog.graphics.VmlGroupElement= opt_group)` Appends an element.
| `clear()` Remove all drawing elements from the graphics.
| `createDom()` Creates the DOM representation of the graphics area.
| `createFullSizeElement_(string type) ⇒ ?Element` Creates an element spanning the surface.
| `createGroup(?goog.graphics.VmlGroupElement= opt_group) ⇒ ?goog.graphics.GroupElement` Create an empty group of drawing elements.
| `createVmlElement(string tagName) ⇒ ?Element` Creates a VML element. Used internally and by different VML classes.
| `disposeInternal()` Disposes of the component by removing event handlers, detacing DOM nodes from the document body, and removing references to them.
| `drawEllipse(number cx, number cy, number rx, number ry, ?goog.graphics.Stroke stroke, ?goog.graphics.Fill fill, ?goog.graphics.VmlGroupElement= opt_group) ⇒ ?goog.graphics.EllipseElement` Draw an ellipse.
| `drawImage(number x, number y, number width, number height, string src, ?goog.graphics.VmlGroupElement= opt_group) ⇒ ?goog.graphics.ImageElement` Draw an image.
| `drawPath(?goog.graphics.Path path, ?goog.graphics.Stroke stroke, ?goog.graphics.Fill fill, ?goog.graphics.VmlGroupElement= 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.VmlGroupElement= opt_group) ⇒ ?goog.graphics.RectElement` Draw a rectangle.
| `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.VmlGroupElement= opt_group) ⇒ ?goog.graphics.TextElement` Draw a text string vertically centered on a given line.
| `enterDocument()` Called when the component's element is known to be in the document. Anything using document.getElementById etc. should be done at this stage. If the component contains child components, this call is propagated to its children.
| `getPixelSize() ⇒ ?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.
| `getVmlElement(string id) ⇒ ?Element` Returns the VML element with the given id that is a child of this graphics object. Should be considered package private, and not used externally.
| `handleContainerResize_()` Changes the canvas element size to match the container element size.
| `handlePropertyChange_(?goog.events.BrowserEvent e)` Handle property changes on hidden ancestors.
| `removeFill(?Element element)` Removes the fill information from a dom element.
| `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.
| `updateGraphics_()` Resets the graphics so they will display properly on IE8. Noop in older versions.

Static Method Summary
| `getVmlPath(?goog.graphics.Path path) ⇒ string` Returns a string representation of a logical path suitable for use in a VML element.
| `setAttribute(?Element element, string name, string value)` Sets an attribute on the given VML element, in the way best suited to the current version of IE. Should only be used in the goog.graphics package.
| `setPositionAndSize(?Element element, number left, number top, number width, number height)` Set top, left, width and height for an element. This function is internal for the VML supporting classes, and should not be used externally.
| `toCssSize((number|string) size) ⇒ string` Converts the given size to a css size. If it is a percentage, leaves it alone. Otherwise assumes px.
| `toPosCoord((number|string) number) ⇒ number` Multiplies positioning coordinates by COORD_MULTIPLIER to allow sub-pixel coordinates. Also adds a half pixel offset to match SVG. This function is internal for the VML supporting classes, and should not be used externally.
| `toPosPx((number|string) number) ⇒ string` Add a "px" suffix to a number of pixels, and multiplies all coordinates by COORD_MULTIPLIER to allow sub-pixel coordinates. This function is internal for the VML supporting classes, and should not be used externally.
| `toSizeCoord((number|string) number) ⇒ number` Multiplies the width or height coordinate by COORD_MULTIPLIER to allow sub-pixel coordinates. This function is internal for the VML supporting classes, and should not be used externally.
| `toSizePx(number number) ⇒ string` Add a "px" suffix to a number of pixels, and multiplies all coordinates by COORD_MULTIPLIER to allow sub-pixel coordinates. This function is internal for the VML supporting classes, and should not be used externally.