private void storePreviousFloatingState(Dockable dockable,
			DockableState state) {

		// when storing a previous dockable state before going floating, we have
		// to ensure the relativeDockableAncestorContainer is defined
		RelativeDockablePosition pos = state.getPosition();
		if (pos.getRelativeAncestorContainer() == null) {
			Container c = DockingUtilities
					.findCompoundAncestorContainer(dockable);
			if (c != null) {
				pos.resetRelativePosition(c, dockable);
			} else {
				pos.resetRelativePosition(dockingPanel, dockable);
			}
		}

		previousFloatingDockableStates.put(dockable, state);
		if (dockable instanceof CompoundDockable) {
			// more to do : the compund dockable may have children : they will
			// share the
			// same return position
			ArrayList children = DockingUtilities
					.findCompoundDockableChildren((CompoundDockable) dockable);
			for (int i = 0; i < children.size(); i++) {
				Dockable d = (Dockable) children.get(i);
				previousFloatingDockableStates.put(d, new DockableState(this,
						d, state.getLocation(), state.getPosition()));
			}
		}
	}