/** * Gets the preferred operation when dragging the {@link Dockable} * <code>drop</code> to the location <code>x/y</code>. * @param x the x-coordinate of the mouse * @param y the y-coordinate of the mouse * @param drop the Dockable which will be dropped * @return where to trop the Dockable or <code>null</code> */ public PutInfo getPut( int x, int y, Dockable drop ){ double factorW = getWidthFactor(); double factorH = getHeightFactor(); return getPut( x, y, factorW, factorH, drop ); }
public PutInfo prepareDrop( SplitDockStation station, StationDropItem item ){ if( station.isFullScreen() ) return null; if( station.getDockableCount() == 0 ){ PutInfo putInfo = new PutInfo( null, PutInfo.Put.CENTER, item.getDockable(), true ); putInfo = validatePutInfo( station, putInfo ); return putInfo; } else{ Point point = new Point( item.getMouseX(), item.getMouseY() ); SwingUtilities.convertPointFromScreen( point, station ); PutInfo putInfo = station.getRoot().getPut( point.x, point.y, item.getDockable() ); if( putInfo == null && station.isAllowSideSnap() ){ putInfo = calculateSideSnap( station, point.x, point.y, null, item.getDockable() ); putInfo = validatePutInfo( station, putInfo ); } if( putInfo != null ){ putInfo.setDockable( item.getDockable() ); calculateDivider( station, putInfo, null, item ); } return putInfo; } }
public PutInfo prepareDrop( SplitDockStation station, StationDropItem item ){ if( station.isFullScreen() ) return null; if( station.getDockableCount() == 0 ){ PutInfo putInfo = new PutInfo( null, PutInfo.Put.CENTER, item.getDockable(), true ); putInfo = validatePutInfo( station, putInfo ); return putInfo; } else{ Point point = new Point( item.getMouseX(), item.getMouseY() ); SwingUtilities.convertPointFromScreen( point, station ); PutInfo putInfo = station.getRoot().getPut( point.x, point.y, item.getDockable() ); if( putInfo == null && station.isAllowSideSnap() ){ putInfo = calculateSideSnap( station, point.x, point.y, null, item.getDockable() ); putInfo = validatePutInfo( station, putInfo ); } if( putInfo != null ){ putInfo.setDockable( item.getDockable() ); calculateDivider( station, putInfo, null, item ); } return putInfo; } }
PutInfo putInfo = root.getPut( point.x, point.y, item.getDockable() ); Leaf leaf = root.getLeaf( item.getDockable() );
PutInfo putInfo = root.getPut( point.x, point.y, item.getDockable() ); Leaf leaf = root.getLeaf( item.getDockable() );