@Override
    public void setSpatial(Spatial spatial) {
        if (this.spatial != null && spatial != null && spatial != this.spatial) {
            throw new IllegalStateException("This control has already been added to a Spatial");
        }
        this.spatial = spatial;
    }
An abstract implementation of the Control interface.

@author Kirill Vainer
jme3-core/src/main/java/com/jme3/scene/control/AbstractControl.java