/**
* Associate selectable elements in the current tree with
* Selector instances.
*/
public void initSelectors(GraphicsNode treeRoot) {
Iterator nodeIter = new GraphicsNodeTreeIterator(treeRoot);
if (textSelector == null) {
textSelector =
new ConcreteTextSelector(
getRendererFactory().getRenderContext());
textSelector.addSelectionListener(this);
}
while (nodeIter.hasNext()) {
GraphicsNode node = (GraphicsNode) nodeIter.next();
if (node instanceof Selectable) {
node.addGraphicsNodeMouseListener(
(GraphicsNodeMouseListener) textSelector);
// should make sure this does not add duplicates
}