Search in sources :

Example 1 with SVGRoot

use of com.kitfox.svg.SVGRoot in project pivot by apache.

the class Drawing method setSize.

public void setSize(int width, int height) {
    int previousWidth = getWidth();
    int previousHeight = getHeight();
    SVGRoot root = diagram.getRoot();
    try {
        root.setAttribute("width", AnimationElement.AT_XML, Integer.toString(width));
        root.setAttribute("height", AnimationElement.AT_XML, Integer.toString(height));
    } catch (SVGElementException exception) {
        throw new RuntimeException(exception);
    }
    try {
        diagram.updateTime(0.0);
    } catch (SVGException exception) {
        throw new RuntimeException(exception);
    }
    imageListeners.sizeChanged(this, previousWidth, previousHeight);
}
Also used : SVGRoot(com.kitfox.svg.SVGRoot) SVGException(com.kitfox.svg.SVGException) SVGElementException(com.kitfox.svg.SVGElementException)

Aggregations

SVGElementException (com.kitfox.svg.SVGElementException)1 SVGException (com.kitfox.svg.SVGException)1 SVGRoot (com.kitfox.svg.SVGRoot)1