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;
double x = 0, y = 0, w = 1, h = 1; for( Node node : nodes ){ if( node.getId() == id ){ x = onPath.getX(); y = onPath.getY();
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;
newNodeId = lastNode.getId();
for( index = property.size() - 1; index >= 0; index-- ) { SplitDockPathProperty.Node node = property.getNode(index); long id = node.getId(); if( id != -1 ) { start = getNode(id);
for( index = property.size() - 1; index >= 0; index-- ) { SplitDockPathProperty.Node node = property.getNode(index); long id = node.getId(); if( id != -1 ) { start = getNode(id);
private long getSplitId( SplitDockPathProperty property, int depth ){ SplitDockPathProperty.Node node = property.getNode( depth ); SplitDockPathProperty.Node lastNode = null; if( property.getLeafId() == -1 ){ lastNode = property.getLastNode(); } if( lastNode != node ){ if( depth > 0 ){ return property.getNode( depth-1 ).getId(); } else{ return node.getId(); } } return -1; }
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; }
private long getLeafId( SplitDockPathProperty property ){ long leafId = property.getLeafId(); SplitDockPathProperty.Node lastNode = null; if( leafId == -1 ){ lastNode = property.getLastNode(); if( lastNode != null ){ leafId = lastNode.getId(); } } return leafId; }
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; }