public class SvgFragment extends SvgContainer
Of particular importance is that the svg fragment can also contain a viewbox which can be used for scaling the image to a particular size. Therefore this element is where the real-world rendered dimensions interact with the svg dimenions.
Modifier and Type | Method | Description |
---|---|---|
void |
apply(org.eclipse.swt.graphics.GC gc,
org.eclipse.swt.graphics.Rectangle bounds) |
Apply this svg fragment to the given graphics context, scaled to fit within
the given bounds.
|
SvgElement |
getElement(java.lang.String id) |
|
SvgFragment |
getFragment() |
|
java.util.Map<java.lang.String,java.lang.String> |
getStyles(java.lang.String className) |
Return a map of css styles for the given class name, if it exists.
|
float[] |
getViewport() |
|
boolean |
hasElement(java.lang.String id) |
Returns true if this fragment contains an SvgElement with the given id.
|
boolean |
isOutermost() |
Returns true if this SvgFragment is at the outermost level, meaning it
is a direct child of the SvgDocument.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply, getElements, isEmpty
getId
getDescription, getTitle
public void apply(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)
gc
- the graphics contextbounds
- the bounds to which this fragment will be scaledpublic SvgElement getElement(java.lang.String id)
public SvgFragment getFragment()
public java.util.Map<java.lang.String,java.lang.String> getStyles(java.lang.String className)
Each SvgFragment can contain a style element which consists of css styles.
className
- the name of the css class to return styles for.public float[] getViewport()
public boolean hasElement(java.lang.String id)
id
- the id of the elementpublic boolean isOutermost()