Getting Text from graphic element [message #1385735] |
Tue, 10 June 2014 15:15  |
Eclipse User |
|
|
|
Hi,
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);
link(typeTextShape, addedElement);
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.06078 seconds