private void scanContainer(DockEvent event, boolean drop) {
		Point p = event.getMouseEvent().getPoint();
		Rectangle compBounds = getBounds();
		int distTop = p.y;
		int distLeft = p.x;
		int min = Math.min(distTop, distLeft);
		int distRight = compBounds.width - p.x;
		int distBottom = compBounds.height - p.y;
		int min2 = Math.min(distBottom, distRight);
		min = Math.min(min, min2);

		Dimension size = getSize();
		Dockable dragged = event.getDragSource().getDockable();
		// the drag size is the one of the parent dockable container
		Dimension draggedSize = dragged.getComponent().getParent().getSize();
		int bestHeight = (int) Math.min(draggedSize.height, size.height * 0.5);
		int bestWidth = (int) Math.min(draggedSize.width, size.width * 0.5);

		if(min == distTop) {
			// dock on top
			if(drop) {
				acceptDrop(event, DockingConstants.SPLIT_TOP);
			} else {
				Rectangle2D r2d = new Rectangle2D.Float(0, 0, compBounds.width, bestHeight);
				acceptDrag(event, DockingConstants.SPLIT_TOP, r2d);
			}
		} else if(min == distLeft) {
			if(drop) {
				acceptDrop(event, DockingConstants.SPLIT_LEFT);
			} else {
				Rectangle2D r2d = new Rectangle2D.Float(0, 0, bestWidth, compBounds.height);
				acceptDrag(event, DockingConstants.SPLIT_LEFT, r2d);
			}
		} else if(min == distBottom) {
			if(drop) {
				acceptDrop(event, DockingConstants.SPLIT_BOTTOM);
			} else {
				Rectangle2D r2d = new Rectangle2D.Float(0, compBounds.height - bestHeight, compBounds.width, bestHeight);
				acceptDrag(event, DockingConstants.SPLIT_BOTTOM, r2d);
			}
		} else { // right
			if(drop) {
				acceptDrop(event, DockingConstants.SPLIT_RIGHT);
			} else {
				Rectangle2D r2d = new Rectangle2D.Float(compBounds.width - bestWidth, 0, bestWidth, compBounds.height);
				acceptDrag(event, DockingConstants.SPLIT_RIGHT, r2d);
			}
		}
	}