
public class VML extends DomSurface
| Modifier and Type | Class and Description |
|---|---|
static interface |
VML.SpritePooling |
static interface |
VML.VmlBundle |
static interface |
VML.VmlCss |
| Modifier and Type | Field and Description |
|---|---|
protected VML.VmlCss |
css |
protected boolean |
ignoreOptimizations |
protected static Logger |
logger |
protected RegExp |
newLineRegExp |
protected <any> |
pool |
protected boolean |
poolingEnabled
Flag to cache unused VML elements since they can leak if excessively created and deleted.
|
protected Map<Sprite,PreciseRectangle> |
textBBoxCache |
protected Map<Sprite,TextSprite.TextBaseline> |
textRenderedBaseline |
protected Map<Sprite,PrecisePoint> |
textRenderedPoints |
protected Scaling |
viewBoxShift |
protected int |
zoom |
elements, spriteIdsbackgroundSprite, component, container, height, sprites, surfaceElement, width| Constructor and Description |
|---|
VML() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addNamespace(String namespace,
String urn)
Adds the passed namespace and URN to the document.
|
protected void |
applyAttributes(Sprite sprite)
Applies pending attributes to the DOM element of a
Sprite. |
protected void |
applyClip(Sprite sprite)
Applies the clip rectangle of the given sprite to its DOM element.
|
protected void |
applyZIndex(Sprite sprite,
XElement element)
Applies the z-index of the given sprite to its DOM element.
|
protected boolean |
containsNonVMLCommands(PathSprite sprite)
Determines whether a
PathSprite contains a command not supported by
VML. |
static Surface |
create(DrawComponent component,
int width,
int height)
Instantiates a surface instance with VML.
|
protected XElement |
createNode(String tagName)
Creates a VML DOM node.
|
protected XElement |
createSpriteElement(Sprite sprite)
Creates the DOM element of the passed
Sprite. |
void |
deleteSprite(Sprite sprite)
Deletes the given sprite from the surface.
|
void |
draw()
Renders the surface to the DOM as well as any sprites already added.
|
void |
drawIgnoreOptimizations()
Draws the surface ignoring whether or not sprites are dirty.
|
protected String |
ellipticalArc(Sprite sprite)
Generates a path sprite made up of an elliptical arc based on the given
CircleSprite or EllipseSprite. |
protected PreciseRectangle |
getBBoxText(TextSprite sprite)
Calculates the bounding box of the given text sprite.
|
protected String |
path2vml(PathSprite sprite)
Returns a string representing a VML path using the the passed
PathSprite. |
void |
renderSprite(Sprite sprite)
Renders the given sprite to the DOM.
|
void |
setCursor(Sprite sprite,
String property)
Sets the cursor property for the given sprite.
|
protected void |
setFill(Sprite sprite,
Element element)
Applies the fill attribute of a sprite to its VML DOM element.
|
protected void |
setStroke(Sprite sprite,
XElement element)
Applies the stroke attribute of a sprite to its VML dom element.
|
protected void |
setTextAlign(Style style,
String align)
Sets the text alignment on the given
Style. |
protected void |
setTextAttributes(TextSprite sprite,
XElement element)
Applies the attributes of the passed
TextSprite to its VML element. |
void |
setViewBox(double x,
double y,
double width,
double height)
Sets the view box of the surface.
|
protected static String |
toFixed(double number,
double place)
Returns the given number rounded to the given precision.
|
protected void |
transform(Sprite sprite)
Applies transformation to passed sprite
|
getElement, setElement, setIdadd, addGradient, clear, create, getBackgroundSprite, getBBox, getComponent, getContainer, getHeight, getSprites, getSurfaceElement, getWidth, renderAll, setBackground, setBackgroundSprite, setComponent, setContainer, setHeight, setSprites, setSurfaceElement, setWidthprotected static final Logger logger
protected int zoom
protected Scaling viewBoxShift
protected RegExp newLineRegExp
protected Map<Sprite,PreciseRectangle> textBBoxCache
protected Map<Sprite,PrecisePoint> textRenderedPoints
protected Map<Sprite,TextSprite.TextBaseline> textRenderedBaseline
protected boolean ignoreOptimizations
protected VML.VmlCss css
protected boolean poolingEnabled
<set-property name="gxt.vml.enableSpritePooling" value="true" />
This protected field can also be configured programmatically, but must be set before any sprites are added to the
surface (including before any axis/series/legend is added to a chart, and before it is attached).protected <any> pool
public static Surface create(DrawComponent component, int width, int height)
component - the element that the surface will be attachedwidth - the width of the surfaceheight - the height of the surfaceprotected static String toFixed(double number, double place)
number - the number to be roundedplace - the decimal placepublic void deleteSprite(Sprite sprite)
SurfacedeleteSprite in class DomSurfacesprite - the sprite to be deletedpublic void draw()
Surfacepublic void drawIgnoreOptimizations()
public void renderSprite(Sprite sprite)
SurfacerenderSprite in class Surfacesprite - the sprite to be renderedpublic void setCursor(Sprite sprite, String property)
Surfacepublic void setViewBox(double x,
double y,
double width,
double height)
SurfacesetViewBox in class Surfacex - the x coordinate of the viewboxy - the y coordinate of the viewboxwidth - the width of the viewboxheight - the height of the viewboxprotected PreciseRectangle getBBoxText(TextSprite sprite)
SurfacegetBBoxText in class Surfacesprite - the text sprite to be used in the calculationprotected void addNamespace(String namespace, String urn)
namespace - the namespace to be addedurn - the schema URN of the namespaceprotected void applyAttributes(Sprite sprite)
Sprite.sprite - the sprite in need of attributes to be set.protected void applyClip(Sprite sprite)
sprite - the sprite to have its clip rectangle appliedprotected void applyZIndex(Sprite sprite, XElement element)
sprite - the sprite to have its z-index appliedprotected boolean containsNonVMLCommands(PathSprite sprite)
PathSprite contains a command not supported by
VML.sprite - the sprite to be inspectedprotected XElement createNode(String tagName)
tagName - the type of node to create.protected XElement createSpriteElement(Sprite sprite)
Sprite.sprite - the sprite in need of element creationprotected String ellipticalArc(Sprite sprite)
CircleSprite or EllipseSprite. Returns null if not an
Circlesprite - the circle or ellipse to be converted to an elliptical arcprotected String path2vml(PathSprite sprite)
PathSprite.sprite - the sprite to be convertedprotected void setFill(Sprite sprite, Element element)
sprite - the sprite to have its fill setprotected void setStroke(Sprite sprite, XElement element)
sprite - the sprite to have its stroke setprotected void setTextAlign(Style style,
String align)
Style.style - the stylealign - the text alignmentprotected void setTextAttributes(TextSprite sprite, XElement element)
TextSprite to its VML element.sprite - the sprite whose attributes to useprotected void transform(Sprite sprite)
sprite - the sprite to be transformedCopyright © 2018. All rights reserved.