Ver Fonte

fixed an issue in the place_block method

Kolja Strohm há 6 anos atrás
pai
commit
3fcd6600a1
2 ficheiros alterados com 5 adições e 5 exclusões
  1. 2 2
      src/bk/PlaceBlock.java
  2. 3 3
      src/main/Main.java

+ 2 - 2
src/bk/PlaceBlock.java

@@ -88,8 +88,8 @@ public class PlaceBlock{
                 LayeredGraphNode w = m.read( "w", MemoryType.LOCAL );
                 LayeredGraphNode graph = w.parent();
                 if( m.<String>read( "layout", MemoryType.LOCAL ).contains( "RIGHT" ) )
-                    return graph.getContainedLayers().get( w.getLayer() ).get( graph.getContainedLayers().get( w.getLayer() ).indexOf( w ) - 1 );
-                return graph.getContainedLayers().get( w.getLayer() ).get( graph.getContainedLayers().get( w.getLayer() ).indexOf( w ) + 1 );
+                    return graph.getContainedLayers().get( w.getLayer() ).get( graph.getContainedLayers().get( w.getLayer() ).indexOf( w ) - 1 ).getRoot( LayoutType.fromString( m.<String>read( "layout", MemoryType.LOCAL ) ) );
+                return graph.getContainedLayers().get( w.getLayer() ).get( graph.getContainedLayers().get( w.getLayer() ).indexOf( w ) + 1 ).getRoot( LayoutType.fromString( m.<String>read( "layout", MemoryType.LOCAL ) ) );
             }
         } ));
         ifPos.add( new PseudoCodeNode( "call place_block( u, layout );", vars, tree, new FunctionCall( root, new String[]{ "u", "layout" } ) ) );

+ 3 - 3
src/main/Main.java

@@ -17,10 +17,10 @@ public class Main {
      * @param args the command line arguments, currently not in use
      */
     public static void main(String[] args) {
-        Reader r = new Reader( "logo.json" );
+        Reader r = new Reader( "papergraph.json" );
         LayeredGraphNode graph = r.readInputGraph();
         InitializeNodePositions.placeNodes( graph );
         new MainView( graph );
     }
-
-}
+ 
+}