Hi, I'm looking at the following code:
/** * On default select the represented agent and do the former original action * @return */ @Override public Action getPreferredAction() { return new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { IPogamutEnvironments environments = Lookup.getDefault().lookup(IPogamutEnvironments.class); if (environments == null) return; environments.getEnvironmentSelection(map).changeSelected(agent); // Do the original action Action original = UnrealAgentNode.super.getPreferredAction(); if (original != null) original.actionPerformed(e); } }; }
I'm looking at example 1 on this page:
I understand everything well but here I already lost myself and I did not understand, someone could explain to me what it is that they are trying to do, I am saying this part:
environments.getEnvironmentSelection(map).changeSelected(agent);
// Do the original action
Action original = UnrealAgentNode.super.getPreferredAction();