/** * Adds two elements horizontally. * @param left the left element * @param right the right 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 horizontal( Key left, Key right, double divider, long nodeId ){ return horizontal( left, right, divider, null, null, nodeId ); }
/** * Adds two elements horizontally. * @param left the left element * @param right the right element * @return a key of the combination of the two elements */ public Key horizontal( Key left, Key right ){ return horizontal( left, right, 0.5 ); }
/** * Adds two elements horizontally. * @param left the left element * @param right the right element * @return a key of the combination of the two elements */ public Key horizontal( Key left, Key right ){ return horizontal( left, right, 0.5 ); }
/** * Adds two elements horizontally. * @param left the left element * @param right the right 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 horizontal( Key left, Key right, double divider, long nodeId ){ return horizontal( left, right, divider, null, null, nodeId ); }
/** * Adds two elements horizontally. * @param left the left element * @param right the right 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 horizontal( Key left, Key right, double divider ){ return horizontal( left, right, divider, -1 ); }
/** * Adds two elements horizontally. * @param left the left element * @param right the right 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 horizontal( Key left, Key right, double divider ){ return horizontal( left, right, divider, -1 ); }
public SplitDockTree<Dockable>.Key horizontal( SplitDockTree<Dockable>.Key left, SplitDockTree<Dockable>.Key right, double divider, long id, Path[] placeholders, PlaceholderMap placeholderMap, boolean visible ){ return tree.horizontal( left, right, divider, placeholders, placeholderMap, id ); }
/** * Adds two elements horizontally. * @param left the left element * @param right the right 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 horizontal( D left, D right, double divider ){ return horizontal( put( array( left ) ), put( array( right ) ), divider ); }
/** * Adds two elements horizontally. * @param left the left element * @param right the right element * @return a key of the combination of the two elements */ public Key horizontal( D left, D right ){ return horizontal( put( array( left ) ), put( array( right ) ) ); }
/** * Adds two elements horizontally. * @param left the left element * @param right the right element * @return a key of the combination of the two elements */ public Key horizontal( D left, D right ){ return horizontal( put( array( left ) ), put( array( right ) ) ); }
/** * Adds two elements horizontally. * @param left the left element * @param right the right 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 horizontal( D left, D right, double divider ){ return horizontal( put( array( left ) ), put( array( right ) ), 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; }