+ static class SVGMeasurementContextImpl implements SVGMeasurementContext {
+ private SVGNode node;
+ public SVGMeasurementContextImpl(SVGNode node) {
+ this.node = node;
+ }
+
+ @Override
+ public Tuple4 getBoundingBox(String id) {
+ try {
+ Rectangle2D rect = node.getElementBounds(id);
+ if(rect == null) return null;
+ return new Tuple4(rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight());
+ } catch (SVGException e) {
+ return null;
+ }
+ }
+
+ @Override
+ public void modifyText(String id, String newText) {
+ node.modifyTextElement(id, newText);
+ }
+ }
+