public void store( DataOutputStream out ) throws IOException { Version.write( out, Version.VERSION_1_0_8 ); out.writeInt( nodes.size() ); for( Node node : nodes ){ switch( node.getLocation() ){ case LEFT: out.writeByte( 0 ); break; case RIGHT: out.writeByte( 1 ); break; case TOP: out.writeByte( 2 ); break; case BOTTOM: out.writeByte( 3 ); break; } out.writeDouble( node.getSize() ); out.writeLong( node.getId() ); } out.writeLong( leafId ); }
h = onPath.getHeight(); switch( node.getLocation() ){ case LEFT: w = w * node.getSize();
if( isLeftOrTop( node.getLocation() ) ){ return left.insert( property, depth+1, dockable );
AbstractTreeLocation tree = null; SplitDockPathProperty.Node node = property.getNode( 0 ); switch( node.getLocation() ){ case BOTTOM: tree = split.south( node.getSize(), node.getId() ); switch( node.getLocation() ){ case BOTTOM: tree = tree.south( node.getSize(), node.getId() );
if( isLeftOrTop( node.getLocation() )){ return left.aside( property, depth+1, request );
AbstractTreeLocation tree = null; SplitDockPathProperty.Node node = property.getNode( 0 ); switch( node.getLocation() ){ case BOTTOM: tree = split.south( node.getSize(), node.getId() ); switch( node.getLocation() ){ case BOTTOM: tree = tree.south( node.getSize(), node.getId() );
if( node.getLocation() == SplitDockPathProperty.Location.LEFT || node.getLocation() == SplitDockPathProperty.Location.RIGHT ) orientation = SplitDockStation.Orientation.HORIZONTAL; else orientation = SplitDockStation.Orientation.VERTICAL; boolean reverse = node.getLocation() == SplitDockPathProperty.Location.RIGHT || node.getLocation() == SplitDockPathProperty.Location.BOTTOM;
double x = 0, y = 0, w = 1, h = 1; for( Node node : nodes ){ switch( node.getLocation() ){ case LEFT: w = w * node.getSize();
private boolean needToExpand( SplitDockPathProperty.Node node ){ boolean expand = // if this node is horizontal, but the path is vertical ( orientation == SplitDockStation.Orientation.HORIZONTAL && (node.getLocation() == SplitDockPathProperty.Location.TOP || node.getLocation() == SplitDockPathProperty.Location.BOTTOM )) || // ... or if this node is vertical, but the path is horizontal ( orientation == SplitDockStation.Orientation.VERTICAL && (node.getLocation() == SplitDockPathProperty.Location.LEFT || node.getLocation() == SplitDockPathProperty.Location.RIGHT )); if( node.getId() != -1 && node.getId() != getId() ){ expand = true; } return expand; }
public void store( XElement element ) { for( Node node : nodes ){ XElement xnode = element.addElement( "node" ); xnode.addString( "location", node.getLocation().name() ); xnode.addDouble( "size", node.getSize() ); if( node.getId() >= 0 ){ xnode.addLong( "id", node.getId() ); } } element.addElement( "leaf" ).addLong( "id", leafId ); }
public DockableProperty copy() { SplitDockPathProperty copy = new SplitDockPathProperty(); for( Node node : nodes ){ copy.add( node.getLocation(), node.getSize(), node.getId() ); } copy.setLeafId( getLeafId() ); copy( copy ); return copy; }