/** * Adds two elements vertically. * @param top the top element * @param bottom the bottom element * @param divider how much space the first element gets in respect * to the second element. Must be between 0 and 1. * @return a key of the combination of the two elements */ public Key vertical( Key top, Key bottom, double divider ){ return vertical( top, bottom, divider, -1 ); }
/** * Adds two elements vertically. * @param top the top element * @param bottom the bottom element * @param divider how much space the first element gets in respect * to the second element. Must be between 0 and 1. * @param nodeId a unique identifier for this node, may be -1 * @return a key of the combination of the two elements */ public Key vertical( Key top, Key bottom, double divider, long nodeId ){ return vertical( top, bottom, divider, null, null, nodeId ); }
/** * Adds two elements vertically. * @param top the top element * @param bottom the bottom element * @return a key of the combination of the two elements */ public Key vertical( Key top, Key bottom ){ return vertical( top, bottom, 0.5 ); }
/** * Adds two elements vertically. * @param top the top element * @param bottom the bottom element * @return a key of the combination of the two elements */ public Key vertical( Key top, Key bottom ){ return vertical( top, bottom, 0.5 ); }
/** * Adds two elements vertically. * @param top the top element * @param bottom the bottom element * @param divider how much space the first element gets in respect * to the second element. Must be between 0 and 1. * @return a key of the combination of the two elements */ public Key vertical( Key top, Key bottom, double divider ){ return vertical( top, bottom, divider, -1 ); }
/** * Adds two elements vertically. * @param top the top element * @param bottom the bottom element * @param divider how much space the first element gets in respect * to the second element. Must be between 0 and 1. * @param nodeId a unique identifier for this node, may be -1 * @return a key of the combination of the two elements */ public Key vertical( Key top, Key bottom, double divider, long nodeId ){ return vertical( top, bottom, divider, null, null, nodeId ); }
public SplitDockTree<Dockable>.Key vertical( SplitDockTree<Dockable>.Key top, SplitDockTree<Dockable>.Key bottom, double divider, long id, Path[] placeholders, PlaceholderMap placeholderMap, boolean visible ){ return tree.vertical( top, bottom, divider, placeholders, placeholderMap, id ); }
/** * Adds two elements vertically. * @param top the top element * @param bottom the bottom element * @return a key of the combination of the two elements */ public Key vertical( D top, D bottom ){ return vertical( put( array( top ) ), put( array( bottom ) )); }
/** * Adds two elements vertically. * @param top the top element * @param bottom the bottom element * @param divider how much space the first element gets in respect * to the second element. Must be between 0 and 1. * @return a key of the combination of the two elements */ public Key vertical( D top, D bottom, double divider ){ return vertical( put( array( top ) ), put( array( bottom ) ), divider ); }
/** * Adds two elements vertically. * @param top the top element * @param bottom the bottom element * @return a key of the combination of the two elements */ public Key vertical( D top, D bottom ){ return vertical( put( array( top ) ), put( array( bottom ) )); }
/** * Adds two elements vertically. * @param top the top element * @param bottom the bottom element * @param divider how much space the first element gets in respect * to the second element. Must be between 0 and 1. * @return a key of the combination of the two elements */ public Key vertical( D top, D bottom, double divider ){ return vertical( put( array( top ) ), put( array( bottom ) ), divider ); }
/** * Writes the contents of this node into <code>tree</code>. * @param tree the tree to write into * @return the key of the node */ public SplitDockTree<D>.Key put( SplitDockTree<D> tree ){ if( dockables != null || childA == null || childB == null ){ return tree.put( dockables, selected, placeholders, placeholderMap, -1 ); } else if( horizontal ){ return tree.horizontal( childA.put( tree ), childB.put( tree ), divider, placeholders, placeholderMap, -1 ); } else{ return tree.vertical( childA.put( tree ), childB.put( tree ), divider, placeholders, placeholderMap, -1 ); } }
/** * Writes the contents of this node into <code>tree</code>. * @param tree the tree to write into * @return the key of the node */ public SplitDockTree<D>.Key put( SplitDockTree<D> tree ){ if( dockables != null || childA == null || childB == null ){ return tree.put( dockables, selected, placeholders, placeholderMap, -1 ); } else if( horizontal ){ return tree.horizontal( childA.put( tree ), childB.put( tree ), divider, placeholders, placeholderMap, -1 ); } else{ return tree.vertical( childA.put( tree ), childB.put( tree ), divider, placeholders, placeholderMap, -1 ); } }
/** * Transforms a node of a {@link SplitDockStationLayout} into a key * of a {@link SplitDockTree}. * @param node the element to transform * @param tree the tree into which to add new keys * @param children the set of known children * @return the key or <code>null</code> */ private <D> SplitDockTree<D>.Key handleNode( SplitDockStationLayout.Node node, SplitDockTree<D> tree,Map<Integer, D> children ){ SplitDockTree<D>.Key a = handleEntry( node.getChildA(), tree, children ); SplitDockTree<D>.Key b = handleEntry( node.getChildB(), tree, children ); if( a == null ) return b; if( b == null ) return a; switch( node.getOrientation() ){ case HORIZONTAL: return tree.horizontal( a, b, node.getDivider(), node.getPlaceholders(), node.getPlaceholderMap(), node.getNodeId() ); case VERTICAL: return tree.vertical( a, b, node.getDivider(), node.getPlaceholders(), node.getPlaceholderMap(), node.getNodeId() ); } return null; }