use of org.vectomatic.dom.svg.OMSVGSVGElement in project che by eclipse.
the class AbstractPresentationRenderer method getJointContainer.
/** {@inheritDoc} */
@Override
public Element getJointContainer(Joint joint) {
Element jointElement;
switch(joint) {
case COLLAPSED:
OMSVGSVGElement svg = treeStyles.iconCollapsed().getSvg();
svg.addClassNameBaseVal(treeStyles.styles().jointContainer());
svg.setWidth(Style.Unit.PX, 16.f);
svg.setHeight(Style.Unit.PX, 16.f);
jointElement = svg.getElement();
break;
case EXPANDED:
OMSVGSVGElement svg1 = treeStyles.iconExpanded().getSvg();
svg1.addClassNameBaseVal(treeStyles.styles().jointContainer());
svg1.setWidth(Style.Unit.PX, 16.f);
svg1.setHeight(Style.Unit.PX, 16.f);
jointElement = svg1.getElement();
break;
default:
OMSVGSVGElement svgsvgElement = OMSVGParser.currentDocument().createSVGSVGElement();
svgsvgElement.addClassNameBaseVal(treeStyles.styles().jointContainer());
svgsvgElement.setWidth(Style.Unit.PX, 16.f);
svgsvgElement.setHeight(Style.Unit.PX, 16.f);
jointElement = svgsvgElement.getElement();
}
DivElement wrapper = Document.get().createDivElement();
wrapper.appendChild(jointElement);
return jointElement;
}
use of org.vectomatic.dom.svg.OMSVGSVGElement in project che by eclipse.
the class AbstractPresentationRenderer method getIconContainer.
/** {@inheritDoc} */
@Override
public Element getIconContainer(SVGResource icon) {
if (icon != null) {
OMSVGSVGElement svg = icon.getSvg();
svg.addClassNameBaseVal(treeStyles.styles().iconContainer());
svg.setWidth(Style.Unit.PX, 16);
svg.setHeight(Style.Unit.PX, 16);
return svg.getElement();
}
ImageElement emptyIcon = Document.get().createImageElement();
emptyIcon.setSrc(TreeView.blankImageUrl);
emptyIcon.setClassName(treeStyles.styles().iconContainer());
return emptyIcon;
}
Aggregations