public void close(Dockable dockable) {
		// keep track of where the dockable was
		DockableState currentState = getDockableState(dockable);

		if (currentState == null || currentState.isClosed()) {// 2006/12/01
			return; // no need to continue
		}

		DockableState.Location currentLocation = getLocation(currentState);

		RelativeDockablePosition position = new RelativeDockablePosition(
				dockingPanel, dockable);
		DockableState newState = new DockableState(this, dockable,
				DockableState.Location.CLOSED, position);
		DockableStateWillChangeEvent dswe = new DockableStateWillChangeEvent(
				currentState, newState);
		DockingActionEvent dae = new DockingActionCloseEvent(this, dockable,
				currentLocation);

		if (dockingPanel.isAncestorOf(dockable.getComponent())) {
			if (isDockingActionAccepted(dae, dswe)) {
				if (dockable instanceof CompoundDockable) {
					// V2.1 : propagate closing state to children
					updateCompoundChildrenState((CompoundDockable) dockable,
							DockableState.Location.CLOSED);
				}

				remove(dockable);

				removeFromTabbedGroup(dockable); // 2005/07/13

				context.setDockableState(dockable, newState);
				dockable.getDockKey()
						.setLocation(DockableState.Location.CLOSED);
				fireDockingAction(dae, new DockableStateChangeEvent(
						currentState, newState));
				DockingUtilities.updateResizeWeights(dockingPanel);
			}
		} else if (currentState.isHidden()) {
			if (isDockingActionAccepted(dae, dswe)) {
				if (dockable instanceof CompoundDockable) {
					// V2.1 : propagate closing state to children
					updateCompoundChildrenState((CompoundDockable) dockable,
							DockableState.Location.CLOSED);
				}
				remove(dockable);

				removeFromTabbedGroup(dockable); // 2005/07/13

				context.setDockableState(
						dockable,
						new DockableState(this, dockable,
								DockableState.Location.CLOSED, currentState
										.getPosition()));
				dockable.getDockKey()
						.setLocation(DockableState.Location.CLOSED);
				fireDockingAction(dae, new DockableStateChangeEvent(
						currentState, newState));
			}
		} else if (currentState.isFloating()) {
			if (isDockingActionAccepted(dae, dswe)) {
				if (dockable instanceof CompoundDockable) {
					// V2.1 : propagate closing state to children
					updateCompoundChildrenState((CompoundDockable) dockable,
							DockableState.Location.CLOSED);
				}
				remove(dockable);
				removeFromTabbedGroup(dockable);

				context.setDockableState(dockable, newState);
				dockable.getDockKey()
						.setLocation(DockableState.Location.CLOSED);
				fireDockingAction(dae, new DockableStateChangeEvent(
						currentState, newState));
			}
		} else if (currentState.isMaximized()) { // 2006/11/20
			restore(dockable);
			if (getDockableState(dockable).isDocked()) {
				// ok restore hasn't been vetoed
				close(dockable); // once again we close, but this time with
									// standard (DOCKED) behaviour
			}
		}
	}