Package org.eclipse.nebula.cwt.svg
Class SvgContainer
- java.lang.Object
-
- org.eclipse.nebula.cwt.svg.SvgElement
-
- org.eclipse.nebula.cwt.svg.SvgGraphic
-
- org.eclipse.nebula.cwt.svg.SvgContainer
-
- Direct Known Subclasses:
SvgDocument
,SvgFragment
public class SvgContainer extends SvgGraphic
An SvgElement which is capable of containing other SvgElements. The most commonly accessed container element types are the document, fragment, and group.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.List<SvgElement>
elements
-
Fields inherited from class org.eclipse.nebula.cwt.svg.SvgGraphic
description, fill, stroke, title, transform
-
-
Constructor Summary
Constructors Constructor Description SvgContainer(SvgContainer container, java.lang.String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
add(SvgElement element)
void
apply(org.eclipse.swt.graphics.GC gc)
Apply this svg graphic to the given graphics context.SvgElement[]
getElements()
Returns an array of child elements contained by this container element.boolean
isEmpty()
Returns true if this list contains no elements.-
Methods inherited from class org.eclipse.nebula.cwt.svg.SvgGraphic
getDescription, getFill, getStroke, getTitle, getTransform
-
Methods inherited from class org.eclipse.nebula.cwt.svg.SvgElement
getAncestry, getContainer, getElement, getFragment, getId, getViewport, setContainer
-
-
-
-
Field Detail
-
elements
java.util.List<SvgElement> elements
-
-
Constructor Detail
-
SvgContainer
SvgContainer(SvgContainer container, java.lang.String id)
-
-
Method Detail
-
add
void add(SvgElement element)
-
apply
public void apply(org.eclipse.swt.graphics.GC gc)
Description copied from class:SvgGraphic
Apply this svg graphic to the given graphics context.Note that to support the rather abstract structure of svg, each time this method is called all transformations and css properties to be calculated and applied. If this is a shape, it will be painted to the graphics context. Containers will recursively make this call on their children.
- Specified by:
apply
in classSvgGraphic
- Parameters:
gc
- the gc to use in all graphics operations
-
getElements
public SvgElement[] getElements()
Returns an array of child elements contained by this container element. Modifying this array will not affect the underlying element list of this container element.- Returns:
- an array of child elements contained by this element.
-
isEmpty
public boolean isEmpty()
Returns true if this list contains no elements.- Returns:
- true if this list contains no elements.
-
-