private Leaf getLeaf(){ return (Leaf)info.getNode(); }
private Leaf getLeaf(){ return (Leaf)info.getNode(); }
public DockableDisplayer getOldDisplayer(){ SplitNode node = info.getNode(); if( node instanceof Leaf ){ return ((Leaf)node).getDisplayer(); } return null; }
public DockableDisplayer getOldDisplayer(){ SplitNode node = info.getNode(); if( node instanceof Leaf ){ return ((Leaf)node).getDisplayer(); } return null; }
/** * Creates a new object * @param info information about the current position of the mouse and of * what is under the mouse * @param station the creator of this source * @param mouseOnStation position of the mouse in relation to <code>station</code> * @throws IllegalArgumentException if the target not of <code>info</code> is not a {@link Leaf} */ public SplitDockCombinerSource( PutInfo info, SplitDockStation station, Point mouseOnStation ){ if( !(info.getNode() instanceof Leaf) ){ throw new IllegalArgumentException( "info is not available for a combination" ); } this.info = info; this.station = station; this.mouse = mouseOnStation; old = getLeaf().getDockable(); if( old == null ){ throw new IllegalArgumentException( "old Dockable is null" ); } }
/** * Creates a new object * @param info information about the current position of the mouse and of * what is under the mouse * @param station the creator of this source * @param mouseOnStation position of the mouse in relation to <code>station</code> * @throws IllegalArgumentException if the target not of <code>info</code> is not a {@link Leaf} */ public SplitDockCombinerSource( PutInfo info, SplitDockStation station, Point mouseOnStation ){ if( !(info.getNode() instanceof Leaf) ){ throw new IllegalArgumentException( "info is not available for a combination" ); } this.info = info; this.station = station; this.mouse = mouseOnStation; old = getLeaf().getDockable(); if( old == null ){ throw new IllegalArgumentException( "old Dockable is null" ); } }
/** * Gets the {@link Span}s that are used when <code>put</code> is active. * @param put the drag and drop operation which may be active * @return the {@link Span}s that would expand if <code>put</code> is active, can be <code>null</code> */ public Span[] getSpans( PutInfo put ){ SplitNode node = put.getNode(); if( node instanceof Leaf ){ return ((Leaf)node).getSpans(); } if( node instanceof Root ){ return ((Root)node).getSpans(); } else if( node.getParent() instanceof Root ){ return ((Root)node.getParent()).getSpans(); } return null; }
/** * Gets the {@link Span}s that are used when <code>put</code> is active. * @param put the drag and drop operation which may be active * @return the {@link Span}s that would expand if <code>put</code> is active, can be <code>null</code> */ public Span[] getSpans( PutInfo put ){ SplitNode node = put.getNode(); if( node instanceof Leaf ){ return ((Leaf)node).getSpans(); } if( node instanceof Root ){ return ((Root)node).getSpans(); } else if( node.getParent() instanceof Root ){ return ((Root)node.getParent()).getSpans(); } return null; }
public PutInfo validatePutInfo( SplitDockStation station, PutInfo putInfo ){ if( putInfo != null ){ if( !station.accept( putInfo.getDockable() )) return null; if( putInfo.getNode() != null && (putInfo.getPut() == PutInfo.Put.CENTER || putInfo.getPut() == PutInfo.Put.TITLE )){ if( !putInfo.getDockable().accept( station, ((Leaf)putInfo.getNode()).getDockable() ) || !((Leaf)putInfo.getNode()).getDockable().accept( station, putInfo.getDockable() ) || !station.getController().getAcceptance().accept( station, ((Leaf)putInfo.getNode()).getDockable(), putInfo.getDockable() )){ return null; } } else{ if( !putInfo.getDockable().accept( station ) || !station.getController().getAcceptance().accept( station, putInfo.getDockable() )){ return null; } } } return putInfo; }
public PutInfo validatePutInfo( SplitDockStation station, PutInfo putInfo ){ if( putInfo != null ){ if( !station.accept( putInfo.getDockable() )) return null; if( putInfo.getNode() != null && (putInfo.getPut() == PutInfo.Put.CENTER || putInfo.getPut() == PutInfo.Put.TITLE )){ if( !putInfo.getDockable().accept( station, ((Leaf)putInfo.getNode()).getDockable() ) || !((Leaf)putInfo.getNode()).getDockable().accept( station, putInfo.getDockable() ) || !station.getController().getAcceptance().accept( station, ((Leaf)putInfo.getNode()).getDockable(), putInfo.getDockable() )){ return null; } } else{ if( !putInfo.getDockable().accept( station ) || !station.getController().getAcceptance().accept( station, putInfo.getDockable() )){ return null; } } } return putInfo; }
if( putInfo.getNode() == null ) { Insets insets = getInsets(); Rectangle bounds = new Rectangle( insets.left, insets.top, getWidth()-insets.left-insets.right, getHeight()-insets.top-insets.bottom ); Rectangle bounds = putInfo.getNode().getBounds(); int gap = getWizardSpanStrategy().getGap(); paint.drawInsertion(g, putInfo.getNode().getBounds(), bounds); Rectangle bounds = putInfo.getNode().getBounds(); StationPaint stationPaint = paint.get(); if( stationPaint != null ){
SplitNode node = putInfo.getNode(); while( node != null && !model.isHeaderLevel( node ) ) { node = node.getParent();
putInfo = layoutManager.getValue().prepareMove( this, item ); if( putInfo != null ){ if( putInfo.getNode() == null ){ return new NoStationDropOperation( this, item.getDockable() );
putInfo = layoutManager.getValue().prepareMove( this, item ); if( putInfo != null ){ if( putInfo.getNode() == null ){ return new NoStationDropOperation( this, item.getDockable() );
private void prepareCombine( PutInfo putInfo, boolean move, StationDropItem item ){ if( putInfo.getCombinerSource() == null && putInfo.getCombinerTarget() == null ){ if( putInfo.getNode() instanceof Leaf ){ Point mouseOnStation = new Point( item.getMouseX(), item.getMouseY() ); SwingUtilities.convertPointFromScreen( mouseOnStation, getComponent() );
private void prepareCombine( PutInfo putInfo, boolean move, StationDropItem item ){ if( putInfo.getCombinerSource() == null && putInfo.getCombinerTarget() == null ){ if( putInfo.getNode() instanceof Leaf ){ Point mouseOnStation = new Point( item.getMouseX(), item.getMouseY() ); SwingUtilities.convertPointFromScreen( mouseOnStation, getComponent() );
Leaf leaf = root.getLeaf(putInfo.getDockable()); SplitNode parent = putInfo.getNode();
Leaf leaf = root.getLeaf(putInfo.getDockable()); SplitNode parent = putInfo.getNode();