Search in sources :

Example 1 with OMSVGSVGElement

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;
}
Also used : DivElement(com.google.gwt.dom.client.DivElement) OMSVGSVGElement(org.vectomatic.dom.svg.OMSVGSVGElement) Element(com.google.gwt.dom.client.Element) DivElement(com.google.gwt.dom.client.DivElement) OMSVGSVGElement(org.vectomatic.dom.svg.OMSVGSVGElement) ImageElement(com.google.gwt.dom.client.ImageElement)

Example 2 with OMSVGSVGElement

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;
}
Also used : OMSVGSVGElement(org.vectomatic.dom.svg.OMSVGSVGElement) ImageElement(com.google.gwt.dom.client.ImageElement)

Aggregations

ImageElement (com.google.gwt.dom.client.ImageElement)2 OMSVGSVGElement (org.vectomatic.dom.svg.OMSVGSVGElement)2 DivElement (com.google.gwt.dom.client.DivElement)1 Element (com.google.gwt.dom.client.Element)1