DefaultMutableTreeNode () { final Object selection = patternTree.getLastSelectedPathComponent(); if (!(selection instanceof DefaultMutableTreeNode)) { return null; } return (DefaultMutableTreeNode)selection; }