private void clearPlaceholder( Entry parent, Path placeholder, Entry exception ){ if( parent != null && parent != exception ){ if( parent.getPlaceholderMap() != null ){ parent.getPlaceholderMap().removeAll( placeholder, true ); } parent.getPlaceholders().remove( placeholder ); } if( parent.asNode() != null ){ clearPlaceholder( parent.asNode().getChildA(), placeholder, exception ); clearPlaceholder( parent.asNode().getChildB(), placeholder, exception ); } }
private void clearPlaceholder( Entry parent, Path placeholder, Entry exception ){ if( parent != null && parent != exception ){ if( parent.getPlaceholderMap() != null ){ parent.getPlaceholderMap().removeAll( placeholder, true ); } parent.getPlaceholders().remove( placeholder ); } if( parent.asNode() != null ){ clearPlaceholder( parent.asNode().getChildA(), placeholder, exception ); clearPlaceholder( parent.asNode().getChildB(), placeholder, exception ); } }
private void remove( Entry child ){ if( child != null ){ if( child.asLeaf() != null ){ PerspectiveDockable dockable = child.asLeaf().getDockable(); if( dockable != null ){ children.remove( dockable ); dockable.setParent( null ); } } else{ remove( child.asNode().getChildA() ); remove( child.asNode().getChildB() ); } } } });
Entry other; if( parentNode.getChildA() == this ){ other = parentNode.getChildB(); parentNode.setChildA( null );
Entry other; if( parentNode.getChildA() == this ){ other = parentNode.getChildB(); parentNode.setChildA( null );
private Entry convert( SplitDockPerspective.Entry entry, Map<PerspectiveDockable, Integer> children ){ if( entry == null ){ return null; } if( entry.asNode() != null ){ SplitDockPerspective.Node node = entry.asNode(); Entry childA = convert( node.getChildA(), children ); Entry childB = convert( node.getChildB(), children ); if( childA == null ){ return childB; } if( childB == null ){ return childA; } return new SplitDockStationLayout.Node( node.getOrientation(), node.getDivider(), childA, childB, toArray( node.getPlaceholders() ), node.getPlaceholderMap(), node.getNodeId() ); } else if( entry.asLeaf() != null ){ SplitDockPerspective.Leaf leaf = entry.asLeaf(); Integer id = children.get( leaf.getDockable() ); return new SplitDockStationLayout.Leaf( id == null ? -1 : id.intValue(), toArray( leaf.getPlaceholders() ), leaf.getPlaceholderMap(), leaf.getNodeId() ); } else{ return convert( ((Root)entry).getChild(), children ); } }
private void handle( Entry entry, double x, double y, double width, double height ){ if( entry != null ){ if( entry.asLeaf() != null ) { PerspectiveDockable dockable = entry.asLeaf().getDockable(); if( dockable != null ) { grid.addDockable( x, y, width, height, dockable ); } } else{ Node node = entry.asNode(); double divider = node.getDivider(); if( node.getOrientation() == Orientation.HORIZONTAL ){ handle( node.getChildA(), x, y, width*divider, height ); handle( node.getChildB(), x+width*divider, y, width*(1-divider), height ); } else{ handle( node.getChildA(), x, y, width, height*divider ); handle( node.getChildB(), x, y+height*divider, width, height*(1-divider) ); } } } }
private void handle( Entry entry, double x, double y, double width, double height ){ if( entry != null ){ if( entry.asLeaf() != null ) { PerspectiveDockable dockable = entry.asLeaf().getDockable(); if( dockable != null ) { grid.addDockable( x, y, width, height, dockable ); } } else{ Node node = entry.asNode(); double divider = node.getDivider(); if( node.getOrientation() == Orientation.HORIZONTAL ){ handle( node.getChildA(), x, y, width*divider, height ); handle( node.getChildB(), x+width*divider, y, width*(1-divider), height ); } else{ handle( node.getChildA(), x, y, width, height*divider ); handle( node.getChildB(), x, y+height*divider, width, height*(1-divider) ); } } } }
private void remove( Entry child ){ if( child != null ){ if( child.asLeaf() != null ){ PerspectiveDockable dockable = child.asLeaf().getDockable(); if( dockable != null ){ children.remove( dockable ); dockable.setParent( null ); } } else{ remove( child.asNode().getChildA() ); remove( child.asNode().getChildB() ); } } } });
private Leaf find( Entry start, PerspectiveDockable child ){ if( start == null ){ return null; } if( start.asLeaf() != null ){ if( start.asLeaf().getDockable() == child ){ return start.asLeaf(); } return null; } Leaf result = find( start.asNode().getChildA(), child ); if( result == null ){ result = find( start.asNode().getChildB(), child ); } return result; }
private void remove( Entry child ){ if( child != null ){ if( child.asNode() != null ){ remove( child.asNode().getChildA() ); remove( child.asNode().getChildB() ); } else{ PerspectiveDockable dockable = child.asLeaf().getDockable(); if( dockable != null ){ remove( dockable ); } } } }
private void add( Entry child ){ if( child != null ){ if( child.asNode() != null ){ add( child.asNode().getChildA() ); add( child.asNode().getChildB() ); } else{ PerspectiveDockable dockable = child.asLeaf().getDockable(); if( dockable != null ){ add( dockable ); } } } }
private void add( Entry child ){ if( child != null ){ if( child.asLeaf() != null ){ PerspectiveDockable dockable = child.asLeaf().getDockable(); if( dockable != null ){ DockUtilities.ensureTreeValidity( SplitDockPerspective.this, dockable ); dockable.setParent( SplitDockPerspective.this ); children.add( dockable ); } } else{ add( child.asNode().getChildA() ); add( child.asNode().getChildB() ); } } }
private void remove( Entry child ){ if( child != null ){ if( child.asNode() != null ){ remove( child.asNode().getChildA() ); remove( child.asNode().getChildB() ); } else{ PerspectiveDockable dockable = child.asLeaf().getDockable(); if( dockable != null ){ remove( dockable ); } } } }
private Leaf find( Entry start, PerspectiveDockable child ){ if( start == null ){ return null; } if( start.asLeaf() != null ){ if( start.asLeaf().getDockable() == child ){ return start.asLeaf(); } return null; } Leaf result = find( start.asNode().getChildA(), child ); if( result == null ){ result = find( start.asNode().getChildB(), child ); } return result; }
private void add( Entry child ){ if( child != null ){ if( child.asLeaf() != null ){ PerspectiveDockable dockable = child.asLeaf().getDockable(); if( dockable != null ){ DockUtilities.ensureTreeValidity( SplitDockPerspective.this, dockable ); dockable.setParent( SplitDockPerspective.this ); children.add( dockable ); } } else{ add( child.asNode().getChildA() ); add( child.asNode().getChildB() ); } } }
@Override protected Entry getRightChild( Entry node ){ return ((SplitDockPerspective.Node)node).getChildB(); }
@Override protected Entry getRightChild( Entry node ){ return ((SplitDockPerspective.Node)node).getChildB(); }
private void add( Entry child ){ if( child != null ){ if( child.asNode() != null ){ add( child.asNode().getChildA() ); add( child.asNode().getChildB() ); } else{ PerspectiveDockable dockable = child.asLeaf().getDockable(); if( dockable != null ){ add( dockable ); } } } }