|Getting Text from graphic element [message #1385735]
||Tue, 10 June 2014 19:15
|| Filipe Ramos
Registered: December 2013
In my addFeature class, I create a Text in the following way:
Shape typeTextShape = peCreateService.createShape(containerShape, false);
Text typeText = gaService.createText(typeTextShape, "Some text!");
gaService.setLocationAndSize(typeText, 10, 10, 150, 50);
Then, on my update feature I want to read that text. How can I do that? I tried:
for (Shape shape : containerShape.getChildren())
if (shape instanceof Text)
System.out.println("Text: " + ((Text) shape).getValue());
but it never finds a shape that is instance of Text...
Thanks in advance!
Powered by FUDForum
. Page generated in 0.03573 seconds