// result in creation of yet another figure before this
// method even returns!
GraphController controller = IconController.this
.getController();
GraphModel graphModel = controller.getGraphModel();
ChangeRequest request = new ChangeRequest(graphModel,
"Set the container of a new XMLIcon.") {
// NOTE: The KernelException should not be thrown,
// but if it is, it will be handled properly.
protected void _execute() throws KernelException {
_iconsPendingContainer.remove(object);
// If the icon already has a container, do nothing.
if (icon.getContainer() != null) {
return;
}
// If the container already has an icon, do nothing.
if (object.getAttribute("_icon") != null) {
return;
}
icon.setContainer(object);
}
};
request.setPersistent(false);
object.requestChange(request);
} else if (iconList.size() >= 1) {
// Use only the last icon in the list.
EditorIcon icon = (EditorIcon) iconList
.get(iconList.size() - 1);