private void releasePog()
    {
        if (m_grabbedNode != null)
        {
            final Point treePos = UtilityFunctions.getComponentCoordinates(getPogTree(), m_grabPosition);
            final PogNode node = getClosestPogNode(treePos.x, treePos.y);
            if (node != null)
            {
                boolean after = false;
                final int row = getRowForNode(node);
                if (row > -1)
                {
                    final Rectangle bounds = pogTree.getRowBounds(row);
                    if (treePos.y > bounds.y + bounds.height)
                    {
                        after = true;
                    }
                }

                final Pog sourcePog = m_grabbedNode.getPog();
                Pog targetPog = node.getPog();
                if (!sourcePog.equals(targetPog))
                {
                    final List<Pog> pogs = new ArrayList<Pog>(GametableFrame.getGametableFrame().getGametableCanvas()
                        .getActiveMap().getOrderedPogs());
                    final int sourceIndex = pogs.indexOf(sourcePog);
                    int targetIndex = pogs.indexOf(targetPog);
                    final Map<Integer, Long> changes = new HashMap<Integer, Long>();
                    if (sourceIndex < targetIndex)
                    {
                        // Moving a pog down in the list
                        if (!after)
                        {
                            --targetIndex;
                            targetPog = pogs.get(targetIndex);
                        }
                        changes.put(new Integer(sourcePog.getId()), new Long(targetPog.getSortOrder()));
                        for (int i = sourceIndex + 1; i <= targetIndex; ++i)
                        {
                            final Pog a = pogs.get(i);
                            final Pog b = pogs.get(i - 1);

                            changes.put(new Integer(a.getId()), new Long(b.getSortOrder()));
                        }
                    }
                    else
                    {
                        // Moving a pog up in the list
                        changes.put(new Integer(sourcePog.getId()), new Long(targetPog.getSortOrder()));
                        for (int i = targetIndex; i < sourceIndex; ++i)
                        {
                            final Pog a = pogs.get(i);
                            final Pog b = pogs.get(i + 1);

                            changes.put(new Integer(a.getId()), new Long(b.getSortOrder()));
                        }
                    }
                    GametableFrame.getGametableFrame().getGametableCanvas().reorderPogs(changes);
                }
            }

            m_grabbedNode = null;
            m_grabPosition = null;
            m_grabOffset = null;
            repaint();
        }
    }