public class SVG extends DomSurface
Modifier and Type | Class and Description |
---|---|
static class |
SVG.TextBBox
JavaScriptObject representing bounding box results of an
SVG text element. |
Modifier and Type | Field and Description |
---|---|
protected Map<Sprite,XElement> |
clipElements |
elements, spriteIds
backgroundSprite, component, container, height, sprites, surfaceElement, width
Constructor and Description |
---|
SVG() |
Modifier and Type | Method and Description |
---|---|
void |
addGradient(Gradient gradient)
Adds the passed
Gradient to the surface. |
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.
|
protected PreciseRectangle |
getBBoxText(TextSprite sprite)
Calculates the bounding box of the given text sprite.
|
protected XElement |
getClipElement(Sprite sprite)
Returns the clip element associated with the given sprite.
|
void |
renderSprite(Sprite sprite)
Renders the given sprite to the DOM.
|
protected void |
setClipElement(Sprite sprite,
XElement element)
Associates the given sprite with the given clip element.
|
void |
setCursor(Sprite sprite,
String property)
Sets the cursor property for the given sprite.
|
void |
setViewBox(double x,
double y,
double width,
double height)
Sets the view box of the surface.
|
getElement, setElement, setId
add, clear, create, create, getBBox, getComponent, getHeight, getSprites, getSurfaceElement, getWidth, renderAll, setBackground, setHeight, setWidth
public void addGradient(Gradient gradient)
Surface
Gradient
to the surface.addGradient
in class Surface
gradient
- the gradient to be addedpublic void draw()
Surface
public void deleteSprite(Sprite sprite)
Surface
deleteSprite
in class DomSurface
sprite
- the sprite to be deletedpublic void renderSprite(Sprite sprite)
Surface
renderSprite
in class Surface
sprite
- the sprite to be renderedprotected void setClipElement(Sprite sprite, XElement element)
sprite
- the spriteelement
- the clip elementpublic void setCursor(Sprite sprite, String property)
Surface
public void setViewBox(double x, double y, double width, double height)
Surface
setViewBox
in class Surface
x
- 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)
Surface
getBBoxText
in class Surface
sprite
- the text sprite to be used in the calculationCopyright © 2018. All rights reserved.