question: private void addGroup ( Group group ) { if ( objectNodeMap . get ( group ) != null ) { return ; } if ( group instanceof NeuronGroup ) { NeuronGroup ng = ( NeuronGroup ) group ; addNeuronGroup ( ng ) ; if ( ng . isTopLevelGroup ( ) ) { whereToAdd . setLocation ( whereToAdd . getX ( ) + DEFAULT_SPACING , whereToAdd . getY ( ) + DEFAULT_SPACING ) ; } } else if ( group instanceof SynapseGroup ) { addSynapseGroup ( ( SynapseGroup ) group ) ; } else if ( group instanceof Subnetwork ) { addSubnetwork ( ( Subnetwork ) group ) ; whereToAdd . setLocation ( whereToAdd . getX ( ) + DEFAULT_SPACING , whereToAdd . getY ( ) + DEFAULT_SPACING ) ; } clearSelection ( ) ; }
target:  Add a model group node representation to the piccolo canvas. Be aware that creation of groups is complex. Parts of the groups can be added in different orders (e.g. a neurongroup inside a subnetwork, or neurons inside a neuron group, etc). These may or may not fire listeners So it is hard to make assumptions about which parts of a group have been added when this method is called. As an example, feedforward networks are created using all-to-all connection objects, which can call addSynpase as they are invoked, so that synapse nodes may are already here when the feed-forward node is created and added.