EventContext (Point point) { TreePath path = myTree.getPathForLocation(point.x, point.y); if (path == null || !(path.getLastPathComponent() instanceof ServiceViewItem item)) return null; Rectangle cellBounds = myTree.getPathBounds(path); if (cellBounds == null) return null; ServiceViewDescriptor viewDescriptor = item.getViewDescriptor(); if (!(viewDescriptor instanceof ServiceViewDnDDescriptor)) return null; return new EventContext(point, cellBounds, (ServiceViewDnDDescriptor)viewDescriptor); }