SVGDiagram diagram = SVGCache.getSVGUniverse().getDiagram(uri); setStroke(Color.BLACK, getHexString(Color.GREEN), diagram.getRoot());
return fragment == null ? dia.getRoot() : dia.getElement(fragment);
return fragment == null ? dia.getRoot() : dia.getElement(fragment); } catch (Exception e)
return fragment == null ? dia.getRoot() : dia.getElement(fragment); } catch (Exception e)
return fragment == null ? dia.getRoot() : dia.getElement(fragment); } catch (Exception e)
/** * Loads an SVG document from a URI. * @param svgURI - URI to load document from */ public void setSvgURI(URI svgURI) { URI old = this.svgURI; this.svgURI = svgURI; SVGDiagram diagram = svgUniverse.getDiagram(svgURI); if (diagram != null) { Dimension size = getPreferredSize(); if (size == null) { size = new Dimension((int)diagram.getRoot().getDeviceWidth(), (int)diagram.getRoot().getDeviceHeight()); } diagram.setDeviceViewport(new Rectangle(0, 0, size.width, size.height)); } changes.firePropertyChange("svgURI", old, svgURI); }
/** * Loads an SVG document from a URI. * @param svgURI - URI to load document from */ public void setSvgURI(URI svgURI) { URI old = this.svgURI; this.svgURI = svgURI; SVGDiagram diagram = svgUniverse.getDiagram(svgURI); if (diagram != null) { Dimension size = getPreferredSize(); if (size == null) { size = new Dimension((int)diagram.getRoot().getDeviceWidth(), (int)diagram.getRoot().getDeviceHeight()); } diagram.setDeviceViewport(new Rectangle(0, 0, size.width, size.height)); } changes.firePropertyChange("svgURI", old, svgURI); }
/** * Loads an SVG document from a URI. * @param svgURI - URI to load document from */ public void setSvgURI(URI svgURI) { URI old = this.svgURI; this.svgURI = svgURI; SVGDiagram diagram = svgUniverse.getDiagram(svgURI); if (diagram != null) { Dimension size = getPreferredSize(); if (size == null) { size = new Dimension((int)diagram.getRoot().getDeviceWidth(), (int)diagram.getRoot().getDeviceHeight()); } diagram.setDeviceViewport(new Rectangle(0, 0, size.width, size.height)); } changes.firePropertyChange("svgURI", old, svgURI); }
/** * Loads an SVG document from a URI. * @param svgURI - URI to load document from */ public void setSvgURI(URI svgURI) { URI old = this.svgURI; this.svgURI = svgURI; SVGDiagram diagram = svgUniverse.getDiagram(svgURI); if (diagram != null) { Dimension size = getPreferredSize(); if (size == null) { size = new Dimension((int)diagram.getRoot().getDeviceWidth(), (int)diagram.getRoot().getDeviceHeight()); } diagram.setDeviceViewport(new Rectangle(0, 0, size.width, size.height)); } changes.firePropertyChange("svgURI", old, svgURI); }
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); }
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); }