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 ); }
switch( node.getLocation() ){ case BOTTOM: tree = split.south( node.getSize(), node.getId() ); break; case LEFT: tree = split.west( node.getSize(), node.getId() ); break; case RIGHT: tree = split.east( node.getSize(), node.getId() ); break; case TOP: tree = split.north( node.getSize(), node.getId() ); break; switch( node.getLocation() ){ case BOTTOM: tree = tree.south( node.getSize(), node.getId() ); break; case LEFT: tree = tree.west( node.getSize(), node.getId() ); break; case RIGHT: tree = tree.east( node.getSize(), node.getId() ); break; case TOP: tree = tree.north( node.getSize(), node.getId() ); break;
switch( node.getLocation() ){ case BOTTOM: tree = split.south( node.getSize(), node.getId() ); break; case LEFT: tree = split.west( node.getSize(), node.getId() ); break; case RIGHT: tree = split.east( node.getSize(), node.getId() ); break; case TOP: tree = split.north( node.getSize(), node.getId() ); break; switch( node.getLocation() ){ case BOTTOM: tree = tree.south( node.getSize(), node.getId() ); break; case LEFT: tree = tree.west( node.getSize(), node.getId() ); break; case RIGHT: tree = tree.east( node.getSize(), node.getId() ); break; case TOP: tree = tree.north( node.getSize(), node.getId() ); break;
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; }