void tracksDropped(Point startPoint, Point dropPoint, List<Track> tracks) {
            // This cast is horrid but we can't fix everything at once.
            TrackPanel panel = ((TrackPanel) getParent());
            List<MouseableRegion> regions = getMouseRegions();
            if (regions.isEmpty()) {
                // empty panel,  just add the tracks
                panel.addTracks(tracks);
            } else {
                // Find the regions containing the startPoint and point
                boolean before = true;
                MouseableRegion dropRegion = null;
                MouseableRegion startRegion = null;
                for (MouseableRegion region : regions) {
                    if (region.containsPoint(dropPoint.x, dropPoint.y)) {
                        dropRegion = region;
                        Rectangle bnds = dropRegion.getBounds();
                        int dy1 = (dropPoint.y - bnds.y);
                        int dy2 = bnds.height - dy1;
                        before = dy1 < dy2;
                    }
                    if (region.containsPoint(startPoint.x, startPoint.y)) {
                        startRegion = region;
                    }
                    if (dropRegion != null && startRegion != null) {
                        break;
                    }
                }
                Track dropTrack = null;
                if (dropRegion != null) {
                    Iterator<Track> tmp = dropRegion.getTracks().iterator();
                    if (tmp.hasNext()) {
                        dropTrack = tmp.next();
                    }
                }
                panel.moveSelectedTracksTo(tracks, dropTrack, before);
            }
        }
void tracksDropped(Point startPoint, Point dropPoint, List<Track> tracks) {
           
            TrackPanel panel = ((TrackPanel) getParent());
            List<MouseableRegion> regions = getMouseRegions();
            if (regions.isEmpty()) {
               
                panel.addTracks(tracks);
            } else {
               
                boolean before = true;
                MouseableRegion dropRegion = null;
                MouseableRegion startRegion = null;
                for (MouseableRegion region : regions) {
                    if (region.containsPoint(dropPoint.x, dropPoint.y)) {
                        dropRegion = region;
                        Rectangle bnds = dropRegion.getBounds();
                        int dy1 = (dropPoint.y - bnds.y);
                        int dy2 = bnds.height - dy1;
                        before = dy1 < dy2;
                    }
                    if (region.containsPoint(startPoint.x, startPoint.y)) {
                        startRegion = region;
                    }
                    if (dropRegion != null && startRegion != null) {
                        break;
                    }
                }
                Track dropTrack = null;
                if (dropRegion != null) {
                    Iterator<Track> tmp = dropRegion.getTracks().iterator();
                    if (tmp.hasNext()) {
                        dropTrack = tmp.next();
                    }
                }
                panel.moveSelectedTracksTo(tracks, dropTrack, before);
            }
        }
void tracksdropped(point startpoint, point droppoint, list<track> tracks) { trackpanel panel = ((trackpanel) getparent()); list<mouseableregion> regions = getmouseregions(); if (regions.isempty()) { panel.addtracks(tracks); } else { boolean before = true; mouseableregion dropregion = null; mouseableregion startregion = null; for (mouseableregion region : regions) { if (region.containspoint(droppoint.x, droppoint.y)) { dropregion = region; rectangle bnds = dropregion.getbounds(); int dy1 = (droppoint.y - bnds.y); int dy2 = bnds.height - dy1; before = dy1 < dy2; } if (region.containspoint(startpoint.x, startpoint.y)) { startregion = region; } if (dropregion != null && startregion != null) { break; } } track droptrack = null; if (dropregion != null) { iterator<track> tmp = dropregion.gettracks().iterator(); if (tmp.hasnext()) { droptrack = tmp.next(); } } panel.moveselectedtracksto(tracks, droptrack, before); } }